MK3-E3DREVO_HF_60W_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 bd 56 jmp 0xad7a ; 0xad7a <__dtors_end> 4: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 8: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 10: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 14: 0d 94 3e 5f jmp 0x2be7c ; 0x2be7c <__vector_5> 18: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 1c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 20: 0c 94 f5 74 jmp 0xe9ea ; 0xe9ea <__vector_8> 24: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 28: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 2c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 30: 0c 94 7a 67 jmp 0xcef4 ; 0xcef4 <__vector_12> 34: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 38: 0d 94 dd 32 jmp 0x265ba ; 0x265ba <__vector_14> 3c: 0d 94 6a 2c jmp 0x258d4 ; 0x258d4 <__vector_15> 40: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 44: 0d 94 65 43 jmp 0x286ca ; 0x286ca <__vector_17> 48: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 4c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 50: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 54: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 58: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 5c: 0c 94 29 74 jmp 0xe852 ; 0xe852 <__vector_23> 60: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 64: 0d 94 6b d6 jmp 0x3acd6 ; 0x3acd6 <__vector_25> 68: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 6c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 70: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 74: 0c 94 46 8d jmp 0x11a8c ; 0x11a8c <__vector_29> 78: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 7c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 80: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 84: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 88: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 8c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 90: 0d 94 27 d6 jmp 0x3ac4e ; 0x3ac4e <__vector_36> 94: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 98: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> 9c: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> a0: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> a4: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> a8: 0d 94 84 22 jmp 0x24508 ; 0x24508 <__vector_42> ac: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> b0: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> b4: 0d 94 66 22 jmp 0x244cc ; 0x244cc <__vector_45> b8: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> bc: 0d 94 27 38 jmp 0x2704e ; 0x2704e <__vector_47> c0: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> c4: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> c8: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> cc: 0d 94 26 22 jmp 0x2444c ; 0x2444c <__vector_51> d0: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> d4: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> d8: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> dc: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__bad_interrupt> e0: 0c 94 ee 56 jmp 0xaddc ; 0xaddc <__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 4d 4b 33 2d 52 48 46 36 30 20 Prusa MK3-RHF60 7083: 4f 4b 2e 00 OK.. 00007087 : 7087: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00007092 : 7092: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 000070a2 : 70a2: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 70b2: 65 64 00 ed. 000070b5 : 70b5: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 000070c2 : 70c2: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 70d2: 65 3a 20 00 e: . 000070d6 : 70d6: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 70e6: 64 69 72 3a 20 00 dir: . 000070ec : 70ec: 4d 36 30 30 00 M600. 000070f1 : 70f1: 4d 32 34 00 M24. 000070f5 : 70f5: 4d 32 33 20 25 73 00 M23 %s. 000070fc : 70fc: 31 2f 39 00 1/9. 00007100 : 7100: 88 00 .. 00007102 : 7102: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 7112: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00007120 : 7120: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 7130: 70 72 65 76 65 6e 74 65 64 00 prevented. 0000713a : 713a: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00007147 <__noloc_end>: 7147: 08 4a sbci r16, 0xA8 ; 168 7149: d7 3b cpi r29, 0xB7 ; 183 714b: 3b ce rjmp .-906 ; 0x6dc3 714d: 01 6e ori r16, 0xE1 ; 225 714f: 84 bc out 0x24, r8 ; 36 7151: bf fd .word 0xfdbf ; ???? 7153: c1 2f mov r28, r17 7155: 3d 6c ori r19, 0xCD ; 205 7157: 74 31 cpi r23, 0x14 ; 20 7159: 9a bd out 0x2a, r25 ; 42 715b: 56 83 std Z+6, r21 ; 0x06 715d: 3d da rcall .-2950 ; 0x65d9 <__c.2356+0x1> 715f: 3d 00 .word 0x003d ; ???? 7161: c7 7f andi r28, 0xF7 ; 247 7163: 11 be out 0x31, r1 ; 49 7165: d9 e4 ldi r29, 0x49 ; 73 7167: bb 4c sbci r27, 0xCB ; 203 7169: 3e 91 ld r19, -X 716b: 6b aa std Y+51, r6 ; 0x33 716d: aa be out 0x3a, r10 ; 58 716f: 00 00 nop 7171: 00 80 ld r0, Z 7173: 3f 05 cpc r19, r15 7175: a8 4c sbci r26, 0xC8 ; 200 7177: cd b2 in r12, 0x1d ; 29 7179: d4 4e sbci r29, 0xE4 ; 228 717b: b9 38 cpi r27, 0x89 ; 137 717d: 36 a9 ldd r19, Z+54 ; 0x36 717f: 02 0c add r0, r2 7181: 50 b9 out 0x00, r21 ; 0 7183: 91 86 std Z+9, r9 ; 0x09 7185: 88 08 sbc r8, r8 7187: 3c a6 std Y+44, r3 ; 0x2c 7189: aa aa std Y+50, r10 ; 0x32 718b: 2a be out 0x3a, r2 ; 58 718d: 00 00 nop 718f: 00 80 ld r0, Z 7191: 3f 07 cpc r19, r31 7193: 63 42 sbci r22, 0x23 ; 35 7195: 36 b7 in r19, 0x36 ; 54 7197: 9b d8 rcall .-3786 ; 0x62cf 7199: a7 1a sub r10, r23 719b: 39 68 ori r19, 0x89 ; 137 719d: 56 18 sub r5, r6 719f: ae ba out 0x1e, r10 ; 30 71a1: ab 55 subi r26, 0x5B ; 91 71a3: 8c 1d adc r24, r12 71a5: 3c b7 in r19, 0x3c ; 60 71a7: cc 57 subi r28, 0x7C ; 124 71a9: 63 bd out 0x23, r22 ; 35 71ab: 6d ed ldi r22, 0xDD ; 221 71ad: fd 75 andi r31, 0x5D ; 93 71af: 3e f6 brtc .-114 ; 0x713f 71b1: 17 72 andi r17, 0x27 ; 39 71b3: 31 bf out 0x31, r19 ; 49 71b5: 00 00 nop 71b7: 00 80 ld r0, Z 71b9: 3f 08 sbc r3, r15 71bb: 00 00 nop 71bd: 00 be out 0x30, r0 ; 48 71bf: 92 24 eor r9, r2 71c1: 49 12 cpse r4, r25 71c3: 3e ab std Y+54, r19 ; 0x36 71c5: aa aa std Y+50, r10 ; 0x32 71c7: 2a be out 0x3a, r2 ; 58 71c9: cd cc rjmp .-1638 ; 0x6b65 71cb: cc 4c sbci r28, 0xCC ; 204 71cd: 3e 00 .word 0x003e ; ???? 71cf: 00 00 nop 71d1: 80 be out 0x30, r8 ; 48 71d3: ab aa std Y+51, r10 ; 0x33 71d5: aa aa std Y+50, r10 ; 0x32 71d7: 3e 00 .word 0x003e ; ???? 71d9: 00 00 nop 71db: 00 bf out 0x30, r16 ; 48 71dd: 00 00 nop 71df: 00 80 ld r0, Z 71e1: 3f 00 .word 0x003f ; ???? 71e3: 00 00 nop 71e5: 00 00 nop 71e7: 08 41 sbci r16, 0x18 ; 24 71e9: 78 d3 rcall .+1776 ; 0x78db 71eb: bb 43 sbci r27, 0x3B ; 59 71ed: 87 d1 rcall .+782 ; 0x74fd <__trampolines_start+0x2e9> 71ef: 13 3d cpi r17, 0xD3 ; 211 71f1: 19 0e add r1, r25 71f3: 3c c3 rjmp .+1656 ; 0x786d 71f5: bd 42 sbci r27, 0x2D ; 45 71f7: 82 ad ldd r24, Z+58 ; 0x3a 71f9: 2b 3e cpi r18, 0xEB ; 235 71fb: 68 ec ldi r22, 0xC8 ; 200 71fd: 82 76 andi r24, 0x62 ; 98 71ff: be d9 rcall .-3204 ; 0x657d 7201: 8f e1 ldi r24, 0x1F ; 31 7203: a9 3e cpi r26, 0xE9 ; 233 7205: 4c 80 ldd r4, Y+4 ; 0x04 7207: ef ff .word 0xffef ; ???? 7209: be 01 movw r22, r28 720b: c4 ff sbrs r28, 4 720d: 7f 3f cpi r23, 0xFF ; 255 720f: 00 00 nop 7211: 00 00 nop ... 00007214 <__trampolines_start>: 7214: 0c 94 ed cc jmp 0x199da ; 0x199da 7218: 0c 94 b5 d0 jmp 0x1a16a ; 0x1a16a 721c: 0c 94 52 ee jmp 0x1dca4 ; 0x1dca4 7220: 0c 94 bc d0 jmp 0x1a178 ; 0x1a178 7224: 0c 94 00 cd jmp 0x19a00 ; 0x19a00 7228: 0c 94 04 cd jmp 0x19a08 ; 0x19a08 722c: 0d 94 72 19 jmp 0x232e4 ; 0x232e4 7230: 0d 94 bc 3f jmp 0x27f78 ; 0x27f78 7234: 0c 94 e1 cc jmp 0x199c2 ; 0x199c2 7238: 0c 94 5e e1 jmp 0x1c2bc ; 0x1c2bc 723c: 0c 94 3b df jmp 0x1be76 ; 0x1be76 7240: 0c 94 31 f0 jmp 0x1e062 ; 0x1e062 7244: 0c 94 db e9 jmp 0x1d3b6 ; 0x1d3b6 7248: 0c 94 80 e9 jmp 0x1d300 ; 0x1d300 724c: 0c 94 4f df jmp 0x1be9e ; 0x1be9e 7250: 0c 94 7c 64 jmp 0xc8f8 ; 0xc8f8 <_GLOBAL__sub_D_card> 7254: 0c 94 76 e9 jmp 0x1d2ec ; 0x1d2ec 7258: 0c 94 e0 cf jmp 0x19fc0 ; 0x19fc0 725c: 0c 94 7c f4 jmp 0x1e8f8 ; 0x1e8f8 7260: 0c 94 09 d4 jmp 0x1a812 ; 0x1a812 7264: 0d 94 b5 16 jmp 0x22d6a ; 0x22d6a 7268: 0d 94 44 a0 jmp 0x34088 ; 0x34088 726c: 0c 94 d5 e1 jmp 0x1c3aa ; 0x1c3aa 7270: 0c 94 47 fa jmp 0x1f48e ; 0x1f48e 7274: 0c 94 94 db jmp 0x1b728 ; 0x1b728 7278: 0c 94 91 74 jmp 0xe922 ; 0xe922 <__vector_23+0xd0> 727c: 0d 94 e0 0a jmp 0x215c0 ; 0x215c0 7280: 0c 94 a0 d8 jmp 0x1b140 ; 0x1b140 7284: 0c 94 be cd jmp 0x19b7c ; 0x19b7c 7288: 0c 94 6d 74 jmp 0xe8da ; 0xe8da <__vector_23+0x88> 728c: 0d 94 d4 09 jmp 0x213a8 ; 0x213a8 7290: 0c 94 d8 d0 jmp 0x1a1b0 ; 0x1a1b0 7294: 0d 94 a0 14 jmp 0x22940 ; 0x22940 7298: 0d 94 6f 16 jmp 0x22cde ; 0x22cde 729c: 0c 94 1b cd jmp 0x19a36 ; 0x19a36 72a0: 0d 94 b9 50 jmp 0x2a172 ; 0x2a172 72a4: 0c 94 ce cf jmp 0x19f9c ; 0x19f9c 72a8: 0c 94 bd d3 jmp 0x1a77a ; 0x1a77a ()> 72ac: 0d 94 16 51 jmp 0x2a22c ; 0x2a22c 72b0: 0c 94 ef e9 jmp 0x1d3de ; 0x1d3de 72b4: 0c 94 92 d9 jmp 0x1b324 ; 0x1b324 72b8: 0c 94 9a e9 jmp 0x1d334 ; 0x1d334 72bc: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 72c0: 0c 94 7a e1 jmp 0x1c2f4 ; 0x1c2f4 72c4: 0d 94 be 1e jmp 0x23d7c ; 0x23d7c 72c8: 0c 94 4d f8 jmp 0x1f09a ; 0x1f09a 72cc: 0d 94 09 ad jmp 0x35a12 ; 0x35a12 72d0: 0d 94 fb a6 jmp 0x34df6 ; 0x34df6 72d4: 0d 94 9f 0f jmp 0x21f3e ; 0x21f3e 72d8: 0d 94 41 a0 jmp 0x34082 ; 0x34082 72dc: 0c 94 94 e1 jmp 0x1c328 ; 0x1c328 72e0: 0c 94 85 e1 jmp 0x1c30a ; 0x1c30a 72e4: 0c 94 75 f0 jmp 0x1e0ea ; 0x1e0ea 72e8: 0c 94 a4 cf jmp 0x19f48 ; 0x19f48 72ec: 0d 94 2d 19 jmp 0x2325a ; 0x2325a 72f0: 0d 94 4a 16 jmp 0x22c94 ; 0x22c94 72f4: 0d 94 9d 20 jmp 0x2413a ; 0x2413a 72f8: 0c 94 62 fa jmp 0x1f4c4 ; 0x1f4c4 72fc: 0d 94 f5 a6 jmp 0x34dea ; 0x34dea 7300: 0d 94 04 ad jmp 0x35a08 ; 0x35a08 7304: 0c 94 fa cc jmp 0x199f4 ; 0x199f4 7308: 0c 94 5d e9 jmp 0x1d2ba ; 0x1d2ba 730c: 0d 94 36 73 jmp 0x2e66c ; 0x2e66c 7310: 0d 94 f7 ac jmp 0x359ee ; 0x359ee 7314: 0d 94 50 50 jmp 0x2a0a0 ; 0x2a0a0 7318: 0c 94 d1 e0 jmp 0x1c1a2 ; 0x1c1a2 731c: 0c 94 b8 d3 jmp 0x1a770 ; 0x1a770 ()> 7320: 0d 94 5d 0a jmp 0x214ba ; 0x214ba 7324: 0d 94 5f 29 jmp 0x252be ; 0x252be 7328: 0c 94 62 74 jmp 0xe8c4 ; 0xe8c4 <__vector_23+0x72> 732c: 0c 94 c6 f9 jmp 0x1f38c ; 0x1f38c 7330: 0c 94 e9 cc jmp 0x199d2 ; 0x199d2 7334: 0d 94 57 50 jmp 0x2a0ae ; 0x2a0ae 7338: 0c 94 2d cd jmp 0x19a5a ; 0x19a5a 733c: 0c 94 ae d3 jmp 0x1a75c ; 0x1a75c ()> 7340: 0c 94 e5 e9 jmp 0x1d3ca ; 0x1d3ca 7344: 0c 94 a4 e9 jmp 0x1d348 ; 0x1d348 7348: 0d 94 07 17 jmp 0x22e0e ; 0x22e0e 734c: 0c 94 71 cf jmp 0x19ee2 ; 0x19ee2 7350: 0c 94 15 d0 jmp 0x1a02a ; 0x1a02a 7354: 0c 94 c8 e0 jmp 0x1c190 ; 0x1c190 7358: 0c 94 90 d2 jmp 0x1a520 ; 0x1a520 735c: 0c 94 2d d7 jmp 0x1ae5a ; 0x1ae5a 7360: 0c 94 4d d4 jmp 0x1a89a ; 0x1a89a 7364: 0c 94 0d e2 jmp 0x1c41a ; 0x1c41a 7368: 0c 94 c7 d3 jmp 0x1a78e ; 0x1a78e ()> 736c: 0c 94 cf 74 jmp 0xe99e ; 0xe99e <__vector_23+0x14c> 7370: 0d 94 5f a0 jmp 0x340be ; 0x340be 7374: 0d 94 53 a0 jmp 0x340a6 ; 0x340a6 7378: 0c 94 72 d9 jmp 0x1b2e4 ; 0x1b2e4 737c: 0d 94 37 2b jmp 0x2566e ; 0x2566e 7380: 0c 94 66 e1 jmp 0x1c2cc ; 0x1c2cc 7384: 0c 94 6e e1 jmp 0x1c2dc ; 0x1c2dc 7388: 0d 94 d3 17 jmp 0x22fa6 ; 0x22fa6 738c: 0c 94 70 ef jmp 0x1dee0 ; 0x1dee0 7390: 0c 94 43 cf jmp 0x19e86 ; 0x19e86 7394: 0c 94 81 e0 jmp 0x1c102 ; 0x1c102 7398: 0c 94 1c cd jmp 0x19a38 ; 0x19a38 739c: 0d 94 dc 0a jmp 0x215b8 ; 0x215b8 73a0: 0c 94 59 fa jmp 0x1f4b2 ; 0x1f4b2 73a4: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 ()> 73a8: 0c 94 08 e0 jmp 0x1c010 ; 0x1c010 73ac: 0d 94 10 50 jmp 0x2a020 ; 0x2a020 73b0: 0c 94 02 d0 jmp 0x1a004 ; 0x1a004 73b4: 0c 94 cb d3 jmp 0x1a796 ; 0x1a796 73b8: 0d 94 62 16 jmp 0x22cc4 ; 0x22cc4 73bc: 0c 94 0e cd jmp 0x19a1c ; 0x19a1c 73c0: 0c 94 f4 f4 jmp 0x1e9e8 ; 0x1e9e8 73c4: 0d 94 06 51 jmp 0x2a20c ; 0x2a20c 73c8: 0d 94 0e 51 jmp 0x2a21c ; 0x2a21c 73cc: 0d 94 8d 27 jmp 0x24f1a ; 0x24f1a 73d0: 0c 94 0b cf jmp 0x19e16 ; 0x19e16 73d4: 0c 94 76 fa jmp 0x1f4ec ; 0x1f4ec 73d8: 0d 94 bf 50 jmp 0x2a17e ; 0x2a17e 73dc: 0c 94 bd 74 jmp 0xe97a ; 0xe97a <__vector_23+0x128> 73e0: 0d 94 1e 51 jmp 0x2a23c ; 0x2a23c 73e4: 0c 94 95 ce jmp 0x19d2a ; 0x19d2a 73e8: 0d 94 d1 1c jmp 0x239a2 ; 0x239a2 73ec: 0d 94 a4 14 jmp 0x22948 ; 0x22948 73f0: 0d 94 fe 50 jmp 0x2a1fc ; 0x2a1fc 73f4: 0c 94 6a 76 jmp 0xecd4 ; 0xecd4 73f8: 0d 94 93 2b jmp 0x25726 ; 0x25726 73fc: 0c 94 7c cf jmp 0x19ef8 ; 0x19ef8 7400: 0d 94 f4 ac jmp 0x359e8 ; 0x359e8 7404: 0d 94 fa 0a jmp 0x215f4 ; 0x215f4 7408: 0c 94 c4 cf jmp 0x19f88 ; 0x19f88 740c: 0d 94 ec 0e jmp 0x21dd8 ; 0x21dd8 7410: 0c 94 86 cf jmp 0x19f0c ; 0x19f0c 7414: 0d 94 dc 3e jmp 0x27db8 ; 0x27db8 7418: 0d 94 ce 0c jmp 0x2199c ; 0x2199c 741c: 0c 94 20 cd jmp 0x19a40 ; 0x19a40 7420: 0d 94 92 1c jmp 0x23924 ; 0x23924 7424: 0c 94 bd e9 jmp 0x1d37a ; 0x1d37a 7428: 0c 94 94 f9 jmp 0x1f328 ; 0x1f328 742c: 0d 94 8d d4 jmp 0x3a91a ; 0x3a91a 7430: 0c 94 62 e9 jmp 0x1d2c4 ; 0x1d2c4 7434: 0c 94 2c e3 jmp 0x1c658 ; 0x1c658 7438: 0c 94 f3 e3 jmp 0x1c7e6 ; 0x1c7e6 743c: 0c 94 7b 74 jmp 0xe8f6 ; 0xe8f6 <__vector_23+0xa4> 7440: 0d 94 51 18 jmp 0x230a2 ; 0x230a2 7444: 0c 94 9c ce jmp 0x19d38 ; 0x19d38 7448: 0c 94 de d4 jmp 0x1a9bc ; 0x1a9bc 744c: 0d 94 fd 07 jmp 0x20ffa ; 0x20ffa 7450: 0c 94 56 d4 jmp 0x1a8ac ; 0x1a8ac 7454: 0d 94 67 16 jmp 0x22cce ; 0x22cce 7458: 0c 94 b1 ce jmp 0x19d62 ; 0x19d62 745c: 0d 94 e4 0a jmp 0x215c8 ; 0x215c8 7460: 0d 94 86 d2 jmp 0x3a50c ; 0x3a50c <_menu_edit_P()> 7464: 0c 94 d6 e2 jmp 0x1c5ac ; 0x1c5ac 7468: 0c 94 b0 cf jmp 0x19f60 ; 0x19f60 746c: 0c 94 90 cf jmp 0x19f20 ; 0x19f20 7470: 0d 94 52 1c jmp 0x238a4 ; 0x238a4 7474: 0c 94 d0 cd jmp 0x19ba0 ; 0x19ba0 7478: 0d 94 3e a0 jmp 0x3407c ; 0x3407c 747c: 0d 94 d8 0a jmp 0x215b0 ; 0x215b0 7480: 0c 94 e8 ef jmp 0x1dfd0 ; 0x1dfd0 7484: 0d 94 d8 ac jmp 0x359b0 ; 0x359b0 7488: 0d 94 d5 9f jmp 0x33faa ; 0x33faa 748c: 0c 94 b3 ee jmp 0x1dd66 ; 0x1dd66 7490: 0c 94 ba cf jmp 0x19f74 ; 0x19f74 7494: 0c 94 aa ce jmp 0x19d54 ; 0x19d54 7498: 0c 94 d0 f9 jmp 0x1f3a0 ; 0x1f3a0 749c: 0d 94 26 51 jmp 0x2a24c ; 0x2a24c 74a0: 0d 94 46 51 jmp 0x2a28c ; 0x2a28c 74a4: 0d 94 fb ac jmp 0x359f6 ; 0x359f6 74a8: 0c 94 a4 d3 jmp 0x1a748 ; 0x1a748 ()> 74ac: 0d 94 c6 2b jmp 0x2578c ; 0x2578c 74b0: 0d 94 ed 9f jmp 0x33fda ; 0x33fda 74b4: 0c 94 75 f1 jmp 0x1e2ea ; 0x1e2ea 74b8: 0c 94 48 74 jmp 0xe890 ; 0xe890 <__vector_23+0x3e> 74bc: 0d 94 2e 51 jmp 0x2a25c ; 0x2a25c 74c0: 0d 94 83 0c jmp 0x21906 ; 0x21906 74c4: 0c 94 91 e0 jmp 0x1c122 ; 0x1c122 74c8: 0c 94 55 e9 jmp 0x1d2aa ; 0x1d2aa 74cc: 0c 94 12 cd jmp 0x19a24 ; 0x19a24 74d0: 0c 94 e5 cc jmp 0x199ca ; 0x199ca 74d4: 0c 94 d7 e0 jmp 0x1c1ae ; 0x1c1ae 74d8: 0c 94 90 e9 jmp 0x1d320 ; 0x1d320 74dc: 0c 94 1f f0 jmp 0x1e03e ; 0x1e03e 74e0: 0c 94 41 fa jmp 0x1f482 ; 0x1f482 74e4: 0d 94 f3 2b jmp 0x257e6 ; 0x257e6 74e8: 0d 94 c9 9f jmp 0x33f92 ; 0x33f92 74ec: 0c 94 08 cd jmp 0x19a10 ; 0x19a10 74f0: 0c 94 16 cd jmp 0x19a2c ; 0x19a2c 74f4: 0d 94 d3 21 jmp 0x243a6 ; 0x243a6 74f8: 0c 94 ae e9 jmp 0x1d35c ; 0x1d35c 74fc: 0c 94 cb e0 jmp 0x1c196 ; 0x1c196 7500: 0d 94 9e 0b jmp 0x2173c ; 0x2173c 7504: 0d 94 5b 1c jmp 0x238b6 ; 0x238b6 7508: 0d 94 47 a0 jmp 0x3408e ; 0x3408e 750c: 0d 94 72 17 jmp 0x22ee4 ; 0x22ee4 7510: 0d 94 8d 50 jmp 0x2a11a ; 0x2a11a 7514: 0d 94 f3 50 jmp 0x2a1e6 ; 0x2a1e6 7518: 0c 94 9a cf jmp 0x19f34 ; 0x19f34 751c: 0c 94 52 77 jmp 0xeea4 ; 0xeea4 7520: 0c 94 f6 cc jmp 0x199ec ; 0x199ec 7524: 0d 94 4d 50 jmp 0x2a09a ; 0x2a09a 7528: 0d 94 f6 50 jmp 0x2a1ec ; 0x2a1ec 752c: 0c 94 53 d2 jmp 0x1a4a6 ; 0x1a4a6 7530: 0d 94 36 51 jmp 0x2a26c ; 0x2a26c 7534: 0d 94 f8 a6 jmp 0x34df0 ; 0x34df0 7538: 0c 94 65 cf jmp 0x19eca ; 0x19eca 753c: 0d 94 6b 0f jmp 0x21ed6 ; 0x21ed6 7540: 0c 94 f0 cc jmp 0x199e0 ; 0x199e0 7544: 0d 94 92 ac jmp 0x35924 ; 0x35924 7548: 0d 94 be 28 jmp 0x2517c ; 0x2517c 754c: 0c 94 24 cd jmp 0x19a48 ; 0x19a48 7550: 0c 94 9a 74 jmp 0xe934 ; 0xe934 <__vector_23+0xe2> 7554: 0c 94 35 df jmp 0x1be6a ; 0x1be6a 7558: 0c 94 db cc jmp 0x199b6 ; 0x199b6 755c: 0d 94 ed 50 jmp 0x2a1da ; 0x2a1da 7560: 0c 94 56 cf jmp 0x19eac ; 0x19eac 7564: 0c 94 eb cf jmp 0x19fd6 ; 0x19fd6 7568: 0d 94 d8 a6 jmp 0x34db0 ; 0x34db0 756c: 0d 94 4a 2b jmp 0x25694 ; 0x25694 7570: 0c 94 a9 d3 jmp 0x1a752 ; 0x1a752 ()> 7574: 0d 94 51 10 jmp 0x220a2 ; 0x220a2 7578: 0d 94 3e 51 jmp 0x2a27c ; 0x2a27c 757c: 0c 94 b3 d3 jmp 0x1a766 ; 0x1a766 ()> 7580: 0d 94 d7 2b jmp 0x257ae ; 0x257ae 7584: 0d 94 28 50 jmp 0x2a050 ; 0x2a050 7588: 0c 94 45 df jmp 0x1be8a ; 0x1be8a 758c: 0c 94 4b fa jmp 0x1f496 ; 0x1f496 7590: 0d 94 96 a6 jmp 0x34d2c ; 0x34d2c 7594: 0c 94 d1 e9 jmp 0x1d3a2 ; 0x1d3a2 7598: 0d 94 39 10 jmp 0x22072 ; 0x22072 759c: 0d 94 d2 0a jmp 0x215a4 ; 0x215a4 75a0: 0c 94 dd df jmp 0x1bfba ; 0x1bfba 75a4: 0d 94 4a 21 jmp 0x24294 ; 0x24294 75a8: 0c 94 c7 e9 jmp 0x1d38e ; 0x1d38e 75ac: 0d 94 82 15 jmp 0x22b04 ; 0x22b04 75b0: 0d 94 32 a0 jmp 0x34064 ; 0x34064 75b4: 0d 94 7d a6 jmp 0x34cfa ; 0x34cfa 75b8: 0d 94 f0 50 jmp 0x2a1e0 ; 0x2a1e0 75bc: 0c 94 ce e0 jmp 0x1c19c ; 0x1c19c 75c0: 0c 94 30 fa jmp 0x1f460 ; 0x1f460 75c4: 0d 94 49 1c jmp 0x23892 ; 0x23892 75c8: 0c 94 d6 f7 jmp 0x1efac ; 0x1efac 75cc: 0d 94 c6 18 jmp 0x2318c ; 0x2318c 75d0: 0d 94 5a 50 jmp 0x2a0b4 ; 0x2a0b4 75d4: 0c 94 0a fa jmp 0x1f414 ; 0x1f414 75d8: 0c 94 6c e9 jmp 0x1d2d8 ; 0x1d2d8 75dc: 0c 94 d3 df jmp 0x1bfa6 ; 0x1bfa6 75e0: 0c 94 d4 e0 jmp 0x1c1a8 ; 0x1c1a8 75e4: 0c 94 44 f9 jmp 0x1f288 ; 0x1f288 75e8: 0c 94 e0 e0 jmp 0x1c1c0 ; 0x1c1c0 75ec: 0c 94 1e f8 jmp 0x1f03c ; 0x1f03c 75f0: 0d 94 d8 09 jmp 0x213b0 ; 0x213b0 75f4: 0d 94 56 16 jmp 0x22cac ; 0x22cac 75f8: 0c 94 16 fa jmp 0x1f42c ; 0x1f42c 75fc: 0c 94 dc e4 jmp 0x1c9b8 ; 0x1c9b8 7600: 0d 94 8e 1e jmp 0x23d1c ; 0x23d1c 7604: 0c 94 37 cf jmp 0x19e6e ; 0x19e6e 7608: 0c 94 ba f9 jmp 0x1f374 ; 0x1f374 760c: 0d 94 56 0f jmp 0x21eac ; 0x21eac 7610: 0d 94 07 1a jmp 0x2340e ; 0x2340e 7614: 0c 94 56 da jmp 0x1b4ac ; 0x1b4ac 7618: 0c 94 d6 cd jmp 0x19bac ; 0x19bac 761c: 0d 94 22 18 jmp 0x23044 ; 0x23044 7620: 0d 94 bc 50 jmp 0x2a178 ; 0x2a178 7624: 0d 94 6d 09 jmp 0x212da ; 0x212da 7628: 0c 94 56 e1 jmp 0x1c2ac ; 0x1c2ac 762c: 0c 94 88 e9 jmp 0x1d310 ; 0x1d310 7630: 0c 94 28 cd jmp 0x19a50 ; 0x19a50 7634: 0d 94 f7 07 jmp 0x20fee ; 0x20fee 7638: 0d 94 34 2f jmp 0x25e68 ; 0x25e68 763c: 0d 94 64 1c jmp 0x238c8 ; 0x238c8 7640: 0c 94 a3 ce jmp 0x19d46 ; 0x19d46 7644: 0c 94 fa 70 jmp 0xe1f4 ; 0xe1f4 7648: 0c 94 c1 d1 jmp 0x1a382 ; 0x1a382 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 70 41 07 45 f3 3e .......>..pA.E.> 7893: 01 60 ea 42 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 .`.B.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 5f 48 46 5f _10a-E3DREVO_HF_ 8808: 36 30 57 00 60W. 0000880c <_ZZ16process_commandsvE3__c__18_>: 880c: 52 65 76 00 Rev. 00008810 <_ZZ16process_commandsvE3__c__17_>: 8810: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000881c <_ZZ16process_commandsvE3__c__16_>: 881c: 46 69 72 00 Fir. 00008820 <_ZZ16process_commandsvE3__c__15_>: 8820: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 0000882b <_ZZ16process_commandsvE3__c__14_>: 882b: 53 4e 00 SN. 0000882e <_ZZ16process_commandsvE3__c__13_>: 882e: 52 45 53 45 54 00 RESET. 00008834 <_ZZ16process_commandsvE3__c__12_>: 8834: 4d 4d 55 52 45 53 00 MMURES. 0000883b <_ZZ16process_commandsvE3__c__11_>: 883b: 75 76 6c 6f 00 uvlo. 00008840 : 8840: 46 41 4e 00 FAN. 00008844 : 8844: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 0000884e : 884e: 50 52 55 53 41 00 PRUSA. 00008854 : 8854: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 0000885e : 885e: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 00008868 : 8868: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 00008872 : 8872: 54 4d 43 5f 00 TMC_. 00008877 : 8877: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008884 : 8884: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008892 : 8892: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 000088a1 : 88a1: 43 52 41 53 48 5f 00 CRASH_. 000088a8 : 88a8: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 88b8: 30 00 0. 000088ba : 88ba: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 000088c7 : 88c7: 4d 31 34 30 20 53 30 00 M140 S0. 000088cf : 88cf: 4d 31 30 34 20 53 30 00 M104 S0. 000088d7 : 88d7: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 000088e8 : 88e8: 47 31 20 46 34 30 30 30 00 G1 F4000. 000088f1 : 88f1: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 000088fc : 88fc: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008908 : 8908: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008917 : 8917: 47 39 30 00 G90. 0000891b : 891b: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 0000892a : 892a: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008938 : 8938: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 00008949 : 8949: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 00008956 : 8956: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 8966: 30 30 00 00. 00008969 : 8969: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 00008977 : 8977: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 00008987 : 8987: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 00008997 : 8997: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 000089a8 : 89a8: 47 39 32 20 45 30 00 G92 E0. 000089af : 89af: 47 32 38 00 G28. 000089b3 : 89b3: 4d 31 30 39 00 M109. 000089b8 : 89b8: 4d 31 39 30 00 M190. 000089bd : 89bd: 47 38 30 00 G80. 000089c1 : 89c1: 4d 34 35 00 M45. 000089c5 : 89c5: 4d 34 35 20 5a 00 M45 Z. 000089cb : 89cb: 47 37 36 00 G76. 000089cf : 89cf: 4d 37 30 31 20 50 30 00 M701 P0. 000089d7 : 89d7: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d 89e7: 0a 00 .. 000089e9 : 89e9: 4d 39 31 34 00 M914. 000089ee : 89ee: 4d 39 31 35 00 M915. 000089f3 : 89f3: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 00008a00 : 8a00: 30 2e 38 30 00 0.80. 00008a05 : 8a05: 30 2e 36 30 00 0.60. 00008a0a : 8a0a: 30 2e 34 30 00 0.40. 00008a0f : 8a0f: 30 2e 32 35 00 0.25. 00008a14 : 8a14: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 00008a1e : 8a1e: 4d 4d 55 00 MMU. 00008a22 : 8a22: 4d 34 34 00 M44. 00008a26 : 8a26: 30 2e 38 30 00 0.80. 00008a2b : 8a2b: 30 2e 36 30 00 0.60. 00008a30 : 8a30: 30 2e 34 30 00 0.40. 00008a35 : 8a35: 30 2e 32 35 00 0.25. 00008a3a : 8a3a: 47 32 38 20 58 59 00 G28 XY. 00008a41 : 8a41: 4d 20 38 34 00 M 84. 00008a46 : 8a46: 85 2e 2e 00 .... 00008a4a : 8a4a: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008a57 : 8a57: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008a64 : 8a64: 25 33 64 2f 30 00 %3d/0. 00008a6a : 8a6a: 25 33 64 2f 30 00 %3d/0. 00008a70 : 8a70: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008a80 : 8a80: 48 6f 74 65 6e 64 00 Hotend. 00008a87 : 8a87: 42 65 64 00 Bed. 00008a8b : 8a8b: 5a 00 Z. 00008a8d : 8a8d: 59 00 Y. 00008a8f : 8a8f: 58 00 X. 00008a91 <_ZL13STR_SEPARATOR.lto_priv.442>: 8a91: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8aa1: 2d 2d 2d 2d 00 ----. 00008aa6 : 8aa6: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8ab6: 6c 4e 72 00 lNr. 00008aba : 8aba: 47 6a d7 88 cf 88 c7 88 ba 88 a8 88 Gj.......... 00008ac6 : 8ac6: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 8ad6: 66 00 f. 00008ad8 : 8ad8: 47 31 20 46 31 30 38 30 00 G1 F1080. 00008ae1 : 8ae1: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 00008af1 : 8af1: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008afd : 8afd: a8 89 17 89 e0 6b 08 89 fc 88 f1 88 e8 88 .....k........ 00008b0b : 8b0b: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8b1b: 30 30 30 00 000. 00008b1f : 8b1f: 97 89 87 89 77 89 69 89 a8 89 56 89 49 89 38 89 ....w.i...V.I.8. 8b2f: 2a 89 1b 89 *... 00008b33 : 8b33: 54 25 64 00 T%d. 00008b37 : 8b37: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 00008b45 : 8b45: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 00008b52 : 8b52: 47 6a b8 89 b3 89 af 89 a8 89 Gj........ 00008b5c : 8b5c: 4d 38 34 20 58 59 00 M84 XY. 00008b63 : 8b63: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8b73: 30 30 00 00. 00008b76 : 8b76: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008b80 : 8b80: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8b90: 46 38 30 30 30 00 F8000. 00008b96 : 8b96: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8ba6: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8bb6: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008bc6 : 8bc6: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8bd6: 20 44 25 2e 32 66 00 D%.2f. 00008bdd : 8bdd: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008bea : 8bea: 52 43 00 RC. 00008bed : 8bed: 44 45 56 00 DEV. 00008bf1 : 8bf1: 42 45 54 41 00 BETA. 00008bf6 : 8bf6: 41 4c 50 48 41 00 ALPHA. 00008bfc : 8bfc: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8c0c: 01 01 00 00 04 01 07 01 0a 01 .......... 00008c16 : 8c16: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8c26: 02 01 00 00 05 01 08 01 0b 01 .......... 00008c30 : 8c30: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8c40: 00 01 00 00 03 01 06 01 09 01 .......... 00008c4a : 8c4a: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8c5a: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8c6a: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8c7a: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8c8a: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8c9a: 05 04 04 04 08 08 ...... 00008ca0 : 8ca0: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8cb0: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8cc0: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8cd0: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8ce0: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8cf0: 80 10 20 40 04 80 .. @.. 00008cf6 : 8cf6: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8d22: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008d4c : 8d4c: 33 2e 31 34 2e 31 00 3.14.1. 00008d53 : 8d53: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8d63: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8d73: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008d81 : 8d81: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008d91 : 8d91: 43 5a 50 58 00 CZPX. 00008d96 : 8d96: 3b 53 00 ;S. 00008d99 : 8d99: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008da7 : 8da7: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008db0 : 8db0: 20 0a 20 0a 20 0a 20 00 . . . . 00008db8 : 8db8: 41 6c 6c 20 44 61 74 61 00 All Data. 00008dc1 : 8dc1: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008dce : 8dce: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008ddc : 8ddc: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008de7 : 8de7: 4c 61 6e 67 75 61 67 65 00 Language. 00008df0 <_ZZL13factory_resetcE3__c.lto_priv.533>: 8df0: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008e01 : 8e01: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008e0f : 8e0f: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008e19 <_ZL8MSG_INT4.lto_priv.482>: 8e19: 49 4e 54 34 00 INT4. 00008e1e : 8e1e: 03 00 0e 00 01 00 40 00 ......@. 00008e26 : 8e26: 03 00 02 00 00 00 04 00 ........ 00008e2e : 8e2e: 55 6e 6b 6e 6f 77 6e 00 Unknown. 00008e36 : 8e36: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 8e46: 3a 30 30 00 :00. 00008e4a : 8e4a: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 8e5a: 30 30 30 30 30 30 00 000000. 00008e61 : 8e61: 73 74 61 72 74 00 start. 00008e67 : 8e67: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00008e78 : 8e78: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 00008e83 : 8e83: 43 5a 50 58 00 CZPX. 00008e88 : 8e88: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00008e99 : 8e99: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00008ea9 : 8ea9: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00008eb9 : 8eb9: 4d 32 39 00 M29. 00008ebd : 8ebd: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 00008ec5 : 8ec5: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 8ed5: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 00008ee4 : 8ee4: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 8ef4: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00008efe : 8efe: 20 0a 20 0a 20 00 . . . 00008f04 : 8f04: 00 00 48 42 00 00 58 41 9a 99 8d 41 33 33 53 40 ..HB..XA...A33S@ 00008f14 : 8f14: 4d 4d 55 32 3a 00 MMU2:. 00008f1a : 8f1a: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 8f2a: 64 00 d. 00008f2c : 8f2c: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 8f3c: 69 78 65 64 00 ixed. 00008f41 : 8f41: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ 8f51: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe 8f61: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial 8f71: 20 00 . 00008f73 <_ZZL25restore_print_from_eeprombE3__c__12_>: 8f73: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 00008f7e <_ZZL25restore_print_from_eeprombE3__c__11_>: 8f7e: 47 34 20 53 30 00 G4 S0. 00008f84 <_ZZL25restore_print_from_eeprombE3__c__10_>: 8f84: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 00008f8e : 8f8e: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 00008f97 : 8f97: 4d 31 30 36 20 53 25 75 00 M106 S%u. 00008fa0 : 8fa0: 47 31 20 46 25 64 00 G1 F%d. 00008fa7 : 8fa7: 4d 38 32 00 M82. 00008fab : 8fab: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 00008fb6 : 8fb6: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. 8fc6: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 00008fd0 : 8fd0: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 00008fda : 8fda: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 00008fe7 : 8fe7: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f 8ff7: 20 46 33 30 30 30 00 F3000. 00008ffe : 8ffe: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000900e : 900e: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 00009018 : 9018: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 00009023 : 9023: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000902c : 902c: 4d 31 34 30 20 53 25 64 00 M140 S%d. 00009035 : 9035: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000903e : 903e: 47 32 38 20 58 20 59 00 G28 X Y. 00009046 : 9046: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 00009054 : 9054: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p 9064: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... 9074: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b 9084: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... 9094: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T 90a4: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... 90b4: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F 90c4: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... 90d4: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 90e4: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. 90f4: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* 9104: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... 9114: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. 9124: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. 9134: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. 9144: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. 9154: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. 9164: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` 9174: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. 9184: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr 9194: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... 91a4: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D 91b4: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. 91c4: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V 91d4: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... 91e4: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( 91f4: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... 9204: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: 9214: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... 9224: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... 9234: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... 9244: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 00009254 : 9254: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000925d : 925d: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 926d: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 927d: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 928d: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 929d: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 92ad: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 92bd: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 92cd: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 92dd: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 92ed: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 92fd: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 930d: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 931d: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 932d: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 933d: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 934d: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 935d: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 936d: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 937d: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 938d: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 939d: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 93ad: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 93bd: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 93cd: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 93dd: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 93ed: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 93fd: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 940d: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 941d: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 942d: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 943d: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 944d: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 945d: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 946d: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 947d: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 948d: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 949d: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 94ad: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 94bd: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 94cd: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 94dd: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 94ed: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 94fd: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 950d: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 951d: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 952d: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 953d: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 954d: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 955d: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 956d: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 957d: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 958d: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 959d: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 95ad: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 95bd: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 95cd: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 95dd: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 95ed: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 95fd: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 960d: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 961d: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 962d: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 963d: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 964d: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 0000965d : 965d: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 966d: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 967d: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 968d: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 969d: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 96ad: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 96bd: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 96cd: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 96dd: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 96ed: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 96fd: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 970d: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 971d: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 972d: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 973d: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 974d: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 975d: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 976d: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 977d: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 978d: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 979d: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 97ad: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 97bd: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 97cd: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 97dd: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 97ed: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 97fd: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 980d: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 981d: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 982d: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 983d: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 984d: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 985d: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 986d: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 987d: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 988d: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 989d: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 98ad: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 98bd: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 98cd: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 98dd: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 98ed: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 98fd: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 990d: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 991d: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 992d: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 993d: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 994d: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 995d: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 996d: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 997d: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 998d: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 999d: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 99ad: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 99bd: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 99cd: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 99dd: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 99ed: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 99fd: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9a0d: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9a1d: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9a2d: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9a3d: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9a4d: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009a5d <_ZZ12PID_autotunefiiE3__c__16_>: 9a5d: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9a6d: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9a7d: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9a8d: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9a9d: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9aad: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009ab9 <_ZZ12PID_autotunefiiE3__c__15_>: 9ab9: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9ac9: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009ad6 <_ZZ12PID_autotunefiiE3__c__14_>: 9ad6: 20 40 3a 00 @:. 00009ada <_ZZ12PID_autotunefiiE3__c__13_>: 9ada: 54 3a 00 T:. 00009add <_ZZ12PID_autotunefiiE3__c__12_>: 9add: 42 3a 00 B:. 00009ae0 <_ZZ12PID_autotunefiiE3__c__11_>: 9ae0: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9af0: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9b00: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009b0a <_ZZ12PID_autotunefiiE3__c__10_>: 9b0a: 20 4b 64 3a 20 00 Kd: . 00009b10 : 9b10: 20 4b 69 3a 20 00 Ki: . 00009b16 : 9b16: 20 4b 70 3a 20 00 Kp: . 00009b1c : 9b1c: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009b2a : 9b2a: 20 54 75 3a 20 00 Tu: . 00009b30 : 9b30: 20 4b 75 3a 20 00 Ku: . 00009b36 : 9b36: 20 6d 61 78 3a 20 00 max: . 00009b3d : 9b3d: 20 6d 69 6e 3a 20 00 min: . 00009b44 : 9b44: 20 64 3a 20 00 d: . 00009b49 : 9b49: 20 62 69 61 73 3a 20 00 bias: . 00009b51 : 9b51: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9b61: 72 74 00 rt. 00009b64 : 9b64: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b74: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9b84: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009b8e : 9b8e: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9b9e: 20 25 6c 78 0a 00 %lx.. 00009ba4 : 9ba4: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009bac : 9bac: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009bb8 : 9bb8: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009bc4 : 9bc4: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009bcc : 9bcc: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009bd8 : 9bd8: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009be4 : 9be4: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9bf4: 64 00 d. 00009bf6 : 9bf6: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9c06: 72 65 64 21 00 red!. 00009c0b : 9c0b: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9c1b: 66 0a 00 f.. 00009c1e : 9c1e: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9c2e: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9c3e: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9c4e: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9c5e: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9c6e: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9c7e: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9c8e: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9c9e: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9cae: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9cbe: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9cce: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9cde: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9cee: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9cfe: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9d0e: 00 3f 00 00 .?.. 00009d12 : 9d12: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9d22: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9d32: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9d42: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9d52: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9d62: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9d72: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9d82: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9d92: f0 3f dd ff f0 3f d8 ff .?...?.. 00009d9a : 9d9a: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9daa: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009db2 : 9db2: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9dc2: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009dcb : 9dcb: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009ddb : 9ddb: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9deb: 57 41 59 00 WAY. 00009def : 9def: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9dff: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9e0f: 29 00 ). 00009e11 : 9e11: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e21: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9e31: 44 29 00 D). 00009e34 : 9e34: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009e42 : 9e42: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9e52: 52 00 R. 00009e54 : 9e54: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009e60 : 9e60: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9e70: 20 6f 66 66 2e 20 00 off. . 00009e77 : 9e77: 3a 20 00 : . 00009e7a : 9e7a: 45 72 72 3a 20 00 Err: . 00009e80 : 9e80: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009e90 : 9e90: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009e9f : 9e9f: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9eaf: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9ebf: 6e 61 62 6c 65 00 nable. 00009ec5 : 9ec5: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9ed5: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9ee5: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9ef5: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9f05: 25 2e 32 66 0a 00 %.2f.. 00009f0b : 9f0b: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9f1b: 32 66 0a 00 2f.. 00009f1f : 9f1f: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9f2f: 74 74 69 6e 67 73 3a 00 ttings:. 00009f37 : 9f37: cd cc f4 41 00 00 e8 41 00 00 dc 41 00 00 c4 41 ...A...A...A...A 9f47: 33 33 bb 41 66 66 b2 41 9a 99 a9 41 9a 99 a1 41 33.Aff.A...A...A 9f57: 66 66 9e 41 33 33 9b 41 00 00 98 41 cd cc 94 41 ff.A33.A...A...A 9f67: 66 66 92 41 cd cc 90 41 33 33 8f 41 9a 99 8d 41 ff.A...A33.A...A 00009f77 : 9f77: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current 9f87: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 00009f97 : 9f97: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 00009fa3 : 9fa3: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent 9fb3: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% 9fc3: 30 32 78 29 0a 00 02x).. 00009fc9 : 9fc9: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi 9fd9: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom 9fe9: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x 9ff9: 25 30 32 78 0a 00 %02x.. 00009fff : 9fff: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a00f: 0a 00 .. 0000a011 : a011: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a021: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a029 : a029: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a033 : a033: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a044 : a044: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a054 <__c.1906>: a054: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a064: 21 00 !. 0000a066 : a066: 3a 20 00 : . 0000a069 : a069: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a077 : a077: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a080 : a080: 20 3a 20 00 : . 0000a084 : a084: 25 33 53 00 %3S. 0000a088 : a088: 25 2d 37 73 00 %-7s. 0000a08d : a08d: 4e 64 20 25 34 2e 32 66 20 00 Nd %4.2f . 0000a097 : a097: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a0a7: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a0b2 : a0b2: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a0c2: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a0d1 : a0d1: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a0e1: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a0f1: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a0fe : a0fe: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a10e: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a11e: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a12e: 25 2d 33 64 00 %-3d. 0000a133 : a133: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a13d : a13d: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a14d: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a15d: 31 66 56 00 1fV. 0000a161 : a161: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a170 : a170: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a17c <_ZZL16lcd_support_menuvE3__c__15_>: a17c: 20 00 . 0000a17e <_ZZL16lcd_support_menuvE3__c__14_>: a17e: 20 00 . 0000a180 <_ZZL16lcd_support_menuvE3__c__13_>: a180: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a190: 3a 00 :. 0000a192 <_ZZL16lcd_support_menuvE3__c__12_>: a192: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a1a1 <_ZZL16lcd_support_menuvE3__c__11_>: a1a1: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a1aa <_ZZL16lcd_support_menuvE3__c__10_>: a1aa: 20 46 57 3a 00 FW:. 0000a1af : a1af: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 0000a1ba : a1ba: 45 33 44 52 45 56 4f 5f 48 46 5f 36 30 57 00 E3DREVO_HF_60W. 0000a1c9 : a1c9: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a1d3 : a1d3: 31 5f 37 35 6d 6d 5f 4d 4b 33 00 1_75mm_MK3. 0000a1de : a1de: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 0000a1ee : a1ee: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 0000a1fc : a1fc: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000a209 : a209: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a213 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a213: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a222 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a222: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a22e <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a22e: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a23e <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a23e: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a24a <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a24a: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a25a <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a25a: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a266 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a266: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a276 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a276: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a282 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a282: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a291 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a291: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a29d <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a29d: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a2ac : a2ac: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a2b8 : a2b8: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a2c8 : a2c8: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a2d4 : a2d4: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a2e4 : a2e4: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a2f0 : a2f0: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a2ff : a2ff: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a30b : a30b: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a31a : a31a: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a326 : a326: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a335 : a335: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a33f : a33f: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a34a : a34a: 58 3a 00 X:. 0000a34d : a34d: 59 3a 00 Y:. 0000a350 : a350: 5a 3a 00 Z:. 0000a353 : a353: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a364 : a364: 25 33 75 00 %3u. 0000a368 : a368: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a378: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a388: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a398: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a3a3 : a3a3: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a3b3: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a3c3: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a3d3: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a3dc : a3dc: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... a3ec: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... a3fc: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... a40c: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ a41c: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. a42c: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. a43c: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. a44c: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 0000a45c : a45c: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 0000a46d : a46d: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e a47d: 6e 74 65 72 0a 00 nter.. 0000a483 : a483: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c a493: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a4a3: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a4b3: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a4bb : a4bb: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n a4cb: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld a4db: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000a4e8 : a4e8: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= a4f8: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= a508: 25 64 0a 00 %d.. 0000a50c : a50c: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x a51c: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld a52c: 0a 00 .. 0000a52e : a52e: 25 30 32 78 00 %02x. 0000a533 : a533: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt a543: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 0000a54f : a54f: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm a55f: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 0000a56b : a56b: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ a57b: fc 03 f8 01 f0 00 00 00 ........ 0000a583 : a583: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ a593: f8 01 f0 00 00 00 00 00 ........ 0000a59b : a59b: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l a5ab: 65 61 76 65 0a 00 eave.. 0000a5b1 : a5b1: 20 3c 20 00 < . 0000a5b5 : a5b5: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p a5c5: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab a5d5: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate a5e5: 3a 00 :. 0000a5e7 : ... 0000a5e8 : a5e8: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ a5f8: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000a608 : a608: 25 64 2f 34 00 %d/4. 0000a60d : a60d: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000a619 : a619: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail a629: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax a639: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again a649: 2e 00 .. 0000a64b : a64b: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a65b: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a66b: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a67b: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a683 : a683: 0a 00 .. 0000a685 : a685: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a694 : a694: 25 64 0a 00 %d.. 0000a698 : a698: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a6a9 : a6a9: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a6b9: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a6c9: 25 25 0a 00 %%.. 0000a6cd : a6cd: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a6dd: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a6e9 : a6e9: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a6f9: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a709 <_ZL16ramming_sequence.lto_priv.399>: a709: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a719: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a729: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a739: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a749: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a759: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a769: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a779: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a789: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a799 <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.397>: a799: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a7a9: 74 73 00 ts. 0000a7ac : a7ac: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a7bc: 6f 70 70 65 64 00 opped. 0000a7c2 : a7c2: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a7d2 : a7d2: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a7e2: 73 74 61 72 74 65 64 00 started. 0000a7ea : a7ea: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a7fa: 6e 67 00 ng. 0000a7fd : a7fd: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a80d: 70 65 6e 64 69 6e 67 00 pending. 0000a815 : a815: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a822 : a822: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a82c <_ZL9mmu2Magic.lto_priv.374>: a82c: 4d 4d 55 32 3a 00 MMU2:. 0000a832 : a832: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% a842: 2d 2e 33 66 00 -.3f. 0000a847 : a847: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a857: 20 00 . 0000a859 : a859: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a869: 6e 65 64 00 ned. 0000a86d : a86d: 0f 54 fe 53 ea 53 d5 53 bf 53 ac 53 96 53 82 53 .T.S.S.S.S.S.S.S a87d: 71 53 5b 53 ea 53 fe 53 47 53 38 53 24 53 13 53 qS[S.S.SGS8S$S.S a88d: fe 52 37 5c e8 52 d6 52 c3 52 b2 52 9d 52 8a 52 .R7\.R.R.R.R.R.R a89d: 76 52 61 52 58 52 46 52 31 52 vRaRXRFR1R 0000a8a7 : a8a7: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a8b1 : a8b1: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a8c1: 75 6e 6f 75 74 21 00 unout!. 0000a8c8 : a8c8: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a8d8: 6d 65 6f 75 74 00 meout. 0000a8de : a8de: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a8ed : a8ed: 03 00 03 ... 0000a8f0 : a8f0: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a901 : a901: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a90f : a90f: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a920 : a920: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a930: 64 00 d. 0000a932 : a932: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a942: 65 64 00 ed. 0000a945 <_ZN4MMU2L11errorTitlesE.lto_priv.492>: a945: 6c 56 57 56 40 56 2b 56 16 56 02 56 f2 55 db 55 lVWV@V+V.V.V.U.U a955: c4 55 ad 55 99 55 85 55 6f 55 6f 55 6f 55 5a 55 .U.U.U.UoUoUoUZU a965: 5a 55 5a 55 47 55 47 55 47 55 34 55 34 55 34 55 ZUZUGUGUGU4U4U4U a975: 1d 55 1d 55 1d 55 08 55 08 55 08 55 f2 54 f2 54 .U.U.U.U.U.U.T.T a985: f2 54 e2 54 cd 54 b7 54 a1 54 92 54 85 54 6e 54 .T.T.T.T.T.T.TnT a995: 5b 54 49 54 36 54 24 54 14 54 [TIT6T$T.T 0000a99f : a99f: 42 75 74 74 6f 6e 00 Button. 0000a9a6 : a9a6: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a9b6: 74 6e 4c 4d 52 20 00 tnLMR . 0000a9bd <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.491>: a9bd: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a9cd: 20 20 20 81 00 .. 0000a9d2 : a9d2: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a9e2: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a9ed : a9ed: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a9fb : a9fb: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl aa0b: 65 61 72 65 64 00 eared. 0000aa11 : aa11: 20 57 3a 00 W:. 0000aa15 : aa15: 20 45 3a 00 E:. 0000aa19 : aa19: 54 3a 00 T:. 0000aa1c : aa1c: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000aa2d : aa2d: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000aa3a : aa3a: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000aa48 : aa48: 20 53 69 7a 65 3a 20 00 Size: . 0000aa50 : aa50: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000aa5e : aa5e: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000aa6f : aa6f: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000aa80 : aa80: 22 20 70 6f 73 00 " pos. 0000aa86 : aa86: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000aa91 : aa91: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL aaa1: 74 61 72 67 65 74 3a 22 00 target:". 0000aaaa : aaaa: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s aaba: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w aaca: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev aada: 65 6c 73 2e 00 els.. 0000aadf : aadf: 06 28 33 d0 36 c2 3e 01 3f 15 41 32 42 3b 43 f2 .(3.6.>.?.A2B;C. aaef: 44 3b 45 f2 46 22 47 3b 48 f2 49 3b 4a f0 58 98 D;E.F"G;H.I;J.X. aaff: 59 0c 5a 08 5b 0c 5c 08 61 10 67 9b 6e 22 71 07 Y.Z.[.\.a.g.n"q. ab0f: 72 08 ff r.. 0000ab12 : ab12: 09 5a 0d 00 0e f0 19 14 5e 08 20 64 2b 6d 32 2f .Z......^. d+m2/ ab22: ff . 0000ab23 : ab23: 20 22 25 73 22 00 "%s". 0000ab29 : ab29: 20 25 23 6c 78 00 %#lx. 0000ab2f : ab2f: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000ab38 : ab38: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% ab48: 73 22 0a 00 s".. 0000ab4c : ab4c: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000ab55 : ab55: 04 1a .. 0000ab57 : ab57: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt ab67: 74 65 6d 70 74 73 00 tempts. 0000ab6e : ab6e: 08 1b 1c ... 0000ab71 : ab71: 0b 14 .. 0000ab73 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.398>: ab73: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000ab82 : ab82: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000ab91 <_ZL10bufferFull.lto_priv.552>: ab91: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer aba1: 20 66 75 6c 6c 21 00 full!. 0000aba8 : aba8: 45 72 72 6f 72 3a 00 Error:. 0000abaf : abaf: 22 00 ". 0000abb1 : abb1: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the abc1: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000abca <_ZL9mmu2Magic.lto_priv.375>: abca: 4d 4d 55 32 3a 00 MMU2:. 0000abd0 : abd0: 65 63 68 6f 3a 00 echo:. 0000abd6 : abd6: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000abde : abde: 4d 4d 55 20 69 73 20 00 MMU is . 0000abe6 : abe6: 25 2e 31 30 53 20 00 %.10S . 0000abed : abed: 25 34 64 00 %4d. 0000abf1 : abf1: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t ac01: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000ac0e : ac0e: 25 64 2f 39 00 %d/9. 0000ac13 : ac13: 4d 4d 55 32 3a 00 MMU2:. 0000ac19 : ac19: 25 33 64 00 %3d. 0000ac1d : ac1d: 18 01 04 19 02 0a ...... 0000ac23 : ac23: bc 63 46 63 cc 62 5f 62 16 62 84 61 0c 61 a4 60 .cFc.b_b.b.a.a.` ac33: 55 60 35 60 e9 5f 35 60 d2 5f d2 5f d2 5f d2 5f U`5`._5`._._._._ ac43: d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f ._._._._._._._._ ac53: d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f d2 5f ._._._._._._._._ ac63: d2 5f d2 5f 9b 5f 5a 5f 10 5f 9d 5e 68 5e 1e 5e ._._._Z_._.^h^.^ ac73: d4 5d 76 5d 3d 5d fb 5c de 5c .]v]=].\.\ 0000ac7d : ac7d: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. ac8d: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ ac9d: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000acaa : acaa: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. acba: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... acca: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. acda: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. acea: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. acfa: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ad04 : ad04: 49 64 b2 64 3e 64 35 64 2e 64 3a 50 43 47 27 64 Id.d>d5d.d:PCG'd ad14: 1d 64 .d 0000ad16 : ad16: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ad26: 34 25 68 75 00 4%hu. 0000ad2b : ad2b: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ad3b: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ad4b: 6e 65 63 74 21 00 nect!. 0000ad51 : ad51: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ad5f : ad5f: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ad6f : ad6f: 73 74 61 72 74 0a 00 start.. 0000ad76 <__ctors_start>: ad76: 86 39 cpi r24, 0x96 ; 150 0000ad78 <__ctors_end>: ad78: 7c 64 ori r23, 0x4C ; 76 0000ad7a <__dtors_end>: ad7a: 11 24 eor r1, r1 ad7c: 1f be out 0x3f, r1 ; 63 ad7e: cf ef ldi r28, 0xFF ; 255 ad80: d1 e2 ldi r29, 0x21 ; 33 ad82: de bf out 0x3e, r29 ; 62 ad84: cd bf out 0x3d, r28 ; 61 ad86: 00 e0 ldi r16, 0x00 ; 0 ad88: 0c bf out 0x3c, r16 ; 60 0000ad8a <__do_copy_data>: ad8a: 13 e0 ldi r17, 0x03 ; 3 ad8c: a0 e0 ldi r26, 0x00 ; 0 ad8e: b2 e0 ldi r27, 0x02 ; 2 ad90: ee ed ldi r30, 0xDE ; 222 ad92: f5 ec ldi r31, 0xC5 ; 197 ad94: 03 e0 ldi r16, 0x03 ; 3 ad96: 0b bf out 0x3b, r16 ; 59 ad98: 02 c0 rjmp .+4 ; 0xad9e <__do_copy_data+0x14> ad9a: 07 90 elpm r0, Z+ ad9c: 0d 92 st X+, r0 ad9e: a4 32 cpi r26, 0x24 ; 36 ada0: b1 07 cpc r27, r17 ada2: d9 f7 brne .-10 ; 0xad9a <__do_copy_data+0x10> 0000ada4 <__do_clear_bss>: ada4: 28 e1 ldi r18, 0x18 ; 24 ada6: a4 e2 ldi r26, 0x24 ; 36 ada8: b3 e0 ldi r27, 0x03 ; 3 adaa: 01 c0 rjmp .+2 ; 0xadae <.do_clear_bss_start> 0000adac <.do_clear_bss_loop>: adac: 1d 92 st X+, r1 0000adae <.do_clear_bss_start>: adae: a0 32 cpi r26, 0x20 ; 32 adb0: b2 07 cpc r27, r18 adb2: e1 f7 brne .-8 ; 0xadac <.do_clear_bss_loop> 0000adb4 <__do_global_ctors>: adb4: 16 e5 ldi r17, 0x56 ; 86 adb6: cc eb ldi r28, 0xBC ; 188 adb8: d6 e5 ldi r29, 0x56 ; 86 adba: 00 e0 ldi r16, 0x00 ; 0 adbc: 06 c0 rjmp .+12 ; 0xadca <__do_global_ctors+0x16> adbe: 21 97 sbiw r28, 0x01 ; 1 adc0: 01 09 sbc r16, r1 adc2: 80 2f mov r24, r16 adc4: fe 01 movw r30, r28 adc6: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 <__tablejump2__> adca: cb 3b cpi r28, 0xBB ; 187 adcc: d1 07 cpc r29, r17 adce: 80 e0 ldi r24, 0x00 ; 0 add0: 08 07 cpc r16, r24 add2: a9 f7 brne .-22 ; 0xadbe <__do_global_ctors+0xa> add4: 0e 94 97 fa call 0x1f52e ; 0x1f52e
add8: 0d 94 dd e2 jmp 0x3c5ba ; 0x3c5ba <__do_global_dtors> 0000addc <__bad_interrupt>: addc: 0c 94 72 67 jmp 0xcee4 ; 0xcee4 <__vector_default> 0000ade0 : ade0: 2f 92 push r2 ade2: 3f 92 push r3 ade4: 4f 92 push r4 ade6: 5f 92 push r5 ade8: 6f 92 push r6 adea: 7f 92 push r7 adec: 8f 92 push r8 adee: 9f 92 push r9 adf0: af 92 push r10 adf2: bf 92 push r11 adf4: cf 92 push r12 adf6: df 92 push r13 adf8: ef 92 push r14 adfa: ff 92 push r15 adfc: 0f 93 push r16 adfe: 1f 93 push r17 ae00: cf 93 push r28 ae02: df 93 push r29 ae04: cd b7 in r28, 0x3d ; 61 ae06: de b7 in r29, 0x3e ; 62 ae08: 2f 97 sbiw r28, 0x0f ; 15 ae0a: 0f b6 in r0, 0x3f ; 63 ae0c: f8 94 cli ae0e: de bf out 0x3e, r29 ; 62 ae10: 0f be out 0x3f, r0 ; 63 ae12: cd bf out 0x3d, r28 ; 61 ae14: 6c 01 movw r12, r24 ae16: 1b 01 movw r2, r22 ae18: 5a 01 movw r10, r20 ae1a: fc 01 movw r30, r24 ae1c: 17 82 std Z+7, r1 ; 0x07 ae1e: 16 82 std Z+6, r1 ; 0x06 ae20: 83 81 ldd r24, Z+3 ; 0x03 ae22: 9e 01 movw r18, r28 ae24: 2f 5f subi r18, 0xFF ; 255 ae26: 3f 4f sbci r19, 0xFF ; 255 ae28: 49 01 movw r8, r18 ae2a: 81 fd sbrc r24, 1 ae2c: d2 c0 rjmp .+420 ; 0xafd2 ae2e: 8f ef ldi r24, 0xFF ; 255 ae30: 9f ef ldi r25, 0xFF ; 255 ae32: ee c2 rjmp .+1500 ; 0xb410 ae34: f1 2c mov r15, r1 ae36: 51 2c mov r5, r1 ae38: 00 e0 ldi r16, 0x00 ; 0 ae3a: 00 32 cpi r16, 0x20 ; 32 ae3c: 38 f4 brcc .+14 ; 0xae4c ae3e: 8b 32 cpi r24, 0x2B ; 43 ae40: 09 f1 breq .+66 ; 0xae84 ae42: 90 f4 brcc .+36 ; 0xae68 ae44: 80 32 cpi r24, 0x20 ; 32 ae46: f9 f0 breq .+62 ; 0xae86 ae48: 83 32 cpi r24, 0x23 ; 35 ae4a: 09 f1 breq .+66 ; 0xae8e ae4c: 07 fd sbrc r16, 7 ae4e: 34 c0 rjmp .+104 ; 0xaeb8 ae50: 20 ed ldi r18, 0xD0 ; 208 ae52: 28 0f add r18, r24 ae54: 2a 30 cpi r18, 0x0A ; 10 ae56: 20 f5 brcc .+72 ; 0xaea0 ae58: 06 ff sbrs r16, 6 ae5a: 1b c0 rjmp .+54 ; 0xae92 ae5c: fa e0 ldi r31, 0x0A ; 10 ae5e: ff 9e mul r15, r31 ae60: 20 0d add r18, r0 ae62: 11 24 eor r1, r1 ae64: f2 2e mov r15, r18 ae66: 05 c0 rjmp .+10 ; 0xae72 ae68: 8d 32 cpi r24, 0x2D ; 45 ae6a: 79 f0 breq .+30 ; 0xae8a ae6c: 80 33 cpi r24, 0x30 ; 48 ae6e: 71 f7 brne .-36 ; 0xae4c ae70: 01 60 ori r16, 0x01 ; 1 ae72: f1 01 movw r30, r2 ae74: 93 fd sbrc r25, 3 ae76: 85 91 lpm r24, Z+ ae78: 93 ff sbrs r25, 3 ae7a: 81 91 ld r24, Z+ ae7c: 1f 01 movw r2, r30 ae7e: 81 11 cpse r24, r1 ae80: dc cf rjmp .-72 ; 0xae3a ae82: 1a c0 rjmp .+52 ; 0xaeb8 ae84: 02 60 ori r16, 0x02 ; 2 ae86: 04 60 ori r16, 0x04 ; 4 ae88: f4 cf rjmp .-24 ; 0xae72 ae8a: 08 60 ori r16, 0x08 ; 8 ae8c: f2 cf rjmp .-28 ; 0xae72 ae8e: 00 61 ori r16, 0x10 ; 16 ae90: f0 cf rjmp .-32 ; 0xae72 ae92: 3a e0 ldi r19, 0x0A ; 10 ae94: 53 9e mul r5, r19 ae96: 20 0d add r18, r0 ae98: 11 24 eor r1, r1 ae9a: 52 2e mov r5, r18 ae9c: 00 62 ori r16, 0x20 ; 32 ae9e: e9 cf rjmp .-46 ; 0xae72 aea0: 8e 32 cpi r24, 0x2E ; 46 aea2: 21 f4 brne .+8 ; 0xaeac aea4: 06 fd sbrc r16, 6 aea6: b1 c2 rjmp .+1378 ; 0xb40a aea8: 00 64 ori r16, 0x40 ; 64 aeaa: e3 cf rjmp .-58 ; 0xae72 aeac: 8c 36 cpi r24, 0x6C ; 108 aeae: 11 f4 brne .+4 ; 0xaeb4 aeb0: 00 68 ori r16, 0x80 ; 128 aeb2: df cf rjmp .-66 ; 0xae72 aeb4: 88 36 cpi r24, 0x68 ; 104 aeb6: e9 f2 breq .-70 ; 0xae72 aeb8: 9b eb ldi r25, 0xBB ; 187 aeba: 98 0f add r25, r24 aebc: 93 30 cpi r25, 0x03 ; 3 aebe: 08 f0 brcs .+2 ; 0xaec2 aec0: 5f c0 rjmp .+190 ; 0xaf80 aec2: 00 61 ori r16, 0x10 ; 16 aec4: 80 5e subi r24, 0xE0 ; 224 aec6: 06 fd sbrc r16, 6 aec8: 02 c0 rjmp .+4 ; 0xaece aeca: 46 e0 ldi r20, 0x06 ; 6 aecc: f4 2e mov r15, r20 aece: 10 2f mov r17, r16 aed0: 1f 73 andi r17, 0x3F ; 63 aed2: 85 36 cpi r24, 0x65 ; 101 aed4: 09 f0 breq .+2 ; 0xaed8 aed6: 5b c0 rjmp .+182 ; 0xaf8e aed8: 10 64 ori r17, 0x40 ; 64 aeda: 17 ff sbrs r17, 7 aedc: 61 c0 rjmp .+194 ; 0xafa0 aede: 8f 2d mov r24, r15 aee0: 9b e3 ldi r25, 0x3B ; 59 aee2: 9f 15 cp r25, r15 aee4: 08 f4 brcc .+2 ; 0xaee8 aee6: 8b e3 ldi r24, 0x3B ; 59 aee8: 44 24 eor r4, r4 aeea: 43 94 inc r4 aeec: 48 0e add r4, r24 aeee: 27 e0 ldi r18, 0x07 ; 7 aef0: 35 01 movw r6, r10 aef2: f4 e0 ldi r31, 0x04 ; 4 aef4: 6f 0e add r6, r31 aef6: 71 1c adc r7, r1 aef8: f5 01 movw r30, r10 aefa: 60 81 ld r22, Z aefc: 71 81 ldd r23, Z+1 ; 0x01 aefe: 82 81 ldd r24, Z+2 ; 0x02 af00: 93 81 ldd r25, Z+3 ; 0x03 af02: 04 2d mov r16, r4 af04: a4 01 movw r20, r8 af06: 0f 94 dc d8 call 0x3b1b8 ; 0x3b1b8 <__ftoa_engine> af0a: 5c 01 movw r10, r24 af0c: f9 81 ldd r31, Y+1 ; 0x01 af0e: fc 87 std Y+12, r31 ; 0x0c af10: f0 ff sbrs r31, 0 af12: 03 c0 rjmp .+6 ; 0xaf1a af14: 0d e2 ldi r16, 0x2D ; 45 af16: f3 ff sbrs r31, 3 af18: 07 c0 rjmp .+14 ; 0xaf28 af1a: 0b e2 ldi r16, 0x2B ; 43 af1c: 11 fd sbrc r17, 1 af1e: 04 c0 rjmp .+8 ; 0xaf28 af20: 01 2f mov r16, r17 af22: 04 70 andi r16, 0x04 ; 4 af24: 12 fd sbrc r17, 2 af26: 00 e2 ldi r16, 0x20 ; 32 af28: 2c 85 ldd r18, Y+12 ; 0x0c af2a: 2c 70 andi r18, 0x0C ; 12 af2c: e2 2e mov r14, r18 af2e: 09 f4 brne .+2 ; 0xaf32 af30: 6b c0 rjmp .+214 ; 0xb008 af32: 01 11 cpse r16, r1 af34: d8 c2 rjmp .+1456 ; 0xb4e6 af36: f3 e0 ldi r31, 0x03 ; 3 af38: e1 2c mov r14, r1 af3a: f5 15 cp r31, r5 af3c: a0 f4 brcc .+40 ; 0xaf66 af3e: 83 e0 ldi r24, 0x03 ; 3 af40: e5 2c mov r14, r5 af42: e8 1a sub r14, r24 af44: 13 fd sbrc r17, 3 af46: 08 c0 rjmp .+16 ; 0xaf58 af48: b6 01 movw r22, r12 af4a: 80 e2 ldi r24, 0x20 ; 32 af4c: 90 e0 ldi r25, 0x00 ; 0 af4e: 0f 94 8b da call 0x3b516 ; 0x3b516 af52: ea 94 dec r14 af54: e1 10 cpse r14, r1 af56: f8 cf rjmp .-16 ; 0xaf48 af58: 00 23 and r16, r16 af5a: 29 f0 breq .+10 ; 0xaf66 af5c: b6 01 movw r22, r12 af5e: 80 2f mov r24, r16 af60: 90 e0 ldi r25, 0x00 ; 0 af62: 0f 94 8b da call 0x3b516 ; 0x3b516 af66: 3c 85 ldd r19, Y+12 ; 0x0c af68: 2c e4 ldi r18, 0x4C ; 76 af6a: a2 2e mov r10, r18 af6c: 26 e7 ldi r18, 0x76 ; 118 af6e: b2 2e mov r11, r18 af70: 33 fd sbrc r19, 3 af72: 04 c0 rjmp .+8 ; 0xaf7c af74: 90 e5 ldi r25, 0x50 ; 80 af76: a9 2e mov r10, r25 af78: 96 e7 ldi r25, 0x76 ; 118 af7a: b9 2e mov r11, r25 af7c: 10 71 andi r17, 0x10 ; 16 af7e: 22 c0 rjmp .+68 ; 0xafc4 af80: 9b e9 ldi r25, 0x9B ; 155 af82: 98 0f add r25, r24 af84: 93 30 cpi r25, 0x03 ; 3 af86: 08 f0 brcs .+2 ; 0xaf8a af88: 47 c1 rjmp .+654 ; 0xb218 af8a: 0f 7e andi r16, 0xEF ; 239 af8c: 9c cf rjmp .-200 ; 0xaec6 af8e: 86 36 cpi r24, 0x66 ; 102 af90: 11 f4 brne .+4 ; 0xaf96 af92: 10 68 ori r17, 0x80 ; 128 af94: a2 cf rjmp .-188 ; 0xaeda af96: ff 20 and r15, r15 af98: 09 f4 brne .+2 ; 0xaf9c af9a: 9f cf rjmp .-194 ; 0xaeda af9c: fa 94 dec r15 af9e: 9d cf rjmp .-198 ; 0xaeda afa0: e7 e0 ldi r30, 0x07 ; 7 afa2: 2f 2d mov r18, r15 afa4: ef 15 cp r30, r15 afa6: 18 f4 brcc .+6 ; 0xafae afa8: 27 e0 ldi r18, 0x07 ; 7 afaa: 37 e0 ldi r19, 0x07 ; 7 afac: f3 2e mov r15, r19 afae: 41 2c mov r4, r1 afb0: 9f cf rjmp .-194 ; 0xaef0 afb2: 11 11 cpse r17, r1 afb4: 80 52 subi r24, 0x20 ; 32 afb6: b6 01 movw r22, r12 afb8: 90 e0 ldi r25, 0x00 ; 0 afba: 0f 94 8b da call 0x3b516 ; 0x3b516 afbe: 8f ef ldi r24, 0xFF ; 255 afc0: a8 1a sub r10, r24 afc2: b8 0a sbc r11, r24 afc4: f5 01 movw r30, r10 afc6: 84 91 lpm r24, Z afc8: 81 11 cpse r24, r1 afca: f3 cf rjmp .-26 ; 0xafb2 afcc: e1 10 cpse r14, r1 afce: 84 c2 rjmp .+1288 ; 0xb4d8 afd0: 53 01 movw r10, r6 afd2: f6 01 movw r30, r12 afd4: 93 81 ldd r25, Z+3 ; 0x03 afd6: f1 01 movw r30, r2 afd8: 93 fd sbrc r25, 3 afda: 85 91 lpm r24, Z+ afdc: 93 ff sbrs r25, 3 afde: 81 91 ld r24, Z+ afe0: 1f 01 movw r2, r30 afe2: 88 23 and r24, r24 afe4: 09 f4 brne .+2 ; 0xafe8 afe6: 11 c2 rjmp .+1058 ; 0xb40a afe8: 85 32 cpi r24, 0x25 ; 37 afea: 41 f4 brne .+16 ; 0xaffc afec: 93 fd sbrc r25, 3 afee: 85 91 lpm r24, Z+ aff0: 93 ff sbrs r25, 3 aff2: 81 91 ld r24, Z+ aff4: 1f 01 movw r2, r30 aff6: 85 32 cpi r24, 0x25 ; 37 aff8: 09 f0 breq .+2 ; 0xaffc affa: 1c cf rjmp .-456 ; 0xae34 affc: b6 01 movw r22, r12 affe: 90 e0 ldi r25, 0x00 ; 0 b000: 0f 94 8b da call 0x3b516 ; 0x3b516 b004: 35 01 movw r6, r10 b006: e4 cf rjmp .-56 ; 0xafd0 b008: 17 ff sbrs r17, 7 b00a: 6f c0 rjmp .+222 ; 0xb0ea b00c: 4a 0c add r4, r10 b00e: fc 85 ldd r31, Y+12 ; 0x0c b010: f4 ff sbrs r31, 4 b012: 04 c0 rjmp .+8 ; 0xb01c b014: 8a 81 ldd r24, Y+2 ; 0x02 b016: 81 33 cpi r24, 0x31 ; 49 b018: 09 f4 brne .+2 ; 0xb01c b01a: 4a 94 dec r4 b01c: 14 14 cp r1, r4 b01e: 0c f0 brlt .+2 ; 0xb022 b020: 86 c0 rjmp .+268 ; 0xb12e b022: 28 e0 ldi r18, 0x08 ; 8 b024: 24 15 cp r18, r4 b026: 10 f4 brcc .+4 ; 0xb02c b028: 88 e0 ldi r24, 0x08 ; 8 b02a: 48 2e mov r4, r24 b02c: 85 e0 ldi r24, 0x05 ; 5 b02e: 90 e0 ldi r25, 0x00 ; 0 b030: 17 ff sbrs r17, 7 b032: 06 c0 rjmp .+12 ; 0xb040 b034: c5 01 movw r24, r10 b036: b7 fe sbrs r11, 7 b038: 02 c0 rjmp .+4 ; 0xb03e b03a: 90 e0 ldi r25, 0x00 ; 0 b03c: 80 e0 ldi r24, 0x00 ; 0 b03e: 01 96 adiw r24, 0x01 ; 1 b040: 01 11 cpse r16, r1 b042: 01 96 adiw r24, 0x01 ; 1 b044: ff 20 and r15, r15 b046: 31 f0 breq .+12 ; 0xb054 b048: 2f 2d mov r18, r15 b04a: 30 e0 ldi r19, 0x00 ; 0 b04c: 2f 5f subi r18, 0xFF ; 255 b04e: 3f 4f sbci r19, 0xFF ; 255 b050: 82 0f add r24, r18 b052: 93 1f adc r25, r19 b054: 58 16 cp r5, r24 b056: 19 06 cpc r1, r25 b058: 19 f0 breq .+6 ; 0xb060 b05a: 14 f0 brlt .+4 ; 0xb060 b05c: e5 2c mov r14, r5 b05e: e8 1a sub r14, r24 b060: 81 2f mov r24, r17 b062: 89 70 andi r24, 0x09 ; 9 b064: 11 f4 brne .+4 ; 0xb06a b066: e1 10 cpse r14, r1 b068: 67 c0 rjmp .+206 ; 0xb138 b06a: 00 23 and r16, r16 b06c: 29 f0 breq .+10 ; 0xb078 b06e: b6 01 movw r22, r12 b070: 80 2f mov r24, r16 b072: 90 e0 ldi r25, 0x00 ; 0 b074: 0f 94 8b da call 0x3b516 ; 0x3b516 b078: 13 fd sbrc r17, 3 b07a: 02 c0 rjmp .+4 ; 0xb080 b07c: e1 10 cpse r14, r1 b07e: 63 c0 rjmp .+198 ; 0xb146 b080: 17 ff sbrs r17, 7 b082: 7c c0 rjmp .+248 ; 0xb17c b084: 85 01 movw r16, r10 b086: b7 fe sbrs r11, 7 b088: 02 c0 rjmp .+4 ; 0xb08e b08a: 10 e0 ldi r17, 0x00 ; 0 b08c: 00 e0 ldi r16, 0x00 ; 0 b08e: c5 01 movw r24, r10 b090: 84 19 sub r24, r4 b092: 91 09 sbc r25, r1 b094: 2c 01 movw r4, r24 b096: 6f 2d mov r22, r15 b098: 70 e0 ldi r23, 0x00 ; 0 b09a: ee 27 eor r30, r30 b09c: ff 27 eor r31, r31 b09e: e6 1b sub r30, r22 b0a0: f7 0b sbc r31, r23 b0a2: ff 87 std Y+15, r31 ; 0x0f b0a4: ee 87 std Y+14, r30 ; 0x0e b0a6: 0f 3f cpi r16, 0xFF ; 255 b0a8: 10 07 cpc r17, r16 b0aa: 29 f4 brne .+10 ; 0xb0b6 b0ac: b6 01 movw r22, r12 b0ae: 8e e2 ldi r24, 0x2E ; 46 b0b0: 90 e0 ldi r25, 0x00 ; 0 b0b2: 0f 94 8b da call 0x3b516 ; 0x3b516 b0b6: a0 16 cp r10, r16 b0b8: b1 06 cpc r11, r17 b0ba: 0c f4 brge .+2 ; 0xb0be b0bc: 4b c0 rjmp .+150 ; 0xb154 b0be: 40 16 cp r4, r16 b0c0: 51 06 cpc r5, r17 b0c2: 0c f0 brlt .+2 ; 0xb0c6 b0c4: 47 c0 rjmp .+142 ; 0xb154 b0c6: f5 01 movw r30, r10 b0c8: e0 1b sub r30, r16 b0ca: f1 0b sbc r31, r17 b0cc: e8 0d add r30, r8 b0ce: f9 1d adc r31, r9 b0d0: 81 81 ldd r24, Z+1 ; 0x01 b0d2: 01 50 subi r16, 0x01 ; 1 b0d4: 11 09 sbc r17, r1 b0d6: 2e 85 ldd r18, Y+14 ; 0x0e b0d8: 3f 85 ldd r19, Y+15 ; 0x0f b0da: 02 17 cp r16, r18 b0dc: 13 07 cpc r17, r19 b0de: e4 f1 brlt .+120 ; 0xb158 b0e0: b6 01 movw r22, r12 b0e2: 90 e0 ldi r25, 0x00 ; 0 b0e4: 0f 94 8b da call 0x3b516 ; 0x3b516 b0e8: de cf rjmp .-68 ; 0xb0a6 b0ea: 16 fd sbrc r17, 6 b0ec: 9f cf rjmp .-194 ; 0xb02c b0ee: ef 2d mov r30, r15 b0f0: f0 e0 ldi r31, 0x00 ; 0 b0f2: ea 15 cp r30, r10 b0f4: fb 05 cpc r31, r11 b0f6: 34 f0 brlt .+12 ; 0xb104 b0f8: 3c ef ldi r19, 0xFC ; 252 b0fa: a3 16 cp r10, r19 b0fc: 3f ef ldi r19, 0xFF ; 255 b0fe: b3 06 cpc r11, r19 b100: 0c f0 brlt .+2 ; 0xb104 b102: 10 68 ori r17, 0x80 ; 128 b104: 32 96 adiw r30, 0x02 ; 2 b106: e8 0d add r30, r8 b108: f9 1d adc r31, r9 b10a: 01 c0 rjmp .+2 ; 0xb10e b10c: fa 94 dec r15 b10e: ff 20 and r15, r15 b110: 19 f0 breq .+6 ; 0xb118 b112: 82 91 ld r24, -Z b114: 80 33 cpi r24, 0x30 ; 48 b116: d1 f3 breq .-12 ; 0xb10c b118: 17 ff sbrs r17, 7 b11a: 88 cf rjmp .-240 ; 0xb02c b11c: 44 24 eor r4, r4 b11e: 43 94 inc r4 b120: 4f 0c add r4, r15 b122: fa 14 cp r15, r10 b124: 1b 04 cpc r1, r11 b126: 31 f0 breq .+12 ; 0xb134 b128: 2c f0 brlt .+10 ; 0xb134 b12a: fa 18 sub r15, r10 b12c: 7f cf rjmp .-258 ; 0xb02c b12e: 44 24 eor r4, r4 b130: 43 94 inc r4 b132: 7c cf rjmp .-264 ; 0xb02c b134: f1 2c mov r15, r1 b136: 7a cf rjmp .-268 ; 0xb02c b138: b6 01 movw r22, r12 b13a: 80 e2 ldi r24, 0x20 ; 32 b13c: 90 e0 ldi r25, 0x00 ; 0 b13e: 0f 94 8b da call 0x3b516 ; 0x3b516 b142: ea 94 dec r14 b144: 90 cf rjmp .-224 ; 0xb066 b146: b6 01 movw r22, r12 b148: 80 e3 ldi r24, 0x30 ; 48 b14a: 90 e0 ldi r25, 0x00 ; 0 b14c: 0f 94 8b da call 0x3b516 ; 0x3b516 b150: ea 94 dec r14 b152: 94 cf rjmp .-216 ; 0xb07c b154: 80 e3 ldi r24, 0x30 ; 48 b156: bd cf rjmp .-134 ; 0xb0d2 b158: a0 16 cp r10, r16 b15a: b1 06 cpc r11, r17 b15c: 41 f4 brne .+16 ; 0xb16e b15e: 9a 81 ldd r25, Y+2 ; 0x02 b160: 96 33 cpi r25, 0x36 ; 54 b162: 50 f4 brcc .+20 ; 0xb178 b164: 95 33 cpi r25, 0x35 ; 53 b166: 19 f4 brne .+6 ; 0xb16e b168: 3c 85 ldd r19, Y+12 ; 0x0c b16a: 34 ff sbrs r19, 4 b16c: 05 c0 rjmp .+10 ; 0xb178 b16e: b6 01 movw r22, r12 b170: 90 e0 ldi r25, 0x00 ; 0 b172: 0f 94 8b da call 0x3b516 ; 0x3b516 b176: 2a cf rjmp .-428 ; 0xafcc b178: 81 e3 ldi r24, 0x31 ; 49 b17a: f9 cf rjmp .-14 ; 0xb16e b17c: 8a 81 ldd r24, Y+2 ; 0x02 b17e: 81 33 cpi r24, 0x31 ; 49 b180: 19 f0 breq .+6 ; 0xb188 b182: 9c 85 ldd r25, Y+12 ; 0x0c b184: 9f 7e andi r25, 0xEF ; 239 b186: 9c 87 std Y+12, r25 ; 0x0c b188: b6 01 movw r22, r12 b18a: 90 e0 ldi r25, 0x00 ; 0 b18c: 0f 94 8b da call 0x3b516 ; 0x3b516 b190: ff 20 and r15, r15 b192: a9 f0 breq .+42 ; 0xb1be b194: b6 01 movw r22, r12 b196: 8e e2 ldi r24, 0x2E ; 46 b198: 90 e0 ldi r25, 0x00 ; 0 b19a: 0f 94 8b da call 0x3b516 ; 0x3b516 b19e: f3 94 inc r15 b1a0: f3 94 inc r15 b1a2: e2 e0 ldi r30, 0x02 ; 2 b1a4: 01 e0 ldi r16, 0x01 ; 1 b1a6: 0e 0f add r16, r30 b1a8: e8 0d add r30, r8 b1aa: f9 2d mov r31, r9 b1ac: f1 1d adc r31, r1 b1ae: 80 81 ld r24, Z b1b0: b6 01 movw r22, r12 b1b2: 90 e0 ldi r25, 0x00 ; 0 b1b4: 0f 94 8b da call 0x3b516 ; 0x3b516 b1b8: e0 2f mov r30, r16 b1ba: 0f 11 cpse r16, r15 b1bc: f3 cf rjmp .-26 ; 0xb1a4 b1be: 85 e6 ldi r24, 0x65 ; 101 b1c0: 90 e0 ldi r25, 0x00 ; 0 b1c2: 14 ff sbrs r17, 4 b1c4: 02 c0 rjmp .+4 ; 0xb1ca b1c6: 85 e4 ldi r24, 0x45 ; 69 b1c8: 90 e0 ldi r25, 0x00 ; 0 b1ca: b6 01 movw r22, r12 b1cc: 0f 94 8b da call 0x3b516 ; 0x3b516 b1d0: b7 fc sbrc r11, 7 b1d2: 06 c0 rjmp .+12 ; 0xb1e0 b1d4: a1 14 cp r10, r1 b1d6: b1 04 cpc r11, r1 b1d8: c1 f4 brne .+48 ; 0xb20a b1da: ec 85 ldd r30, Y+12 ; 0x0c b1dc: e4 ff sbrs r30, 4 b1de: 15 c0 rjmp .+42 ; 0xb20a b1e0: b1 94 neg r11 b1e2: a1 94 neg r10 b1e4: b1 08 sbc r11, r1 b1e6: 8d e2 ldi r24, 0x2D ; 45 b1e8: b6 01 movw r22, r12 b1ea: 90 e0 ldi r25, 0x00 ; 0 b1ec: 0f 94 8b da call 0x3b516 ; 0x3b516 b1f0: 80 e3 ldi r24, 0x30 ; 48 b1f2: 2a e0 ldi r18, 0x0A ; 10 b1f4: a2 16 cp r10, r18 b1f6: b1 04 cpc r11, r1 b1f8: 54 f4 brge .+20 ; 0xb20e b1fa: b6 01 movw r22, r12 b1fc: 90 e0 ldi r25, 0x00 ; 0 b1fe: 0f 94 8b da call 0x3b516 ; 0x3b516 b202: b6 01 movw r22, r12 b204: c5 01 movw r24, r10 b206: c0 96 adiw r24, 0x30 ; 48 b208: b4 cf rjmp .-152 ; 0xb172 b20a: 8b e2 ldi r24, 0x2B ; 43 b20c: ed cf rjmp .-38 ; 0xb1e8 b20e: 8f 5f subi r24, 0xFF ; 255 b210: fa e0 ldi r31, 0x0A ; 10 b212: af 1a sub r10, r31 b214: b1 08 sbc r11, r1 b216: ed cf rjmp .-38 ; 0xb1f2 b218: 83 36 cpi r24, 0x63 ; 99 b21a: c9 f0 breq .+50 ; 0xb24e b21c: 83 37 cpi r24, 0x73 ; 115 b21e: 71 f1 breq .+92 ; 0xb27c b220: 83 35 cpi r24, 0x53 ; 83 b222: 09 f0 breq .+2 ; 0xb226 b224: 5b c0 rjmp .+182 ; 0xb2dc b226: 35 01 movw r6, r10 b228: f2 e0 ldi r31, 0x02 ; 2 b22a: 6f 0e add r6, r31 b22c: 71 1c adc r7, r1 b22e: f5 01 movw r30, r10 b230: a0 80 ld r10, Z b232: b1 80 ldd r11, Z+1 ; 0x01 b234: 6f 2d mov r22, r15 b236: 70 e0 ldi r23, 0x00 ; 0 b238: 06 fd sbrc r16, 6 b23a: 02 c0 rjmp .+4 ; 0xb240 b23c: 6f ef ldi r22, 0xFF ; 255 b23e: 7f ef ldi r23, 0xFF ; 255 b240: c5 01 movw r24, r10 b242: 0f 94 1f da call 0x3b43e ; 0x3b43e b246: 9d 87 std Y+13, r25 ; 0x0d b248: 8c 87 std Y+12, r24 ; 0x0c b24a: 00 68 ori r16, 0x80 ; 128 b24c: 0d c0 rjmp .+26 ; 0xb268 b24e: 35 01 movw r6, r10 b250: 32 e0 ldi r19, 0x02 ; 2 b252: 63 0e add r6, r19 b254: 71 1c adc r7, r1 b256: f5 01 movw r30, r10 b258: 80 81 ld r24, Z b25a: 89 83 std Y+1, r24 ; 0x01 b25c: 21 e0 ldi r18, 0x01 ; 1 b25e: 30 e0 ldi r19, 0x00 ; 0 b260: 3d 87 std Y+13, r19 ; 0x0d b262: 2c 87 std Y+12, r18 ; 0x0c b264: 54 01 movw r10, r8 b266: 0f 77 andi r16, 0x7F ; 127 b268: 03 fd sbrc r16, 3 b26a: 06 c0 rjmp .+12 ; 0xb278 b26c: 2c 85 ldd r18, Y+12 ; 0x0c b26e: 3d 85 ldd r19, Y+13 ; 0x0d b270: 52 16 cp r5, r18 b272: 13 06 cpc r1, r19 b274: 09 f0 breq .+2 ; 0xb278 b276: a8 f4 brcc .+42 ; 0xb2a2 b278: e5 2c mov r14, r5 b27a: 2b c0 rjmp .+86 ; 0xb2d2 b27c: 35 01 movw r6, r10 b27e: 32 e0 ldi r19, 0x02 ; 2 b280: 63 0e add r6, r19 b282: 71 1c adc r7, r1 b284: f5 01 movw r30, r10 b286: a0 80 ld r10, Z b288: b1 80 ldd r11, Z+1 ; 0x01 b28a: 6f 2d mov r22, r15 b28c: 70 e0 ldi r23, 0x00 ; 0 b28e: 06 fd sbrc r16, 6 b290: 02 c0 rjmp .+4 ; 0xb296 b292: 6f ef ldi r22, 0xFF ; 255 b294: 7f ef ldi r23, 0xFF ; 255 b296: c5 01 movw r24, r10 b298: 0f 94 44 da call 0x3b488 ; 0x3b488 b29c: 9d 87 std Y+13, r25 ; 0x0d b29e: 8c 87 std Y+12, r24 ; 0x0c b2a0: e2 cf rjmp .-60 ; 0xb266 b2a2: b6 01 movw r22, r12 b2a4: 80 e2 ldi r24, 0x20 ; 32 b2a6: 90 e0 ldi r25, 0x00 ; 0 b2a8: 0f 94 8b da call 0x3b516 ; 0x3b516 b2ac: 5a 94 dec r5 b2ae: de cf rjmp .-68 ; 0xb26c b2b0: f5 01 movw r30, r10 b2b2: 07 fd sbrc r16, 7 b2b4: 85 91 lpm r24, Z+ b2b6: 07 ff sbrs r16, 7 b2b8: 81 91 ld r24, Z+ b2ba: 5f 01 movw r10, r30 b2bc: b6 01 movw r22, r12 b2be: 90 e0 ldi r25, 0x00 ; 0 b2c0: 0f 94 8b da call 0x3b516 ; 0x3b516 b2c4: e1 10 cpse r14, r1 b2c6: ea 94 dec r14 b2c8: 8c 85 ldd r24, Y+12 ; 0x0c b2ca: 9d 85 ldd r25, Y+13 ; 0x0d b2cc: 01 97 sbiw r24, 0x01 ; 1 b2ce: 9d 87 std Y+13, r25 ; 0x0d b2d0: 8c 87 std Y+12, r24 ; 0x0c b2d2: ec 85 ldd r30, Y+12 ; 0x0c b2d4: fd 85 ldd r31, Y+13 ; 0x0d b2d6: ef 2b or r30, r31 b2d8: 59 f7 brne .-42 ; 0xb2b0 b2da: 78 ce rjmp .-784 ; 0xafcc b2dc: 84 36 cpi r24, 0x64 ; 100 b2de: 19 f0 breq .+6 ; 0xb2e6 b2e0: 89 36 cpi r24, 0x69 ; 105 b2e2: 09 f0 breq .+2 ; 0xb2e6 b2e4: 74 c0 rjmp .+232 ; 0xb3ce b2e6: 35 01 movw r6, r10 b2e8: 07 ff sbrs r16, 7 b2ea: 66 c0 rjmp .+204 ; 0xb3b8 b2ec: f4 e0 ldi r31, 0x04 ; 4 b2ee: 6f 0e add r6, r31 b2f0: 71 1c adc r7, r1 b2f2: f5 01 movw r30, r10 b2f4: 60 81 ld r22, Z b2f6: 71 81 ldd r23, Z+1 ; 0x01 b2f8: 82 81 ldd r24, Z+2 ; 0x02 b2fa: 93 81 ldd r25, Z+3 ; 0x03 b2fc: 10 2f mov r17, r16 b2fe: 1f 76 andi r17, 0x6F ; 111 b300: 97 ff sbrs r25, 7 b302: 08 c0 rjmp .+16 ; 0xb314 b304: 90 95 com r25 b306: 80 95 com r24 b308: 70 95 com r23 b30a: 61 95 neg r22 b30c: 7f 4f sbci r23, 0xFF ; 255 b30e: 8f 4f sbci r24, 0xFF ; 255 b310: 9f 4f sbci r25, 0xFF ; 255 b312: 10 68 ori r17, 0x80 ; 128 b314: 2a e0 ldi r18, 0x0A ; 10 b316: 30 e0 ldi r19, 0x00 ; 0 b318: a4 01 movw r20, r8 b31a: 0f 94 b2 db call 0x3b764 ; 0x3b764 <__ultoa_invert> b31e: a8 2e mov r10, r24 b320: a8 18 sub r10, r8 b322: ba 2c mov r11, r10 b324: 01 2f mov r16, r17 b326: 16 ff sbrs r17, 6 b328: 0a c0 rjmp .+20 ; 0xb33e b32a: 0e 7f andi r16, 0xFE ; 254 b32c: af 14 cp r10, r15 b32e: 38 f4 brcc .+14 ; 0xb33e b330: 14 ff sbrs r17, 4 b332: 04 c0 rjmp .+8 ; 0xb33c b334: 12 fd sbrc r17, 2 b336: 02 c0 rjmp .+4 ; 0xb33c b338: 01 2f mov r16, r17 b33a: 0e 7e andi r16, 0xEE ; 238 b33c: bf 2c mov r11, r15 b33e: 04 ff sbrs r16, 4 b340: a3 c0 rjmp .+326 ; 0xb488 b342: fe 01 movw r30, r28 b344: ea 0d add r30, r10 b346: f1 1d adc r31, r1 b348: 80 81 ld r24, Z b34a: 80 33 cpi r24, 0x30 ; 48 b34c: 09 f0 breq .+2 ; 0xb350 b34e: 95 c0 rjmp .+298 ; 0xb47a b350: 09 7e andi r16, 0xE9 ; 233 b352: f0 2f mov r31, r16 b354: f8 70 andi r31, 0x08 ; 8 b356: ef 2e mov r14, r31 b358: 03 fd sbrc r16, 3 b35a: a5 c0 rjmp .+330 ; 0xb4a6 b35c: 00 ff sbrs r16, 0 b35e: 9f c0 rjmp .+318 ; 0xb49e b360: fa 2c mov r15, r10 b362: b5 14 cp r11, r5 b364: 10 f4 brcc .+4 ; 0xb36a b366: f5 0c add r15, r5 b368: fb 18 sub r15, r11 b36a: 04 ff sbrs r16, 4 b36c: a2 c0 rjmp .+324 ; 0xb4b2 b36e: b6 01 movw r22, r12 b370: 80 e3 ldi r24, 0x30 ; 48 b372: 90 e0 ldi r25, 0x00 ; 0 b374: 0f 94 8b da call 0x3b516 ; 0x3b516 b378: 02 ff sbrs r16, 2 b37a: 09 c0 rjmp .+18 ; 0xb38e b37c: 88 e7 ldi r24, 0x78 ; 120 b37e: 90 e0 ldi r25, 0x00 ; 0 b380: 01 ff sbrs r16, 1 b382: 02 c0 rjmp .+4 ; 0xb388 b384: 88 e5 ldi r24, 0x58 ; 88 b386: 90 e0 ldi r25, 0x00 ; 0 b388: b6 01 movw r22, r12 b38a: 0f 94 8b da call 0x3b516 ; 0x3b516 b38e: af 14 cp r10, r15 b390: 08 f4 brcc .+2 ; 0xb394 b392: 9b c0 rjmp .+310 ; 0xb4ca b394: aa 94 dec r10 b396: 0a 2d mov r16, r10 b398: 10 e0 ldi r17, 0x00 ; 0 b39a: 0f 5f subi r16, 0xFF ; 255 b39c: 1f 4f sbci r17, 0xFF ; 255 b39e: 08 0d add r16, r8 b3a0: 19 1d adc r17, r9 b3a2: f8 01 movw r30, r16 b3a4: 82 91 ld r24, -Z b3a6: 8f 01 movw r16, r30 b3a8: b6 01 movw r22, r12 b3aa: 90 e0 ldi r25, 0x00 ; 0 b3ac: 0f 94 8b da call 0x3b516 ; 0x3b516 b3b0: 80 16 cp r8, r16 b3b2: 91 06 cpc r9, r17 b3b4: b1 f7 brne .-20 ; 0xb3a2 b3b6: 0a ce rjmp .-1004 ; 0xafcc b3b8: f2 e0 ldi r31, 0x02 ; 2 b3ba: 6f 0e add r6, r31 b3bc: 71 1c adc r7, r1 b3be: f5 01 movw r30, r10 b3c0: 60 81 ld r22, Z b3c2: 71 81 ldd r23, Z+1 ; 0x01 b3c4: 07 2e mov r0, r23 b3c6: 00 0c add r0, r0 b3c8: 88 0b sbc r24, r24 b3ca: 99 0b sbc r25, r25 b3cc: 97 cf rjmp .-210 ; 0xb2fc b3ce: 10 2f mov r17, r16 b3d0: 85 37 cpi r24, 0x75 ; 117 b3d2: a9 f4 brne .+42 ; 0xb3fe b3d4: 1f 7e andi r17, 0xEF ; 239 b3d6: 2a e0 ldi r18, 0x0A ; 10 b3d8: 30 e0 ldi r19, 0x00 ; 0 b3da: 35 01 movw r6, r10 b3dc: 17 ff sbrs r17, 7 b3de: 44 c0 rjmp .+136 ; 0xb468 b3e0: f4 e0 ldi r31, 0x04 ; 4 b3e2: 6f 0e add r6, r31 b3e4: 71 1c adc r7, r1 b3e6: f5 01 movw r30, r10 b3e8: 60 81 ld r22, Z b3ea: 71 81 ldd r23, Z+1 ; 0x01 b3ec: 82 81 ldd r24, Z+2 ; 0x02 b3ee: 93 81 ldd r25, Z+3 ; 0x03 b3f0: a4 01 movw r20, r8 b3f2: 0f 94 b2 db call 0x3b764 ; 0x3b764 <__ultoa_invert> b3f6: a8 2e mov r10, r24 b3f8: a8 18 sub r10, r8 b3fa: 1f 77 andi r17, 0x7F ; 127 b3fc: 92 cf rjmp .-220 ; 0xb322 b3fe: 19 7f andi r17, 0xF9 ; 249 b400: 8f 36 cpi r24, 0x6F ; 111 b402: 79 f1 breq .+94 ; 0xb462 b404: f0 f4 brcc .+60 ; 0xb442 b406: 88 35 cpi r24, 0x58 ; 88 b408: 39 f1 breq .+78 ; 0xb458 b40a: f6 01 movw r30, r12 b40c: 86 81 ldd r24, Z+6 ; 0x06 b40e: 97 81 ldd r25, Z+7 ; 0x07 b410: 2f 96 adiw r28, 0x0f ; 15 b412: 0f b6 in r0, 0x3f ; 63 b414: f8 94 cli b416: de bf out 0x3e, r29 ; 62 b418: 0f be out 0x3f, r0 ; 63 b41a: cd bf out 0x3d, r28 ; 61 b41c: df 91 pop r29 b41e: cf 91 pop r28 b420: 1f 91 pop r17 b422: 0f 91 pop r16 b424: ff 90 pop r15 b426: ef 90 pop r14 b428: df 90 pop r13 b42a: cf 90 pop r12 b42c: bf 90 pop r11 b42e: af 90 pop r10 b430: 9f 90 pop r9 b432: 8f 90 pop r8 b434: 7f 90 pop r7 b436: 6f 90 pop r6 b438: 5f 90 pop r5 b43a: 4f 90 pop r4 b43c: 3f 90 pop r3 b43e: 2f 90 pop r2 b440: 08 95 ret b442: 80 37 cpi r24, 0x70 ; 112 b444: 39 f0 breq .+14 ; 0xb454 b446: 88 37 cpi r24, 0x78 ; 120 b448: 01 f7 brne .-64 ; 0xb40a b44a: 14 fd sbrc r17, 4 b44c: 14 60 ori r17, 0x04 ; 4 b44e: 20 e1 ldi r18, 0x10 ; 16 b450: 30 e0 ldi r19, 0x00 ; 0 b452: c3 cf rjmp .-122 ; 0xb3da b454: 10 61 ori r17, 0x10 ; 16 b456: f9 cf rjmp .-14 ; 0xb44a b458: 04 fd sbrc r16, 4 b45a: 16 60 ori r17, 0x06 ; 6 b45c: 20 e1 ldi r18, 0x10 ; 16 b45e: 32 e0 ldi r19, 0x02 ; 2 b460: bc cf rjmp .-136 ; 0xb3da b462: 28 e0 ldi r18, 0x08 ; 8 b464: 30 e0 ldi r19, 0x00 ; 0 b466: b9 cf rjmp .-142 ; 0xb3da b468: f2 e0 ldi r31, 0x02 ; 2 b46a: 6f 0e add r6, r31 b46c: 71 1c adc r7, r1 b46e: f5 01 movw r30, r10 b470: 60 81 ld r22, Z b472: 71 81 ldd r23, Z+1 ; 0x01 b474: 90 e0 ldi r25, 0x00 ; 0 b476: 80 e0 ldi r24, 0x00 ; 0 b478: bb cf rjmp .-138 ; 0xb3f0 b47a: 02 fd sbrc r16, 2 b47c: 02 c0 rjmp .+4 ; 0xb482 b47e: b3 94 inc r11 b480: 68 cf rjmp .-304 ; 0xb352 b482: b3 94 inc r11 b484: b3 94 inc r11 b486: 65 cf rjmp .-310 ; 0xb352 b488: 80 2f mov r24, r16 b48a: 86 78 andi r24, 0x86 ; 134 b48c: 09 f4 brne .+2 ; 0xb490 b48e: 61 cf rjmp .-318 ; 0xb352 b490: f6 cf rjmp .-20 ; 0xb47e b492: b6 01 movw r22, r12 b494: 80 e2 ldi r24, 0x20 ; 32 b496: 90 e0 ldi r25, 0x00 ; 0 b498: 0f 94 8b da call 0x3b516 ; 0x3b516 b49c: b3 94 inc r11 b49e: b5 14 cp r11, r5 b4a0: c0 f3 brcs .-16 ; 0xb492 b4a2: e1 2c mov r14, r1 b4a4: 62 cf rjmp .-316 ; 0xb36a b4a6: e5 2c mov r14, r5 b4a8: eb 18 sub r14, r11 b4aa: b5 14 cp r11, r5 b4ac: 08 f4 brcc .+2 ; 0xb4b0 b4ae: 5d cf rjmp .-326 ; 0xb36a b4b0: f8 cf rjmp .-16 ; 0xb4a2 b4b2: 80 2f mov r24, r16 b4b4: 86 78 andi r24, 0x86 ; 134 b4b6: 09 f4 brne .+2 ; 0xb4ba b4b8: 6a cf rjmp .-300 ; 0xb38e b4ba: 8b e2 ldi r24, 0x2B ; 43 b4bc: 01 ff sbrs r16, 1 b4be: 80 e2 ldi r24, 0x20 ; 32 b4c0: 07 fd sbrc r16, 7 b4c2: 8d e2 ldi r24, 0x2D ; 45 b4c4: b6 01 movw r22, r12 b4c6: 90 e0 ldi r25, 0x00 ; 0 b4c8: 60 cf rjmp .-320 ; 0xb38a b4ca: b6 01 movw r22, r12 b4cc: 80 e3 ldi r24, 0x30 ; 48 b4ce: 90 e0 ldi r25, 0x00 ; 0 b4d0: 0f 94 8b da call 0x3b516 ; 0x3b516 b4d4: fa 94 dec r15 b4d6: 5b cf rjmp .-330 ; 0xb38e b4d8: b6 01 movw r22, r12 b4da: 80 e2 ldi r24, 0x20 ; 32 b4dc: 90 e0 ldi r25, 0x00 ; 0 b4de: 0f 94 8b da call 0x3b516 ; 0x3b516 b4e2: ea 94 dec r14 b4e4: 73 cd rjmp .-1306 ; 0xafcc b4e6: 24 e0 ldi r18, 0x04 ; 4 b4e8: e1 2c mov r14, r1 b4ea: 25 15 cp r18, r5 b4ec: 08 f0 brcs .+2 ; 0xb4f0 b4ee: 36 cd rjmp .-1428 ; 0xaf5c b4f0: 84 e0 ldi r24, 0x04 ; 4 b4f2: 26 cd rjmp .-1460 ; 0xaf40 0000b4f4 : 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 ( b4f4: 20 e0 ldi r18, 0x00 ; 0 b4f6: 30 e0 ldi r19, 0x00 ; 0 b4f8: 40 e8 ldi r20, 0x80 ; 128 b4fa: 5f eb ldi r21, 0xBF ; 191 b4fc: 60 91 83 02 lds r22, 0x0283 ; 0x800283 b500: 70 91 84 02 lds r23, 0x0284 ; 0x800284 b504: 80 91 85 02 lds r24, 0x0285 ; 0x800285 b508: 90 91 86 02 lds r25, 0x0286 ; 0x800286 b50c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> b510: 88 23 and r24, r24 b512: 21 f1 breq .+72 ; 0xb55c (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b514: e0 91 92 12 lds r30, 0x1292 ; 0x801292 b518: f0 91 93 12 lds r31, 0x1293 ; 0x801293 b51c: eb 55 subi r30, 0x5B ; 91 b51e: 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) && ( b520: 80 81 ld r24, Z b522: 8b 7f andi r24, 0xFB ; 251 b524: 82 30 cpi r24, 0x02 ; 2 b526: d1 f4 brne .+52 ; 0xb55c (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)); b528: 80 e1 ldi r24, 0x10 ; 16 b52a: e3 e8 ldi r30, 0x83 ; 131 b52c: f2 e0 ldi r31, 0x02 ; 2 b52e: a2 e9 ldi r26, 0x92 ; 146 b530: b6 e0 ldi r27, 0x06 ; 6 b532: 01 90 ld r0, Z+ b534: 0d 92 st X+, r0 b536: 8a 95 dec r24 b538: e1 f7 brne .-8 ; 0xb532 saved_start_position[0] = SAVED_START_POSITION_UNSET; b53a: 80 e0 ldi r24, 0x00 ; 0 b53c: 90 e0 ldi r25, 0x00 ; 0 b53e: a0 e8 ldi r26, 0x80 ; 128 b540: bf eb ldi r27, 0xBF ; 191 b542: 80 93 83 02 sts 0x0283, r24 ; 0x800283 b546: 90 93 84 02 sts 0x0284, r25 ; 0x800284 b54a: a0 93 85 02 sts 0x0285, r26 ; 0x800285 b54e: b0 93 86 02 sts 0x0286, r27 ; 0x800286 return saved_segment_idx; b552: 80 91 69 05 lds r24, 0x0569 ; 0x800569 b556: 90 91 6a 05 lds r25, 0x056A ; 0x80056a b55a: 08 95 ret } else return 1; //begin with the first segment b55c: 81 e0 ldi r24, 0x01 ; 1 b55e: 90 e0 ldi r25, 0x00 ; 0 } b560: 08 95 ret 0000b562 : 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) { b562: cf 92 push r12 b564: df 92 push r13 b566: ef 92 push r14 b568: ff 92 push r15 b56a: 0f 93 push r16 b56c: 1f 93 push r17 b56e: cf 93 push r28 b570: 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); b572: 90 e0 ldi r25, 0x00 ; 0 b574: ec 01 movw r28, r24 b576: cc 0f add r28, r28 b578: dd 1f adc r29, r29 b57a: cc 0f add r28, r28 b57c: dd 1f adc r29, r29 b57e: fe 01 movw r30, r28 b580: e2 50 subi r30, 0x02 ; 2 b582: 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); b584: 25 91 lpm r18, Z+ b586: 35 91 lpm r19, Z+ b588: 45 91 lpm r20, Z+ b58a: 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]; b58c: fe 01 movw r30, r28 b58e: ea 5e subi r30, 0xEA ; 234 b590: f1 4f sbci r31, 0xF1 ; 241 b592: c0 80 ld r12, Z b594: d1 80 ldd r13, Z+1 ; 0x01 b596: e2 80 ldd r14, Z+2 ; 0x02 b598: f3 80 ldd r15, Z+3 ; 0x03 b59a: 8e 01 movw r16, r28 b59c: 0e 56 subi r16, 0x6E ; 110 b59e: 19 4f sbci r17, 0xF9 ; 249 b5a0: c7 01 movw r24, r14 b5a2: b6 01 movw r22, r12 b5a4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> b5a8: f8 01 movw r30, r16 b5aa: 60 83 st Z, r22 b5ac: 71 83 std Z+1, r23 ; 0x01 b5ae: 82 83 std Z+2, r24 ; 0x02 b5b0: 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); b5b2: fe 01 movw r30, r28 b5b4: ee 50 subi r30, 0x0E ; 14 b5b6: 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); b5b8: 25 91 lpm r18, Z+ b5ba: 35 91 lpm r19, Z+ b5bc: 45 91 lpm r20, Z+ b5be: 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]; b5c0: 8e 01 movw r16, r28 b5c2: 0f 5d subi r16, 0xDF ; 223 b5c4: 1d 4f sbci r17, 0xFD ; 253 b5c6: c7 01 movw r24, r14 b5c8: b6 01 movw r22, r12 b5ca: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> b5ce: f8 01 movw r30, r16 b5d0: 60 83 st Z, r22 b5d2: 71 83 std Z+1, r23 ; 0x01 b5d4: 82 83 std Z+2, r24 ; 0x02 b5d6: 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); b5d8: fe 01 movw r30, r28 b5da: ea 51 subi r30, 0x1A ; 26 b5dc: 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); b5de: 25 91 lpm r18, Z+ b5e0: 35 91 lpm r19, Z+ b5e2: 45 91 lpm r20, Z+ b5e4: 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]; b5e6: cb 5e subi r28, 0xEB ; 235 b5e8: dd 4f sbci r29, 0xFD ; 253 b5ea: c7 01 movw r24, r14 b5ec: b6 01 movw r22, r12 b5ee: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> b5f2: 68 83 st Y, r22 b5f4: 79 83 std Y+1, r23 ; 0x01 b5f6: 8a 83 std Y+2, r24 ; 0x02 b5f8: 9b 83 std Y+3, r25 ; 0x03 } b5fa: df 91 pop r29 b5fc: cf 91 pop r28 b5fe: 1f 91 pop r17 b600: 0f 91 pop r16 b602: ff 90 pop r15 b604: ef 90 pop r14 b606: df 90 pop r13 b608: cf 90 pop r12 b60a: 08 95 ret 0000b60c : 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)); } b60c: 80 e1 ldi r24, 0x10 ; 16 b60e: e4 e7 ldi r30, 0x74 ; 116 b610: f6 e0 ldi r31, 0x06 ; 6 b612: a2 e9 ldi r26, 0x92 ; 146 b614: b6 e0 ldi r27, 0x06 ; 6 b616: 01 90 ld r0, Z+ b618: 0d 92 st X+, r0 b61a: 8a 95 dec r24 b61c: e1 f7 brne .-8 ; 0xb616 b61e: 08 95 ret 0000b620 : /// @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)); b620: e1 e7 ldi r30, 0x71 ; 113 b622: fb e7 ldi r31, 0x7B ; 123 b624: 83 30 cpi r24, 0x03 ; 3 b626: 21 f0 breq .+8 ; 0xb630 b628: e8 2f mov r30, r24 b62a: f0 e0 ldi r31, 0x00 ; 0 b62c: e2 59 subi r30, 0x92 ; 146 b62e: f4 48 sbci r31, 0x84 ; 132 b630: 84 91 lpm r24, Z } b632: 08 95 ret 0000b634 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b634: 40 91 a3 10 lds r20, 0x10A3 ; 0x8010a3 b638: 50 91 a4 10 lds r21, 0x10A4 ; 0x8010a4 return 0; b63c: 90 e0 ldi r25, 0x00 ; 0 b63e: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b640: 41 15 cp r20, r1 b642: 51 05 cpc r21, r1 b644: b1 f1 breq .+108 ; 0xb6b2 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b646: 20 91 92 12 lds r18, 0x1292 ; 0x801292 b64a: 30 91 93 12 lds r19, 0x1293 ; 0x801293 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b64e: 90 e0 ldi r25, 0x00 ; 0 b650: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b652: f9 01 movw r30, r18 b654: eb 55 subi r30, 0x5B ; 91 b656: ff 4e sbci r31, 0xEF ; 239 b658: a0 81 ld r26, Z b65a: a2 30 cpi r26, 0x02 ; 2 b65c: 21 f4 brne .+8 ; 0xb666 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b65e: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b660: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b662: 86 0f add r24, r22 b664: 97 1f adc r25, r23 } if (-- _buflen == 0) b666: 41 50 subi r20, 0x01 ; 1 b668: 51 09 sbc r21, r1 b66a: 19 f1 breq .+70 ; 0xb6b2 b66c: f9 01 movw r30, r18 b66e: e8 55 subi r30, 0x58 ; 88 b670: 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) ; b672: a1 91 ld r26, Z+ b674: 9f 01 movw r18, r30 b676: 25 5a subi r18, 0xA5 ; 165 b678: 30 41 sbci r19, 0x10 ; 16 b67a: a1 11 cpse r26, r1 b67c: fa cf rjmp .-12 ; 0xb672 b67e: f9 01 movw r30, r18 b680: eb 55 subi r30, 0x5B ; 91 b682: 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) ; b684: 2d 3e cpi r18, 0xED ; 237 b686: a1 e0 ldi r26, 0x01 ; 1 b688: 3a 07 cpc r19, r26 b68a: 30 f4 brcc .+12 ; 0xb698 b68c: a1 91 ld r26, Z+ b68e: a1 11 cpse r26, r1 b690: e0 cf rjmp .-64 ; 0xb652 b692: 2f 5f subi r18, 0xFF ; 255 b694: 3f 4f sbci r19, 0xFF ; 255 b696: f6 cf rjmp .-20 ; 0xb684 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b698: 2d 3e cpi r18, 0xED ; 237 b69a: e1 e0 ldi r30, 0x01 ; 1 b69c: 3e 07 cpc r19, r30 b69e: c9 f6 brne .-78 ; 0xb652 b6a0: e5 ea ldi r30, 0xA5 ; 165 b6a2: f0 e1 ldi r31, 0x10 ; 16 b6a4: 9f 01 movw r18, r30 b6a6: 25 5a subi r18, 0xA5 ; 165 b6a8: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b6aa: a1 91 ld r26, Z+ b6ac: aa 23 and r26, r26 b6ae: d1 f3 breq .-12 ; 0xb6a4 b6b0: d0 cf rjmp .-96 ; 0xb652 } } return sdlen; } b6b2: 08 95 ret 0000b6b4 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b6b4: 98 2f mov r25, r24 b6b6: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b6b8: 83 ff sbrs r24, 3 b6ba: 0d c0 rjmp .+26 ; 0xb6d6 b6bc: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b6c0: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b6c2: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b6c6: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b6ca: 88 7f andi r24, 0xF8 ; 248 b6cc: 97 70 andi r25, 0x07 ; 7 b6ce: 89 2b or r24, r25 b6d0: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b6d4: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b6d6: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b6da: 87 7f andi r24, 0xF7 ; 247 b6dc: f2 cf rjmp .-28 ; 0xb6c2 0000b6de : 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)); }; b6de: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b6e2: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b6e6: 4a e0 ldi r20, 0x0A ; 10 b6e8: 50 e0 ldi r21, 0x00 ; 0 b6ea: 70 e0 ldi r23, 0x00 ; 0 b6ec: 60 e0 ldi r22, 0x00 ; 0 b6ee: 01 96 adiw r24, 0x01 ; 1 b6f0: 0f 94 ae d7 call 0x3af5c ; 0x3af5c b6f4: 86 2f mov r24, r22 b6f6: 08 95 ret 0000b6f8 : // 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)); }; b6f8: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b6fc: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b700: 4a e0 ldi r20, 0x0A ; 10 b702: 50 e0 ldi r21, 0x00 ; 0 b704: 70 e0 ldi r23, 0x00 ; 0 b706: 60 e0 ldi r22, 0x00 ; 0 b708: 01 96 adiw r24, 0x01 ; 1 b70a: 0f 94 ae d7 call 0x3af5c ; 0x3af5c b70e: cb 01 movw r24, r22 b710: 08 95 ret 0000b712 : // 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); } b712: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b716: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b71a: 4a e0 ldi r20, 0x0A ; 10 b71c: 50 e0 ldi r21, 0x00 ; 0 b71e: 70 e0 ldi r23, 0x00 ; 0 b720: 60 e0 ldi r22, 0x00 ; 0 b722: 01 96 adiw r24, 0x01 ; 1 b724: 0d 94 ae d7 jmp 0x3af5c ; 0x3af5c 0000b728 : // 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; b728: 80 91 9b 04 lds r24, 0x049B ; 0x80049b b72c: 90 91 9c 04 lds r25, 0x049C ; 0x80049c b730: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a b734: 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); b738: 8b eb ldi r24, 0xBB ; 187 b73a: 9d e6 ldi r25, 0x6D ; 109 b73c: 9f 93 push r25 b73e: 8f 93 push r24 b740: 80 91 7a 03 lds r24, 0x037A ; 0x80037a b744: 90 91 7b 03 lds r25, 0x037B ; 0x80037b b748: a0 91 7c 03 lds r26, 0x037C ; 0x80037c b74c: b0 91 7d 03 lds r27, 0x037D ; 0x80037d b750: 01 96 adiw r24, 0x01 ; 1 b752: a1 1d adc r26, r1 b754: b1 1d adc r27, r1 b756: bf 93 push r27 b758: af 93 push r26 b75a: 9f 93 push r25 b75c: 8f 93 push r24 b75e: 87 e6 ldi r24, 0x67 ; 103 b760: 96 e6 ldi r25, 0x66 ; 102 b762: 9f 93 push r25 b764: 8f 93 push r24 b766: 8e e6 ldi r24, 0x6E ; 110 b768: 96 e6 ldi r25, 0x66 ; 102 b76a: 9f 93 push r25 b76c: 8f 93 push r24 b76e: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca b772: 8d b7 in r24, 0x3d ; 61 b774: 9e b7 in r25, 0x3e ; 62 b776: 0a 96 adiw r24, 0x0a ; 10 b778: 0f b6 in r0, 0x3f ; 63 b77a: f8 94 cli b77c: 9e bf out 0x3e, r25 ; 62 b77e: 0f be out 0x3f, r0 ; 63 b780: 8d bf out 0x3d, r24 ; 61 } b782: 08 95 ret 0000b784 : 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) { b784: 0f 93 push r16 b786: 1f 93 push r17 b788: cf 93 push r28 b78a: df 93 push r29 b78c: ec 01 movw r28, r24 b78e: c6 0f add r28, r22 b790: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b792: 8c 17 cp r24, r28 b794: 9d 07 cpc r25, r29 b796: 79 f0 breq .+30 ; 0xb7b6 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b798: 8c 01 movw r16, r24 b79a: 0f 5f subi r16, 0xFF ; 255 b79c: 1f 4f sbci r17, 0xFF ; 255 b79e: 0f 94 23 dc call 0x3b846 ; 0x3b846 b7a2: 8f 3f cpi r24, 0xFF ; 255 b7a4: 31 f0 breq .+12 ; 0xb7b2 return true; b7a6: 81 e0 ldi r24, 0x01 ; 1 } return false; } b7a8: df 91 pop r29 b7aa: cf 91 pop r28 b7ac: 1f 91 pop r17 b7ae: 0f 91 pop r16 b7b0: 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) b7b2: c8 01 movw r24, r16 b7b4: ee cf rjmp .-36 ; 0xb792 return true; } return false; b7b6: 80 e0 ldi r24, 0x00 ; 0 b7b8: f7 cf rjmp .-18 ; 0xb7a8 0000b7ba : #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; } b7ba: 68 2f mov r22, r24 b7bc: 88 0f add r24, r24 b7be: 77 0b sbc r23, r23 b7c0: 80 91 92 12 lds r24, 0x1292 ; 0x801292 b7c4: 90 91 93 12 lds r25, 0x1293 ; 0x801293 b7c8: 88 55 subi r24, 0x58 ; 88 b7ca: 9f 4e sbci r25, 0xEF ; 239 b7cc: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 b7d0: 9c 01 movw r18, r24 b7d2: 90 93 96 03 sts 0x0396, r25 ; 0x800396 b7d6: 80 93 95 03 sts 0x0395, r24 ; 0x800395 b7da: 81 e0 ldi r24, 0x01 ; 1 b7dc: 23 2b or r18, r19 b7de: 09 f4 brne .+2 ; 0xb7e2 b7e0: 80 e0 ldi r24, 0x00 ; 0 b7e2: 08 95 ret 0000b7e4 : #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 { b7e4: 0f 93 push r16 b7e6: 1f 93 push r17 b7e8: cf 93 push r28 b7ea: df 93 push r29 b7ec: 8c 01 movw r16, r24 b7ee: 86 2f mov r24, r22 b7f0: ea 01 movw r28, r20 if (code_seen(code)) { b7f2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba b7f6: 88 23 and r24, r24 b7f8: 19 f1 breq .+70 ; 0xb840 // Verify value is within allowed range int16_t temp = code_value_short(); b7fa: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b7fe: 9c 01 movw r18, r24 b800: 97 ff sbrs r25, 7 b802: 03 c0 rjmp .+6 ; 0xb80a b804: 31 95 neg r19 b806: 21 95 neg r18 b808: 31 09 sbc r19, r1 b80a: 25 36 cpi r18, 0x65 ; 101 b80c: 31 05 cpc r19, r1 b80e: 9c f0 brlt .+38 ; 0xb836 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b810: 9f 93 push r25 b812: 8f 93 push r24 b814: 88 ea ldi r24, 0xA8 ; 168 b816: 9b ea ldi r25, 0xAB ; 171 b818: 9f 93 push r25 b81a: 8f 93 push r24 b81c: 83 e6 ldi r24, 0x63 ; 99 b81e: 9c e7 ldi r25, 0x7C ; 124 b820: 9f 93 push r25 b822: 8f 93 push r24 b824: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca b828: 0f 90 pop r0 b82a: 0f 90 pop r0 b82c: 0f 90 pop r0 b82e: 0f 90 pop r0 b830: 0f 90 pop r0 b832: 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; b834: 80 e0 ldi r24, 0x00 ; 0 }; b836: df 91 pop r29 b838: cf 91 pop r28 b83a: 1f 91 pop r17 b83c: 0f 91 pop r16 b83e: 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) { b840: f8 01 movw r30, r16 b842: 80 81 ld r24, Z b844: 88 23 and r24, r24 b846: b1 f3 breq .-20 ; 0xb834 return (int8_t)eeprom_read_byte(eep_address); b848: ce 01 movw r24, r28 } return 0; }; b84a: df 91 pop r29 b84c: cf 91 pop r28 b84e: 1f 91 pop r17 b850: 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); b852: 0d 94 23 dc jmp 0x3b846 ; 0x3b846 0000b856 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b856: 60 e0 ldi r22, 0x00 ; 0 b858: 86 e6 ldi r24, 0x66 ; 102 b85a: 9f e0 ldi r25, 0x0F ; 15 b85c: 0f 94 47 dc call 0x3b88e ; 0x3b88e b860: 60 e0 ldi r22, 0x00 ; 0 b862: 88 e6 ldi r24, 0x68 ; 104 b864: 9f e0 ldi r25, 0x0F ; 15 b866: 0f 94 47 dc call 0x3b88e ; 0x3b88e b86a: 60 e0 ldi r22, 0x00 ; 0 b86c: 85 e6 ldi r24, 0x65 ; 101 b86e: 9f e0 ldi r25, 0x0F ; 15 b870: 0f 94 47 dc call 0x3b88e ; 0x3b88e b874: 60 e0 ldi r22, 0x00 ; 0 b876: 84 e6 ldi r24, 0x64 ; 100 b878: 9f e0 ldi r25, 0x0F ; 15 b87a: 0f 94 47 dc call 0x3b88e ; 0x3b88e b87e: 60 e0 ldi r22, 0x00 ; 0 b880: 82 ed ldi r24, 0xD2 ; 210 b882: 9e e0 ldi r25, 0x0E ; 14 b884: 0f 94 47 dc call 0x3b88e ; 0x3b88e b888: 60 e0 ldi r22, 0x00 ; 0 b88a: 8f ec ldi r24, 0xCF ; 207 b88c: 9e e0 ldi r25, 0x0E ; 14 b88e: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0000b892 : // 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) b892: 80 36 cpi r24, 0x60 ; 96 b894: 91 05 cpc r25, r1 b896: f8 f4 brcc .+62 ; 0xb8d6 return false; if (bufindr == bufindw && buflen > 0) b898: 40 91 92 12 lds r20, 0x1292 ; 0x801292 b89c: 50 91 93 12 lds r21, 0x1293 ; 0x801293 b8a0: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> b8a4: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> b8a8: 42 17 cp r20, r18 b8aa: 53 07 cpc r21, r19 b8ac: 39 f4 brne .+14 ; 0xb8bc b8ae: 60 91 a3 10 lds r22, 0x10A3 ; 0x8010a3 b8b2: 70 91 a4 10 lds r23, 0x10A4 ; 0x8010a4 b8b6: 16 16 cp r1, r22 b8b8: 17 06 cpc r1, r23 b8ba: 6c f0 brlt .+26 ; 0xb8d6 // 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); b8bc: b9 01 movw r22, r18 b8be: 68 0f add r22, r24 b8c0: 79 1f adc r23, r25 b8c2: fb 01 movw r30, r22 b8c4: e3 59 subi r30, 0x93 ; 147 b8c6: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) b8c8: 24 17 cp r18, r20 b8ca: 35 07 cpc r19, r21 b8cc: 30 f4 brcc .+12 ; 0xb8da // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; b8ce: 81 e0 ldi r24, 0x01 ; 1 b8d0: 4e 17 cp r20, r30 b8d2: 5f 07 cpc r21, r31 b8d4: 08 f4 brcc .+2 ; 0xb8d8 // 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; b8d6: 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; } b8d8: 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? b8da: ee 3e cpi r30, 0xEE ; 238 b8dc: f1 40 sbci r31, 0x01 ; 1 b8de: f8 f0 brcs .+62 ; 0xb91e // 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); b8e0: 6c 5f subi r22, 0xFC ; 252 b8e2: 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) || b8e4: 6e 3e cpi r22, 0xEE ; 238 b8e6: 71 40 sbci r23, 0x01 ; 1 b8e8: 18 f4 brcc .+6 ; 0xb8f0 // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) b8ea: 49 36 cpi r20, 0x69 ; 105 b8ec: 51 05 cpc r21, r1 b8ee: b8 f4 brcc .+46 ; 0xb91e return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { b8f0: 83 59 subi r24, 0x93 ; 147 b8f2: 9f 4f sbci r25, 0xFF ; 255 b8f4: 48 17 cp r20, r24 b8f6: 59 07 cpc r21, r25 b8f8: 70 f3 brcs .-36 ; 0xb8d6 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); b8fa: 4d ee ldi r20, 0xED ; 237 b8fc: 51 e0 ldi r21, 0x01 ; 1 b8fe: 42 1b sub r20, r18 b900: 53 0b sbc r21, r19 b902: 70 e0 ldi r23, 0x00 ; 0 b904: 60 e0 ldi r22, 0x00 ; 0 b906: c9 01 movw r24, r18 b908: 8b 55 subi r24, 0x5B ; 91 b90a: 9f 4e sbci r25, 0xEF ; 239 b90c: 0f 94 55 e2 call 0x3c4aa ; 0x3c4aa // 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; } b910: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); b912: f8 94 cli b914: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> b918: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; b91c: 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; b91e: 81 e0 ldi r24, 0x01 ; 1 b920: 08 95 ret 0000b922 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { b922: 2f 92 push r2 b924: 3f 92 push r3 b926: 4f 92 push r4 b928: 5f 92 push r5 b92a: 6f 92 push r6 b92c: 7f 92 push r7 b92e: 8f 92 push r8 b930: 9f 92 push r9 b932: af 92 push r10 b934: bf 92 push r11 b936: cf 92 push r12 b938: df 92 push r13 b93a: ef 92 push r14 b93c: ff 92 push r15 b93e: 0f 93 push r16 b940: 1f 93 push r17 b942: cf 93 push r28 b944: df 93 push r29 b946: cd b7 in r28, 0x3d ; 61 b948: de b7 in r29, 0x3e ; 62 b94a: cc 58 subi r28, 0x8C ; 140 b94c: d2 40 sbci r29, 0x02 ; 2 b94e: 0f b6 in r0, 0x3f ; 63 b950: f8 94 cli b952: de bf out 0x3e, r29 ; 62 b954: 0f be out 0x3f, r0 ; 63 b956: cd bf out 0x3d, r28 ; 61 b958: cb 58 subi r28, 0x8B ; 139 b95a: dd 4f sbci r29, 0xFD ; 253 b95c: 68 83 st Y, r22 b95e: 79 83 std Y+1, r23 ; 0x01 b960: 8a 83 std Y+2, r24 ; 0x02 b962: 9b 83 std Y+3, r25 ; 0x03 b964: c5 57 subi r28, 0x75 ; 117 b966: 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; b968: fe 01 movw r30, r28 b96a: e7 54 subi r30, 0x47 ; 71 b96c: fe 4f sbci r31, 0xFE ; 254 b96e: 88 e2 ldi r24, 0x28 ; 40 b970: df 01 movw r26, r30 b972: 1d 92 st X+, r1 b974: 8a 95 dec r24 b976: e9 f7 brne .-6 ; 0xb972 b978: e8 5b subi r30, 0xB8 ; 184 b97a: f1 40 sbci r31, 0x01 ; 1 b97c: 1f 01 movw r2, r30 b97e: 80 e9 ldi r24, 0x90 ; 144 b980: 91 e0 ldi r25, 0x01 ; 1 b982: df 01 movw r26, r30 b984: fc 01 movw r30, r24 b986: 1d 92 st X+, r1 b988: 31 97 sbiw r30, 0x01 ; 1 b98a: e9 f7 brne .-6 ; 0xb986 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; b98c: c7 5a subi r28, 0xA7 ; 167 b98e: dd 4f sbci r29, 0xFD ; 253 b990: 19 82 std Y+1, r1 ; 0x01 b992: 18 82 st Y, r1 b994: c9 55 subi r28, 0x59 ; 89 b996: d2 40 sbci r29, 0x02 ; 2 b998: 9e 01 movw r18, r28 b99a: 2f 51 subi r18, 0x1F ; 31 b99c: 3e 4f sbci r19, 0xFE ; 254 b99e: c1 59 subi r28, 0x91 ; 145 b9a0: dd 4f sbci r29, 0xFD ; 253 b9a2: 39 83 std Y+1, r19 ; 0x01 b9a4: 28 83 st Y, r18 b9a6: cf 56 subi r28, 0x6F ; 111 b9a8: d2 40 sbci r29, 0x02 ; 2 b9aa: 8e 01 movw r16, r28 b9ac: 07 5a subi r16, 0xA7 ; 167 b9ae: 1d 4f sbci r17, 0xFD ; 253 b9b0: ce 01 movw r24, r28 b9b2: 8f 5c subi r24, 0xCF ; 207 b9b4: 9d 4f sbci r25, 0xFD ; 253 b9b6: c3 59 subi r28, 0x93 ; 147 b9b8: dd 4f sbci r29, 0xFD ; 253 b9ba: 99 83 std Y+1, r25 ; 0x01 b9bc: 88 83 st Y, r24 b9be: cd 56 subi r28, 0x6D ; 109 b9c0: d2 40 sbci r29, 0x02 ; 2 b9c2: 3c 01 movw r6, r24 b9c4: 49 01 movw r8, r18 b9c6: 40 eb ldi r20, 0xB0 ; 176 b9c8: a4 2e mov r10, r20 b9ca: 4f e0 ldi r20, 0x0F ; 15 b9cc: b4 2e mov r11, r20 b9ce: 53 e2 ldi r21, 0x23 ; 35 b9d0: c5 2e mov r12, r21 b9d2: d1 2c mov r13, r1 for (i = 0; i < n; i++) { b9d4: f1 2c mov r15, r1 b9d6: 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]; b9d8: b6 01 movw r22, r12 b9da: 0d 2c mov r0, r13 b9dc: 00 0c add r0, r0 b9de: 88 0b sbc r24, r24 b9e0: 99 0b sbc r25, r25 b9e2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> b9e6: d4 01 movw r26, r8 b9e8: 6d 93 st X+, r22 b9ea: 7d 93 st X+, r23 b9ec: 8d 93 st X+, r24 b9ee: 9d 93 st X+, r25 b9f0: 4d 01 movw r8, r26 f[i] = (float)shift[i]; b9f2: f8 01 movw r30, r16 b9f4: 61 91 ld r22, Z+ b9f6: 71 91 ld r23, Z+ b9f8: 8f 01 movw r16, r30 b9fa: 07 2e mov r0, r23 b9fc: 00 0c add r0, r0 b9fe: 88 0b sbc r24, r24 ba00: 99 0b sbc r25, r25 ba02: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> ba06: d3 01 movw r26, r6 ba08: 6d 93 st X+, r22 ba0a: 7d 93 st X+, r23 ba0c: 8d 93 st X+, r24 ba0e: 9d 93 st X+, r25 ba10: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { ba12: bf ef ldi r27, 0xFF ; 255 ba14: eb 1a sub r14, r27 ba16: fb 0a sbc r15, r27 ba18: e6 e0 ldi r30, 0x06 ; 6 ba1a: ee 16 cp r14, r30 ba1c: f1 04 cpc r15, r1 ba1e: 09 f0 breq .+2 ; 0xba22 ba20: 38 c3 rjmp .+1648 ; 0xc092 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; ba22: cb 58 subi r28, 0x8B ; 139 ba24: dd 4f sbci r29, 0xFD ; 253 ba26: 28 81 ld r18, Y ba28: 39 81 ldd r19, Y+1 ; 0x01 ba2a: 4a 81 ldd r20, Y+2 ; 0x02 ba2c: 5b 81 ldd r21, Y+3 ; 0x03 ba2e: c5 57 subi r28, 0x75 ; 117 ba30: d2 40 sbci r29, 0x02 ; 2 ba32: c1 59 subi r28, 0x91 ; 145 ba34: dd 4f sbci r29, 0xFD ; 253 ba36: a8 81 ld r26, Y ba38: b9 81 ldd r27, Y+1 ; 0x01 ba3a: cf 56 subi r28, 0x6F ; 111 ba3c: d2 40 sbci r29, 0x02 ; 2 ba3e: 6d 91 ld r22, X+ ba40: 7d 91 ld r23, X+ ba42: 8d 91 ld r24, X+ ba44: 9c 91 ld r25, X ba46: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> ba4a: 41 2c mov r4, r1 ba4c: 51 2c mov r5, r1 ba4e: 32 01 movw r6, r4 ba50: 18 16 cp r1, r24 ba52: 0c f4 brge .+2 ; 0xba56 ba54: 02 c3 rjmp .+1540 ; 0xc05a ba56: c3 59 subi r28, 0x93 ; 147 ba58: dd 4f sbci r29, 0xFD ; 253 ba5a: 08 81 ld r16, Y ba5c: 19 81 ldd r17, Y+1 ; 0x01 ba5e: cd 56 subi r28, 0x6D ; 109 ba60: d2 40 sbci r29, 0x02 ; 2 ba62: 0c 5e subi r16, 0xEC ; 236 ba64: 1f 4f sbci r17, 0xFF ; 255 ba66: c1 59 subi r28, 0x91 ; 145 ba68: dd 4f sbci r29, 0xFD ; 253 ba6a: e8 80 ld r14, Y ba6c: f9 80 ldd r15, Y+1 ; 0x01 ba6e: cf 56 subi r28, 0x6F ; 111 ba70: d2 40 sbci r29, 0x02 ; 2 ba72: b4 e1 ldi r27, 0x14 ; 20 ba74: eb 0e add r14, r27 ba76: f1 1c adc r15, r1 ba78: 6e 01 movw r12, r28 ba7a: ef ed ldi r30, 0xDF ; 223 ba7c: ce 1a sub r12, r30 ba7e: ed ef ldi r30, 0xFD ; 253 ba80: de 0a sbc r13, r30 ba82: 9e 01 movw r18, r28 ba84: 2b 55 subi r18, 0x5B ; 91 ba86: 3e 4f sbci r19, 0xFE ; 254 ba88: cf 58 subi r28, 0x8F ; 143 ba8a: dd 4f sbci r29, 0xFD ; 253 ba8c: 39 83 std Y+1, r19 ; 0x01 ba8e: 28 83 st Y, r18 ba90: c1 57 subi r28, 0x71 ; 113 ba92: 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]); ba94: d8 01 movw r26, r16 ba96: 4d 90 ld r4, X+ ba98: 5d 90 ld r5, X+ ba9a: 6d 90 ld r6, X+ ba9c: 7c 90 ld r7, X ba9e: f7 01 movw r30, r14 baa0: 60 81 ld r22, Z baa2: 71 81 ldd r23, Z+1 ; 0x01 baa4: 82 81 ldd r24, Z+2 ; 0x02 baa6: 93 81 ldd r25, Z+3 ; 0x03 baa8: d7 01 movw r26, r14 baaa: 5e 91 ld r21, -X baac: 4e 91 ld r20, -X baae: 3e 91 ld r19, -X bab0: 2e 91 ld r18, -X bab2: 7d 01 movw r14, r26 bab4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bab8: 4b 01 movw r8, r22 baba: 5c 01 movw r10, r24 babc: f8 01 movw r30, r16 babe: 52 91 ld r21, -Z bac0: 42 91 ld r20, -Z bac2: 32 91 ld r19, -Z bac4: 22 91 ld r18, -Z bac6: 8f 01 movw r16, r30 bac8: c3 01 movw r24, r6 baca: b2 01 movw r22, r4 bacc: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bad0: a5 01 movw r20, r10 bad2: 94 01 movw r18, r8 bad4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> bad8: d6 01 movw r26, r12 bada: 9e 93 st -X, r25 badc: 8e 93 st -X, r24 bade: 7e 93 st -X, r23 bae0: 6e 93 st -X, r22 bae2: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bae4: cf 58 subi r28, 0x8F ; 143 bae6: dd 4f sbci r29, 0xFD ; 253 bae8: e8 81 ld r30, Y baea: f9 81 ldd r31, Y+1 ; 0x01 baec: c1 57 subi r28, 0x71 ; 113 baee: d2 40 sbci r29, 0x02 ; 2 baf0: b2 92 st -Z, r11 baf2: a2 92 st -Z, r10 baf4: 92 92 st -Z, r9 baf6: 82 92 st -Z, r8 baf8: cf 58 subi r28, 0x8F ; 143 bafa: dd 4f sbci r29, 0xFD ; 253 bafc: f9 83 std Y+1, r31 ; 0x01 bafe: e8 83 st Y, r30 bb00: c1 57 subi r28, 0x71 ; 113 bb02: 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--) { bb04: c3 59 subi r28, 0x93 ; 147 bb06: dd 4f sbci r29, 0xFD ; 253 bb08: 28 81 ld r18, Y bb0a: 39 81 ldd r19, Y+1 ; 0x01 bb0c: cd 56 subi r28, 0x6D ; 109 bb0e: d2 40 sbci r29, 0x02 ; 2 bb10: 02 17 cp r16, r18 bb12: 13 07 cpc r17, r19 bb14: 09 f0 breq .+2 ; 0xbb18 bb16: be cf rjmp .-132 ; 0xba94 bb18: 4e 01 movw r8, r28 bb1a: 3f e6 ldi r19, 0x6F ; 111 bb1c: 83 1a sub r8, r19 bb1e: 3e ef ldi r19, 0xFE ; 254 bb20: 93 0a sbc r9, r19 bb22: 5e 01 movw r10, r28 bb24: 83 ef ldi r24, 0xF3 ; 243 bb26: a8 1a sub r10, r24 bb28: 8d ef ldi r24, 0xFD ; 253 bb2a: b8 0a sbc r11, r24 bb2c: 61 01 movw r12, r2 bb2e: 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 bb52: 9b 01 movw r18, r22 bb54: ac 01 movw r20, r24 bb56: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> bb5a: f8 01 movw r30, r16 bb5c: 64 a7 std Z+44, r22 ; 0x2c bb5e: 75 a7 std Z+45, r23 ; 0x2d bb60: 86 a7 std Z+46, r24 ; 0x2e bb62: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bb64: f1 e0 ldi r31, 0x01 ; 1 bb66: ef 16 cp r14, r31 bb68: f1 04 cpc r15, r1 bb6a: 61 f0 breq .+24 ; 0xbb84 m[i][i - 1] = h[i - 1]; bb6c: d8 01 movw r26, r16 bb6e: 98 96 adiw r26, 0x28 ; 40 bb70: 4d 92 st X+, r4 bb72: 5d 92 st X+, r5 bb74: 6d 92 st X+, r6 bb76: 7c 92 st X, r7 bb78: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bb7a: f8 01 movw r30, r16 bb7c: 44 82 std Z+4, r4 ; 0x04 bb7e: 55 82 std Z+5, r5 ; 0x05 bb80: 66 82 std Z+6, r6 ; 0x06 bb82: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bb84: ff ef ldi r31, 0xFF ; 255 bb86: ef 1a sub r14, r31 bb88: ff 0a sbc r15, r31 bb8a: f5 01 movw r30, r10 bb8c: 20 81 ld r18, Z bb8e: 31 81 ldd r19, Z+1 ; 0x01 bb90: 42 81 ldd r20, Z+2 ; 0x02 bb92: 53 81 ldd r21, Z+3 ; 0x03 bb94: 84 e0 ldi r24, 0x04 ; 4 bb96: a8 0e add r10, r24 bb98: b1 1c adc r11, r1 bb9a: 64 81 ldd r22, Z+4 ; 0x04 bb9c: 75 81 ldd r23, Z+5 ; 0x05 bb9e: 86 81 ldd r24, Z+6 ; 0x06 bba0: 97 81 ldd r25, Z+7 ; 0x07 bba2: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bba6: 20 e0 ldi r18, 0x00 ; 0 bba8: 30 e0 ldi r19, 0x00 ; 0 bbaa: 40 ec ldi r20, 0xC0 ; 192 bbac: 50 e4 ldi r21, 0x40 ; 64 bbae: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bbb2: d6 01 movw r26, r12 bbb4: dc 96 adiw r26, 0x3c ; 60 bbb6: 6d 93 st X+, r22 bbb8: 7d 93 st X+, r23 bbba: 8d 93 st X+, r24 bbbc: 9c 93 st X, r25 bbbe: df 97 sbiw r26, 0x3f ; 63 bbc0: 04 5d subi r16, 0xD4 ; 212 bbc2: 1f 4f sbci r17, 0xFF ; 255 bbc4: b8 e2 ldi r27, 0x28 ; 40 bbc6: cb 0e add r12, r27 bbc8: 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 bbd2: b1 cf rjmp .-158 ; 0xbb36 bbd4: 7e 01 movw r14, r28 bbd6: fd e2 ldi r31, 0x2D ; 45 bbd8: ef 0e add r14, r31 bbda: f1 1c adc r15, r1 bbdc: 28 e2 ldi r18, 0x28 ; 40 bbde: a2 2e mov r10, r18 bbe0: b1 2c mov r11, r1 bbe2: 00 eb ldi r16, 0xB0 ; 176 bbe4: 1f ef ldi r17, 0xFF ; 255 bbe6: 24 e0 ldi r18, 0x04 ; 4 bbe8: 22 0e add r2, r18 bbea: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bc08: 2b 01 movw r4, r22 bc0a: 3c 01 movw r6, r24 bc0c: 61 01 movw r12, r2 bc0e: c0 1a sub r12, r16 bc10: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bc12: 88 24 eor r8, r8 bc14: 83 94 inc r8 bc16: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bc18: f6 01 movw r30, r12 bc1a: e0 0f add r30, r16 bc1c: f1 1f adc r31, r17 bc1e: ea 0d add r30, r10 bc20: fb 1d adc r31, r11 bc22: 20 81 ld r18, Z bc24: 31 81 ldd r19, Z+1 ; 0x01 bc26: 42 81 ldd r20, Z+2 ; 0x02 bc28: 53 81 ldd r21, Z+3 ; 0x03 bc2a: c3 01 movw r24, r6 bc2c: b2 01 movw r22, r4 bc2e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bc32: 9b 01 movw r18, r22 bc34: ac 01 movw r20, r24 bc36: f6 01 movw r30, r12 bc38: 60 81 ld r22, Z bc3a: 71 81 ldd r23, Z+1 ; 0x01 bc3c: 82 81 ldd r24, Z+2 ; 0x02 bc3e: 93 81 ldd r25, Z+3 ; 0x03 bc40: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bc44: d6 01 movw r26, r12 bc46: 6d 93 st X+, r22 bc48: 7d 93 st X+, r23 bc4a: 8d 93 st X+, r24 bc4c: 9d 93 st X+, r25 bc4e: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bc5e: 3c e2 ldi r19, 0x2C ; 44 bc60: e3 0e add r14, r19 bc62: f1 1c adc r15, r1 bc64: 08 52 subi r16, 0x28 ; 40 bc66: 11 09 sbc r17, r1 bc68: 88 e2 ldi r24, 0x28 ; 40 bc6a: a8 0e add r10, r24 bc6c: 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 bc76: ba cf rjmp .-140 ; 0xbbec bc78: 1e 01 movw r2, r28 bc7a: f5 eb ldi r31, 0xB5 ; 181 bc7c: 2f 0e add r2, r31 bc7e: 31 1c adc r3, r1 bc80: 6e 01 movw r12, r28 bc82: 21 eb ldi r18, 0xB1 ; 177 bc84: c2 0e add r12, r18 bc86: d1 1c adc r13, r1 bc88: 7e 01 movw r14, r28 bc8a: 37 e3 ldi r19, 0x37 ; 55 bc8c: e3 1a sub r14, r19 bc8e: 3e ef ldi r19, 0xFE ; 254 bc90: 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--) { bc92: 04 e0 ldi r16, 0x04 ; 4 bc94: 10 e0 ldi r17, 0x00 ; 0 bc96: 48 01 movw r8, r16 bc98: b1 2c mov r11, r1 bc9a: a1 2c mov r10, r1 sum = 0; bc9c: 41 2c mov r4, r1 bc9e: 51 2c mov r5, r1 bca0: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bca2: f6 01 movw r30, r12 bca4: ea 0d add r30, r10 bca6: fb 1d adc r31, r11 bca8: d7 01 movw r26, r14 bcaa: aa 0d add r26, r10 bcac: bb 1d adc r27, r11 bcae: 2d 91 ld r18, X+ bcb0: 3d 91 ld r19, X+ bcb2: 4d 91 ld r20, X+ bcb4: 5c 91 ld r21, X bcb6: 60 81 ld r22, Z bcb8: 71 81 ldd r23, Z+1 ; 0x01 bcba: 82 81 ldd r24, Z+2 ; 0x02 bcbc: 93 81 ldd r25, Z+3 ; 0x03 bcbe: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bcc2: 9b 01 movw r18, r22 bcc4: ac 01 movw r20, r24 bcc6: c3 01 movw r24, r6 bcc8: b2 01 movw r22, r4 bcca: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> bcce: 2b 01 movw r4, r22 bcd0: 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++) bcd2: 8f ef ldi r24, 0xFF ; 255 bcd4: 88 1a sub r8, r24 bcd6: 98 0a sbc r9, r24 bcd8: 94 e0 ldi r25, 0x04 ; 4 bcda: a9 0e add r10, r25 bcdc: b1 1c adc r11, r1 bcde: a5 e0 ldi r26, 0x05 ; 5 bce0: 8a 16 cp r8, r26 bce2: 91 04 cpc r9, r1 bce4: f1 f6 brne .-68 ; 0xbca2 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; bce6: a3 01 movw r20, r6 bce8: 92 01 movw r18, r4 bcea: f1 01 movw r30, r2 bcec: 60 81 ld r22, Z bcee: 71 81 ldd r23, Z+1 ; 0x01 bcf0: 82 81 ldd r24, Z+2 ; 0x02 bcf2: 93 81 ldd r25, Z+3 ; 0x03 bcf4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bcf8: d6 01 movw r26, r12 bcfa: 2d 91 ld r18, X+ bcfc: 3d 91 ld r19, X+ bcfe: 4d 91 ld r20, X+ bd00: 5c 91 ld r21, X bd02: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> bd06: f7 01 movw r30, r14 bd08: 60 83 st Z, r22 bd0a: 71 83 std Z+1, r23 ; 0x01 bd0c: 82 83 std Z+2, r24 ; 0x02 bd0e: 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--) { bd10: 01 50 subi r16, 0x01 ; 1 bd12: 11 09 sbc r17, r1 bd14: f8 e2 ldi r31, 0x28 ; 40 bd16: 2f 1a sub r2, r31 bd18: 31 08 sbc r3, r1 bd1a: 2c e2 ldi r18, 0x2C ; 44 bd1c: c2 1a sub r12, r18 bd1e: d1 08 sbc r13, r1 bd20: 34 e0 ldi r19, 0x04 ; 4 bd22: e3 1a sub r14, r19 bd24: f1 08 sbc r15, r1 bd26: 01 15 cp r16, r1 bd28: 11 05 cpc r17, r1 bd2a: 09 f0 breq .+2 ; 0xbd2e bd2c: b4 cf rjmp .-152 ; 0xbc96 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { bd2e: cb 50 subi r28, 0x0B ; 11 bd30: de 4f sbci r29, 0xFE ; 254 bd32: 88 81 ld r24, Y bd34: 99 81 ldd r25, Y+1 ; 0x01 bd36: aa 81 ldd r26, Y+2 ; 0x02 bd38: bb 81 ldd r27, Y+3 ; 0x03 bd3a: c5 5f subi r28, 0xF5 ; 245 bd3c: d1 40 sbci r29, 0x01 ; 1 bd3e: cf 57 subi r28, 0x7F ; 127 bd40: dd 4f sbci r29, 0xFD ; 253 bd42: 88 83 st Y, r24 bd44: 99 83 std Y+1, r25 ; 0x01 bd46: aa 83 std Y+2, r26 ; 0x02 bd48: bb 83 std Y+3, r27 ; 0x03 bd4a: c1 58 subi r28, 0x81 ; 129 bd4c: d2 40 sbci r29, 0x02 ; 2 bd4e: 1e 01 movw r2, r28 bd50: 97 e4 ldi r25, 0x47 ; 71 bd52: 29 1a sub r2, r25 bd54: 9e ef ldi r25, 0xFE ; 254 bd56: 39 0a sbc r3, r25 bd58: 10 e0 ldi r17, 0x00 ; 0 bd5a: 00 e0 ldi r16, 0x00 ; 0 bd5c: c1 59 subi r28, 0x91 ; 145 bd5e: dd 4f sbci r29, 0xFD ; 253 bd60: a8 81 ld r26, Y bd62: b9 81 ldd r27, Y+1 ; 0x01 bd64: cf 56 subi r28, 0x6F ; 111 bd66: d2 40 sbci r29, 0x02 ; 2 bd68: cd 90 ld r12, X+ bd6a: dd 90 ld r13, X+ bd6c: ed 90 ld r14, X+ bd6e: fd 90 ld r15, X+ bd70: c1 59 subi r28, 0x91 ; 145 bd72: dd 4f sbci r29, 0xFD ; 253 bd74: b9 83 std Y+1, r27 ; 0x01 bd76: a8 83 st Y, r26 bd78: cf 56 subi r28, 0x6F ; 111 bd7a: d2 40 sbci r29, 0x02 ; 2 bd7c: cb 58 subi r28, 0x8B ; 139 bd7e: dd 4f sbci r29, 0xFD ; 253 bd80: 28 81 ld r18, Y bd82: 39 81 ldd r19, Y+1 ; 0x01 bd84: 4a 81 ldd r20, Y+2 ; 0x02 bd86: 5b 81 ldd r21, Y+3 ; 0x03 bd88: c5 57 subi r28, 0x75 ; 117 bd8a: d2 40 sbci r29, 0x02 ; 2 bd8c: c7 01 movw r24, r14 bd8e: b6 01 movw r22, r12 bd90: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> bd94: 18 16 cp r1, r24 bd96: b4 f0 brlt .+44 ; 0xbdc4 bd98: cb 58 subi r28, 0x8B ; 139 bd9a: dd 4f sbci r29, 0xFD ; 253 bd9c: 28 81 ld r18, Y bd9e: 39 81 ldd r19, Y+1 ; 0x01 bda0: 4a 81 ldd r20, Y+2 ; 0x02 bda2: 5b 81 ldd r21, Y+3 ; 0x03 bda4: c5 57 subi r28, 0x75 ; 117 bda6: d2 40 sbci r29, 0x02 ; 2 bda8: c1 59 subi r28, 0x91 ; 145 bdaa: dd 4f sbci r29, 0xFD ; 253 bdac: e8 81 ld r30, Y bdae: f9 81 ldd r31, Y+1 ; 0x01 bdb0: cf 56 subi r28, 0x6F ; 111 bdb2: d2 40 sbci r29, 0x02 ; 2 bdb4: 60 81 ld r22, Z bdb6: 71 81 ldd r23, Z+1 ; 0x01 bdb8: 82 81 ldd r24, Z+2 ; 0x02 bdba: 93 81 ldd r25, Z+3 ; 0x03 bdbc: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> bdc0: 87 ff sbrs r24, 7 bdc2: 18 c0 rjmp .+48 ; 0xbdf4 bdc4: 04 30 cpi r16, 0x04 ; 4 bdc6: 11 05 cpc r17, r1 bdc8: 09 f0 breq .+2 ; 0xbdcc bdca: 30 c1 rjmp .+608 ; 0xc02c bdcc: cb 58 subi r28, 0x8B ; 139 bdce: dd 4f sbci r29, 0xFD ; 253 bdd0: 28 81 ld r18, Y bdd2: 39 81 ldd r19, Y+1 ; 0x01 bdd4: 4a 81 ldd r20, Y+2 ; 0x02 bdd6: 5b 81 ldd r21, Y+3 ; 0x03 bdd8: c5 57 subi r28, 0x75 ; 117 bdda: d2 40 sbci r29, 0x02 ; 2 bddc: cf 57 subi r28, 0x7F ; 127 bdde: dd 4f sbci r29, 0xFD ; 253 bde0: 68 81 ld r22, Y bde2: 79 81 ldd r23, Y+1 ; 0x01 bde4: 8a 81 ldd r24, Y+2 ; 0x02 bde6: 9b 81 ldd r25, Y+3 ; 0x03 bde8: c1 58 subi r28, 0x81 ; 129 bdea: d2 40 sbci r29, 0x02 ; 2 bdec: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> bdf0: 87 ff sbrs r24, 7 bdf2: 1c c1 rjmp .+568 ; 0xc02c a = (s[i + 1] - s[i]) / (6 * h[i]); bdf4: d1 01 movw r26, r2 bdf6: 14 96 adiw r26, 0x04 ; 4 bdf8: 8d 90 ld r8, X+ bdfa: 9d 90 ld r9, X+ bdfc: ad 90 ld r10, X+ bdfe: bc 90 ld r11, X be00: 17 97 sbiw r26, 0x07 ; 7 be02: 8d 91 ld r24, X+ be04: 9d 91 ld r25, X+ be06: 0d 90 ld r0, X+ be08: bc 91 ld r27, X be0a: a0 2d mov r26, r0 be0c: cf 58 subi r28, 0x8F ; 143 be0e: dd 4f sbci r29, 0xFD ; 253 be10: 88 83 st Y, r24 be12: 99 83 std Y+1, r25 ; 0x01 be14: aa 83 std Y+2, r26 ; 0x02 be16: bb 83 std Y+3, r27 ; 0x03 be18: c1 57 subi r28, 0x71 ; 113 be1a: d2 40 sbci r29, 0x02 ; 2 be1c: f8 01 movw r30, r16 be1e: ee 0f add r30, r30 be20: ff 1f adc r31, r31 be22: ee 0f add r30, r30 be24: ff 1f adc r31, r31 be26: 21 e9 ldi r18, 0x91 ; 145 be28: 31 e0 ldi r19, 0x01 ; 1 be2a: 2c 0f add r18, r28 be2c: 3d 1f adc r19, r29 be2e: e2 0f add r30, r18 be30: f3 1f adc r31, r19 be32: 40 80 ld r4, Z be34: 51 80 ldd r5, Z+1 ; 0x01 be36: 62 80 ldd r6, Z+2 ; 0x02 be38: 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; be3a: c3 59 subi r28, 0x93 ; 147 be3c: dd 4f sbci r29, 0xFD ; 253 be3e: a8 81 ld r26, Y be40: b9 81 ldd r27, Y+1 ; 0x01 be42: cd 56 subi r28, 0x6D ; 109 be44: d2 40 sbci r29, 0x02 ; 2 be46: 8d 91 ld r24, X+ be48: 9d 91 ld r25, X+ be4a: 0d 90 ld r0, X+ be4c: bc 91 ld r27, X be4e: a0 2d mov r26, r0 be50: c3 58 subi r28, 0x83 ; 131 be52: dd 4f sbci r29, 0xFD ; 253 be54: 88 83 st Y, r24 be56: 99 83 std Y+1, r25 ; 0x01 be58: aa 83 std Y+2, r26 ; 0x02 be5a: bb 83 std Y+3, r27 ; 0x03 be5c: cd 57 subi r28, 0x7D ; 125 be5e: 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; be60: a7 01 movw r20, r14 be62: 96 01 movw r18, r12 be64: cb 58 subi r28, 0x8B ; 139 be66: dd 4f sbci r29, 0xFD ; 253 be68: 68 81 ld r22, Y be6a: 79 81 ldd r23, Y+1 ; 0x01 be6c: 8a 81 ldd r24, Y+2 ; 0x02 be6e: 9b 81 ldd r25, Y+3 ; 0x03 be70: c5 57 subi r28, 0x75 ; 117 be72: d2 40 sbci r29, 0x02 ; 2 be74: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> be78: 6b 01 movw r12, r22 be7a: 7c 01 movw r14, r24 be7c: 20 e0 ldi r18, 0x00 ; 0 be7e: 30 e0 ldi r19, 0x00 ; 0 be80: 40 e4 ldi r20, 0x40 ; 64 be82: 50 e4 ldi r21, 0x40 ; 64 be84: 0f 94 bb e0 call 0x3c176 ; 0x3c176 be88: cb 57 subi r28, 0x7B ; 123 be8a: dd 4f sbci r29, 0xFD ; 253 be8c: 68 83 st Y, r22 be8e: 79 83 std Y+1, r23 ; 0x01 be90: 8a 83 std Y+2, r24 ; 0x02 be92: 9b 83 std Y+3, r25 ; 0x03 be94: c5 58 subi r28, 0x85 ; 133 be96: 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; be98: c3 58 subi r28, 0x83 ; 131 be9a: dd 4f sbci r29, 0xFD ; 253 be9c: 28 81 ld r18, Y be9e: 39 81 ldd r19, Y+1 ; 0x01 bea0: 4a 81 ldd r20, Y+2 ; 0x02 bea2: 5b 81 ldd r21, Y+3 ; 0x03 bea4: cd 57 subi r28, 0x7D ; 125 bea6: d2 40 sbci r29, 0x02 ; 2 bea8: c3 59 subi r28, 0x93 ; 147 beaa: dd 4f sbci r29, 0xFD ; 253 beac: e8 81 ld r30, Y beae: f9 81 ldd r31, Y+1 ; 0x01 beb0: cd 56 subi r28, 0x6D ; 109 beb2: d2 40 sbci r29, 0x02 ; 2 beb4: 64 81 ldd r22, Z+4 ; 0x04 beb6: 75 81 ldd r23, Z+5 ; 0x05 beb8: 86 81 ldd r24, Z+6 ; 0x06 beba: 97 81 ldd r25, Z+7 ; 0x07 bebc: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bec0: a3 01 movw r20, r6 bec2: 92 01 movw r18, r4 bec4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> bec8: c7 58 subi r28, 0x87 ; 135 beca: dd 4f sbci r29, 0xFD ; 253 becc: 68 83 st Y, r22 bece: 79 83 std Y+1, r23 ; 0x01 bed0: 8a 83 std Y+2, r24 ; 0x02 bed2: 9b 83 std Y+3, r25 ; 0x03 bed4: c9 57 subi r28, 0x79 ; 121 bed6: d2 40 sbci r29, 0x02 ; 2 bed8: a3 01 movw r20, r6 beda: 92 01 movw r18, r4 bedc: c3 01 movw r24, r6 bede: b2 01 movw r22, r4 bee0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> bee4: cf 58 subi r28, 0x8F ; 143 bee6: dd 4f sbci r29, 0xFD ; 253 bee8: 28 81 ld r18, Y beea: 39 81 ldd r19, Y+1 ; 0x01 beec: 4a 81 ldd r20, Y+2 ; 0x02 beee: 5b 81 ldd r21, Y+3 ; 0x03 bef0: c1 57 subi r28, 0x71 ; 113 bef2: d2 40 sbci r29, 0x02 ; 2 bef4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bef8: c7 57 subi r28, 0x77 ; 119 befa: dd 4f sbci r29, 0xFD ; 253 befc: 68 83 st Y, r22 befe: 79 83 std Y+1, r23 ; 0x01 bf00: 8a 83 std Y+2, r24 ; 0x02 bf02: 9b 83 std Y+3, r25 ; 0x03 bf04: c9 58 subi r28, 0x89 ; 137 bf06: d2 40 sbci r29, 0x02 ; 2 bf08: a3 01 movw r20, r6 bf0a: 92 01 movw r18, r4 bf0c: c5 01 movw r24, r10 bf0e: b4 01 movw r22, r8 bf10: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bf14: 9b 01 movw r18, r22 bf16: ac 01 movw r20, r24 bf18: c7 57 subi r28, 0x77 ; 119 bf1a: dd 4f sbci r29, 0xFD ; 253 bf1c: 68 81 ld r22, Y bf1e: 79 81 ldd r23, Y+1 ; 0x01 bf20: 8a 81 ldd r24, Y+2 ; 0x02 bf22: 9b 81 ldd r25, Y+3 ; 0x03 bf24: c9 58 subi r28, 0x89 ; 137 bf26: d2 40 sbci r29, 0x02 ; 2 bf28: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> bf2c: 20 e0 ldi r18, 0x00 ; 0 bf2e: 30 e0 ldi r19, 0x00 ; 0 bf30: 40 ec ldi r20, 0xC0 ; 192 bf32: 50 e4 ldi r21, 0x40 ; 64 bf34: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> bf38: 9b 01 movw r18, r22 bf3a: ac 01 movw r20, r24 bf3c: c7 58 subi r28, 0x87 ; 135 bf3e: dd 4f sbci r29, 0xFD ; 253 bf40: 68 81 ld r22, Y bf42: 79 81 ldd r23, Y+1 ; 0x01 bf44: 8a 81 ldd r24, Y+2 ; 0x02 bf46: 9b 81 ldd r25, Y+3 ; 0x03 bf48: c9 57 subi r28, 0x79 ; 121 bf4a: d2 40 sbci r29, 0x02 ; 2 bf4c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__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; bf50: a7 01 movw r20, r14 bf52: 96 01 movw r18, r12 bf54: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bf58: c7 58 subi r28, 0x87 ; 135 bf5a: dd 4f sbci r29, 0xFD ; 253 bf5c: 68 83 st Y, r22 bf5e: 79 83 std Y+1, r23 ; 0x01 bf60: 8a 83 std Y+2, r24 ; 0x02 bf62: 9b 83 std Y+3, r25 ; 0x03 bf64: c9 57 subi r28, 0x79 ; 121 bf66: 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]); bf68: cf 58 subi r28, 0x8F ; 143 bf6a: dd 4f sbci r29, 0xFD ; 253 bf6c: 28 81 ld r18, Y bf6e: 39 81 ldd r19, Y+1 ; 0x01 bf70: 4a 81 ldd r20, Y+2 ; 0x02 bf72: 5b 81 ldd r21, Y+3 ; 0x03 bf74: c1 57 subi r28, 0x71 ; 113 bf76: d2 40 sbci r29, 0x02 ; 2 bf78: c5 01 movw r24, r10 bf7a: b4 01 movw r22, r8 bf7c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> bf80: 4b 01 movw r8, r22 bf82: 5c 01 movw r10, r24 bf84: 20 e0 ldi r18, 0x00 ; 0 bf86: 30 e0 ldi r19, 0x00 ; 0 bf88: 40 ec ldi r20, 0xC0 ; 192 bf8a: 50 e4 ldi r21, 0x40 ; 64 bf8c: c3 01 movw r24, r6 bf8e: b2 01 movw r22, r4 bf90: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bf94: 9b 01 movw r18, r22 bf96: ac 01 movw r20, r24 bf98: c5 01 movw r24, r10 bf9a: b4 01 movw r22, r8 bf9c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__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; bfa0: cb 57 subi r28, 0x7B ; 123 bfa2: dd 4f sbci r29, 0xFD ; 253 bfa4: 28 81 ld r18, Y bfa6: 39 81 ldd r19, Y+1 ; 0x01 bfa8: 4a 81 ldd r20, Y+2 ; 0x02 bfaa: 5b 81 ldd r21, Y+3 ; 0x03 bfac: c5 58 subi r28, 0x85 ; 133 bfae: d2 40 sbci r29, 0x02 ; 2 bfb0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bfb4: 4b 01 movw r8, r22 bfb6: 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; bfb8: 20 e0 ldi r18, 0x00 ; 0 bfba: 30 e0 ldi r19, 0x00 ; 0 bfbc: 40 e0 ldi r20, 0x00 ; 0 bfbe: 5f e3 ldi r21, 0x3F ; 63 bfc0: cf 58 subi r28, 0x8F ; 143 bfc2: dd 4f sbci r29, 0xFD ; 253 bfc4: 68 81 ld r22, Y bfc6: 79 81 ldd r23, Y+1 ; 0x01 bfc8: 8a 81 ldd r24, Y+2 ; 0x02 bfca: 9b 81 ldd r25, Y+3 ; 0x03 bfcc: c1 57 subi r28, 0x71 ; 113 bfce: d2 40 sbci r29, 0x02 ; 2 bfd0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bfd4: 2b 01 movw r4, r22 bfd6: 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; bfd8: a7 01 movw r20, r14 bfda: 96 01 movw r18, r12 bfdc: c7 01 movw r24, r14 bfde: b6 01 movw r22, r12 bfe0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bfe4: 9b 01 movw r18, r22 bfe6: ac 01 movw r20, r24 bfe8: c3 01 movw r24, r6 bfea: b2 01 movw r22, r4 bfec: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> bff0: 9b 01 movw r18, r22 bff2: ac 01 movw r20, r24 bff4: c5 01 movw r24, r10 bff6: b4 01 movw r22, r8 bff8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> bffc: 9b 01 movw r18, r22 bffe: ac 01 movw r20, r24 c000: c7 58 subi r28, 0x87 ; 135 c002: dd 4f sbci r29, 0xFD ; 253 c004: 68 81 ld r22, Y c006: 79 81 ldd r23, Y+1 ; 0x01 c008: 8a 81 ldd r24, Y+2 ; 0x02 c00a: 9b 81 ldd r25, Y+3 ; 0x03 c00c: c9 57 subi r28, 0x79 ; 121 c00e: d2 40 sbci r29, 0x02 ; 2 c010: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> c014: c3 58 subi r28, 0x83 ; 131 c016: dd 4f sbci r29, 0xFD ; 253 c018: 28 81 ld r18, Y c01a: 39 81 ldd r19, Y+1 ; 0x01 c01c: 4a 81 ldd r20, Y+2 ; 0x02 c01e: 5b 81 ldd r21, Y+3 ; 0x03 c020: cd 57 subi r28, 0x7D ; 125 c022: d2 40 sbci r29, 0x02 ; 2 c024: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> c028: 2b 01 movw r4, r22 c02a: 3c 01 movw r6, r24 c02c: 0f 5f subi r16, 0xFF ; 255 c02e: 1f 4f sbci r17, 0xFF ; 255 c030: f4 e0 ldi r31, 0x04 ; 4 c032: 2f 0e add r2, r31 c034: 31 1c adc r3, r1 c036: c3 59 subi r28, 0x93 ; 147 c038: dd 4f sbci r29, 0xFD ; 253 c03a: 28 81 ld r18, Y c03c: 39 81 ldd r19, Y+1 ; 0x01 c03e: cd 56 subi r28, 0x6D ; 109 c040: d2 40 sbci r29, 0x02 ; 2 c042: 2c 5f subi r18, 0xFC ; 252 c044: 3f 4f sbci r19, 0xFF ; 255 c046: c3 59 subi r28, 0x93 ; 147 c048: dd 4f sbci r29, 0xFD ; 253 c04a: 39 83 std Y+1, r19 ; 0x01 c04c: 28 83 st Y, r18 c04e: cd 56 subi r28, 0x6D ; 109 c050: 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 c058: 81 ce rjmp .-766 ; 0xbd5c sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c05a: c3 01 movw r24, r6 c05c: b2 01 movw r22, r4 c05e: c4 57 subi r28, 0x74 ; 116 c060: dd 4f sbci r29, 0xFD ; 253 c062: 0f b6 in r0, 0x3f ; 63 c064: f8 94 cli c066: de bf out 0x3e, r29 ; 62 c068: 0f be out 0x3f, r0 ; 63 c06a: cd bf out 0x3d, r28 ; 61 c06c: df 91 pop r29 c06e: cf 91 pop r28 c070: 1f 91 pop r17 c072: 0f 91 pop r16 c074: ff 90 pop r15 c076: ef 90 pop r14 c078: df 90 pop r13 c07a: cf 90 pop r12 c07c: bf 90 pop r11 c07e: af 90 pop r10 c080: 9f 90 pop r9 c082: 8f 90 pop r8 c084: 7f 90 pop r7 c086: 6f 90 pop r6 c088: 5f 90 pop r5 c08a: 4f 90 pop r4 c08c: 3f 90 pop r3 c08e: 2f 90 pop r2 c090: 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)); c092: c5 01 movw r24, r10 c094: 0f 94 31 dc call 0x3b862 ; 0x3b862 c098: d8 01 movw r26, r16 c09a: 8d 93 st X+, r24 c09c: 9c 93 st X, r25 c09e: b5 e0 ldi r27, 0x05 ; 5 c0a0: cb 0e add r12, r27 c0a2: d1 1c adc r13, r1 c0a4: e2 e0 ldi r30, 0x02 ; 2 c0a6: ae 0e add r10, r30 c0a8: b1 1c adc r11, r1 c0aa: 96 cc rjmp .-1748 ; 0xb9d8 0000c0ac : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c0ac: 0f 93 push r16 c0ae: 1f 93 push r17 c0b0: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c0b2: 20 91 ba 13 lds r18, 0x13BA ; 0x8013ba c0b6: 21 30 cpi r18, 0x01 ; 1 c0b8: 79 f5 brne .+94 ; 0xc118 c0ba: 8c 01 movw r16, r24 c0bc: 80 e5 ldi r24, 0x50 ; 80 c0be: 0e 94 dd 5b call 0xb7ba ; 0xb7ba c0c2: 88 23 and r24, r24 c0c4: 49 f1 breq .+82 ; 0xc118 { mmuSlotIndex = code_value_uint8(); c0c6: 0e 94 6f 5b call 0xb6de ; 0xb6de c0ca: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c0cc: 85 30 cpi r24, 0x05 ; 5 c0ce: 20 f5 brcc .+72 ; 0xc118 switch (gcode) c0d0: 01 3c cpi r16, 0xC1 ; 193 c0d2: 82 e0 ldi r24, 0x02 ; 2 c0d4: 18 07 cpc r17, r24 c0d6: 49 f0 breq .+18 ; 0xc0ea c0d8: 02 3c cpi r16, 0xC2 ; 194 c0da: 12 40 sbci r17, 0x02 ; 2 c0dc: 69 f0 breq .+26 ; 0xc0f8 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c0de: 8c 2f mov r24, r28 default: break; } } } } c0e0: cf 91 pop r28 c0e2: 1f 91 pop r17 c0e4: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c0e6: 0d 94 5c ad jmp 0x35ab8 ; 0x35ab8 break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c0ea: 60 e0 ldi r22, 0x00 ; 0 c0ec: 8c 2f mov r24, r28 default: break; } } } } c0ee: cf 91 pop r28 c0f0: 1f 91 pop r17 c0f2: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c0f4: 0d 94 9f ad jmp 0x35b3e ; 0x35b3e break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c0f8: 8e ec ldi r24, 0xCE ; 206 c0fa: 9e e0 ldi r25, 0x0E ; 14 c0fc: 0f 94 23 dc call 0x3b846 ; 0x3b846 c100: 88 23 and r24, r24 c102: 51 f0 breq .+20 ; 0xc118 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c104: 0f 94 8b 88 call 0x31116 ; 0x31116 c108: 88 23 and r24, r24 c10a: 31 f0 breq .+12 ; 0xc118 c10c: 8c 2f mov r24, r28 default: break; } } } } c10e: cf 91 pop r28 c110: 1f 91 pop r17 c112: 0f 91 pop r16 c114: 0d 94 1c ae jmp 0x35c38 ; 0x35c38 c118: cf 91 pop r28 c11a: 1f 91 pop r17 c11c: 0f 91 pop r16 c11e: 08 95 ret 0000c120 : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c120: cf 93 push r28 c122: 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(); c124: 0f 94 ef 42 call 0x285de ; 0x285de cli(); c128: f8 94 cli tmc2130_mode = mode; c12a: c0 93 8c 06 sts 0x068C, r28 ; 0x80068c update_mode_profile(); c12e: 0f 94 a8 63 call 0x2c750 ; 0x2c750 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(); c132: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 1 #else 0 #endif ) , enableECool(enableECool) { } c136: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c138: 82 70 andi r24, 0x02 ; 2 c13a: 0f 94 67 26 call 0x24cce ; 0x24cce // 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(); c13e: 0f 94 49 43 call 0x28692 ; 0x28692 sei(); c142: 78 94 sei } c144: cf 91 pop r28 c146: 08 95 ret 0000c148 : 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);} c148: 8f 92 push r8 c14a: 9f 92 push r9 c14c: af 92 push r10 c14e: bf 92 push r11 c150: cf 92 push r12 c152: df 92 push r13 c154: ef 92 push r14 c156: ff 92 push r15 c158: 0f 93 push r16 c15a: 1f 93 push r17 c15c: cf 93 push r28 c15e: df 93 push r29 c160: 00 91 95 03 lds r16, 0x0395 ; 0x800395 c164: 10 91 96 03 lds r17, 0x0396 ; 0x800396 c168: 0f 5f subi r16, 0xFF ; 255 c16a: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c16c: 68 01 movw r12, r16 c16e: 8f ef ldi r24, 0xFF ; 255 c170: c8 1a sub r12, r24 c172: d8 0a sbc r13, r24 c174: d8 01 movw r26, r16 c176: dc 91 ld r29, X } while (isspace(c)); c178: 8d 2f mov r24, r29 c17a: 90 e0 ldi r25, 0x00 ; 0 c17c: 0f 94 b4 d9 call 0x3b368 ; 0x3b368 c180: 7c 01 movw r14, r24 c182: 89 2b or r24, r25 c184: 01 f5 brne .+64 ; 0xc1c6 flag = 0; if (c == '-') { c186: dd 32 cpi r29, 0x2D ; 45 c188: 01 f5 brne .+64 ; 0xc1ca flag = FL_MINUS; c = *nptr++; c18a: 68 01 movw r12, r16 c18c: b2 e0 ldi r27, 0x02 ; 2 c18e: cb 0e add r12, r27 c190: d1 1c adc r13, r1 c192: f8 01 movw r30, r16 c194: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c196: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c198: 86 01 movw r16, r12 c19a: 01 50 subi r16, 0x01 ; 1 c19c: 11 09 sbc r17, r1 c19e: 43 e0 ldi r20, 0x03 ; 3 c1a0: 50 e0 ldi r21, 0x00 ; 0 c1a2: 65 ea ldi r22, 0xA5 ; 165 c1a4: 7b e7 ldi r23, 0x7B ; 123 c1a6: c8 01 movw r24, r16 c1a8: 0f 94 ea d9 call 0x3b3d4 ; 0x3b3d4 c1ac: 89 2b or r24, r25 c1ae: c1 f4 brne .+48 ; 0xc1e0 nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c1b0: 60 e0 ldi r22, 0x00 ; 0 c1b2: 70 e0 ldi r23, 0x00 ; 0 c1b4: 80 e8 ldi r24, 0x80 ; 128 c1b6: 9f ef ldi r25, 0xFF ; 255 c1b8: c1 11 cpse r28, r1 c1ba: db c0 rjmp .+438 ; 0xc372 c1bc: 60 e0 ldi r22, 0x00 ; 0 c1be: 70 e0 ldi r23, 0x00 ; 0 c1c0: 80 e8 ldi r24, 0x80 ; 128 c1c2: 9f e7 ldi r25, 0x7F ; 127 c1c4: d6 c0 rjmp .+428 ; 0xc372 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c1c6: 86 01 movw r16, r12 c1c8: d1 cf rjmp .-94 ; 0xc16c flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c1ca: db 32 cpi r29, 0x2B ; 43 c1cc: 39 f4 brne .+14 ; 0xc1dc c = *nptr++; c1ce: 68 01 movw r12, r16 c1d0: f2 e0 ldi r31, 0x02 ; 2 c1d2: cf 0e add r12, r31 c1d4: d1 1c adc r13, r1 c1d6: d8 01 movw r26, r16 c1d8: 11 96 adiw r26, 0x01 ; 1 c1da: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c1dc: c0 e0 ldi r28, 0x00 ; 0 c1de: dc cf rjmp .-72 ; 0xc198 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)) { c1e0: 43 e0 ldi r20, 0x03 ; 3 c1e2: 50 e0 ldi r21, 0x00 ; 0 c1e4: 62 ea ldi r22, 0xA2 ; 162 c1e6: 7b e7 ldi r23, 0x7B ; 123 c1e8: c8 01 movw r24, r16 c1ea: 0f 94 ea d9 call 0x3b3d4 ; 0x3b3d4 c1ee: 89 2b or r24, r25 c1f0: 09 f4 brne .+2 ; 0xc1f4 c1f2: cc c0 rjmp .+408 ; 0xc38c c1f4: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c1f6: 10 e0 ldi r17, 0x00 ; 0 c1f8: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c1fa: 20 e0 ldi r18, 0x00 ; 0 c1fc: 30 e0 ldi r19, 0x00 ; 0 c1fe: a9 01 movw r20, r18 c200: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c202: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c204: da 30 cpi r29, 0x0A ; 10 c206: 60 f5 brcc .+88 ; 0xc260 flag |= FL_ANY; c208: bc 2e mov r11, r28 c20a: 68 94 set c20c: b1 f8 bld r11, 1 c20e: 8c 2f mov r24, r28 c210: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c212: c2 ff sbrs r28, 2 c214: 09 c0 rjmp .+18 ; 0xc228 if (!(flag & FL_DOT)) c216: 81 11 cpse r24, r1 c218: 02 c0 rjmp .+4 ; 0xc21e exp += 1; c21a: 0f 5f subi r16, 0xFF ; 255 c21c: 1f 4f sbci r17, 0xFF ; 255 c21e: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c220: d6 01 movw r26, r12 c222: dc 91 ld r29, X c224: cb 2d mov r28, r11 c226: ec cf rjmp .-40 ; 0xc200 if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c228: 88 23 and r24, r24 c22a: 11 f0 breq .+4 ; 0xc230 exp -= 1; c22c: 01 50 subi r16, 0x01 ; 1 c22e: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c230: a5 e0 ldi r26, 0x05 ; 5 c232: b0 e0 ldi r27, 0x00 ; 0 c234: 0f 94 b8 dc call 0x3b970 ; 0x3b970 <__muluhisi3> c238: 9b 01 movw r18, r22 c23a: ac 01 movw r20, r24 c23c: 22 0f add r18, r18 c23e: 33 1f adc r19, r19 c240: 44 1f adc r20, r20 c242: 55 1f adc r21, r21 c244: 2d 0f add r18, r29 c246: 31 1d adc r19, r1 c248: 41 1d adc r20, r1 c24a: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c24c: 28 39 cpi r18, 0x98 ; 152 c24e: b9 e9 ldi r27, 0x99 ; 153 c250: 3b 07 cpc r19, r27 c252: 4b 07 cpc r20, r27 c254: b9 e1 ldi r27, 0x19 ; 25 c256: 5b 07 cpc r21, r27 c258: 10 f3 brcs .-60 ; 0xc21e flag |= FL_OVFL; c25a: c6 60 ori r28, 0x06 ; 6 c25c: bc 2e mov r11, r28 c25e: df cf rjmp .-66 ; 0xc21e } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c260: de 3f cpi r29, 0xFE ; 254 c262: 31 f4 brne .+12 ; 0xc270 c264: c3 fd sbrc r28, 3 c266: 33 c0 rjmp .+102 ; 0xc2ce flag |= FL_DOT; c268: bc 2e mov r11, r28 c26a: 68 94 set c26c: b3 f8 bld r11, 3 c26e: d7 cf rjmp .-82 ; 0xc21e } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c270: d5 33 cpi r29, 0x35 ; 53 c272: 69 f5 brne .+90 ; 0xc2ce { int i; c = *nptr++; c274: 80 81 ld r24, Z i = 2; if (c == '-') { c276: 8d 32 cpi r24, 0x2D ; 45 c278: 31 f4 brne .+12 ; 0xc286 flag |= FL_MEXP; c27a: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c27c: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c27e: 6e 5f subi r22, 0xFE ; 254 c280: 7f 4f sbci r23, 0xFF ; 255 c282: 81 81 ldd r24, Z+1 ; 0x01 c284: 05 c0 rjmp .+10 ; 0xc290 c286: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c288: 8b 32 cpi r24, 0x2B ; 43 c28a: c9 f3 breq .-14 ; 0xc27e // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c28c: 6f 5f subi r22, 0xFF ; 255 c28e: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c290: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c292: 8a 30 cpi r24, 0x0A ; 10 c294: e0 f4 brcc .+56 ; 0xc2ce c296: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c298: b0 e8 ldi r27, 0x80 ; 128 c29a: eb 16 cp r14, r27 c29c: bc e0 ldi r27, 0x0C ; 12 c29e: fb 06 cpc r15, r27 c2a0: 5c f4 brge .+22 ; 0xc2b8 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c2a2: b7 01 movw r22, r14 c2a4: 66 0f add r22, r22 c2a6: 77 1f adc r23, r23 c2a8: 66 0f add r22, r22 c2aa: 77 1f adc r23, r23 c2ac: e6 0e add r14, r22 c2ae: f7 1e adc r15, r23 c2b0: ee 0c add r14, r14 c2b2: ff 1c adc r15, r15 c2b4: e8 0e add r14, r24 c2b6: f1 1c adc r15, r1 c = *nptr++ - '0'; c2b8: 81 91 ld r24, Z+ c2ba: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c2bc: 8a 30 cpi r24, 0x0A ; 10 c2be: 60 f3 brcs .-40 ; 0xc298 if (flag & FL_MEXP) c2c0: c4 ff sbrs r28, 4 c2c2: 03 c0 rjmp .+6 ; 0xc2ca i = -i; c2c4: f1 94 neg r15 c2c6: e1 94 neg r14 c2c8: f1 08 sbc r15, r1 exp += i; c2ca: 0e 0d add r16, r14 c2cc: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c2ce: ca 01 movw r24, r20 c2d0: b9 01 movw r22, r18 c2d2: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c2d6: c3 70 andi r28, 0x03 ; 3 c2d8: c3 30 cpi r28, 0x03 ; 3 c2da: 09 f4 brne .+2 ; 0xc2de x.flt = -x.flt; c2dc: 90 58 subi r25, 0x80 ; 128 c2de: 4b 01 movw r8, r22 c2e0: 5c 01 movw r10, r24 if (x.flt != 0) { c2e2: 20 e0 ldi r18, 0x00 ; 0 c2e4: 30 e0 ldi r19, 0x00 ; 0 c2e6: a9 01 movw r20, r18 c2e8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> c2ec: 88 23 and r24, r24 c2ee: 09 f4 brne .+2 ; 0xc2f2 c2f0: 3e c0 rjmp .+124 ; 0xc36e if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c2f2: ce e9 ldi r28, 0x9E ; 158 c2f4: 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) { c2f6: 17 ff sbrs r17, 7 c2f8: 05 c0 rjmp .+10 ; 0xc304 nptr = (void*)(pwr_m10 + 5); exp = -exp; c2fa: 11 95 neg r17 c2fc: 01 95 neg r16 c2fe: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c300: c6 e8 ldi r28, 0x86 ; 134 c302: db e7 ldi r29, 0x7B ; 123 c304: 6e 01 movw r12, r28 c306: e8 e1 ldi r30, 0x18 ; 24 c308: ce 1a sub r12, r30 c30a: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c30c: 80 e2 ldi r24, 0x20 ; 32 c30e: e8 2e mov r14, r24 c310: f1 2c mov r15, r1 c312: 0d c0 rjmp .+26 ; 0xc32e for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c314: fe 01 movw r30, r28 c316: 25 91 lpm r18, Z+ c318: 35 91 lpm r19, Z+ c31a: 45 91 lpm r20, Z+ c31c: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c31e: 0e 19 sub r16, r14 c320: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c322: c5 01 movw r24, r10 c324: b4 01 movw r22, r8 c326: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> c32a: 4b 01 movw r8, r22 c32c: 5c 01 movw r10, r24 c32e: d5 01 movw r26, r10 c330: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c332: 0e 15 cp r16, r14 c334: 1f 05 cpc r17, r15 c336: 74 f7 brge .-36 ; 0xc314 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c338: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c33a: f5 94 asr r15 c33c: e7 94 ror r14 c33e: cc 16 cp r12, r28 c340: dd 06 cpc r13, r29 c342: a9 f7 brne .-22 ; 0xc32e not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c344: 8a 2f mov r24, r26 c346: 88 0f add r24, r24 c348: 8b 2f mov r24, r27 c34a: 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) c34c: 8f 3f cpi r24, 0xFF ; 255 c34e: 49 f0 breq .+18 ; 0xc362 c350: 20 e0 ldi r18, 0x00 ; 0 c352: 30 e0 ldi r19, 0x00 ; 0 c354: a9 01 movw r20, r18 c356: c5 01 movw r24, r10 c358: b4 01 movw r22, r8 c35a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> c35e: 81 11 cpse r24, r1 c360: 06 c0 rjmp .+12 ; 0xc36e errno = ERANGE; c362: 82 e2 ldi r24, 0x22 ; 34 c364: 90 e0 ldi r25, 0x00 ; 0 c366: 90 93 15 18 sts 0x1815, r25 ; 0x801815 c36a: 80 93 14 18 sts 0x1814, r24 ; 0x801814 } return x.flt; c36e: c5 01 movw r24, r10 c370: b4 01 movw r22, r8 c372: df 91 pop r29 c374: cf 91 pop r28 c376: 1f 91 pop r17 c378: 0f 91 pop r16 c37a: ff 90 pop r15 c37c: ef 90 pop r14 c37e: df 90 pop r13 c380: cf 90 pop r12 c382: bf 90 pop r11 c384: af 90 pop r10 c386: 9f 90 pop r9 c388: 8f 90 pop r8 c38a: 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; c38c: 60 e0 ldi r22, 0x00 ; 0 c38e: 70 e0 ldi r23, 0x00 ; 0 c390: 80 ec ldi r24, 0xC0 ; 192 c392: 9f e7 ldi r25, 0x7F ; 127 c394: ee cf rjmp .-36 ; 0xc372 0000c396 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c396: 2f 92 push r2 c398: 3f 92 push r3 c39a: 4f 92 push r4 c39c: 5f 92 push r5 c39e: 6f 92 push r6 c3a0: 7f 92 push r7 c3a2: 8f 92 push r8 c3a4: 9f 92 push r9 c3a6: af 92 push r10 c3a8: bf 92 push r11 c3aa: cf 92 push r12 c3ac: df 92 push r13 c3ae: ef 92 push r14 c3b0: ff 92 push r15 c3b2: 0f 93 push r16 c3b4: 1f 93 push r17 c3b6: cf 93 push r28 c3b8: df 93 push r29 c3ba: 00 d0 rcall .+0 ; 0xc3bc c3bc: cd b7 in r28, 0x3d ; 61 c3be: de b7 in r29, 0x3e ; 62 c3c0: 8d ed ldi r24, 0xDD ; 221 c3c2: c8 2e mov r12, r24 c3c4: 82 e0 ldi r24, 0x02 ; 2 c3c6: d8 2e mov r13, r24 c3c8: 84 e7 ldi r24, 0x74 ; 116 c3ca: 96 e0 ldi r25, 0x06 ; 6 c3cc: 9b 83 std Y+3, r25 ; 0x03 c3ce: 8a 83 std Y+2, r24 ; 0x02 c3d0: 92 e9 ldi r25, 0x92 ; 146 c3d2: e9 2e mov r14, r25 c3d4: 96 e0 ldi r25, 0x06 ; 6 c3d6: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c3d8: 33 24 eor r3, r3 c3da: 33 94 inc r3 c3dc: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c3de: f6 01 movw r30, r12 c3e0: 81 91 ld r24, Z+ c3e2: 6f 01 movw r12, r30 c3e4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba c3e8: 28 2e mov r2, r24 c3ea: 88 23 and r24, r24 c3ec: 09 f4 brne .+2 ; 0xc3f0 c3ee: a6 c0 rjmp .+332 ; 0xc53c { bool relative = axis_relative_modes & mask; c3f0: 10 91 e5 03 lds r17, 0x03E5 ; 0x8003e5 c3f4: 13 21 and r17, r3 destination[i] = code_value(); c3f6: 0e 94 a4 60 call 0xc148 ; 0xc148 c3fa: 2b 01 movw r4, r22 c3fc: 3c 01 movw r6, r24 c3fe: ea 81 ldd r30, Y+2 ; 0x02 c400: fb 81 ldd r31, Y+3 ; 0x03 c402: 40 82 st Z, r4 c404: 51 82 std Z+1, r5 ; 0x01 c406: 62 82 std Z+2, r6 ; 0x02 c408: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c40a: 03 30 cpi r16, 0x03 ; 3 c40c: 09 f0 breq .+2 ; 0xc410 c40e: 46 c0 rjmp .+140 ; 0xc49c 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; c410: f1 e0 ldi r31, 0x01 ; 1 c412: f9 83 std Y+1, r31 ; 0x01 c414: 11 11 cpse r17, r1 c416: 01 c0 rjmp .+2 ; 0xc41a c418: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c41a: 80 90 93 02 lds r8, 0x0293 ; 0x800293 c41e: 90 90 94 02 lds r9, 0x0294 ; 0x800294 c422: a0 90 95 02 lds r10, 0x0295 ; 0x800295 c426: b0 90 96 02 lds r11, 0x0296 ; 0x800296 if (emult != 1.) { c42a: 20 e0 ldi r18, 0x00 ; 0 c42c: 30 e0 ldi r19, 0x00 ; 0 c42e: 40 e8 ldi r20, 0x80 ; 128 c430: 5f e3 ldi r21, 0x3F ; 63 c432: c5 01 movw r24, r10 c434: b4 01 movw r22, r8 c436: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> c43a: 88 23 and r24, r24 c43c: 59 f1 breq .+86 ; 0xc494 if (! relative) { c43e: 11 11 cpse r17, r1 c440: 15 c0 rjmp .+42 ; 0xc46c destination[i] -= current_position[i]; c442: 20 91 9e 06 lds r18, 0x069E ; 0x80069e c446: 30 91 9f 06 lds r19, 0x069F ; 0x80069f c44a: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 c44e: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 c452: c3 01 movw r24, r6 c454: b2 01 movw r22, r4 c456: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> c45a: 60 93 80 06 sts 0x0680, r22 ; 0x800680 c45e: 70 93 81 06 sts 0x0681, r23 ; 0x800681 c462: 80 93 82 06 sts 0x0682, r24 ; 0x800682 c466: 90 93 83 06 sts 0x0683, r25 ; 0x800683 relative = true; c46a: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c46c: a5 01 movw r20, r10 c46e: 94 01 movw r18, r8 c470: 60 91 80 06 lds r22, 0x0680 ; 0x800680 c474: 70 91 81 06 lds r23, 0x0681 ; 0x800681 c478: 80 91 82 06 lds r24, 0x0682 ; 0x800682 c47c: 90 91 83 06 lds r25, 0x0683 ; 0x800683 c480: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> c484: 60 93 80 06 sts 0x0680, r22 ; 0x800680 c488: 70 93 81 06 sts 0x0681, r23 ; 0x800681 c48c: 80 93 82 06 sts 0x0682, r24 ; 0x800682 c490: 90 93 83 06 sts 0x0683, r25 ; 0x800683 } } if (relative) c494: e9 81 ldd r30, Y+1 ; 0x01 c496: e1 11 cpse r30, r1 c498: 03 c0 rjmp .+6 ; 0xc4a0 c49a: 22 c0 rjmp .+68 ; 0xc4e0 c49c: 11 23 and r17, r17 c49e: 99 f0 breq .+38 ; 0xc4c6 destination[i] += current_position[i]; c4a0: f7 01 movw r30, r14 c4a2: 20 81 ld r18, Z c4a4: 31 81 ldd r19, Z+1 ; 0x01 c4a6: 42 81 ldd r20, Z+2 ; 0x02 c4a8: 53 81 ldd r21, Z+3 ; 0x03 c4aa: ea 81 ldd r30, Y+2 ; 0x02 c4ac: fb 81 ldd r31, Y+3 ; 0x03 c4ae: 60 81 ld r22, Z c4b0: 71 81 ldd r23, Z+1 ; 0x01 c4b2: 82 81 ldd r24, Z+2 ; 0x02 c4b4: 93 81 ldd r25, Z+3 ; 0x03 c4b6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> c4ba: ea 81 ldd r30, Y+2 ; 0x02 c4bc: fb 81 ldd r31, Y+3 ; 0x03 c4be: 60 83 st Z, r22 c4c0: 71 83 std Z+1, r23 ; 0x01 c4c2: 82 83 std Z+2, r24 ; 0x02 c4c4: 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) { c4c6: 0f 5f subi r16, 0xFF ; 255 c4c8: 33 0c add r3, r3 c4ca: 8a 81 ldd r24, Y+2 ; 0x02 c4cc: 9b 81 ldd r25, Y+3 ; 0x03 c4ce: 04 96 adiw r24, 0x04 ; 4 c4d0: 9b 83 std Y+3, r25 ; 0x03 c4d2: 8a 83 std Y+2, r24 ; 0x02 c4d4: 94 e0 ldi r25, 0x04 ; 4 c4d6: e9 0e add r14, r25 c4d8: f1 1c adc r15, r1 c4da: 04 30 cpi r16, 0x04 ; 4 c4dc: 09 f0 breq .+2 ; 0xc4e0 c4de: 7f cf rjmp .-258 ; 0xc3de 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')) { c4e0: 86 e4 ldi r24, 0x46 ; 70 c4e2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba c4e6: 88 23 and r24, r24 c4e8: 99 f0 breq .+38 ; 0xc510 const float next_feedrate = code_value(); c4ea: 0e 94 a4 60 call 0xc148 ; 0xc148 c4ee: 6b 01 movw r12, r22 c4f0: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c4f2: 20 e0 ldi r18, 0x00 ; 0 c4f4: 30 e0 ldi r19, 0x00 ; 0 c4f6: a9 01 movw r20, r18 c4f8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> c4fc: 18 16 cp r1, r24 c4fe: 44 f4 brge .+16 ; 0xc510 c500: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 c504: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 c508: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba c50c: f0 92 bb 02 sts 0x02BB, r15 ; 0x8002bb } } c510: 0f 90 pop r0 c512: 0f 90 pop r0 c514: 0f 90 pop r0 c516: df 91 pop r29 c518: cf 91 pop r28 c51a: 1f 91 pop r17 c51c: 0f 91 pop r16 c51e: ff 90 pop r15 c520: ef 90 pop r14 c522: df 90 pop r13 c524: cf 90 pop r12 c526: bf 90 pop r11 c528: af 90 pop r10 c52a: 9f 90 pop r9 c52c: 8f 90 pop r8 c52e: 7f 90 pop r7 c530: 6f 90 pop r6 c532: 5f 90 pop r5 c534: 4f 90 pop r4 c536: 3f 90 pop r3 c538: 2f 90 pop r2 c53a: 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? c53c: f7 01 movw r30, r14 c53e: 80 81 ld r24, Z c540: 91 81 ldd r25, Z+1 ; 0x01 c542: a2 81 ldd r26, Z+2 ; 0x02 c544: b3 81 ldd r27, Z+3 ; 0x03 c546: ea 81 ldd r30, Y+2 ; 0x02 c548: fb 81 ldd r31, Y+3 ; 0x03 c54a: 80 83 st Z, r24 c54c: 91 83 std Z+1, r25 ; 0x01 c54e: a2 83 std Z+2, r26 ; 0x02 c550: b3 83 std Z+3, r27 ; 0x03 c552: b9 cf rjmp .-142 ; 0xc4c6 0000c554 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c554: 2f 92 push r2 c556: 3f 92 push r3 c558: 4f 92 push r4 c55a: 5f 92 push r5 c55c: 6f 92 push r6 c55e: 7f 92 push r7 c560: 8f 92 push r8 c562: 9f 92 push r9 c564: af 92 push r10 c566: bf 92 push r11 c568: cf 92 push r12 c56a: df 92 push r13 c56c: ef 92 push r14 c56e: ff 92 push r15 c570: 0f 93 push r16 c572: 1f 93 push r17 c574: cf 93 push r28 c576: df 93 push r29 c578: cd b7 in r28, 0x3d ; 61 c57a: de b7 in r29, 0x3e ; 62 c57c: 65 97 sbiw r28, 0x15 ; 21 c57e: 0f b6 in r0, 0x3f ; 63 c580: f8 94 cli c582: de bf out 0x3e, r29 ; 62 c584: 0f be out 0x3f, r0 ; 63 c586: cd bf out 0x3d, r28 ; 61 c588: 69 8b std Y+17, r22 ; 0x11 c58a: 7a 8b std Y+18, r23 ; 0x12 c58c: 8b 8b std Y+19, r24 ; 0x13 c58e: 9c 8b std Y+20, r25 ; 0x14 c590: 49 01 movw r8, r18 c592: 5a 01 movw r10, r20 c594: 30 2e mov r3, r16 c596: cd 8a std Y+21, r12 ; 0x15 c598: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c59a: 81 e0 ldi r24, 0x01 ; 1 c59c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c5a0: df 92 push r13 c5a2: 2d 89 ldd r18, Y+21 ; 0x15 c5a4: 2f 93 push r18 c5a6: 1f 92 push r1 c5a8: ef 92 push r14 c5aa: 89 ea ldi r24, 0xA9 ; 169 c5ac: 95 e6 ldi r25, 0x65 ; 101 c5ae: 9f 93 push r25 c5b0: 8f 93 push r24 c5b2: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c5b6: 81 e4 ldi r24, 0x41 ; 65 c5b8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba c5bc: 0f 90 pop r0 c5be: 0f 90 pop r0 c5c0: 0f 90 pop r0 c5c2: 0f 90 pop r0 c5c4: 0f 90 pop r0 c5c6: 0f 90 pop r0 c5c8: 88 23 and r24, r24 c5ca: a1 f0 breq .+40 ; 0xc5f4 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c5cc: 80 91 95 03 lds r24, 0x0395 ; 0x800395 c5d0: 90 91 96 03 lds r25, 0x0396 ; 0x800396 c5d4: fc 01 movw r30, r24 c5d6: 21 81 ldd r18, Z+1 ; 0x01 c5d8: 28 37 cpi r18, 0x78 ; 120 c5da: 09 f0 breq .+2 ; 0xc5de c5dc: 69 c0 rjmp .+210 ; 0xc6b0 c5de: 40 e1 ldi r20, 0x10 ; 16 c5e0: 50 e0 ldi r21, 0x00 ; 0 c5e2: 70 e0 ldi r23, 0x00 ; 0 c5e4: 60 e0 ldi r22, 0x00 ; 0 c5e6: 02 96 adiw r24, 0x02 ; 2 c5e8: 0f 94 ae d7 call 0x3af5c ; 0x3af5c c5ec: 69 8b std Y+17, r22 ; 0x11 c5ee: 7a 8b std Y+18, r23 ; 0x12 c5f0: 8b 8b std Y+19, r24 ; 0x13 c5f2: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c5f4: 83 e4 ldi r24, 0x43 ; 67 c5f6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba c5fa: 88 23 and r24, r24 c5fc: 09 f4 brne .+2 ; 0xc600 c5fe: 65 c0 rjmp .+202 ; 0xc6ca count = code_value_long(); c600: 0e 94 89 5b call 0xb712 ; 0xb712 c604: 2b 01 movw r4, r22 c606: 3c 01 movw r6, r24 c608: c9 88 ldd r12, Y+17 ; 0x11 c60a: da 88 ldd r13, Y+18 ; 0x12 c60c: eb 88 ldd r14, Y+19 ; 0x13 c60e: fc 88 ldd r15, Y+20 ; 0x14 c610: 8c 14 cp r8, r12 c612: 9d 04 cpc r9, r13 c614: ae 04 cpc r10, r14 c616: bf 04 cpc r11, r15 c618: 10 f4 brcc .+4 ; 0xc61e c61a: 75 01 movw r14, r10 c61c: 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) c61e: d3 01 movw r26, r6 c620: c2 01 movw r24, r4 c622: 8c 0d add r24, r12 c624: 9d 1d adc r25, r13 c626: ae 1d adc r26, r14 c628: bf 1d adc r27, r15 c62a: 88 16 cp r8, r24 c62c: 99 06 cpc r9, r25 c62e: aa 06 cpc r10, r26 c630: bb 06 cpc r11, r27 c632: 28 f0 brcs .+10 ; 0xc63e c634: 8c 15 cp r24, r12 c636: 9d 05 cpc r25, r13 c638: ae 05 cpc r26, r14 c63a: bf 05 cpc r27, r15 c63c: 30 f4 brcc .+12 ; 0xc64a count = addr_end - addr_start; c63e: 24 01 movw r4, r8 c640: 35 01 movw r6, r10 c642: 4c 18 sub r4, r12 c644: 5d 08 sbc r5, r13 c646: 6e 08 sbc r6, r14 c648: 7f 08 sbc r7, r15 if (code_seen('X')) c64a: 88 e5 ldi r24, 0x58 ; 88 c64c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba c650: 88 23 and r24, r24 c652: 09 f4 brne .+2 ; 0xc656 c654: 91 c0 rjmp .+290 ; 0xc778 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c656: 20 91 95 03 lds r18, 0x0395 ; 0x800395 c65a: 30 91 96 03 lds r19, 0x0396 ; 0x800396 c65e: 2f 5f subi r18, 0xFF ; 255 c660: 3f 4f sbci r19, 0xFF ; 255 c662: fe 01 movw r30, r28 c664: 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; c666: 10 e0 ldi r17, 0x00 ; 0 c668: 00 e0 ldi r16, 0x00 ; 0 c66a: 4f 01 movw r8, r30 c66c: d9 01 movw r26, r18 while (*hex) c66e: 8c 91 ld r24, X c670: 2f 5f subi r18, 0xFF ; 255 c672: 3f 4f sbci r19, 0xFF ; 255 c674: 88 23 and r24, r24 c676: 09 f4 brne .+2 ; 0xc67a c678: 3f c0 rjmp .+126 ; 0xc6f8 { if (count && (parsed >= count)) break; c67a: 00 31 cpi r16, 0x10 ; 16 c67c: 11 05 cpc r17, r1 c67e: e1 f1 breq .+120 ; 0xc6f8 char c = *(hex++); if (c == ' ') continue; c680: 80 32 cpi r24, 0x20 ; 32 c682: a1 f3 breq .-24 ; 0xc66c if (c == '\n') break; c684: 8a 30 cpi r24, 0x0A ; 10 c686: c1 f1 breq .+112 ; 0xc6f8 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c688: 90 ed ldi r25, 0xD0 ; 208 c68a: 98 0f add r25, r24 c68c: 9a 30 cpi r25, 0x0A ; 10 c68e: 10 f5 brcc .+68 ; 0xc6d4 c690: 82 95 swap r24 c692: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c694: 9d 01 movw r18, r26 c696: 2e 5f subi r18, 0xFE ; 254 c698: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c69a: 11 96 adiw r26, 0x01 ; 1 c69c: 9c 91 ld r25, X c69e: 40 ed ldi r20, 0xD0 ; 208 c6a0: 49 0f add r20, r25 c6a2: 4a 30 cpi r20, 0x0A ; 10 c6a4: f8 f4 brcc .+62 ; 0xc6e4 c6a6: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c6a8: 81 93 st Z+, r24 parsed++; c6aa: 0f 5f subi r16, 0xFF ; 255 c6ac: 1f 4f sbci r17, 0xFF ; 255 c6ae: de cf rjmp .-68 ; 0xc66c { 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(); c6b0: 0e 94 a4 60 call 0xc148 ; 0xc148 c6b4: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> c6b8: 9b 01 movw r18, r22 c6ba: 77 0f add r23, r23 c6bc: 44 0b sbc r20, r20 c6be: 55 0b sbc r21, r21 c6c0: 29 8b std Y+17, r18 ; 0x11 c6c2: 3a 8b std Y+18, r19 ; 0x12 c6c4: 4b 8b std Y+19, r20 ; 0x13 c6c6: 5c 8b std Y+20, r21 ; 0x14 c6c8: 95 cf rjmp .-214 ; 0xc5f4 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 c6ca: 44 24 eor r4, r4 c6cc: 4a 94 dec r4 c6ce: 54 2c mov r5, r4 c6d0: 32 01 movw r6, r4 c6d2: 9a cf rjmp .-204 ; 0xc608 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); c6d4: 9f e9 ldi r25, 0x9F ; 159 c6d6: 98 0f add r25, r24 c6d8: 96 30 cpi r25, 0x06 ; 6 c6da: 58 f4 brcc .+22 ; 0xc6f2 c6dc: 82 95 swap r24 c6de: 80 7f andi r24, 0xF0 ; 240 c6e0: 80 57 subi r24, 0x70 ; 112 c6e2: d8 cf rjmp .-80 ; 0xc694 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c6e4: 4f e9 ldi r20, 0x9F ; 159 c6e6: 49 0f add r20, r25 c6e8: 46 30 cpi r20, 0x06 ; 6 c6ea: 18 f4 brcc .+6 ; 0xc6f2 c6ec: 97 55 subi r25, 0x57 ; 87 c6ee: 89 2b or r24, r25 c6f0: db cf rjmp .-74 ; 0xc6a8 else return -parsed; c6f2: 11 95 neg r17 c6f4: 01 95 neg r16 c6f6: 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); c6f8: 28 01 movw r4, r16 c6fa: 01 2e mov r0, r17 c6fc: 00 0c add r0, r0 c6fe: 66 08 sbc r6, r6 c700: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c702: da 8a std Y+18, r13 ; 0x12 c704: 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++) c706: b1 2c mov r11, r1 c708: a1 2c mov r10, r1 c70a: 0a 15 cp r16, r10 c70c: 1b 05 cpc r17, r11 c70e: f1 f0 breq .+60 ; 0xc74c { switch (type) c710: 33 20 and r3, r3 c712: 39 f0 breq .+14 ; 0xc722 c714: 31 e0 ldi r19, 0x01 ; 1 c716: 33 16 cp r3, r19 c718: 71 f0 breq .+28 ; 0xc736 } // 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++) c71a: 4f ef ldi r20, 0xFF ; 255 c71c: a4 1a sub r10, r20 c71e: b4 0a sbc r11, r20 c720: f4 cf rjmp .-24 ; 0xc70a { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c722: f4 01 movw r30, r8 c724: ea 0d add r30, r10 c726: fb 1d adc r31, r11 c728: 80 81 ld r24, Z c72a: e9 89 ldd r30, Y+17 ; 0x11 c72c: fa 89 ldd r31, Y+18 ; 0x12 c72e: ea 0d add r30, r10 c730: fb 1d adc r31, r11 c732: 80 83 st Z, r24 c734: f2 cf rjmp .-28 ; 0xc71a case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c736: f4 01 movw r30, r8 c738: ea 0d add r30, r10 c73a: 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); c73c: 60 81 ld r22, Z c73e: 89 89 ldd r24, Y+17 ; 0x11 c740: 9a 89 ldd r25, Y+18 ; 0x12 c742: 8a 0d add r24, r10 c744: 9b 1d adc r25, r11 c746: 0f 94 6b dc call 0x3b8d6 ; 0x3b8d6 c74a: e7 cf rjmp .-50 ; 0xc71a { 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); c74c: ff 92 push r15 c74e: ef 92 push r14 c750: df 92 push r13 c752: cf 92 push r12 c754: 2f 92 push r2 c756: 5d 89 ldd r21, Y+21 ; 0x15 c758: 5f 93 push r21 c75a: 7f 92 push r7 c75c: 6f 92 push r6 c75e: 5f 92 push r5 c760: 4f 92 push r4 c762: 8d e7 ldi r24, 0x7D ; 125 c764: 95 e6 ldi r25, 0x65 ; 101 c766: 9f 93 push r25 c768: 8f 93 push r24 c76a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca c76e: 0f b6 in r0, 0x3f ; 63 c770: f8 94 cli c772: de bf out 0x3e, r29 ; 62 c774: 0f be out 0x3f, r0 ; 63 c776: 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); c778: 03 2d mov r16, r3 c77a: a3 01 movw r20, r6 c77c: 92 01 movw r18, r4 c77e: c7 01 movw r24, r14 c780: b6 01 movw r22, r12 c782: 0f 94 30 86 call 0x30c60 ; 0x30c60 } c786: 65 96 adiw r28, 0x15 ; 21 c788: 0f b6 in r0, 0x3f ; 63 c78a: f8 94 cli c78c: de bf out 0x3e, r29 ; 62 c78e: 0f be out 0x3f, r0 ; 63 c790: cd bf out 0x3d, r28 ; 61 c792: df 91 pop r29 c794: cf 91 pop r28 c796: 1f 91 pop r17 c798: 0f 91 pop r16 c79a: ff 90 pop r15 c79c: ef 90 pop r14 c79e: df 90 pop r13 c7a0: cf 90 pop r12 c7a2: bf 90 pop r11 c7a4: af 90 pop r10 c7a6: 9f 90 pop r9 c7a8: 8f 90 pop r8 c7aa: 7f 90 pop r7 c7ac: 6f 90 pop r6 c7ae: 5f 90 pop r5 c7b0: 4f 90 pop r4 c7b2: 3f 90 pop r3 c7b4: 2f 90 pop r2 c7b6: 08 95 ret 0000c7b8 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c7b8: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> c7bc: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> c7c0: 90 e0 ldi r25, 0x00 ; 0 c7c2: 8a 30 cpi r24, 0x0A ; 10 c7c4: 20 f0 brcs .+8 ; 0xc7ce c7c6: 89 5a subi r24, 0xA9 ; 169 c7c8: 9f 4f sbci r25, 0xFF ; 255 c7ca: 0d 94 8b da jmp 0x3b516 ; 0x3b516 c7ce: c0 96 adiw r24, 0x30 ; 48 c7d0: fc cf rjmp .-8 ; 0xc7ca 0000c7d2 : 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); c7d2: 84 ff sbrs r24, 4 c7d4: 18 c0 rjmp .+48 ; 0xc806 c7d6: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c7d8: 85 ff sbrs r24, 5 c7da: 17 c0 rjmp .+46 ; 0xc80a c7dc: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c7de: 2f b7 in r18, 0x3f ; 63 c7e0: 86 ff sbrs r24, 6 c7e2: 15 c0 rjmp .+42 ; 0xc80e c7e4: f8 94 cli c7e6: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c7ea: 90 68 ori r25, 0x80 ; 128 c7ec: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c7f0: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c7f2: 87 ff sbrs r24, 7 c7f4: 11 c0 rjmp .+34 ; 0xc818 c7f6: 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); c7f8: 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); c7fa: 85 e0 ldi r24, 0x05 ; 5 c7fc: 8a 95 dec r24 c7fe: f1 f7 brne .-4 ; 0xc7fc c800: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c802: 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(); } c804: 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); c806: 8d 98 cbi 0x11, 5 ; 17 c808: e7 cf rjmp .-50 ; 0xc7d8 WRITE(LCD_PINS_D5, value & 0x20); c80a: a4 98 cbi 0x14, 4 ; 20 c80c: e8 cf rjmp .-48 ; 0xc7de WRITE(LCD_PINS_D6, value & 0x40); c80e: f8 94 cli c810: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c814: 9f 77 andi r25, 0x7F ; 127 c816: ea cf rjmp .-44 ; 0xc7ec WRITE(LCD_PINS_D7, value & 0x80); c818: a3 98 cbi 0x14, 3 ; 20 c81a: ee cf rjmp .-36 ; 0xc7f8 0000c81c : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c81c: 0f 93 push r16 c81e: 1f 93 push r17 c820: cf 93 push r28 c822: df 93 push r29 c824: c8 2f mov r28, r24 c826: d6 2f mov r29, r22 c828: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c82a: 60 ff sbrs r22, 0 c82c: 15 c0 rjmp .+42 ; 0xc858 c82e: 5d 9a sbi 0x0b, 5 ; 11 c830: 8a e1 ldi r24, 0x1A ; 26 c832: 8a 95 dec r24 c834: f1 f7 brne .-4 ; 0xc832 c836: 00 c0 rjmp .+0 ; 0xc838 _delay_us(5); lcd_writebits(data); c838: 8c 2f mov r24, r28 c83a: 0e 94 e9 63 call 0xc7d2 ; 0xc7d2 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c83e: d1 fd sbrc r29, 1 c840: 04 c0 rjmp .+8 ; 0xc84a // _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 c842: 8c 2f mov r24, r28 c844: 82 95 swap r24 c846: 0e 94 e9 63 call 0xc7d2 ; 0xc7d2 } #endif delayMicroseconds(duration); c84a: c8 01 movw r24, r16 } c84c: df 91 pop r29 c84e: cf 91 pop r28 c850: 1f 91 pop r17 c852: 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); c854: 0c 94 8a e8 jmp 0x1d114 ; 0x1d114 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); c858: 5d 98 cbi 0x0b, 5 ; 11 c85a: ea cf rjmp .-44 ; 0xc830 0000c85c : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c85c: cf 92 push r12 c85e: df 92 push r13 c860: ef 92 push r14 c862: ff 92 push r15 c864: cf 93 push r28 c866: df 93 push r29 c868: ec 01 movw r28, r24 c86a: 6a 01 movw r12, r20 c86c: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c86e: 0f 94 2b dc call 0x3b856 ; 0x3b856 c872: 6f 3f cpi r22, 0xFF ; 255 c874: 7f 4f sbci r23, 0xFF ; 255 c876: 8f 4f sbci r24, 0xFF ; 255 c878: 9f 4f sbci r25, 0xFF ; 255 c87a: 59 f4 brne .+22 ; 0xc892 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); c87c: b7 01 movw r22, r14 c87e: a6 01 movw r20, r12 c880: 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); } c882: df 91 pop r29 c884: cf 91 pop r28 c886: ff 90 pop r15 c888: ef 90 pop r14 c88a: df 90 pop r13 c88c: 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); c88e: 0d 94 79 dc jmp 0x3b8f2 ; 0x3b8f2 } 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); } c892: df 91 pop r29 c894: cf 91 pop r28 c896: ff 90 pop r15 c898: ef 90 pop r14 c89a: df 90 pop r13 c89c: cf 90 pop r12 c89e: 08 95 ret 0000c8a0 : /// 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)); c8a0: 80 e1 ldi r24, 0x10 ; 16 c8a2: e2 e9 ldi r30, 0x92 ; 146 c8a4: f6 e0 ldi r31, 0x06 ; 6 c8a6: a3 e7 ldi r26, 0x73 ; 115 c8a8: b2 e0 ldi r27, 0x02 ; 2 c8aa: 01 90 ld r0, Z+ c8ac: 0d 92 st X+, r0 c8ae: 8a 95 dec r24 c8b0: e1 f7 brne .-8 ; 0xc8aa saved_feedmultiply2 = feedmultiply; //save feedmultiply c8b2: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c8b6: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c8ba: 90 93 72 03 sts 0x0372, r25 ; 0x800372 c8be: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c8c2: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 c8c6: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 c8ca: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad c8ce: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_bed_temperature = (uint8_t)degTargetBed(); c8d2: 80 91 72 06 lds r24, 0x0672 ; 0x800672 c8d6: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c8da: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 c8de: 83 fb bst r24, 3 c8e0: 88 27 eor r24, r24 c8e2: 80 f9 bld r24, 0 c8e4: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; c8e8: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 c8ec: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab isPartialBackupAvailable = true; c8f0: 81 e0 ldi r24, 0x01 ; 1 c8f2: 80 93 a2 06 sts 0x06A2, r24 ; 0x8006a2 } c8f6: 08 95 ret 0000c8f8 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c8f8: cf 93 push r28 c8fa: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c8fc: 80 e2 ldi r24, 0x20 ; 32 c8fe: 97 e1 ldi r25, 0x17 ; 23 c900: 0e 94 38 77 call 0xee70 ; 0xee70 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c904: 8e e5 ldi r24, 0x5E ; 94 c906: 95 e1 ldi r25, 0x15 ; 21 c908: 89 2b or r24, r25 c90a: 51 f0 breq .+20 ; 0xc920 <_GLOBAL__sub_D_card+0x28> c90c: c0 e3 ldi r28, 0x30 ; 48 c90e: d6 e1 ldi r29, 0x16 ; 22 c910: a3 97 sbiw r28, 0x23 ; 35 c912: ce 01 movw r24, r28 c914: 0e 94 38 77 call 0xee70 ; 0xee70 c918: 85 e1 ldi r24, 0x15 ; 21 c91a: ce 35 cpi r28, 0x5E ; 94 c91c: d8 07 cpc r29, r24 c91e: c1 f7 brne .-16 ; 0xc910 <_GLOBAL__sub_D_card+0x18> c920: 8b e3 ldi r24, 0x3B ; 59 c922: 95 e1 ldi r25, 0x15 ; 21 c924: 0e 94 38 77 call 0xee70 ; 0xee70 c928: 86 e1 ldi r24, 0x16 ; 22 c92a: 95 e1 ldi r25, 0x15 ; 21 c92c: df 91 pop r29 c92e: cf 91 pop r28 c930: 0c 94 38 77 jmp 0xee70 ; 0xee70 0000c934 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c934: cf 93 push r28 c936: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c938: c2 e9 ldi r28, 0x92 ; 146 c93a: d6 e0 ldi r29, 0x06 ; 6 c93c: 20 e0 ldi r18, 0x00 ; 0 c93e: 30 e0 ldi r19, 0x00 ; 0 c940: 48 ec ldi r20, 0xC8 ; 200 c942: 51 e4 ldi r21, 0x41 ; 65 c944: 6c 85 ldd r22, Y+12 ; 0x0c c946: 7d 85 ldd r23, Y+13 ; 0x0d c948: 8e 85 ldd r24, Y+14 ; 0x0e c94a: 9f 85 ldd r25, Y+15 ; 0x0f c94c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> c950: 6c 87 std Y+12, r22 ; 0x0c c952: 7d 87 std Y+13, r23 ; 0x0d c954: 8e 87 std Y+14, r24 ; 0x0e c956: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c958: 63 e3 ldi r22, 0x33 ; 51 c95a: 73 e3 ldi r23, 0x33 ; 51 c95c: 83 e5 ldi r24, 0x53 ; 83 c95e: 90 e4 ldi r25, 0x40 ; 64 } c960: df 91 pop r29 c962: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c964: 0d 94 50 c0 jmp 0x380a0 ; 0x380a0 0000c968 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c968: 60 e0 ldi r22, 0x00 ; 0 c96a: 85 ea ldi r24, 0xA5 ; 165 c96c: 9f e0 ldi r25, 0x0F ; 15 c96e: 0f 94 47 dc call 0x3b88e ; 0x3b88e c972: 60 e0 ldi r22, 0x00 ; 0 c974: 8f e7 ldi r24, 0x7F ; 127 c976: 9c e0 ldi r25, 0x0C ; 12 c978: 0f 94 47 dc call 0x3b88e ; 0x3b88e // 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; c97c: 80 e0 ldi r24, 0x00 ; 0 c97e: 90 e0 ldi r25, 0x00 ; 0 c980: a0 e8 ldi r26, 0x80 ; 128 c982: bf eb ldi r27, 0xBF ; 191 c984: 80 93 83 02 sts 0x0283, r24 ; 0x800283 c988: 90 93 84 02 sts 0x0284, r25 ; 0x800284 c98c: a0 93 85 02 sts 0x0285, r26 ; 0x800285 c990: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c994: 82 e0 ldi r24, 0x02 ; 2 c996: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; c99a: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 } c99e: 08 95 ret 0000c9a0 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c9a0: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac c9a4: 90 91 ad 05 lds r25, 0x05AD ; 0x8005ad c9a8: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 c9ac: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 c9b0: 28 17 cp r18, r24 c9b2: 39 07 cpc r19, r25 c9b4: 71 f0 breq .+28 ; 0xc9d2 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c9b6: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 c9ba: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c9be: 81 e0 ldi r24, 0x01 ; 1 c9c0: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 wait_for_heater(_millis(), active_extruder); c9c4: 0f 94 53 29 call 0x252a6 ; 0x252a6 c9c8: 0f 94 e8 81 call 0x303d0 ; 0x303d0 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c9cc: 82 e0 ldi r24, 0x02 ; 2 c9ce: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 } } c9d2: 08 95 ret 0000c9d4 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c9d4: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 c9d8: 88 23 and r24, r24 c9da: 41 f0 breq .+16 ; 0xc9ec // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c9dc: 80 91 39 02 lds r24, 0x0239 ; 0x800239 c9e0: 90 91 3a 02 lds r25, 0x023A ; 0x80023a c9e4: 90 93 72 03 sts 0x0372, r25 ; 0x800372 c9e8: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } c9ec: 08 95 ret 0000c9ee : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) c9ee: 80 91 a1 05 lds r24, 0x05A1 ; 0x8005a1 c9f2: 90 91 a2 05 lds r25, 0x05A2 ; 0x8005a2 c9f6: 00 97 sbiw r24, 0x00 ; 0 c9f8: 29 f1 breq .+74 ; 0xca44 c9fa: 20 91 a8 0d lds r18, 0x0DA8 ; 0x800da8 c9fe: 21 11 cpse r18, r1 ca00: 21 c0 rjmp .+66 ; 0xca44 ca02: 20 91 a7 0d lds r18, 0x0DA7 ; 0x800da7 ca06: 21 11 cpse r18, r1 ca08: 1d c0 rjmp .+58 ; 0xca44 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); ca0a: fc 01 movw r30, r24 ca0c: e8 5a subi r30, 0xA8 ; 168 ca0e: ff 4f sbci r31, 0xFF ; 255 ca10: 20 e1 ldi r18, 0x10 ; 16 ca12: a3 e8 ldi r26, 0x83 ; 131 ca14: b2 e0 ldi r27, 0x02 ; 2 ca16: 01 90 ld r0, Z+ ca18: 0d 92 st X+, r0 ca1a: 2a 95 dec r18 ca1c: e1 f7 brne .-8 ; 0xca16 saved_feedrate2 = current_block->gcode_feedrate; ca1e: fc 01 movw r30, r24 ca20: e6 59 subi r30, 0x96 ; 150 ca22: ff 4f sbci r31, 0xFF ; 255 ca24: 20 81 ld r18, Z ca26: 31 81 ldd r19, Z+1 ; 0x01 ca28: 30 93 5f 05 sts 0x055F, r19 ; 0x80055f ca2c: 20 93 5e 05 sts 0x055E, r18 ; 0x80055e saved_segment_idx = current_block->segment_idx; ca30: 88 59 subi r24, 0x98 ; 152 ca32: 9f 4f sbci r25, 0xFF ; 255 ca34: fc 01 movw r30, r24 ca36: 80 81 ld r24, Z ca38: 91 81 ldd r25, Z+1 ; 0x01 ca3a: 90 93 6a 05 sts 0x056A, r25 ; 0x80056a ca3e: 80 93 69 05 sts 0x0569, r24 ; 0x800569 ca42: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; ca44: 80 e0 ldi r24, 0x00 ; 0 ca46: 90 e0 ldi r25, 0x00 ; 0 ca48: a0 e8 ldi r26, 0x80 ; 128 ca4a: bf eb ldi r27, 0xBF ; 191 ca4c: 80 93 83 02 sts 0x0283, r24 ; 0x800283 ca50: 90 93 84 02 sts 0x0284, r25 ; 0x800284 ca54: a0 93 85 02 sts 0x0285, r26 ; 0x800285 ca58: b0 93 86 02 sts 0x0286, r27 ; 0x800286 saved_feedrate2 = feedrate; ca5c: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 ca60: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 ca64: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba ca68: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb ca6c: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> ca70: 70 93 5f 05 sts 0x055F, r23 ; 0x80055f ca74: 60 93 5e 05 sts 0x055E, r22 ; 0x80055e saved_segment_idx = 0; ca78: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a ca7c: 10 92 69 05 sts 0x0569, r1 ; 0x800569 } } ca80: 08 95 ret 0000ca82 : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { ca82: cf 92 push r12 ca84: df 92 push r13 ca86: ef 92 push r14 ca88: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { ca8a: 80 91 90 14 lds r24, 0x1490 ; 0x801490 ca8e: 88 23 and r24, r24 ca90: d9 f1 breq .+118 ; 0xcb08 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue ca92: 80 91 82 03 lds r24, 0x0382 ; 0x800382 ca96: 90 91 83 03 lds r25, 0x0383 ; 0x800383 ca9a: a0 91 84 03 lds r26, 0x0384 ; 0x800384 ca9e: b0 91 85 03 lds r27, 0x0385 ; 0x800385 caa2: 80 93 60 05 sts 0x0560, r24 ; 0x800560 caa6: 90 93 61 05 sts 0x0561, r25 ; 0x800561 caaa: a0 93 62 05 sts 0x0562, r26 ; 0x800562 caae: b0 93 63 05 sts 0x0563, r27 ; 0x800563 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cab2: 0f 94 36 63 call 0x2c66c ; 0x2c66c saved_sdpos -= sdlen_planner; cab6: c0 90 60 05 lds r12, 0x0560 ; 0x800560 caba: d0 90 61 05 lds r13, 0x0561 ; 0x800561 cabe: e0 90 62 05 lds r14, 0x0562 ; 0x800562 cac2: f0 90 63 05 lds r15, 0x0563 ; 0x800563 cac6: c8 1a sub r12, r24 cac8: d9 0a sbc r13, r25 caca: e1 08 sbc r14, r1 cacc: f1 08 sbc r15, r1 cace: c0 92 60 05 sts 0x0560, r12 ; 0x800560 cad2: d0 92 61 05 sts 0x0561, r13 ; 0x800561 cad6: e0 92 62 05 sts 0x0562, r14 ; 0x800562 cada: f0 92 63 05 sts 0x0563, r15 ; 0x800563 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cade: 0e 94 1a 5b call 0xb634 ; 0xb634 saved_sdpos -= sdlen_cmdqueue; cae2: c8 1a sub r12, r24 cae4: d9 0a sbc r13, r25 cae6: e1 08 sbc r14, r1 cae8: f1 08 sbc r15, r1 caea: c0 92 60 05 sts 0x0560, r12 ; 0x800560 caee: d0 92 61 05 sts 0x0561, r13 ; 0x800561 caf2: e0 92 62 05 sts 0x0562, r14 ; 0x800562 caf6: f0 92 63 05 sts 0x0563, r15 ; 0x800563 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cafa: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cafe: ff 90 pop r15 cb00: ef 90 pop r14 cb02: df 90 pop r13 cb04: cf 90 pop r12 cb06: 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 cb08: 80 91 0e 05 lds r24, 0x050E ; 0x80050e cb0c: 88 23 and r24, r24 cb0e: b1 f1 breq .+108 ; 0xcb7c saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cb10: 80 91 7a 03 lds r24, 0x037A ; 0x80037a cb14: 90 91 7b 03 lds r25, 0x037B ; 0x80037b cb18: a0 91 7c 03 lds r26, 0x037C ; 0x80037c cb1c: b0 91 7d 03 lds r27, 0x037D ; 0x80037d cb20: 80 93 60 05 sts 0x0560, r24 ; 0x800560 cb24: 90 93 61 05 sts 0x0561, r25 ; 0x800561 cb28: a0 93 62 05 sts 0x0562, r26 ; 0x800562 cb2c: 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 cb30: 0f 94 36 63 call 0x2c66c ; 0x2c66c saved_sdpos -= nlines; cb34: 40 91 60 05 lds r20, 0x0560 ; 0x800560 cb38: 50 91 61 05 lds r21, 0x0561 ; 0x800561 cb3c: 60 91 62 05 lds r22, 0x0562 ; 0x800562 cb40: 70 91 63 05 lds r23, 0x0563 ; 0x800563 cb44: 48 1b sub r20, r24 cb46: 51 09 sbc r21, r1 cb48: 61 09 sbc r22, r1 cb4a: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cb4c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 cb50: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 cb54: 09 2e mov r0, r25 cb56: 00 0c add r0, r0 cb58: aa 0b sbc r26, r26 cb5a: bb 0b sbc r27, r27 cb5c: 48 1b sub r20, r24 cb5e: 59 0b sbc r21, r25 cb60: 6a 0b sbc r22, r26 cb62: 7b 0b sbc r23, r27 cb64: 40 93 60 05 sts 0x0560, r20 ; 0x800560 cb68: 50 93 61 05 sts 0x0561, r21 ; 0x800561 cb6c: 60 93 62 05 sts 0x0562, r22 ; 0x800562 cb70: 70 93 63 05 sts 0x0563, r23 ; 0x800563 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; cb74: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cb76: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a cb7a: c1 cf rjmp .-126 ; 0xcafe cb7c: 82 e0 ldi r24, 0x02 ; 2 cb7e: fb cf rjmp .-10 ; 0xcb76 0000cb80 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { cb80: cf 92 push r12 cb82: df 92 push r13 cb84: ef 92 push r14 cb86: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cb88: c0 90 56 0e lds r12, 0x0E56 ; 0x800e56 cb8c: d0 90 57 0e lds r13, 0x0E57 ; 0x800e57 cb90: e0 90 58 0e lds r14, 0x0E58 ; 0x800e58 cb94: 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) { cb98: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 cb9c: 88 23 and r24, r24 cb9e: 09 f4 brne .+2 ; 0xcba2 cba0: 4e c0 rjmp .+156 ; 0xcc3e cba2: 20 e0 ldi r18, 0x00 ; 0 cba4: 30 e0 ldi r19, 0x00 ; 0 cba6: a9 01 movw r20, r18 cba8: c7 01 movw r24, r14 cbaa: b6 01 movw r22, r12 cbac: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> cbb0: 18 16 cp r1, r24 cbb2: 0c f0 brlt .+2 ; 0xcbb6 cbb4: 44 c0 rjmp .+136 ; 0xcc3e float area = M_PI * diameter * diameter * 0.25; cbb6: 2b ed ldi r18, 0xDB ; 219 cbb8: 3f e0 ldi r19, 0x0F ; 15 cbba: 49 e4 ldi r20, 0x49 ; 73 cbbc: 50 e4 ldi r21, 0x40 ; 64 cbbe: c7 01 movw r24, r14 cbc0: b6 01 movw r22, r12 cbc2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> cbc6: a7 01 movw r20, r14 cbc8: 96 01 movw r18, r12 cbca: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> cbce: 20 e0 ldi r18, 0x00 ; 0 cbd0: 30 e0 ldi r19, 0x00 ; 0 cbd2: 40 e8 ldi r20, 0x80 ; 128 cbd4: 5e e3 ldi r21, 0x3E ; 62 cbd6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> cbda: 9b 01 movw r18, r22 cbdc: ac 01 movw r20, r24 out = 1.f / area; cbde: 60 e0 ldi r22, 0x00 ; 0 cbe0: 70 e0 ldi r23, 0x00 ; 0 cbe2: 80 e8 ldi r24, 0x80 ; 128 cbe4: 9f e3 ldi r25, 0x3F ; 63 cbe6: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> cbea: 6b 01 movw r12, r22 cbec: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cbee: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc cbf2: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd cbf6: 64 36 cpi r22, 0x64 ; 100 cbf8: 71 05 cpc r23, r1 cbfa: a1 f0 breq .+40 ; 0xcc24 out *= float(extrudemultiply) * 0.01f; cbfc: 07 2e mov r0, r23 cbfe: 00 0c add r0, r0 cc00: 88 0b sbc r24, r24 cc02: 99 0b sbc r25, r25 cc04: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> cc08: 2a e0 ldi r18, 0x0A ; 10 cc0a: 37 ed ldi r19, 0xD7 ; 215 cc0c: 43 e2 ldi r20, 0x23 ; 35 cc0e: 5c e3 ldi r21, 0x3C ; 60 cc10: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> cc14: 9b 01 movw r18, r22 cc16: ac 01 movw r20, r24 cc18: c7 01 movw r24, r14 cc1a: b6 01 movw r22, r12 cc1c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> cc20: 6b 01 movw r12, r22 cc22: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cc24: c0 92 93 02 sts 0x0293, r12 ; 0x800293 cc28: d0 92 94 02 sts 0x0294, r13 ; 0x800294 cc2c: e0 92 95 02 sts 0x0295, r14 ; 0x800295 cc30: 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 } cc34: ff 90 pop r15 cc36: ef 90 pop r14 cc38: df 90 pop r13 cc3a: cf 90 pop r12 cc3c: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cc3e: c1 2c mov r12, r1 cc40: d1 2c mov r13, r1 cc42: 80 e8 ldi r24, 0x80 ; 128 cc44: e8 2e mov r14, r24 cc46: 8f e3 ldi r24, 0x3F ; 63 cc48: f8 2e mov r15, r24 cc4a: d1 cf rjmp .-94 ; 0xcbee 0000cc4c : } } #endif //FAST_PWM_FAN void save_statistics() { cc4c: 8f 92 push r8 cc4e: 9f 92 push r9 cc50: af 92 push r10 cc52: bf 92 push r11 cc54: cf 92 push r12 cc56: df 92 push r13 cc58: ef 92 push r14 cc5a: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter cc5c: 81 ef ldi r24, 0xF1 ; 241 cc5e: 9f e0 ldi r25, 0x0F ; 15 cc60: 0f 94 64 7a call 0x2f4c8 ; 0x2f4c8 cc64: 6b 01 movw r12, r22 cc66: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cc68: 8d ee ldi r24, 0xED ; 237 cc6a: 9f e0 ldi r25, 0x0F ; 15 cc6c: 0f 94 64 7a call 0x2f4c8 ; 0x2f4c8 cc70: 4b 01 movw r8, r22 cc72: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cc74: 0f 94 aa 3e call 0x27d54 ; 0x27d54 cc78: 2c e3 ldi r18, 0x3C ; 60 cc7a: 30 e0 ldi r19, 0x00 ; 0 cc7c: 40 e0 ldi r20, 0x00 ; 0 cc7e: 50 e0 ldi r21, 0x00 ; 0 cc80: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cc84: ba 01 movw r22, r20 cc86: a9 01 movw r20, r18 cc88: 48 0d add r20, r8 cc8a: 59 1d adc r21, r9 cc8c: 6a 1d adc r22, r10 cc8e: 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); cc90: 8d ee ldi r24, 0xED ; 237 cc92: 9f e0 ldi r25, 0x0F ; 15 cc94: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cc98: 60 91 65 06 lds r22, 0x0665 ; 0x800665 cc9c: 70 91 66 06 lds r23, 0x0666 ; 0x800666 cca0: 80 91 67 06 lds r24, 0x0667 ; 0x800667 cca4: 90 91 68 06 lds r25, 0x0668 ; 0x800668 cca8: 28 ee ldi r18, 0xE8 ; 232 ccaa: 33 e0 ldi r19, 0x03 ; 3 ccac: 40 e0 ldi r20, 0x00 ; 0 ccae: 50 e0 ldi r21, 0x00 ; 0 ccb0: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> ccb4: ba 01 movw r22, r20 ccb6: a9 01 movw r20, r18 ccb8: 4c 0d add r20, r12 ccba: 5d 1d adc r21, r13 ccbc: 6e 1d adc r22, r14 ccbe: 7f 1d adc r23, r15 ccc0: 81 ef ldi r24, 0xF1 ; 241 ccc2: 9f e0 ldi r25, 0x0F ; 15 ccc4: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 print_job_timer.reset(); ccc8: 0f 94 79 42 call 0x284f2 ; 0x284f2 total_filament_used = 0; cccc: 10 92 65 06 sts 0x0665, r1 ; 0x800665 ccd0: 10 92 66 06 sts 0x0666, r1 ; 0x800666 ccd4: 10 92 67 06 sts 0x0667, r1 ; 0x800667 ccd8: 10 92 68 06 sts 0x0668, r1 ; 0x800668 if (MMU2::mmu2.Enabled()) { ccdc: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba cce0: 81 30 cpi r24, 0x01 ; 1 cce2: 81 f4 brne .+32 ; 0xcd04 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); cce4: 60 91 be 13 lds r22, 0x13BE ; 0x8013be cce8: 70 91 bf 13 lds r23, 0x13BF ; 0x8013bf ccec: 90 e0 ldi r25, 0x00 ; 0 ccee: 80 e0 ldi r24, 0x00 ; 0 ccf0: 0f 94 4c 7a call 0x2f498 ; 0x2f498 /// @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; }; ccf4: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf ccf8: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } ccfc: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 cd00: 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 } } cd04: ff 90 pop r15 cd06: ef 90 pop r14 cd08: df 90 pop r13 cd0a: cf 90 pop r12 cd0c: bf 90 pop r11 cd0e: af 90 pop r10 cd10: 9f 90 pop r9 cd12: 8f 90 pop r8 cd14: 08 95 ret 0000cd16 : } #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); cd16: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 cd1a: 1f 92 push r1 cd1c: 8f 93 push r24 cd1e: 80 91 6b 03 lds r24, 0x036B ; 0x80036b cd22: 1f 92 push r1 cd24: 8f 93 push r24 cd26: e9 ec ldi r30, 0xC9 ; 201 cd28: f3 e0 ldi r31, 0x03 ; 3 cd2a: 42 81 ldd r20, Z+2 ; 0x02 cd2c: 53 81 ldd r21, Z+3 ; 0x03 cd2e: 2c e3 ldi r18, 0x3C ; 60 cd30: 24 9f mul r18, r20 cd32: c0 01 movw r24, r0 cd34: 25 9f mul r18, r21 cd36: 90 0d add r25, r0 cd38: 11 24 eor r1, r1 cd3a: 9f 93 push r25 cd3c: 8f 93 push r24 cd3e: 40 81 ld r20, Z cd40: 51 81 ldd r21, Z+1 ; 0x01 cd42: 24 9f mul r18, r20 cd44: c0 01 movw r24, r0 cd46: 25 9f mul r18, r21 cd48: 90 0d add r25, r0 cd4a: 11 24 eor r1, r1 cd4c: 9f 93 push r25 cd4e: 8f 93 push r24 cd50: 80 e4 ldi r24, 0x40 ; 64 cd52: 96 e6 ldi r25, 0x66 ; 102 cd54: 9f 93 push r25 cd56: 8f 93 push r24 cd58: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca cd5c: 8d b7 in r24, 0x3d ; 61 cd5e: 9e b7 in r25, 0x3e ; 62 cd60: 0a 96 adiw r24, 0x0a ; 10 cd62: 0f b6 in r0, 0x3f ; 63 cd64: f8 94 cli cd66: 9e bf out 0x3e, r25 ; 62 cd68: 0f be out 0x3f, r0 ; 63 cd6a: 8d bf out 0x3d, r24 ; 61 } cd6c: 08 95 ret 0000cd6e : // 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) { cd6e: cf 93 push r28 cd70: 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); cd72: 8f ef ldi r24, 0xFF ; 255 cd74: 9f e0 ldi r25, 0x0F ; 15 cd76: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cd7a: 81 30 cpi r24, 0x01 ; 1 cd7c: 21 f0 breq .+8 ; 0xcd86 cd7e: 80 91 8c 06 lds r24, 0x068C ; 0x80068c cd82: 81 30 cpi r24, 0x01 ; 1 cd84: 29 f4 brne .+10 ; 0xcd90 //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); cd86: 81 e0 ldi r24, 0x01 ; 1 cd88: 8c 27 eor r24, r28 } } cd8a: 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); cd8c: 0c 94 90 60 jmp 0xc120 ; 0xc120 } } cd90: cf 91 pop r28 cd92: 08 95 ret 0000cd94 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cd94: 86 e8 ldi r24, 0x86 ; 134 cd96: 93 e0 ldi r25, 0x03 ; 3 cd98: 0d 94 f6 2b jmp 0x257ec ; 0x257ec ::start()> 0000cd9c : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cd9c: 20 e0 ldi r18, 0x00 ; 0 cd9e: 30 e0 ldi r19, 0x00 ; 0 cda0: 40 e7 ldi r20, 0x70 ; 112 cda2: 52 e4 ldi r21, 0x42 ; 66 cda4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> } cda8: 08 95 ret 0000cdaa : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cdaa: 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; cdae: 40 91 66 03 lds r20, 0x0366 ; 0x800366 cdb2: 50 91 67 03 lds r21, 0x0367 ; 0x800367 cdb6: 60 91 68 03 lds r22, 0x0368 ; 0x800368 cdba: 70 91 69 03 lds r23, 0x0369 ; 0x800369 cdbe: 40 93 b8 02 sts 0x02B8, r20 ; 0x8002b8 cdc2: 50 93 b9 02 sts 0x02B9, r21 ; 0x8002b9 cdc6: 60 93 ba 02 sts 0x02BA, r22 ; 0x8002ba cdca: 70 93 bb 02 sts 0x02BB, r23 ; 0x8002bb feedmultiply = original_feedmultiply; cdce: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cdd2: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cdd6: 86 e8 ldi r24, 0x86 ; 134 cdd8: 93 e0 ldi r25, 0x03 ; 3 cdda: 0d 94 f6 2b jmp 0x257ec ; 0x257ec ::start()> 0000cdde : 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) { cdde: 1f 93 push r17 cde0: cf 93 push r28 cde2: df 93 push r29 cde4: 18 2f mov r17, r24 saved_feedrate = feedrate; cde6: 80 91 b8 02 lds r24, 0x02B8 ; 0x8002b8 cdea: 90 91 b9 02 lds r25, 0x02B9 ; 0x8002b9 cdee: a0 91 ba 02 lds r26, 0x02BA ; 0x8002ba cdf2: b0 91 bb 02 lds r27, 0x02BB ; 0x8002bb cdf6: 80 93 66 03 sts 0x0366, r24 ; 0x800366 cdfa: 90 93 67 03 sts 0x0367, r25 ; 0x800367 cdfe: a0 93 68 03 sts 0x0368, r26 ; 0x800368 ce02: b0 93 69 03 sts 0x0369, r27 ; 0x800369 int l_feedmultiply = feedmultiply; ce06: c0 91 39 02 lds r28, 0x0239 ; 0x800239 ce0a: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; ce0e: 84 e6 ldi r24, 0x64 ; 100 ce10: 90 e0 ldi r25, 0x00 ; 0 ce12: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a ce16: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); ce1a: 86 e8 ldi r24, 0x86 ; 134 ce1c: 93 e0 ldi r25, 0x03 ; 3 ce1e: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> ce22: 10 93 b7 02 sts 0x02B7, r17 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(enable_endstops_now); return l_feedmultiply; } ce26: ce 01 movw r24, r28 ce28: df 91 pop r29 ce2a: cf 91 pop r28 ce2c: 1f 91 pop r17 ce2e: 08 95 ret 0000ce30 : ce30: 40 e0 ldi r20, 0x00 ; 0 ce32: 50 e0 ldi r21, 0x00 ; 0 ce34: ba 01 movw r22, r20 ce36: 8d ee ldi r24, 0xED ; 237 ce38: 9f e0 ldi r25, 0x0F ; 15 ce3a: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 ce3e: 40 e0 ldi r20, 0x00 ; 0 ce40: 50 e0 ldi r21, 0x00 ; 0 ce42: ba 01 movw r22, r20 ce44: 81 ef ldi r24, 0xF1 ; 241 ce46: 9f e0 ldi r25, 0x0F ; 15 ce48: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 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(); ce4c: 0e 94 2b 5c call 0xb856 ; 0xb856 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); ce50: 70 e0 ldi r23, 0x00 ; 0 ce52: 60 e0 ldi r22, 0x00 ; 0 ce54: 85 e0 ldi r24, 0x05 ; 5 ce56: 9f e0 ldi r25, 0x0F ; 15 ce58: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca ce5c: 70 e0 ldi r23, 0x00 ; 0 ce5e: 60 e0 ldi r22, 0x00 ; 0 ce60: 83 e0 ldi r24, 0x03 ; 3 ce62: 9f e0 ldi r25, 0x0F ; 15 ce64: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca ce68: 70 e0 ldi r23, 0x00 ; 0 ce6a: 60 e0 ldi r22, 0x00 ; 0 ce6c: 81 e0 ldi r24, 0x01 ; 1 ce6e: 9f e0 ldi r25, 0x0F ; 15 ce70: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca ce74: 70 e0 ldi r23, 0x00 ; 0 ce76: 60 e0 ldi r22, 0x00 ; 0 ce78: 8f ef ldi r24, 0xFF ; 255 ce7a: 9e e0 ldi r25, 0x0E ; 14 ce7c: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca ce80: 70 e0 ldi r23, 0x00 ; 0 ce82: 60 e0 ldi r22, 0x00 ; 0 ce84: 83 ed ldi r24, 0xD3 ; 211 ce86: 9e e0 ldi r25, 0x0E ; 14 ce88: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca ce8c: 70 e0 ldi r23, 0x00 ; 0 ce8e: 60 e0 ldi r22, 0x00 ; 0 ce90: 80 ed ldi r24, 0xD0 ; 208 ce92: 9e e0 ldi r25, 0x0E ; 14 ce94: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); ce98: 40 e0 ldi r20, 0x00 ; 0 ce9a: 50 e0 ldi r21, 0x00 ; 0 ce9c: ba 01 movw r22, r20 ce9e: 88 ea ldi r24, 0xA8 ; 168 cea0: 9c e0 ldi r25, 0x0C ; 12 cea2: 0d 94 59 dc jmp 0x3b8b2 ; 0x3b8b2 0000cea6 : wdt_disable(); } } void softReset(void) { cli(); cea6: 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" ); cea8: 88 e1 ldi r24, 0x18 ; 24 ceaa: 98 e0 ldi r25, 0x08 ; 8 ceac: 0f b6 in r0, 0x3f ; 63 ceae: f8 94 cli ceb0: a8 95 wdr ceb2: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> ceb6: 0f be out 0x3f, r0 ; 63 ceb8: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> cebc: ff cf rjmp .-2 ; 0xcebc 0000cebe : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { cebe: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); cec0: 9f b7 in r25, 0x3f ; 63 cec2: f8 94 cli cec4: e2 e0 ldi r30, 0x02 ; 2 cec6: f1 e0 ldi r31, 0x01 ; 1 cec8: 80 81 ld r24, Z ceca: 84 60 ori r24, 0x04 ; 4 cecc: 80 83 st Z, r24 cece: 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); ced0: 6c 2f mov r22, r28 ced2: 83 e0 ldi r24, 0x03 ; 3 ced4: 9d e0 ldi r25, 0x0D ; 13 ced6: 0f 94 47 dc call 0x3b88e ; 0x3b88e eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); ceda: 8c 2f mov r24, r28 cedc: 0e 94 c3 ed call 0x1db86 ; 0x1db86 #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); cee0: 0e 94 53 67 call 0xcea6 ; 0xcea6 0000cee4 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { cee4: 1f 92 push r1 cee6: 0f 92 push r0 cee8: 0f b6 in r0, 0x3f ; 63 ceea: 0f 92 push r0 ceec: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); ceee: 83 e0 ldi r24, 0x03 ; 3 cef0: 0e 94 5f 67 call 0xcebe ; 0xcebe 0000cef4 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { cef4: 1f 92 push r1 cef6: 0f 92 push r0 cef8: 0f b6 in r0, 0x3f ; 63 cefa: 0f 92 push r0 cefc: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); cefe: 82 e0 ldi r24, 0x02 ; 2 cf00: 0e 94 5f 67 call 0xcebe ; 0xcebe 0000cf04 : } #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); cf04: 85 ea ldi r24, 0xA5 ; 165 cf06: 9f e0 ldi r25, 0x0F ; 15 cf08: 0f 94 23 dc call 0x3b846 ; 0x3b846 cf0c: 91 e0 ldi r25, 0x01 ; 1 cf0e: 81 11 cpse r24, r1 cf10: 01 c0 rjmp .+2 ; 0xcf14 cf12: 90 e0 ldi r25, 0x00 ; 0 } cf14: 89 2f mov r24, r25 cf16: 08 95 ret 0000cf18 : 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(); cf18: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 cf1c: 81 11 cpse r24, r1 cf1e: 06 c0 rjmp .+12 ; 0xcf2c cf20: 81 e0 ldi r24, 0x01 ; 1 cf22: 90 91 9d 03 lds r25, 0x039D ; 0x80039d cf26: 92 30 cpi r25, 0x02 ; 2 cf28: 09 f0 breq .+2 ; 0xcf2c cf2a: 80 e0 ldi r24, 0x00 ; 0 } cf2c: 08 95 ret 0000cf2e : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); cf2e: 80 91 90 14 lds r24, 0x1490 ; 0x801490 cf32: 81 11 cpse r24, r1 cf34: 0a c0 rjmp .+20 ; 0xcf4a cf36: 80 91 0e 05 lds r24, 0x050E ; 0x80050e cf3a: 81 11 cpse r24, r1 cf3c: 06 c0 rjmp .+12 ; 0xcf4a cf3e: 81 e0 ldi r24, 0x01 ; 1 cf40: 90 91 9d 03 lds r25, 0x039D ; 0x80039d cf44: 91 30 cpi r25, 0x01 ; 1 cf46: 09 f0 breq .+2 ; 0xcf4a cf48: 80 e0 ldi r24, 0x00 ; 0 } cf4a: 08 95 ret 0000cf4c : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { cf4c: cf 93 push r28 cf4e: df 93 push r29 return ( !homing_flag cf50: c0 91 a7 0d lds r28, 0x0DA7 ; 0x800da7 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf54: c1 11 cpse r28, r1 cf56: 1f c0 rjmp .+62 ; 0xcf96 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag cf58: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 cf5c: 81 11 cpse r24, r1 cf5e: 1c c0 rjmp .+56 ; 0xcf98 && !printingIsPaused() cf60: 0e 94 8c 67 call 0xcf18 ; 0xcf18 cf64: 81 11 cpse r24, r1 cf66: 18 c0 rjmp .+48 ; 0xcf98 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cf68: d0 91 b4 0d lds r29, 0x0DB4 ; 0x800db4 cf6c: d4 30 cpi r29, 0x04 ; 4 cf6e: 61 f4 brne .+24 ; 0xcf88 cf70: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 cf74: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 cf78: 89 2b or r24, r25 cf7a: 91 f4 brne .+36 ; 0xcfa0 cf7c: 80 91 72 06 lds r24, 0x0672 ; 0x800672 cf80: 90 91 73 06 lds r25, 0x0673 ; 0x800673 cf84: 89 2b or r24, r25 cf86: 61 f4 brne .+24 ; 0xcfa0 || printJobOngoing() cf88: 0e 94 97 67 call 0xcf2e ; 0xcf2e cf8c: c8 2f mov r28, r24 cf8e: 81 11 cpse r24, r1 cf90: 03 c0 rjmp .+6 ; 0xcf98 || lcd_commands_type == LcdCommands::Idle cf92: c1 e0 ldi r28, 0x01 ; 1 cf94: 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) cf96: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } cf98: 8c 2f mov r24, r28 cf9a: df 91 pop r29 cf9c: cf 91 pop r28 cf9e: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cfa0: c1 e0 ldi r28, 0x01 ; 1 cfa2: fa cf rjmp .-12 ; 0xcf98 0000cfa4 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); cfa4: 0e 94 a6 67 call 0xcf4c ; 0xcf4c cfa8: 88 23 and r24, r24 cfaa: 89 f0 breq .+34 ; 0xcfce cfac: 20 e0 ldi r18, 0x00 ; 0 cfae: 30 e0 ldi r19, 0x00 ; 0 cfb0: 40 e0 ldi r20, 0x00 ; 0 cfb2: 50 e4 ldi r21, 0x40 ; 64 cfb4: 60 91 9a 06 lds r22, 0x069A ; 0x80069a cfb8: 70 91 9b 06 lds r23, 0x069B ; 0x80069b cfbc: 80 91 9c 06 lds r24, 0x069C ; 0x80069c cfc0: 90 91 9d 06 lds r25, 0x069D ; 0x80069d cfc4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> cfc8: 88 1f adc r24, r24 cfca: 88 27 eor r24, r24 cfcc: 88 1f adc r24, r24 } cfce: 08 95 ret 0000cfd0 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() cfd0: 0e 94 97 67 call 0xcf2e ; 0xcf2e || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; cfd4: 81 11 cpse r24, r1 cfd6: 18 c0 rjmp .+48 ; 0xd008 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() cfd8: 0e 94 8c 67 call 0xcf18 ; 0xcf18 cfdc: 81 11 cpse r24, r1 cfde: 14 c0 rjmp .+40 ; 0xd008 || saved_printing cfe0: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 cfe4: 81 11 cpse r24, r1 cfe6: 10 c0 rjmp .+32 ; 0xd008 || (lcd_commands_type != LcdCommands::Idle) cfe8: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 cfec: 81 11 cpse r24, r1 cfee: 0b c0 rjmp .+22 ; 0xd006 || MMU2::mmu2.MMU_PRINT_SAVED() cff0: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb cff4: 81 11 cpse r24, r1 cff6: 07 c0 rjmp .+14 ; 0xd006 || homing_flag cff8: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 cffc: 81 11 cpse r24, r1 cffe: 04 c0 rjmp .+8 ; 0xd008 || mesh_bed_leveling_flag; d000: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 d004: 08 95 ret d006: 81 e0 ldi r24, 0x01 ; 1 } d008: 08 95 ret 0000d00a : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d00a: fc 01 movw r30, r24 d00c: 20 81 ld r18, Z d00e: 21 11 cpse r18, r1 d010: 01 c0 rjmp .+2 ; 0xd014 d012: 66 95 lsr r22 d014: fc 01 movw r30, r24 d016: 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() } d018: 08 95 ret 0000d01a : 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) { d01a: fc 01 movw r30, r24 iRun = ir; d01c: 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); d01e: 21 e0 ldi r18, 0x01 ; 1 d020: 60 32 cpi r22, 0x20 ; 32 d022: 08 f0 brcs .+2 ; 0xd026 d024: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d026: 90 81 ld r25, Z d028: 29 17 cp r18, r25 d02a: 81 f0 breq .+32 ; 0xd04c d02c: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d02e: 99 23 and r25, r25 d030: 51 f0 breq .+20 ; 0xd046 // 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; d032: 90 e0 ldi r25, 0x00 ; 0 d034: 95 95 asr r25 d036: 87 95 ror r24 d038: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d03a: 70 e0 ldi r23, 0x00 ; 0 d03c: 75 95 asr r23 d03e: 67 95 ror r22 d040: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d042: 20 83 st Z, r18 d044: 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; d046: 88 0f add r24, r24 d048: 82 83 std Z+2, r24 ; 0x02 d04a: fb cf rjmp .-10 ; 0xd042 } // Update vSense vSense = newvSense; } else if (!vSense) { d04c: 21 11 cpse r18, r1 d04e: 04 c0 rjmp .+8 ; 0xd058 // 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; d050: 70 e0 ldi r23, 0x00 ; 0 d052: 75 95 asr r23 d054: 67 95 ror r22 d056: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d058: 08 95 ret 0000d05a : } #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; } d05a: 20 91 92 12 lds r18, 0x1292 ; 0x801292 d05e: 30 91 93 12 lds r19, 0x1293 ; 0x801293 d062: bc 01 movw r22, r24 d064: c9 01 movw r24, r18 d066: 88 55 subi r24, 0x58 ; 88 d068: 9f 4e sbci r25, 0xEF ; 239 d06a: 0f 94 2a da call 0x3b454 ; 0x3b454 d06e: 9c 01 movw r18, r24 d070: 90 93 96 03 sts 0x0396, r25 ; 0x800396 d074: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d078: 81 e0 ldi r24, 0x01 ; 1 d07a: 23 2b or r18, r19 d07c: 09 f4 brne .+2 ; 0xd080 d07e: 80 e0 ldi r24, 0x00 ; 0 d080: 08 95 ret 0000d082 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d082: 80 e1 ldi r24, 0x10 ; 16 d084: e2 e9 ldi r30, 0x92 ; 146 d086: f6 e0 ldi r31, 0x06 ; 6 d088: a4 e7 ldi r26, 0x74 ; 116 d08a: b6 e0 ldi r27, 0x06 ; 6 d08c: 01 90 ld r0, Z+ d08e: 0d 92 st X+, r0 d090: 8a 95 dec r24 d092: e1 f7 brne .-8 ; 0xd08c d094: 08 95 ret 0000d096 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d096: 4f 92 push r4 d098: 5f 92 push r5 d09a: 6f 92 push r6 d09c: 7f 92 push r7 d09e: 8f 92 push r8 d0a0: 9f 92 push r9 d0a2: af 92 push r10 d0a4: bf 92 push r11 d0a6: cf 92 push r12 d0a8: df 92 push r13 d0aa: ef 92 push r14 d0ac: ff 92 push r15 d0ae: 0f 93 push r16 d0b0: 1f 93 push r17 d0b2: cf 93 push r28 d0b4: df 93 push r29 d0b6: 00 d0 rcall .+0 ; 0xd0b8 d0b8: 00 d0 rcall .+0 ; 0xd0ba d0ba: 1f 92 push r1 d0bc: 1f 92 push r1 d0be: cd b7 in r28, 0x3d ; 61 d0c0: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d0c2: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 d0c6: 22 23 and r18, r18 d0c8: 09 f4 brne .+2 ; 0xd0cc d0ca: 73 c1 rjmp .+742 ; 0xd3b2 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d0cc: 20 91 e6 03 lds r18, 0x03E6 ; 0x8003e6 d0d0: 22 30 cpi r18, 0x02 ; 2 d0d2: 09 f4 brne .+2 ; 0xd0d6 d0d4: 6e c1 rjmp .+732 ; 0xd3b2 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d0d6: 20 91 e6 03 lds r18, 0x03E6 ; 0x8003e6 d0da: 21 30 cpi r18, 0x01 ; 1 d0dc: 11 f4 brne .+4 ; 0xd0e2 d0de: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 d0e2: 2b 01 movw r4, r22 d0e4: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d0e6: 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) d0ea: 10 91 ae 05 lds r17, 0x05AE ; 0x8005ae d0ee: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee d0f2: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef d0f6: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 d0fa: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 d0fe: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> d102: 61 17 cp r22, r17 d104: 31 f0 breq .+12 ; 0xd112 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d106: 81 2f mov r24, r17 d108: 90 e0 ldi r25, 0x00 ; 0 d10a: 90 93 73 06 sts 0x0673, r25 ; 0x800673 d10e: 80 93 72 06 sts 0x0672, r24 ; 0x800672 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d112: 0e 94 d0 64 call 0xc9a0 ; 0xc9a0 // Restore saved fan speed fanSpeed = saved_fan_speed; d116: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab d11a: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d11e: 90 91 e5 03 lds r25, 0x03E5 ; 0x8003e5 d122: 80 91 64 05 lds r24, 0x0564 ; 0x800564 d126: 81 95 neg r24 d128: 89 27 eor r24, r25 d12a: 88 70 andi r24, 0x08 ; 8 d12c: 89 27 eor r24, r25 d12e: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 float e = saved_pos[E_AXIS] - e_move; d132: a3 01 movw r20, r6 d134: 92 01 movw r18, r4 d136: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d13a: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d13e: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d142: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d146: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d14a: 6d 83 std Y+5, r22 ; 0x05 d14c: 7e 83 std Y+6, r23 ; 0x06 d14e: 8f 83 std Y+7, r24 ; 0x07 d150: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d152: ce 01 movw r24, r28 d154: 05 96 adiw r24, 0x05 ; 5 d156: 0f 94 c5 63 call 0x2c78a ; 0x2c78a #ifdef FANCHECK fans_check_enabled = false; d15a: 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) d15e: 20 e0 ldi r18, 0x00 ; 0 d160: 30 e0 ldi r19, 0x00 ; 0 d162: 40 e8 ldi r20, 0x80 ; 128 d164: 5f eb ldi r21, 0xBF ; 191 d166: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d16a: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d16e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d172: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d176: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> d17a: 81 11 cpse r24, r1 d17c: 20 c0 rjmp .+64 ; 0xd1be { saved_pos[X_AXIS] = current_position[X_AXIS]; d17e: 80 91 92 06 lds r24, 0x0692 ; 0x800692 d182: 90 91 93 06 lds r25, 0x0693 ; 0x800693 d186: a0 91 94 06 lds r26, 0x0694 ; 0x800694 d18a: b0 91 95 06 lds r27, 0x0695 ; 0x800695 d18e: 80 93 73 02 sts 0x0273, r24 ; 0x800273 d192: 90 93 74 02 sts 0x0274, r25 ; 0x800274 d196: a0 93 75 02 sts 0x0275, r26 ; 0x800275 d19a: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_pos[Y_AXIS] = current_position[Y_AXIS]; d19e: 80 91 96 06 lds r24, 0x0696 ; 0x800696 d1a2: 90 91 97 06 lds r25, 0x0697 ; 0x800697 d1a6: a0 91 98 06 lds r26, 0x0698 ; 0x800698 d1aa: b0 91 99 06 lds r27, 0x0699 ; 0x800699 d1ae: 80 93 77 02 sts 0x0277, r24 ; 0x800277 d1b2: 90 93 78 02 sts 0x0278, r25 ; 0x800278 d1b6: a0 93 79 02 sts 0x0279, r26 ; 0x800279 d1ba: 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); d1be: a3 01 movw r20, r6 d1c0: 92 01 movw r18, r4 d1c2: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d1c6: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d1ca: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d1ce: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d1d2: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d1d6: 69 83 std Y+1, r22 ; 0x01 d1d8: 7a 83 std Y+2, r23 ; 0x02 d1da: 8b 83 std Y+3, r24 ; 0x03 d1dc: 9c 83 std Y+4, r25 ; 0x04 d1de: e0 90 9a 06 lds r14, 0x069A ; 0x80069a d1e2: f0 90 9b 06 lds r15, 0x069B ; 0x80069b d1e6: 00 91 9c 06 lds r16, 0x069C ; 0x80069c d1ea: 10 91 9d 06 lds r17, 0x069D ; 0x80069d d1ee: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d1f2: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d1f6: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d1fa: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d1fe: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d202: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d206: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d20a: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d20e: 1f 92 push r1 d210: 1f 92 push r1 d212: 1f 92 push r1 d214: 1f 92 push r1 d216: e2 e6 ldi r30, 0x62 ; 98 d218: 8e 2e mov r8, r30 d21a: e7 e2 ldi r30, 0x27 ; 39 d21c: 9e 2e mov r9, r30 d21e: e6 e7 ldi r30, 0x76 ; 118 d220: ae 2e mov r10, r30 d222: e2 e4 ldi r30, 0x42 ; 66 d224: be 2e mov r11, r30 d226: fe 01 movw r30, r28 d228: 31 96 adiw r30, 0x01 ; 1 d22a: 6f 01 movw r12, r30 d22c: 0f 94 fb b0 call 0x361f6 ; 0x361f6 //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); d230: a3 01 movw r20, r6 d232: 92 01 movw r18, r4 d234: 60 91 7f 02 lds r22, 0x027F ; 0x80027f d238: 70 91 80 02 lds r23, 0x0280 ; 0x800280 d23c: 80 91 81 02 lds r24, 0x0281 ; 0x800281 d240: 90 91 82 02 lds r25, 0x0282 ; 0x800282 d244: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d248: 69 83 std Y+1, r22 ; 0x01 d24a: 7a 83 std Y+2, r23 ; 0x02 d24c: 8b 83 std Y+3, r24 ; 0x03 d24e: 9c 83 std Y+4, r25 ; 0x04 d250: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d254: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d258: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d25c: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d260: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d264: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d268: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d26c: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d270: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d274: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d278: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d27c: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d280: 1f 92 push r1 d282: 1f 92 push r1 d284: 1f 92 push r1 d286: 1f 92 push r1 d288: 0f 94 fb b0 call 0x361f6 ; 0x361f6 //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); d28c: e0 90 7b 02 lds r14, 0x027B ; 0x80027b d290: f0 90 7c 02 lds r15, 0x027C ; 0x80027c d294: 00 91 7d 02 lds r16, 0x027D ; 0x80027d d298: 10 91 7e 02 lds r17, 0x027E ; 0x80027e d29c: 20 91 77 02 lds r18, 0x0277 ; 0x800277 d2a0: 30 91 78 02 lds r19, 0x0278 ; 0x800278 d2a4: 40 91 79 02 lds r20, 0x0279 ; 0x800279 d2a8: 50 91 7a 02 lds r21, 0x027A ; 0x80027a d2ac: 60 91 73 02 lds r22, 0x0273 ; 0x800273 d2b0: 70 91 74 02 lds r23, 0x0274 ; 0x800274 d2b4: 80 91 75 02 lds r24, 0x0275 ; 0x800275 d2b8: 90 91 76 02 lds r25, 0x0276 ; 0x800276 d2bc: 1f 92 push r1 d2be: 1f 92 push r1 d2c0: 1f 92 push r1 d2c2: 1f 92 push r1 d2c4: 81 2c mov r8, r1 d2c6: 91 2c mov r9, r1 d2c8: f8 ee ldi r31, 0xE8 ; 232 d2ca: af 2e mov r10, r31 d2cc: f2 e4 ldi r31, 0x42 ; 66 d2ce: bf 2e mov r11, r31 d2d0: af e7 ldi r26, 0x7F ; 127 d2d2: ca 2e mov r12, r26 d2d4: a2 e0 ldi r26, 0x02 ; 2 d2d6: da 2e mov r13, r26 d2d8: 0f 94 fb b0 call 0x361f6 ; 0x361f6 st_synchronize(); d2dc: 0f 94 ef 42 call 0x285de ; 0x285de #ifdef FANCHECK fans_check_enabled = true; d2e0: 11 e0 ldi r17, 0x01 ; 1 d2e2: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d2e6: 60 91 5e 05 lds r22, 0x055E ; 0x80055e d2ea: 70 91 5f 05 lds r23, 0x055F ; 0x80055f d2ee: 90 e0 ldi r25, 0x00 ; 0 d2f0: 80 e0 ldi r24, 0x00 ; 0 d2f2: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> d2f6: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 d2fa: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 d2fe: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba d302: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb feedmultiply = saved_feedmultiply2; d306: 80 91 71 03 lds r24, 0x0371 ; 0x800371 d30a: 90 91 72 03 lds r25, 0x0372 ; 0x800372 d30e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d312: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d316: 80 e1 ldi r24, 0x10 ; 16 d318: e3 e7 ldi r30, 0x73 ; 115 d31a: f2 e0 ldi r31, 0x02 ; 2 d31c: a2 e9 ldi r26, 0x92 ; 146 d31e: b6 e0 ldi r27, 0x06 ; 6 d320: 01 90 ld r0, Z+ d322: 0d 92 st X+, r0 d324: 8a 95 dec r24 d326: e1 f7 brne .-8 ; 0xd320 set_destination_to_current(); d328: 0e 94 41 68 call 0xd082 ; 0xd082 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d32c: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d330: 0f b6 in r0, 0x3f ; 63 d332: f8 94 cli d334: de bf out 0x3e, r29 ; 62 d336: 0f be out 0x3f, r0 ; 63 d338: cd bf out 0x3d, r28 ; 61 d33a: 81 11 cpse r24, r1 d33c: 51 c0 rjmp .+162 ; 0xd3e0 card.setIndex(saved_sdpos); d33e: 60 91 60 05 lds r22, 0x0560 ; 0x800560 d342: 70 91 61 05 lds r23, 0x0561 ; 0x800561 d346: 80 91 62 05 lds r24, 0x0562 ; 0x800562 d34a: 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);}; d34e: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 d352: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 d356: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 d35a: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 d35e: 0f 94 a3 75 call 0x2eb46 ; 0x2eb46 sdpos_atomic = saved_sdpos; d362: 80 91 60 05 lds r24, 0x0560 ; 0x800560 d366: 90 91 61 05 lds r25, 0x0561 ; 0x800561 d36a: a0 91 62 05 lds r26, 0x0562 ; 0x800562 d36e: b0 91 63 05 lds r27, 0x0563 ; 0x800563 d372: 80 93 82 03 sts 0x0382, r24 ; 0x800382 d376: 90 93 83 03 sts 0x0383, r25 ; 0x800383 d37a: a0 93 84 03 sts 0x0384, r26 ; 0x800384 d37e: b0 93 85 03 sts 0x0385, r27 ; 0x800385 card.sdprinting = true; d382: 10 93 90 14 sts 0x1490, r17 ; 0x801490 d386: 60 e0 ldi r22, 0x00 ; 0 d388: 85 ea ldi r24, 0xA5 ; 165 d38a: 9f e0 ldi r25, 0x0F ; 15 d38c: 0f 94 47 dc call 0x3b88e ; 0x3b88e d390: 60 e0 ldi r22, 0x00 ; 0 d392: 8f e7 ldi r24, 0x7F ; 127 d394: 9c e0 ldi r25, 0x0C ; 12 d396: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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); d39a: 83 e7 ldi r24, 0x73 ; 115 d39c: 90 e7 ldi r25, 0x70 ; 112 d39e: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d3a2: 82 e0 ldi r24, 0x02 ; 2 d3a4: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d3a8: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 planner_aborted = true; // unroll the stack d3ac: 81 e0 ldi r24, 0x01 ; 1 d3ae: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } d3b2: 28 96 adiw r28, 0x08 ; 8 d3b4: 0f b6 in r0, 0x3f ; 63 d3b6: f8 94 cli d3b8: de bf out 0x3e, r29 ; 62 d3ba: 0f be out 0x3f, r0 ; 63 d3bc: cd bf out 0x3d, r28 ; 61 d3be: df 91 pop r29 d3c0: cf 91 pop r28 d3c2: 1f 91 pop r17 d3c4: 0f 91 pop r16 d3c6: ff 90 pop r15 d3c8: ef 90 pop r14 d3ca: df 90 pop r13 d3cc: cf 90 pop r12 d3ce: bf 90 pop r11 d3d0: af 90 pop r10 d3d2: 9f 90 pop r9 d3d4: 8f 90 pop r8 d3d6: 7f 90 pop r7 d3d8: 6f 90 pop r6 d3da: 5f 90 pop r5 d3dc: 4f 90 pop r4 d3de: 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 d3e0: 81 30 cpi r24, 0x01 ; 1 d3e2: 89 f6 brne .-94 ; 0xd386 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d3e4: 80 91 60 05 lds r24, 0x0560 ; 0x800560 d3e8: 90 91 61 05 lds r25, 0x0561 ; 0x800561 d3ec: a0 91 62 05 lds r26, 0x0562 ; 0x800562 d3f0: b0 91 63 05 lds r27, 0x0563 ; 0x800563 d3f4: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a d3f8: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b d3fc: a0 93 7c 03 sts 0x037C, r26 ; 0x80037c d400: b0 93 7d 03 sts 0x037D, r27 ; 0x80037d serial_count = 0; d404: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f d408: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e FlushSerialRequestResend(); d40c: 0e 94 94 5b call 0xb728 ; 0xb728 d410: ba cf rjmp .-140 ; 0xd386 0000d412 : 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) { d412: 3f 92 push r3 d414: 4f 92 push r4 d416: 5f 92 push r5 d418: 6f 92 push r6 d41a: 7f 92 push r7 d41c: 8f 92 push r8 d41e: 9f 92 push r9 d420: af 92 push r10 d422: bf 92 push r11 d424: cf 92 push r12 d426: df 92 push r13 d428: ef 92 push r14 d42a: ff 92 push r15 d42c: 0f 93 push r16 d42e: 1f 93 push r17 d430: cf 93 push r28 d432: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d434: 30 90 0f 18 lds r3, 0x180F ; 0x80180f d438: 33 20 and r3, r3 d43a: 09 f4 brne .+2 ; 0xd43e d43c: 80 c0 rjmp .+256 ; 0xd53e d43e: 8b 01 movw r16, r22 d440: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d442: 31 fe sbrs r3, 1 d444: 54 c0 rjmp .+168 ; 0xd4ee // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d446: 88 80 ld r8, Y d448: 99 80 ldd r9, Y+1 ; 0x01 d44a: aa 80 ldd r10, Y+2 ; 0x02 d44c: bb 80 ldd r11, Y+3 ; 0x03 d44e: fb 01 movw r30, r22 d450: c0 80 ld r12, Z d452: d1 80 ldd r13, Z+1 ; 0x01 d454: e2 80 ldd r14, Z+2 ; 0x02 d456: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d458: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d45c: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d460: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d464: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d468: c5 01 movw r24, r10 d46a: b4 01 movw r22, r8 d46c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d470: 2b 01 movw r4, r22 d472: 3c 01 movw r6, r24 d474: 20 91 e8 17 lds r18, 0x17E8 ; 0x8017e8 d478: 30 91 e9 17 lds r19, 0x17E9 ; 0x8017e9 d47c: 40 91 ea 17 lds r20, 0x17EA ; 0x8017ea d480: 50 91 eb 17 lds r21, 0x17EB ; 0x8017eb d484: c7 01 movw r24, r14 d486: b6 01 movw r22, r12 d488: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d48c: 9b 01 movw r18, r22 d48e: ac 01 movw r20, r24 d490: c3 01 movw r24, r6 d492: b2 01 movw r22, r4 d494: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> d498: 2b 01 movw r4, r22 d49a: 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; d49c: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc d4a0: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd d4a4: 40 91 de 17 lds r20, 0x17DE ; 0x8017de d4a8: 50 91 df 17 lds r21, 0x17DF ; 0x8017df d4ac: c5 01 movw r24, r10 d4ae: b4 01 movw r22, r8 d4b0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d4b4: 4b 01 movw r8, r22 d4b6: 5c 01 movw r10, r24 d4b8: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d4bc: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d4c0: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d4c4: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d4c8: c7 01 movw r24, r14 d4ca: b6 01 movw r22, r12 d4cc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d4d0: 9b 01 movw r18, r22 d4d2: ac 01 movw r20, r24 d4d4: c5 01 movw r24, r10 d4d6: b4 01 movw r22, r8 d4d8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d4dc: 68 83 st Y, r22 d4de: 79 83 std Y+1, r23 ; 0x01 d4e0: 8a 83 std Y+2, r24 ; 0x02 d4e2: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d4e4: f8 01 movw r30, r16 d4e6: 40 82 st Z, r4 d4e8: 51 82 std Z+1, r5 ; 0x01 d4ea: 62 82 std Z+2, r6 ; 0x02 d4ec: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d4ee: 30 fe sbrs r3, 0 d4f0: 26 c0 rjmp .+76 ; 0xd53e // Then add the offset. x += world2machine_shift[0]; d4f2: 20 91 07 18 lds r18, 0x1807 ; 0x801807 d4f6: 30 91 08 18 lds r19, 0x1808 ; 0x801808 d4fa: 40 91 09 18 lds r20, 0x1809 ; 0x801809 d4fe: 50 91 0a 18 lds r21, 0x180A ; 0x80180a d502: 68 81 ld r22, Y d504: 79 81 ldd r23, Y+1 ; 0x01 d506: 8a 81 ldd r24, Y+2 ; 0x02 d508: 9b 81 ldd r25, Y+3 ; 0x03 d50a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> d50e: 68 83 st Y, r22 d510: 79 83 std Y+1, r23 ; 0x01 d512: 8a 83 std Y+2, r24 ; 0x02 d514: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d516: 20 91 0b 18 lds r18, 0x180B ; 0x80180b d51a: 30 91 0c 18 lds r19, 0x180C ; 0x80180c d51e: 40 91 0d 18 lds r20, 0x180D ; 0x80180d d522: 50 91 0e 18 lds r21, 0x180E ; 0x80180e d526: f8 01 movw r30, r16 d528: 60 81 ld r22, Z d52a: 71 81 ldd r23, Z+1 ; 0x01 d52c: 82 81 ldd r24, Z+2 ; 0x02 d52e: 93 81 ldd r25, Z+3 ; 0x03 d530: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> d534: f8 01 movw r30, r16 d536: 60 83 st Z, r22 d538: 71 83 std Z+1, r23 ; 0x01 d53a: 82 83 std Z+2, r24 ; 0x02 d53c: 93 83 std Z+3, r25 ; 0x03 } } } d53e: df 91 pop r29 d540: cf 91 pop r28 d542: 1f 91 pop r17 d544: 0f 91 pop r16 d546: ff 90 pop r15 d548: ef 90 pop r14 d54a: df 90 pop r13 d54c: cf 90 pop r12 d54e: bf 90 pop r11 d550: af 90 pop r10 d552: 9f 90 pop r9 d554: 8f 90 pop r8 d556: 7f 90 pop r7 d558: 6f 90 pop r6 d55a: 5f 90 pop r5 d55c: 4f 90 pop r4 d55e: 3f 90 pop r3 d560: 08 95 ret 0000d562 : } } } inline bool world2machine_clamp(float &x, float &y) { d562: 2f 92 push r2 d564: 3f 92 push r3 d566: 4f 92 push r4 d568: 5f 92 push r5 d56a: 6f 92 push r6 d56c: 7f 92 push r7 d56e: 8f 92 push r8 d570: 9f 92 push r9 d572: af 92 push r10 d574: bf 92 push r11 d576: cf 92 push r12 d578: df 92 push r13 d57a: ef 92 push r14 d57c: ff 92 push r15 d57e: 0f 93 push r16 d580: 1f 93 push r17 d582: cf 93 push r28 d584: df 93 push r29 d586: 00 d0 rcall .+0 ; 0xd588 d588: 00 d0 rcall .+0 ; 0xd58a d58a: 1f 92 push r1 d58c: 1f 92 push r1 d58e: cd b7 in r28, 0x3d ; 61 d590: de b7 in r29, 0x3e ; 62 d592: 8c 01 movw r16, r24 d594: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d596: fc 01 movw r30, r24 d598: 80 81 ld r24, Z d59a: 91 81 ldd r25, Z+1 ; 0x01 d59c: a2 81 ldd r26, Z+2 ; 0x02 d59e: b3 81 ldd r27, Z+3 ; 0x03 d5a0: 89 83 std Y+1, r24 ; 0x01 d5a2: 9a 83 std Y+2, r25 ; 0x02 d5a4: ab 83 std Y+3, r26 ; 0x03 d5a6: bc 83 std Y+4, r27 ; 0x04 out_y = y; d5a8: fb 01 movw r30, r22 d5aa: 80 81 ld r24, Z d5ac: 91 81 ldd r25, Z+1 ; 0x01 d5ae: a2 81 ldd r26, Z+2 ; 0x02 d5b0: b3 81 ldd r27, Z+3 ; 0x03 d5b2: 8d 83 std Y+5, r24 ; 0x05 d5b4: 9e 83 std Y+6, r25 ; 0x06 d5b6: af 83 std Y+7, r26 ; 0x07 d5b8: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d5ba: be 01 movw r22, r28 d5bc: 6b 5f subi r22, 0xFB ; 251 d5be: 7f 4f sbci r23, 0xFF ; 255 d5c0: ce 01 movw r24, r28 d5c2: 01 96 adiw r24, 0x01 ; 1 d5c4: 0e 94 09 6a call 0xd412 ; 0xd412 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d5c8: c9 80 ldd r12, Y+1 ; 0x01 d5ca: da 80 ldd r13, Y+2 ; 0x02 d5cc: eb 80 ldd r14, Y+3 ; 0x03 d5ce: fc 80 ldd r15, Y+4 ; 0x04 d5d0: 20 e0 ldi r18, 0x00 ; 0 d5d2: 30 e0 ldi r19, 0x00 ; 0 d5d4: a9 01 movw r20, r18 d5d6: c7 01 movw r24, r14 d5d8: b6 01 movw r22, r12 d5da: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> d5de: 87 ff sbrs r24, 7 d5e0: 35 c0 rjmp .+106 ; 0xd64c tmpx = X_MIN_POS; d5e2: 19 82 std Y+1, r1 ; 0x01 d5e4: 1a 82 std Y+2, r1 ; 0x02 d5e6: 1b 82 std Y+3, r1 ; 0x03 d5e8: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d5ea: ff 24 eor r15, r15 d5ec: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d5ee: 8d 80 ldd r8, Y+5 ; 0x05 d5f0: 9e 80 ldd r9, Y+6 ; 0x06 d5f2: af 80 ldd r10, Y+7 ; 0x07 d5f4: b8 84 ldd r11, Y+8 ; 0x08 d5f6: 20 e0 ldi r18, 0x00 ; 0 d5f8: 30 e0 ldi r19, 0x00 ; 0 d5fa: 40 e8 ldi r20, 0x80 ; 128 d5fc: 50 ec ldi r21, 0xC0 ; 192 d5fe: c5 01 movw r24, r10 d600: b4 01 movw r22, r8 d602: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> d606: 87 ff sbrs r24, 7 d608: 35 c0 rjmp .+106 ; 0xd674 tmpy = Y_MIN_POS; d60a: 80 e0 ldi r24, 0x00 ; 0 d60c: 90 e0 ldi r25, 0x00 ; 0 d60e: a0 e8 ldi r26, 0x80 ; 128 d610: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d612: 8d 83 std Y+5, r24 ; 0x05 d614: 9e 83 std Y+6, r25 ; 0x06 d616: af 83 std Y+7, r26 ; 0x07 d618: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d61a: cd 80 ldd r12, Y+5 ; 0x05 d61c: de 80 ldd r13, Y+6 ; 0x06 d61e: ef 80 ldd r14, Y+7 ; 0x07 d620: f8 84 ldd r15, Y+8 ; 0x08 d622: 89 80 ldd r8, Y+1 ; 0x01 d624: 9a 80 ldd r9, Y+2 ; 0x02 d626: ab 80 ldd r10, Y+3 ; 0x03 d628: 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) { d62a: 70 90 0f 18 lds r7, 0x180F ; 0x80180f d62e: 71 10 cpse r7, r1 d630: 4c c0 rjmp .+152 ; 0xd6ca // No correction. out_x = x; d632: f8 01 movw r30, r16 d634: 80 82 st Z, r8 d636: 91 82 std Z+1, r9 ; 0x01 d638: a2 82 std Z+2, r10 ; 0x02 d63a: b3 82 std Z+3, r11 ; 0x03 out_y = y; d63c: f1 01 movw r30, r2 d63e: c0 82 st Z, r12 d640: d1 82 std Z+1, r13 ; 0x01 d642: e2 82 std Z+2, r14 ; 0x02 d644: 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) { d646: ff 24 eor r15, r15 d648: f3 94 inc r15 d64a: 25 c0 rjmp .+74 ; 0xd696 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) { d64c: 20 e0 ldi r18, 0x00 ; 0 d64e: 30 e0 ldi r19, 0x00 ; 0 d650: 4f e7 ldi r20, 0x7F ; 127 d652: 53 e4 ldi r21, 0x43 ; 67 d654: c7 01 movw r24, r14 d656: b6 01 movw r22, r12 d658: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d65c: 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) { d65e: 18 16 cp r1, r24 d660: 34 f6 brge .-116 ; 0xd5ee tmpx = X_MAX_POS; d662: 80 e0 ldi r24, 0x00 ; 0 d664: 90 e0 ldi r25, 0x00 ; 0 d666: af e7 ldi r26, 0x7F ; 127 d668: b3 e4 ldi r27, 0x43 ; 67 d66a: 89 83 std Y+1, r24 ; 0x01 d66c: 9a 83 std Y+2, r25 ; 0x02 d66e: ab 83 std Y+3, r26 ; 0x03 d670: bc 83 std Y+4, r27 ; 0x04 d672: bb cf rjmp .-138 ; 0xd5ea } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d674: 20 e0 ldi r18, 0x00 ; 0 d676: 30 e8 ldi r19, 0x80 ; 128 d678: 44 e5 ldi r20, 0x54 ; 84 d67a: 53 e4 ldi r21, 0x43 ; 67 d67c: c5 01 movw r24, r10 d67e: b4 01 movw r22, r8 d680: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> d684: 18 16 cp r1, r24 d686: 2c f4 brge .+10 ; 0xd692 tmpy = Y_MAX_POS; d688: 80 e0 ldi r24, 0x00 ; 0 d68a: 90 e8 ldi r25, 0x80 ; 128 d68c: a4 e5 ldi r26, 0x54 ; 84 d68e: b3 e4 ldi r27, 0x43 ; 67 d690: c0 cf rjmp .-128 ; 0xd612 clamped = true; } if (clamped) d692: f1 10 cpse r15, r1 d694: c2 cf rjmp .-124 ; 0xd61a machine2world(tmpx, tmpy, x, y); return clamped; } d696: 8f 2d mov r24, r15 d698: 28 96 adiw r28, 0x08 ; 8 d69a: 0f b6 in r0, 0x3f ; 63 d69c: f8 94 cli d69e: de bf out 0x3e, r29 ; 62 d6a0: 0f be out 0x3f, r0 ; 63 d6a2: cd bf out 0x3d, r28 ; 61 d6a4: df 91 pop r29 d6a6: cf 91 pop r28 d6a8: 1f 91 pop r17 d6aa: 0f 91 pop r16 d6ac: ff 90 pop r15 d6ae: ef 90 pop r14 d6b0: df 90 pop r13 d6b2: cf 90 pop r12 d6b4: bf 90 pop r11 d6b6: af 90 pop r10 d6b8: 9f 90 pop r9 d6ba: 8f 90 pop r8 d6bc: 7f 90 pop r7 d6be: 6f 90 pop r6 d6c0: 5f 90 pop r5 d6c2: 4f 90 pop r4 d6c4: 3f 90 pop r3 d6c6: 2f 90 pop r2 d6c8: 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) { d6ca: 70 fe sbrs r7, 0 d6cc: 1c c0 rjmp .+56 ; 0xd706 // Then add the offset. x -= world2machine_shift[0]; d6ce: 20 91 07 18 lds r18, 0x1807 ; 0x801807 d6d2: 30 91 08 18 lds r19, 0x1808 ; 0x801808 d6d6: 40 91 09 18 lds r20, 0x1809 ; 0x801809 d6da: 50 91 0a 18 lds r21, 0x180A ; 0x80180a d6de: c5 01 movw r24, r10 d6e0: b4 01 movw r22, r8 d6e2: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d6e6: 4b 01 movw r8, r22 d6e8: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d6ea: 20 91 0b 18 lds r18, 0x180B ; 0x80180b d6ee: 30 91 0c 18 lds r19, 0x180C ; 0x80180c d6f2: 40 91 0d 18 lds r20, 0x180D ; 0x80180d d6f6: 50 91 0e 18 lds r21, 0x180E ; 0x80180e d6fa: c7 01 movw r24, r14 d6fc: b6 01 movw r22, r12 d6fe: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d702: 6b 01 movw r12, r22 d704: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d706: 71 fe sbrs r7, 1 d708: 9e cf rjmp .-196 ; 0xd646 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d70a: 20 91 f7 17 lds r18, 0x17F7 ; 0x8017f7 d70e: 30 91 f8 17 lds r19, 0x17F8 ; 0x8017f8 d712: 40 91 f9 17 lds r20, 0x17F9 ; 0x8017f9 d716: 50 91 fa 17 lds r21, 0x17FA ; 0x8017fa d71a: c5 01 movw r24, r10 d71c: b4 01 movw r22, r8 d71e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d722: 2b 01 movw r4, r22 d724: 3c 01 movw r6, r24 d726: 20 91 fb 17 lds r18, 0x17FB ; 0x8017fb d72a: 30 91 fc 17 lds r19, 0x17FC ; 0x8017fc d72e: 40 91 fd 17 lds r20, 0x17FD ; 0x8017fd d732: 50 91 fe 17 lds r21, 0x17FE ; 0x8017fe d736: c7 01 movw r24, r14 d738: b6 01 movw r22, r12 d73a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d73e: 9b 01 movw r18, r22 d740: ac 01 movw r20, r24 d742: c3 01 movw r24, r6 d744: b2 01 movw r22, r4 d746: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> d74a: f8 01 movw r30, r16 d74c: 60 83 st Z, r22 d74e: 71 83 std Z+1, r23 ; 0x01 d750: 82 83 std Z+2, r24 ; 0x02 d752: 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; d754: 20 91 ff 17 lds r18, 0x17FF ; 0x8017ff d758: 30 91 00 18 lds r19, 0x1800 ; 0x801800 d75c: 40 91 01 18 lds r20, 0x1801 ; 0x801801 d760: 50 91 02 18 lds r21, 0x1802 ; 0x801802 d764: c5 01 movw r24, r10 d766: b4 01 movw r22, r8 d768: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d76c: 4b 01 movw r8, r22 d76e: 5c 01 movw r10, r24 d770: 20 91 03 18 lds r18, 0x1803 ; 0x801803 d774: 30 91 04 18 lds r19, 0x1804 ; 0x801804 d778: 40 91 05 18 lds r20, 0x1805 ; 0x801805 d77c: 50 91 06 18 lds r21, 0x1806 ; 0x801806 d780: c7 01 movw r24, r14 d782: b6 01 movw r22, r12 d784: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d788: 9b 01 movw r18, r22 d78a: ac 01 movw r20, r24 d78c: c5 01 movw r24, r10 d78e: b4 01 movw r22, r8 d790: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> d794: f1 01 movw r30, r2 d796: 60 83 st Z, r22 d798: 71 83 std Z+1, r23 ; 0x01 d79a: 82 83 std Z+2, r24 ; 0x02 d79c: 93 83 std Z+3, r25 ; 0x03 d79e: 53 cf rjmp .-346 ; 0xd646 0000d7a0 : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d7a0: cf 92 push r12 d7a2: df 92 push r13 d7a4: ef 92 push r14 d7a6: ff 92 push r15 d7a8: cf 93 push r28 d7aa: df 93 push r29 d7ac: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d7ae: bc 01 movw r22, r24 d7b0: 6c 5f subi r22, 0xFC ; 252 d7b2: 7f 4f sbci r23, 0xFF ; 255 d7b4: 0e 94 b1 6a call 0xd562 ; 0xd562 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d7b8: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d7bc: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d7c0: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d7c4: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d7c8: a7 01 movw r20, r14 d7ca: 96 01 movw r18, r12 d7cc: 68 85 ldd r22, Y+8 ; 0x08 d7ce: 79 85 ldd r23, Y+9 ; 0x09 d7d0: 8a 85 ldd r24, Y+10 ; 0x0a d7d2: 9b 85 ldd r25, Y+11 ; 0x0b d7d4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> d7d8: 87 ff sbrs r24, 7 d7da: 04 c0 rjmp .+8 ; 0xd7e4 d7dc: c8 86 std Y+8, r12 ; 0x08 d7de: d9 86 std Y+9, r13 ; 0x09 d7e0: ea 86 std Y+10, r14 ; 0x0a d7e2: 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]; d7e4: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d7e8: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d7ec: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d7f0: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d7f4: a7 01 movw r20, r14 d7f6: 96 01 movw r18, r12 d7f8: 68 85 ldd r22, Y+8 ; 0x08 d7fa: 79 85 ldd r23, Y+9 ; 0x09 d7fc: 8a 85 ldd r24, Y+10 ; 0x0a d7fe: 9b 85 ldd r25, Y+11 ; 0x0b d800: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> d804: 18 16 cp r1, r24 d806: 24 f4 brge .+8 ; 0xd810 d808: c8 86 std Y+8, r12 ; 0x08 d80a: d9 86 std Y+9, r13 ; 0x09 d80c: ea 86 std Y+10, r14 ; 0x0a d80e: fb 86 std Y+11, r15 ; 0x0b } } d810: df 91 pop r29 d812: cf 91 pop r28 d814: ff 90 pop r15 d816: ef 90 pop r14 d818: df 90 pop r13 d81a: cf 90 pop r12 d81c: 08 95 ret 0000d81e : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d81e: 2f 92 push r2 d820: 3f 92 push r3 d822: 4f 92 push r4 d824: 5f 92 push r5 d826: 6f 92 push r6 d828: 7f 92 push r7 d82a: 8f 92 push r8 d82c: 9f 92 push r9 d82e: af 92 push r10 d830: bf 92 push r11 d832: cf 92 push r12 d834: df 92 push r13 d836: ef 92 push r14 d838: ff 92 push r15 d83a: 0f 93 push r16 d83c: 1f 93 push r17 d83e: cf 93 push r28 d840: df 93 push r29 d842: cd b7 in r28, 0x3d ; 61 d844: de b7 in r29, 0x3e ; 62 d846: a2 97 sbiw r28, 0x22 ; 34 d848: 0f b6 in r0, 0x3f ; 63 d84a: f8 94 cli d84c: de bf out 0x3e, r29 ; 62 d84e: 0f be out 0x3f, r0 ; 63 d850: cd bf out 0x3d, r28 ; 61 d852: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d854: 84 e7 ldi r24, 0x74 ; 116 d856: 96 e0 ldi r25, 0x06 ; 6 d858: 0e 94 d0 6b call 0xd7a0 ; 0xd7a0 previous_millis_cmd.start(); d85c: 86 e8 ldi r24, 0x86 ; 134 d85e: 93 e0 ldi r25, 0x03 ; 3 d860: 0f 94 f6 2b call 0x257ec ; 0x257ec ::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])) { d864: 40 90 92 06 lds r4, 0x0692 ; 0x800692 d868: 50 90 93 06 lds r5, 0x0693 ; 0x800693 d86c: 60 90 94 06 lds r6, 0x0694 ; 0x800694 d870: 70 90 95 06 lds r7, 0x0695 ; 0x800695 d874: c0 90 74 06 lds r12, 0x0674 ; 0x800674 d878: d0 90 75 06 lds r13, 0x0675 ; 0x800675 d87c: e0 90 76 06 lds r14, 0x0676 ; 0x800676 d880: f0 90 77 06 lds r15, 0x0677 ; 0x800677 d884: a7 01 movw r20, r14 d886: 96 01 movw r18, r12 d888: c3 01 movw r24, r6 d88a: b2 01 movw r22, r4 d88c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> d890: 81 11 cpse r24, r1 d892: 3f c0 rjmp .+126 ; 0xd912 d894: 20 91 78 06 lds r18, 0x0678 ; 0x800678 d898: 30 91 79 06 lds r19, 0x0679 ; 0x800679 d89c: 40 91 7a 06 lds r20, 0x067A ; 0x80067a d8a0: 50 91 7b 06 lds r21, 0x067B ; 0x80067b d8a4: 60 91 96 06 lds r22, 0x0696 ; 0x800696 d8a8: 70 91 97 06 lds r23, 0x0697 ; 0x800697 d8ac: 80 91 98 06 lds r24, 0x0698 ; 0x800698 d8b0: 90 91 99 06 lds r25, 0x0699 ; 0x800699 d8b4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> d8b8: 81 11 cpse r24, r1 d8ba: 2b c0 rjmp .+86 ; 0xd912 plan_buffer_line_destinationXYZE(feedrate/60); d8bc: 20 e0 ldi r18, 0x00 ; 0 d8be: 30 e0 ldi r19, 0x00 ; 0 d8c0: 40 e7 ldi r20, 0x70 ; 112 d8c2: 52 e4 ldi r21, 0x42 ; 66 d8c4: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 d8c8: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 d8cc: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba d8d0: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb d8d4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> d8d8: 0f 94 1d c0 call 0x3803a ; 0x3803a #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d8dc: 0e 94 06 5b call 0xb60c ; 0xb60c } d8e0: a2 96 adiw r28, 0x22 ; 34 d8e2: 0f b6 in r0, 0x3f ; 63 d8e4: f8 94 cli d8e6: de bf out 0x3e, r29 ; 62 d8e8: 0f be out 0x3f, r0 ; 63 d8ea: cd bf out 0x3d, r28 ; 61 d8ec: df 91 pop r29 d8ee: cf 91 pop r28 d8f0: 1f 91 pop r17 d8f2: 0f 91 pop r16 d8f4: ff 90 pop r15 d8f6: ef 90 pop r14 d8f8: df 90 pop r13 d8fa: cf 90 pop r12 d8fc: bf 90 pop r11 d8fe: af 90 pop r10 d900: 9f 90 pop r9 d902: 8f 90 pop r8 d904: 7f 90 pop r7 d906: 6f 90 pop r6 d908: 5f 90 pop r5 d90a: 4f 90 pop r4 d90c: 3f 90 pop r3 d90e: 2f 90 pop r2 d910: 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); d912: 60 91 39 02 lds r22, 0x0239 ; 0x800239 d916: 70 91 3a 02 lds r23, 0x023A ; 0x80023a d91a: 07 2e mov r0, r23 d91c: 00 0c add r0, r0 d91e: 88 0b sbc r24, r24 d920: 99 0b sbc r25, r25 d922: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> d926: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 d92a: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 d92e: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba d932: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb d936: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d93a: 2e e3 ldi r18, 0x3E ; 62 d93c: 33 ec ldi r19, 0xC3 ; 195 d93e: 4e e2 ldi r20, 0x2E ; 46 d940: 59 e3 ldi r21, 0x39 ; 57 d942: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> d946: 6f 83 std Y+7, r22 ; 0x07 d948: 78 87 std Y+8, r23 ; 0x08 d94a: 89 87 std Y+9, r24 ; 0x09 d94c: 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) { d94e: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 d952: 88 23 and r24, r24 d954: 09 f4 brne .+2 ; 0xd958 d956: 0f c1 rjmp .+542 ; 0xdb76 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]; d958: a3 01 movw r20, r6 d95a: 92 01 movw r18, r4 d95c: c7 01 movw r24, r14 d95e: b6 01 movw r22, r12 d960: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d964: 2b 01 movw r4, r22 d966: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d968: 20 91 96 06 lds r18, 0x0696 ; 0x800696 d96c: 30 91 97 06 lds r19, 0x0697 ; 0x800697 d970: 40 91 98 06 lds r20, 0x0698 ; 0x800698 d974: 50 91 99 06 lds r21, 0x0699 ; 0x800699 d978: 60 91 78 06 lds r22, 0x0678 ; 0x800678 d97c: 70 91 79 06 lds r23, 0x0679 ; 0x800679 d980: 80 91 7a 06 lds r24, 0x067A ; 0x80067a d984: 90 91 7b 06 lds r25, 0x067B ; 0x80067b d988: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> d98c: 6b 87 std Y+11, r22 ; 0x0b d98e: 7c 87 std Y+12, r23 ; 0x0c d990: 8d 87 std Y+13, r24 ; 0x0d d992: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d994: c3 01 movw r24, r6 d996: b2 01 movw r22, r4 d998: 9f 77 andi r25, 0x7F ; 127 d99a: 2b 85 ldd r18, Y+11 ; 0x0b d99c: 3c 85 ldd r19, Y+12 ; 0x0c d99e: 4d 85 ldd r20, Y+13 ; 0x0d d9a0: 5e 85 ldd r21, Y+14 ; 0x0e d9a2: 5f 77 andi r21, 0x7F ; 127 d9a4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> d9a8: 6b 01 movw r12, r22 d9aa: 7c 01 movw r14, r24 if (len > 0) d9ac: 20 e0 ldi r18, 0x00 ; 0 d9ae: 30 e0 ldi r19, 0x00 ; 0 d9b0: a9 01 movw r20, r18 d9b2: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> d9b6: 18 16 cp r1, r24 d9b8: 0c f0 brlt .+2 ; 0xd9bc d9ba: dd c0 rjmp .+442 ; 0xdb76 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d9bc: 20 e0 ldi r18, 0x00 ; 0 d9be: 30 e0 ldi r19, 0x00 ; 0 d9c0: 40 ef ldi r20, 0xF0 ; 240 d9c2: 51 e4 ldi r21, 0x41 ; 65 d9c4: c7 01 movw r24, r14 d9c6: b6 01 movw r22, r12 d9c8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> d9cc: 0f 94 29 de call 0x3bc52 ; 0x3bc52 d9d0: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> d9d4: 7e 83 std Y+6, r23 ; 0x06 d9d6: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d9d8: 62 30 cpi r22, 0x02 ; 2 d9da: 71 05 cpc r23, r1 d9dc: 08 f4 brcc .+2 ; 0xd9e0 d9de: cb c0 rjmp .+406 ; 0xdb76 d9e0: 21 14 cp r2, r1 d9e2: 31 04 cpc r3, r1 d9e4: 09 f4 brne .+2 ; 0xd9e8 d9e6: c7 c0 rjmp .+398 ; 0xdb76 float dz = z - current_position[Z_AXIS]; d9e8: 20 91 9a 06 lds r18, 0x069A ; 0x80069a d9ec: 30 91 9b 06 lds r19, 0x069B ; 0x80069b d9f0: 40 91 9c 06 lds r20, 0x069C ; 0x80069c d9f4: 50 91 9d 06 lds r21, 0x069D ; 0x80069d d9f8: 60 91 7c 06 lds r22, 0x067C ; 0x80067c d9fc: 70 91 7d 06 lds r23, 0x067D ; 0x80067d da00: 80 91 7e 06 lds r24, 0x067E ; 0x80067e da04: 90 91 7f 06 lds r25, 0x067F ; 0x80067f da08: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> da0c: 6f 87 std Y+15, r22 ; 0x0f da0e: 78 8b std Y+16, r23 ; 0x10 da10: 89 8b std Y+17, r24 ; 0x11 da12: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; da14: 20 91 9e 06 lds r18, 0x069E ; 0x80069e da18: 30 91 9f 06 lds r19, 0x069F ; 0x80069f da1c: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 da20: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 da24: 60 91 80 06 lds r22, 0x0680 ; 0x800680 da28: 70 91 81 06 lds r23, 0x0681 ; 0x800681 da2c: 80 91 82 06 lds r24, 0x0682 ; 0x800682 da30: 90 91 83 06 lds r25, 0x0683 ; 0x800683 da34: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> da38: 6b 8b std Y+19, r22 ; 0x13 da3a: 7c 8b std Y+20, r23 ; 0x14 da3c: 8d 8b std Y+21, r24 ; 0x15 da3e: 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); da40: ad 81 ldd r26, Y+5 ; 0x05 da42: be 81 ldd r27, Y+6 ; 0x06 da44: cd 01 movw r24, r26 da46: b0 e0 ldi r27, 0x00 ; 0 da48: a0 e0 ldi r26, 0x00 ; 0 da4a: 8f 8f std Y+31, r24 ; 0x1f da4c: 98 a3 std Y+32, r25 ; 0x20 da4e: a9 a3 std Y+33, r26 ; 0x21 da50: 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) { da52: 2d 81 ldd r18, Y+5 ; 0x05 da54: 3e 81 ldd r19, Y+6 ; 0x06 da56: 22 16 cp r2, r18 da58: 33 06 cpc r3, r19 da5a: 08 f0 brcs .+2 ; 0xda5e da5c: 8c c0 rjmp .+280 ; 0xdb76 float t = float(i) / float(n_segments); da5e: b1 01 movw r22, r2 da60: 90 e0 ldi r25, 0x00 ; 0 da62: 80 e0 ldi r24, 0x00 ; 0 da64: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> da68: 6b 01 movw r12, r22 da6a: 7c 01 movw r14, r24 da6c: 6f 8d ldd r22, Y+31 ; 0x1f da6e: 78 a1 ldd r23, Y+32 ; 0x20 da70: 89 a1 ldd r24, Y+33 ; 0x21 da72: 9a a1 ldd r25, Y+34 ; 0x22 da74: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> da78: 9b 01 movw r18, r22 da7a: ac 01 movw r20, r24 da7c: c7 01 movw r24, r14 da7e: b6 01 movw r22, r12 da80: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> da84: 6b 01 movw r12, r22 da86: 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, da88: ac 01 movw r20, r24 da8a: 9b 01 movw r18, r22 da8c: 6b 89 ldd r22, Y+19 ; 0x13 da8e: 7c 89 ldd r23, Y+20 ; 0x14 da90: 8d 89 ldd r24, Y+21 ; 0x15 da92: 9e 89 ldd r25, Y+22 ; 0x16 da94: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> da98: 9b 01 movw r18, r22 da9a: ac 01 movw r20, r24 da9c: 60 91 9e 06 lds r22, 0x069E ; 0x80069e daa0: 70 91 9f 06 lds r23, 0x069F ; 0x80069f daa4: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 daa8: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 daac: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> dab0: 69 83 std Y+1, r22 ; 0x01 dab2: 7a 83 std Y+2, r23 ; 0x02 dab4: 8b 83 std Y+3, r24 ; 0x03 dab6: 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, dab8: a7 01 movw r20, r14 daba: 96 01 movw r18, r12 dabc: 6f 85 ldd r22, Y+15 ; 0x0f dabe: 78 89 ldd r23, Y+16 ; 0x10 dac0: 89 89 ldd r24, Y+17 ; 0x11 dac2: 9a 89 ldd r25, Y+18 ; 0x12 dac4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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, dac8: 20 91 9a 06 lds r18, 0x069A ; 0x80069a dacc: 30 91 9b 06 lds r19, 0x069B ; 0x80069b dad0: 40 91 9c 06 lds r20, 0x069C ; 0x80069c dad4: 50 91 9d 06 lds r21, 0x069D ; 0x80069d dad8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> dadc: 6f 8b std Y+23, r22 ; 0x17 dade: 78 8f std Y+24, r23 ; 0x18 dae0: 89 8f std Y+25, r24 ; 0x19 dae2: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dae4: a7 01 movw r20, r14 dae6: 96 01 movw r18, r12 dae8: 6b 85 ldd r22, Y+11 ; 0x0b daea: 7c 85 ldd r23, Y+12 ; 0x0c daec: 8d 85 ldd r24, Y+13 ; 0x0d daee: 9e 85 ldd r25, Y+14 ; 0x0e daf0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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, daf4: 20 91 96 06 lds r18, 0x0696 ; 0x800696 daf8: 30 91 97 06 lds r19, 0x0697 ; 0x800697 dafc: 40 91 98 06 lds r20, 0x0698 ; 0x800698 db00: 50 91 99 06 lds r21, 0x0699 ; 0x800699 db04: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> db08: 6b 8f std Y+27, r22 ; 0x1b db0a: 7c 8f std Y+28, r23 ; 0x1c db0c: 8d 8f std Y+29, r24 ; 0x1d db0e: 9e 8f std Y+30, r25 ; 0x1e db10: a7 01 movw r20, r14 db12: 96 01 movw r18, r12 db14: c3 01 movw r24, r6 db16: b2 01 movw r22, r4 db18: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> db1c: 20 91 92 06 lds r18, 0x0692 ; 0x800692 db20: 30 91 93 06 lds r19, 0x0693 ; 0x800693 db24: 40 91 94 06 lds r20, 0x0694 ; 0x800694 db28: 50 91 95 06 lds r21, 0x0695 ; 0x800695 db2c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> db30: 3f 92 push r3 db32: 2f 92 push r2 db34: a2 e9 ldi r26, 0x92 ; 146 db36: b6 e0 ldi r27, 0x06 ; 6 db38: bf 93 push r27 db3a: af 93 push r26 db3c: 8f 80 ldd r8, Y+7 ; 0x07 db3e: 98 84 ldd r9, Y+8 ; 0x08 db40: a9 84 ldd r10, Y+9 ; 0x09 db42: ba 84 ldd r11, Y+10 ; 0x0a db44: de 01 movw r26, r28 db46: 11 96 adiw r26, 0x01 ; 1 db48: 6d 01 movw r12, r26 db4a: ef 88 ldd r14, Y+23 ; 0x17 db4c: f8 8c ldd r15, Y+24 ; 0x18 db4e: 09 8d ldd r16, Y+25 ; 0x19 db50: 1a 8d ldd r17, Y+26 ; 0x1a db52: 2b 8d ldd r18, Y+27 ; 0x1b db54: 3c 8d ldd r19, Y+28 ; 0x1c db56: 4d 8d ldd r20, Y+29 ; 0x1d db58: 5e 8d ldd r21, Y+30 ; 0x1e db5a: 0f 94 fb b0 call 0x361f6 ; 0x361f6 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) db5e: 0f 90 pop r0 db60: 0f 90 pop r0 db62: 0f 90 pop r0 db64: 0f 90 pop r0 db66: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac db6a: 81 11 cpse r24, r1 db6c: b7 ce rjmp .-658 ; 0xd8dc 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) { db6e: bf ef ldi r27, 0xFF ; 255 db70: 2b 1a sub r2, r27 db72: 3b 0a sbc r3, r27 db74: 6e cf rjmp .-292 ; 0xda52 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); db76: e0 90 7c 06 lds r14, 0x067C ; 0x80067c db7a: f0 90 7d 06 lds r15, 0x067D ; 0x80067d db7e: 00 91 7e 06 lds r16, 0x067E ; 0x80067e db82: 10 91 7f 06 lds r17, 0x067F ; 0x80067f db86: 20 91 78 06 lds r18, 0x0678 ; 0x800678 db8a: 30 91 79 06 lds r19, 0x0679 ; 0x800679 db8e: 40 91 7a 06 lds r20, 0x067A ; 0x80067a db92: 50 91 7b 06 lds r21, 0x067B ; 0x80067b db96: 60 91 74 06 lds r22, 0x0674 ; 0x800674 db9a: 70 91 75 06 lds r23, 0x0675 ; 0x800675 db9e: 80 91 76 06 lds r24, 0x0676 ; 0x800676 dba2: 90 91 77 06 lds r25, 0x0677 ; 0x800677 dba6: 1f 92 push r1 dba8: 1f 92 push r1 dbaa: e2 e9 ldi r30, 0x92 ; 146 dbac: f6 e0 ldi r31, 0x06 ; 6 dbae: ff 93 push r31 dbb0: ef 93 push r30 dbb2: 8f 80 ldd r8, Y+7 ; 0x07 dbb4: 98 84 ldd r9, Y+8 ; 0x08 dbb6: a9 84 ldd r10, Y+9 ; 0x09 dbb8: ba 84 ldd r11, Y+10 ; 0x0a dbba: e0 e8 ldi r30, 0x80 ; 128 dbbc: ce 2e mov r12, r30 dbbe: e6 e0 ldi r30, 0x06 ; 6 dbc0: de 2e mov r13, r30 dbc2: 0f 94 fb b0 call 0x361f6 ; 0x361f6 dbc6: 0f 90 pop r0 dbc8: 0f 90 pop r0 dbca: 0f 90 pop r0 dbcc: 0f 90 pop r0 dbce: 86 ce rjmp .-756 ; 0xd8dc 0000dbd0 : /// @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) { dbd0: cf 92 push r12 dbd2: df 92 push r13 dbd4: ef 92 push r14 dbd6: ff 92 push r15 dbd8: cf 93 push r28 dbda: 9b 01 movw r18, r22 dbdc: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dbde: c0 90 9a 06 lds r12, 0x069A ; 0x80069a dbe2: d0 90 9b 06 lds r13, 0x069B ; 0x80069b dbe6: e0 90 9c 06 lds r14, 0x069C ; 0x80069c dbea: f0 90 9d 06 lds r15, 0x069D ; 0x80069d // Prepare to move Z axis current_position[Z_AXIS] += delta; dbee: c7 01 movw r24, r14 dbf0: b6 01 movw r22, r12 dbf2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> dbf6: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a dbfa: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b dbfe: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c dc02: 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); dc06: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dc08: 90 91 91 06 lds r25, 0x0691 ; 0x800691 dc0c: 91 11 cpse r25, r1 dc0e: 02 c0 rjmp .+4 ; 0xdc14 dc10: 84 ff sbrs r24, 4 dc12: 26 c0 rjmp .+76 ; 0xdc60 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); dc14: 82 e9 ldi r24, 0x92 ; 146 dc16: 96 e0 ldi r25, 0x06 ; 6 dc18: 0e 94 d0 6b call 0xd7a0 ; 0xd7a0 plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); dc1c: e0 91 71 02 lds r30, 0x0271 ; 0x800271 dc20: f0 91 72 02 lds r31, 0x0272 ; 0x800272 dc24: 60 85 ldd r22, Z+8 ; 0x08 dc26: 71 85 ldd r23, Z+9 ; 0x09 dc28: 82 85 ldd r24, Z+10 ; 0x0a dc2a: 93 85 ldd r25, Z+11 ; 0x0b dc2c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); dc30: 0f 94 ef 42 call 0x285de ; 0x285de // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; dc34: a7 01 movw r20, r14 dc36: 96 01 movw r18, r12 dc38: 60 91 9a 06 lds r22, 0x069A ; 0x80069a dc3c: 70 91 9b 06 lds r23, 0x069B ; 0x80069b dc40: 80 91 9c 06 lds r24, 0x069C ; 0x80069c dc44: 90 91 9d 06 lds r25, 0x069D ; 0x80069d dc48: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> dc4c: 6b 01 movw r12, r22 dc4e: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } dc50: c7 01 movw r24, r14 dc52: b6 01 movw r22, r12 dc54: cf 91 pop r28 dc56: ff 90 pop r15 dc58: ef 90 pop r14 dc5a: df 90 pop r13 dc5c: cf 90 pop r12 dc5e: 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(); dc60: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); dc62: 0f 94 ef 42 call 0x285de ; 0x285de // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); dc66: 81 e0 ldi r24, 0x01 ; 1 dc68: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 dc6c: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); dc6e: 84 e0 ldi r24, 0x04 ; 4 dc70: 0f 94 df 25 call 0x24bbe ; 0x24bbe #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); dc74: 65 e5 ldi r22, 0x55 ; 85 dc76: 75 e5 ldi r23, 0x55 ; 85 dc78: 85 e5 ldi r24, 0x55 ; 85 dc7a: 91 e4 ldi r25, 0x41 ; 65 dc7c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); dc80: 0f 94 ef 42 call 0x285de ; 0x285de // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; dc84: 82 e0 ldi r24, 0x02 ; 2 dc86: 0f 94 db 42 call 0x285b6 ; 0x285b6 dc8a: a7 01 movw r20, r14 dc8c: 96 01 movw r18, r12 dc8e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> dc92: 6b 01 movw r12, r22 dc94: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) dc96: 0f 94 f7 4d call 0x29bee ; 0x29bee dc9a: 88 23 and r24, r24 dc9c: 91 f0 breq .+36 ; 0xdcc2 { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; dc9e: 80 91 1d 02 lds r24, 0x021D ; 0x80021d dca2: 90 91 1e 02 lds r25, 0x021E ; 0x80021e dca6: a0 91 1f 02 lds r26, 0x021F ; 0x80021f dcaa: b0 91 20 02 lds r27, 0x0220 ; 0x800220 dcae: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a dcb2: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b dcb6: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c dcba: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_set_position_curposXYZE(); dcbe: 0f 94 10 bf call 0x37e20 ; 0x37e20 } tmc2130_home_exit(); dcc2: 0f 94 b0 25 call 0x24b60 ; 0x24b60 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); dcc6: 8c 2f mov r24, r28 dcc8: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 dccc: c1 cf rjmp .-126 ; 0xdc50 0000dcce : // // 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) { dcce: 8f 92 push r8 dcd0: 9f 92 push r9 dcd2: af 92 push r10 dcd4: bf 92 push r11 dcd6: cf 92 push r12 dcd8: df 92 push r13 dcda: ef 92 push r14 dcdc: ff 92 push r15 dcde: 4b 01 movw r8, r22 dce0: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) dce2: c0 90 9a 06 lds r12, 0x069A ; 0x80069a dce6: d0 90 9b 06 lds r13, 0x069B ; 0x80069b dcea: e0 90 9c 06 lds r14, 0x069C ; 0x80069c dcee: f0 90 9d 06 lds r15, 0x069D ; 0x80069d dcf2: ac 01 movw r20, r24 dcf4: 9b 01 movw r18, r22 dcf6: c7 01 movw r24, r14 dcf8: b6 01 movw r22, r12 dcfa: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> dcfe: 87 ff sbrs r24, 7 dd00: 11 c0 rjmp .+34 ; 0xdd24 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); dd02: a5 01 movw r20, r10 dd04: 94 01 movw r18, r8 dd06: c7 01 movw r24, r14 dd08: b6 01 movw r22, r12 dd0a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> dd0e: 9f 77 andi r25, 0x7F ; 127 } dd10: ff 90 pop r15 dd12: ef 90 pop r14 dd14: df 90 pop r13 dd16: cf 90 pop r12 dd18: bf 90 pop r11 dd1a: af 90 pop r10 dd1c: 9f 90 pop r9 dd1e: 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)); dd20: 0c 94 e8 6d jmp 0xdbd0 ; 0xdbd0 } dd24: ff 90 pop r15 dd26: ef 90 pop r14 dd28: df 90 pop r13 dd2a: cf 90 pop r12 dd2c: bf 90 pop r11 dd2e: af 90 pop r10 dd30: 9f 90 pop r9 dd32: 8f 90 pop r8 dd34: 08 95 ret 0000dd36 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { dd36: ee e5 ldi r30, 0x5E ; 94 dd38: 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; dd3a: 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]; dd3c: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty dd3e: 8f 37 cpi r24, 0x7F ; 127 dd40: 31 f0 breq .+12 ; 0xdd4e dd42: df 01 movw r26, r30 dd44: 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 dd46: 87 ff sbrs r24, 7 dd48: 07 c0 rjmp .+14 ; 0xdd58 lcd_custom_characters[i] = c & 0x7F; dd4a: 8f 77 andi r24, 0x7F ; 127 dd4c: 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++) { dd4e: 83 e0 ldi r24, 0x03 ; 3 dd50: e6 36 cpi r30, 0x66 ; 102 dd52: f8 07 cpc r31, r24 dd54: 99 f7 brne .-26 ; 0xdd3c for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dd56: 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; dd58: 9c 93 st X, r25 dd5a: f9 cf rjmp .-14 ; 0xdd4e 0000dd5c : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dd5c: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dd60: 98 17 cp r25, r24 dd62: 10 f4 brcc .+4 ; 0xdd68 lcd_draw_update = lcdDrawUpdateOverride; dd64: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dd68: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dd6c: 88 23 and r24, r24 dd6e: 39 f0 breq .+14 ; 0xdd7e if (lcd_lcdupdate_func) dd70: e0 91 15 04 lds r30, 0x0415 ; 0x800415 dd74: f0 91 16 04 lds r31, 0x0416 ; 0x800416 dd78: 30 97 sbiw r30, 0x00 ; 0 dd7a: 09 f0 breq .+2 ; 0xdd7e lcd_lcdupdate_func(); dd7c: 19 94 eijmp } dd7e: 08 95 ret 0000dd80 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dd80: cf 93 push r28 dd82: df 93 push r29 dd84: cd b7 in r28, 0x3d ; 61 dd86: de b7 in r29, 0x3e ; 62 dd88: ae 01 movw r20, r28 dd8a: 4a 5f subi r20, 0xFA ; 250 dd8c: 5f 4f sbci r21, 0xFF ; 255 dd8e: fa 01 movw r30, r20 dd90: 61 91 ld r22, Z+ dd92: 71 91 ld r23, Z+ dd94: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dd96: 83 e0 ldi r24, 0x03 ; 3 dd98: 94 e0 ldi r25, 0x04 ; 4 dd9a: 0f 94 6a db call 0x3b6d4 ; 0x3b6d4 va_end(args); return ret; } dd9e: df 91 pop r29 dda0: cf 91 pop r28 dda2: 08 95 ret 0000dda4 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); dda4: 63 e0 ldi r22, 0x03 ; 3 dda6: 74 e0 ldi r23, 0x04 ; 4 dda8: 0d 94 bb da jmp 0x3b576 ; 0x3b576 0000ddac : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); ddac: 63 e0 ldi r22, 0x03 ; 3 ddae: 74 e0 ldi r23, 0x04 ; 4 ddb0: 08 2e mov r0, r24 ddb2: 00 0c add r0, r0 ddb4: 99 0b sbc r25, r25 ddb6: 0d 94 8b da jmp 0x3b516 ; 0x3b516 0000ddba : va_end(args); return ret; } void lcd_space(uint8_t n) { ddba: cf 93 push r28 ddbc: c8 2f mov r28, r24 while (n--) lcd_putc(' '); ddbe: c1 50 subi r28, 0x01 ; 1 ddc0: 20 f0 brcs .+8 ; 0xddca ddc2: 80 e2 ldi r24, 0x20 ; 32 ddc4: 0e 94 d6 6e call 0xddac ; 0xddac ddc8: fa cf rjmp .-12 ; 0xddbe } ddca: cf 91 pop r28 ddcc: 08 95 ret 0000ddce : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { ddce: cf 93 push r28 ddd0: c8 2f mov r28, r24 ddd2: 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); ddd4: 64 30 cpi r22, 0x04 ; 4 ddd6: 08 f0 brcs .+2 ; 0xddda ddd8: 83 e0 ldi r24, 0x03 ; 3 ddda: 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); ddde: 0e 94 10 5b call 0xb620 ; 0xb620 dde2: 8c 0f add r24, r28 lcd_ddram_address = addr; dde4: 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); dde8: 44 e6 ldi r20, 0x64 ; 100 ddea: 50 e0 ldi r21, 0x00 ; 0 ddec: 60 e0 ldi r22, 0x00 ; 0 ddee: 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); } ddf0: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); ddf2: 0c 94 0e 64 jmp 0xc81c ; 0xc81c 0000ddf6 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { ddf6: cf 93 push r28 ddf8: df 93 push r29 ddfa: ea 01 movw r28, r20 lcd_set_cursor(c, r); ddfc: 0e 94 e7 6e call 0xddce ; 0xddce return fputs_P(str, lcdout); de00: 63 e0 ldi r22, 0x03 ; 3 de02: 74 e0 ldi r23, 0x04 ; 4 de04: ce 01 movw r24, r28 } de06: df 91 pop r29 de08: 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); de0a: 0d 94 bb da jmp 0x3b576 ; 0x3b576 0000de0e : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { de0e: cf 93 push r28 de10: c4 2f mov r28, r20 lcd_set_cursor(c, r); de12: 0e 94 e7 6e call 0xddce ; 0xddce return fputc(ch, lcdout); de16: 63 e0 ldi r22, 0x03 ; 3 de18: 74 e0 ldi r23, 0x04 ; 4 de1a: 8c 2f mov r24, r28 de1c: cc 0f add r28, r28 de1e: 99 0b sbc r25, r25 } de20: 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); de22: 0d 94 8b da jmp 0x3b516 ; 0x3b516 0000de26 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); de26: 60 e0 ldi r22, 0x00 ; 0 de28: 80 e0 ldi r24, 0x00 ; 0 de2a: 0e 94 e7 6e call 0xddce ; 0xddce lcd_ddram_address = 0; de2e: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c } de32: 08 95 ret 0000de34 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); de34: 40 e4 ldi r20, 0x40 ; 64 de36: 56 e0 ldi r21, 0x06 ; 6 de38: 60 e0 ldi r22, 0x00 ; 0 de3a: 81 e0 ldi r24, 0x01 ; 1 de3c: 0e 94 0e 64 call 0xc81c ; 0xc81c // 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; de40: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; de44: 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)); de48: 48 e0 ldi r20, 0x08 ; 8 de4a: 50 e0 ldi r21, 0x00 ; 0 de4c: 6f e7 ldi r22, 0x7F ; 127 de4e: 70 e0 ldi r23, 0x00 ; 0 de50: 8e e5 ldi r24, 0x5E ; 94 de52: 93 e0 ldi r25, 0x03 ; 3 de54: 0d 94 55 e2 jmp 0x3c4aa ; 0x3c4aa 0000de58 : } 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) de58: 90 91 6e 02 lds r25, 0x026E ; 0x80026e de5c: 98 17 cp r25, r24 de5e: 09 f1 breq .+66 ; 0xdea2 { lcd_update_enabled = enabled; de60: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) de64: 88 23 and r24, r24 de66: e9 f0 breq .+58 ; 0xdea2 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; de68: 10 92 71 06 sts 0x0671, r1 ; 0x800671 de6c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_encoder_diff = 0; de70: 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(); de74: 8c ed ldi r24, 0xDC ; 220 de76: 93 e0 ldi r25, 0x03 ; 3 de78: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; de7c: 0f 94 53 29 call 0x252a6 ; 0x252a6 de80: 61 50 subi r22, 0x01 ; 1 de82: 71 09 sbc r23, r1 de84: 81 09 sbc r24, r1 de86: 91 09 sbc r25, r1 de88: 60 93 d8 03 sts 0x03D8, r22 ; 0x8003d8 de8c: 70 93 d9 03 sts 0x03D9, r23 ; 0x8003d9 de90: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da de94: 90 93 db 03 sts 0x03DB, r25 ; 0x8003db // Full update. lcd_clear(); de98: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_update(2); de9c: 82 e0 ldi r24, 0x02 ; 2 de9e: 0c 94 ae 6e jmp 0xdd5c ; 0xdd5c } else { // Clear the LCD always, or let it to the caller? } } } dea2: 08 95 ret 0000dea4 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { dea4: cf 93 push r28 dea6: c8 2f mov r28, r24 lcd_currline = 0; dea8: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; deac: 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)); deb0: 48 e0 ldi r20, 0x08 ; 8 deb2: 50 e0 ldi r21, 0x00 ; 0 deb4: 6f e7 ldi r22, 0x7F ; 127 deb6: 70 e0 ldi r23, 0x00 ; 0 deb8: 8e e5 ldi r24, 0x5E ; 94 deba: 93 e0 ldi r25, 0x03 ; 3 debc: 0f 94 55 e2 call 0x3c4aa ; 0x3c4aa 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 dec0: 44 e9 ldi r20, 0x94 ; 148 dec2: 51 e1 ldi r21, 0x11 ; 17 dec4: 62 e0 ldi r22, 0x02 ; 2 dec6: 80 e3 ldi r24, 0x30 ; 48 dec8: 0e 94 0e 64 call 0xc81c ; 0xc81c // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); decc: 46 e9 ldi r20, 0x96 ; 150 dece: 50 e0 ldi r21, 0x00 ; 0 ded0: 62 e0 ldi r22, 0x02 ; 2 ded2: 80 e3 ldi r24, 0x30 ; 48 ded4: 0e 94 0e 64 call 0xc81c ; 0xc81c // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); ded8: 46 e9 ldi r20, 0x96 ; 150 deda: 50 e0 ldi r21, 0x00 ; 0 dedc: 62 e0 ldi r22, 0x02 ; 2 dede: 80 e3 ldi r24, 0x30 ; 48 dee0: 0e 94 0e 64 call 0xc81c ; 0xc81c #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); dee4: 46 e9 ldi r20, 0x96 ; 150 dee6: 50 e0 ldi r21, 0x00 ; 0 dee8: 62 e0 ldi r22, 0x02 ; 2 deea: 80 e2 ldi r24, 0x20 ; 32 deec: 0e 94 0e 64 call 0xc81c ; 0xc81c #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); def0: 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); def4: 44 e6 ldi r20, 0x64 ; 100 def6: 50 e0 ldi r21, 0x00 ; 0 def8: 60 e0 ldi r22, 0x00 ; 0 defa: 80 62 ori r24, 0x20 ; 32 defc: 0e 94 0e 64 call 0xc81c ; 0xc81c } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; df00: 84 e0 ldi r24, 0x04 ; 4 df02: 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); df06: 44 e6 ldi r20, 0x64 ; 100 df08: 50 e0 ldi r21, 0x00 ; 0 df0a: 60 e0 ldi r22, 0x00 ; 0 df0c: 8c e0 ldi r24, 0x0C ; 12 df0e: 0e 94 0e 64 call 0xc81c ; 0xc81c 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(); df12: c1 11 cpse r28, r1 df14: 0e 94 1a 6f call 0xde34 ; 0xde34 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df18: 44 e6 ldi r20, 0x64 ; 100 df1a: 50 e0 ldi r21, 0x00 ; 0 df1c: 60 e0 ldi r22, 0x00 ; 0 df1e: 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); } df20: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df22: 0c 94 0e 64 jmp 0xc81c ; 0xc81c 0000df26 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); df26: 81 e0 ldi r24, 0x01 ; 1 df28: 0c 94 52 6f jmp 0xdea4 ; 0xdea4 0000df2c : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { df2c: cf 92 push r12 df2e: df 92 push r13 df30: ff 92 push r15 df32: 0f 93 push r16 df34: 1f 93 push r17 df36: cf 93 push r28 df38: df 93 push r29 df3a: 00 d0 rcall .+0 ; 0xdf3c df3c: 00 d0 rcall .+0 ; 0xdf3e df3e: 1f 92 push r1 df40: 1f 92 push r1 df42: cd b7 in r28, 0x3d ; 61 df44: de b7 in r29, 0x3e ; 62 if (value == '\n') { df46: 8a 30 cpi r24, 0x0A ; 10 df48: d9 f4 brne .+54 ; 0xdf80 if (lcd_currline > 3) lcd_currline = -1; df4a: 80 91 5d 03 lds r24, 0x035D ; 0x80035d df4e: 84 30 cpi r24, 0x04 ; 4 df50: 18 f0 brcs .+6 ; 0xdf58 df52: 8f ef ldi r24, 0xFF ; 255 df54: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d lcd_set_cursor(0, lcd_currline + 1); // LF df58: 60 91 5d 03 lds r22, 0x035D ; 0x80035d df5c: 6f 5f subi r22, 0xFF ; 255 df5e: 80 e0 ldi r24, 0x00 ; 0 df60: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } df64: 28 96 adiw r28, 0x08 ; 8 df66: 0f b6 in r0, 0x3f ; 63 df68: f8 94 cli df6a: de bf out 0x3e, r29 ; 62 df6c: 0f be out 0x3f, r0 ; 63 df6e: cd bf out 0x3d, r28 ; 61 df70: df 91 pop r29 df72: cf 91 pop r28 df74: 1f 91 pop r17 df76: 0f 91 pop r16 df78: ff 90 pop r15 df7a: df 90 pop r13 df7c: cf 90 pop r12 df7e: 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))) { df80: 90 e8 ldi r25, 0x80 ; 128 df82: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); df84: 44 e6 ldi r20, 0x64 ; 100 df86: 50 e0 ldi r21, 0x00 ; 0 df88: 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))) { df8a: 9a 34 cpi r25, 0x4A ; 74 df8c: 08 f5 brcc .+66 ; 0xdfd0 // 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. df8e: 48 2f mov r20, r24 df90: 40 58 subi r20, 0x80 ; 128 df92: 55 0b sbc r21, r21 df94: 9a 01 movw r18, r20 df96: 96 e0 ldi r25, 0x06 ; 6 df98: 92 9f mul r25, r18 df9a: a0 01 movw r20, r0 df9c: 93 9f mul r25, r19 df9e: 50 0d add r21, r0 dfa0: 11 24 eor r1, r1 dfa2: fa 01 movw r30, r20 dfa4: e9 54 subi r30, 0x49 ; 73 dfa6: f6 48 sbci r31, 0x86 ; 134 dfa8: f4 90 lpm r15, Z dfaa: ee e5 ldi r30, 0x5E ; 94 dfac: f3 e0 ldi r31, 0x03 ; 3 dfae: 30 e0 ldi r19, 0x00 ; 0 dfb0: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; dfb2: 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)) { dfb4: 61 91 ld r22, Z+ dfb6: 78 2f mov r23, r24 dfb8: 76 27 eor r23, r22 dfba: 7f 77 andi r23, 0x7F ; 127 dfbc: 89 f4 brne .+34 ; 0xdfe0 lcd_custom_characters[i] = c; // mark the custom character as used dfbe: f9 01 movw r30, r18 dfc0: e2 5a subi r30, 0xA2 ; 162 dfc2: fc 4f sbci r31, 0xFC ; 252 dfc4: 80 83 st Z, r24 dfc6: 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); dfc8: 44 e6 ldi r20, 0x64 ; 100 dfca: 50 e0 ldi r21, 0x00 ; 0 dfcc: 61 e0 ldi r22, 0x01 ; 1 dfce: 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); dfd0: 0e 94 0e 64 call 0xc81c ; 0xc81c lcd_ddram_address++; // no need for preventing ddram overflow dfd4: 80 91 5c 03 lds r24, 0x035C ; 0x80035c dfd8: 8f 5f subi r24, 0xFF ; 255 dfda: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c dfde: c2 cf rjmp .-124 ; 0xdf64 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 dfe0: 6f 37 cpi r22, 0x7F ; 127 dfe2: 09 f0 breq .+2 ; 0xdfe6 dfe4: 3c c0 rjmp .+120 ; 0xe05e lcd_custom_characters[i] = c; // mark the custom character as used dfe6: f9 01 movw r30, r18 dfe8: e2 5a subi r30, 0xA2 ; 162 dfea: fc 4f sbci r31, 0xFC ; 252 dfec: 80 83 st Z, r24 slotToUse = i; dfee: 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; dff0: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); dff2: fa 01 movw r30, r20 dff4: ee 54 subi r30, 0x4E ; 78 dff6: f6 48 sbci r31, 0x86 ; 134 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); dff8: 8e 01 movw r16, r28 dffa: 0f 5f subi r16, 0xFF ; 255 dffc: 1f 4f sbci r17, 0xFF ; 255 dffe: d8 01 movw r26, r16 e000: 95 91 lpm r25, Z+ e002: 88 e0 ldi r24, 0x08 ; 8 e004: 18 2e mov r1, r24 0000e006 : e006: 10 fe sbrs r1, 0 e008: 05 90 lpm r0, Z+ e00a: 02 94 swap r0 e00c: 80 2d mov r24, r0 e00e: 97 95 ror r25 e010: 88 1f adc r24, r24 e012: 8d 93 st X+, r24 e014: 1a 94 dec r1 e016: b9 f7 brne .-18 ; 0xe006 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e018: bf 2d mov r27, r15 e01a: e8 e0 ldi r30, 0x08 ; 8 e01c: be 02 muls r27, r30 e01e: c0 01 movw r24, r0 e020: 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); e022: 44 e6 ldi r20, 0x64 ; 100 e024: 50 e0 ldi r21, 0x00 ; 0 e026: 60 e0 ldi r22, 0x00 ; 0 e028: 80 64 ori r24, 0x40 ; 64 e02a: 0e 94 0e 64 call 0xc81c ; 0xc81c e02e: 6e 01 movw r12, r28 e030: f9 e0 ldi r31, 0x09 ; 9 e032: cf 0e add r12, r31 e034: 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); e036: 44 e6 ldi r20, 0x64 ; 100 e038: 50 e0 ldi r21, 0x00 ; 0 e03a: 61 e0 ldi r22, 0x01 ; 1 e03c: d8 01 movw r26, r16 e03e: 8d 91 ld r24, X+ e040: 8d 01 movw r16, r26 e042: 0e 94 0e 64 call 0xc81c ; 0xc81c : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e046: c0 16 cp r12, r16 e048: d1 06 cpc r13, r17 e04a: a9 f7 brne .-22 ; 0xe036 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e04c: 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); e050: 44 e6 ldi r20, 0x64 ; 100 e052: 50 e0 ldi r21, 0x00 ; 0 e054: 60 e0 ldi r22, 0x00 ; 0 e056: 80 68 ori r24, 0x80 ; 128 e058: 0e 94 0e 64 call 0xc81c ; 0xc81c e05c: b5 cf rjmp .-150 ; 0xdfc8 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 e05e: 67 ff sbrs r22, 7 slotToUse = i; e060: 92 2f mov r25, r18 e062: 2f 5f subi r18, 0xFF ; 255 e064: 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++) { e066: 28 30 cpi r18, 0x08 ; 8 e068: 31 05 cpc r19, r1 e06a: 09 f0 breq .+2 ; 0xe06e e06c: a3 cf rjmp .-186 ; 0xdfb4 } // 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) { e06e: 9f 3f cpi r25, 0xFF ; 255 e070: 09 f0 breq .+2 ; 0xe074 e072: be cf rjmp .-132 ; 0xdff0 e074: a9 cf rjmp .-174 ; 0xdfc8 0000e076 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e076: 8f 92 push r8 e078: 9f 92 push r9 e07a: af 92 push r10 e07c: bf 92 push r11 e07e: ef 92 push r14 e080: ff 92 push r15 e082: 0f 93 push r16 e084: 1f 93 push r17 e086: cf 93 push r28 e088: df 93 push r29 e08a: cd b7 in r28, 0x3d ; 61 e08c: de b7 in r29, 0x3e ; 62 e08e: a0 97 sbiw r28, 0x20 ; 32 e090: 0f b6 in r0, 0x3f ; 63 e092: f8 94 cli e094: de bf out 0x3e, r29 ; 62 e096: 0f be out 0x3f, r0 ; 63 e098: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e09a: 61 15 cp r22, r1 e09c: 71 05 cpc r23, r1 e09e: 81 05 cpc r24, r1 e0a0: 91 05 cpc r25, r1 e0a2: 99 f4 brne .+38 ; 0xe0ca } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e0a4: 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)); } e0a6: a0 96 adiw r28, 0x20 ; 32 e0a8: 0f b6 in r0, 0x3f ; 63 e0aa: f8 94 cli e0ac: de bf out 0x3e, r29 ; 62 e0ae: 0f be out 0x3f, r0 ; 63 e0b0: cd bf out 0x3d, r28 ; 61 e0b2: df 91 pop r29 e0b4: cf 91 pop r28 e0b6: 1f 91 pop r17 e0b8: 0f 91 pop r16 e0ba: ff 90 pop r15 e0bc: ef 90 pop r14 e0be: bf 90 pop r11 e0c0: af 90 pop r10 e0c2: 9f 90 pop r9 e0c4: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e0c6: 0c 94 96 6f jmp 0xdf2c ; 0xdf2c } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e0ca: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e0cc: 84 2e mov r8, r20 e0ce: 91 2c mov r9, r1 e0d0: b1 2c mov r11, r1 e0d2: a1 2c mov r10, r1 e0d4: 9e 01 movw r18, r28 e0d6: 2f 5f subi r18, 0xFF ; 255 e0d8: 3f 4f sbci r19, 0xFF ; 255 e0da: 79 01 movw r14, r18 e0dc: a5 01 movw r20, r10 e0de: 94 01 movw r18, r8 e0e0: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> e0e4: f7 01 movw r30, r14 e0e6: e0 0f add r30, r16 e0e8: f1 1d adc r31, r1 e0ea: 60 83 st Z, r22 n /= base; e0ec: b9 01 movw r22, r18 e0ee: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e0f0: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e0f2: 61 15 cp r22, r1 e0f4: 71 05 cpc r23, r1 e0f6: 81 05 cpc r24, r1 e0f8: 91 05 cpc r25, r1 e0fa: 81 f7 brne .-32 ; 0xe0dc e0fc: 0e 0d add r16, r14 e0fe: 1f 2d mov r17, r15 e100: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e102: e0 16 cp r14, r16 e104: f1 06 cpc r15, r17 e106: 59 f0 breq .+22 ; 0xe11e lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e108: f8 01 movw r30, r16 e10a: 82 91 ld r24, -Z e10c: 8f 01 movw r16, r30 e10e: 8a 30 cpi r24, 0x0A ; 10 e110: 20 f4 brcc .+8 ; 0xe11a e112: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e114: 0e 94 96 6f call 0xdf2c ; 0xdf2c e118: f4 cf rjmp .-24 ; 0xe102 { 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)); e11a: 89 5c subi r24, 0xC9 ; 201 e11c: fb cf rjmp .-10 ; 0xe114 } e11e: a0 96 adiw r28, 0x20 ; 32 e120: 0f b6 in r0, 0x3f ; 63 e122: f8 94 cli e124: de bf out 0x3e, r29 ; 62 e126: 0f be out 0x3f, r0 ; 63 e128: cd bf out 0x3d, r28 ; 61 e12a: df 91 pop r29 e12c: cf 91 pop r28 e12e: 1f 91 pop r17 e130: 0f 91 pop r16 e132: ff 90 pop r15 e134: ef 90 pop r14 e136: bf 90 pop r11 e138: af 90 pop r10 e13a: 9f 90 pop r9 e13c: 8f 90 pop r8 e13e: 08 95 ret 0000e140 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e140: cf 92 push r12 e142: df 92 push r13 e144: ef 92 push r14 e146: ff 92 push r15 e148: 6b 01 movw r12, r22 e14a: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e14c: f7 fe sbrs r15, 7 e14e: 0b c0 rjmp .+22 ; 0xe166 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e150: 8d e2 ldi r24, 0x2D ; 45 e152: 0e 94 96 6f call 0xdf2c ; 0xdf2c else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e156: f0 94 com r15 e158: e0 94 com r14 e15a: d0 94 com r13 e15c: c0 94 com r12 e15e: c1 1c adc r12, r1 e160: d1 1c adc r13, r1 e162: e1 1c adc r14, r1 e164: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e166: 4a e0 ldi r20, 0x0A ; 10 e168: c7 01 movw r24, r14 e16a: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e16c: ff 90 pop r15 e16e: ef 90 pop r14 e170: df 90 pop r13 e172: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e174: 0c 94 3b 70 jmp 0xe076 ; 0xe076 0000e178 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e178: 0f 93 push r16 e17a: 1f 93 push r17 e17c: cf 93 push r28 e17e: 8c 01 movw r16, r24 e180: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e182: cc 23 and r28, r28 e184: 59 f0 breq .+22 ; 0xe19c e186: f8 01 movw r30, r16 e188: 24 91 lpm r18, Z e18a: 22 23 and r18, r18 e18c: 39 f0 breq .+14 ; 0xe19c lcd_write(pgm_read_byte(s++)); e18e: 0f 5f subi r16, 0xFF ; 255 e190: 1f 4f sbci r17, 0xFF ; 255 e192: 84 91 lpm r24, Z e194: 0e 94 96 6f call 0xdf2c ; 0xdf2c --len; e198: c1 50 subi r28, 0x01 ; 1 e19a: f3 cf rjmp .-26 ; 0xe182 } lcd_space(len); e19c: 8c 2f mov r24, r28 e19e: 0e 94 dd 6e call 0xddba ; 0xddba return len; } e1a2: 8c 2f mov r24, r28 e1a4: cf 91 pop r28 e1a6: 1f 91 pop r17 e1a8: 0f 91 pop r16 e1aa: 08 95 ret 0000e1ac : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e1ac: 0f 93 push r16 e1ae: 1f 93 push r17 e1b0: cf 93 push r28 e1b2: 8c 01 movw r16, r24 e1b4: c6 2f mov r28, r22 while (len && *s) { e1b6: cc 23 and r28, r28 e1b8: 49 f0 breq .+18 ; 0xe1cc e1ba: f8 01 movw r30, r16 e1bc: 81 91 ld r24, Z+ e1be: 8f 01 movw r16, r30 e1c0: 88 23 and r24, r24 e1c2: 21 f0 breq .+8 ; 0xe1cc lcd_write(*(s++)); e1c4: 0e 94 96 6f call 0xdf2c ; 0xdf2c --len; e1c8: c1 50 subi r28, 0x01 ; 1 e1ca: f5 cf rjmp .-22 ; 0xe1b6 } lcd_space(len); e1cc: 8c 2f mov r24, r28 e1ce: 0e 94 dd 6e call 0xddba ; 0xddba return len; } e1d2: 8c 2f mov r24, r28 e1d4: cf 91 pop r28 e1d6: 1f 91 pop r17 e1d8: 0f 91 pop r16 e1da: 08 95 ret 0000e1dc : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e1dc: cf 93 push r28 e1de: df 93 push r29 e1e0: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e1e2: 89 91 ld r24, Y+ e1e4: 88 23 and r24, r24 e1e6: 19 f0 breq .+6 ; 0xe1ee e1e8: 0e 94 96 6f call 0xdf2c ; 0xdf2c e1ec: fa cf rjmp .-12 ; 0xe1e2 } e1ee: df 91 pop r29 e1f0: cf 91 pop r28 e1f2: 08 95 ret 0000e1f4 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e1f4: 0e 94 96 6f call 0xdf2c ; 0xdf2c return 0; } e1f8: 90 e0 ldi r25, 0x00 ; 0 e1fa: 80 e0 ldi r24, 0x00 ; 0 e1fc: 08 95 ret 0000e1fe : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e1fe: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 lcd_longpress_trigger = 0; e202: 10 92 d4 05 sts 0x05D4, r1 ; 0x8005d4 } e206: 08 95 ret 0000e208 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e208: cf 93 push r28 bool clicked = LCD_CLICKED; e20a: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 e20e: c1 e0 ldi r28, 0x01 ; 1 e210: 81 11 cpse r24, r1 e212: 04 c0 rjmp .+8 ; 0xe21c e214: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e216: 8c 2f mov r24, r28 e218: cf 91 pop r28 e21a: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e21c: 0e 94 ff 70 call 0xe1fe ; 0xe1fe e220: fa cf rjmp .-12 ; 0xe216 0000e222 : 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 e222: e0 e0 ldi r30, 0x00 ; 0 e224: f1 e0 ldi r31, 0x01 ; 1 e226: 85 91 lpm r24, Z+ e228: 95 91 lpm r25, Z+ e22a: a5 91 lpm r26, Z+ e22c: b4 91 lpm r27, Z e22e: 85 3a cpi r24, 0xA5 ; 165 e230: 9a 45 sbci r25, 0x5A ; 90 e232: a4 4b sbci r26, 0xB4 ; 180 e234: bb 44 sbci r27, 0x4B ; 75 e236: 29 f4 brne .+10 ; 0xe242 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e238: ea e0 ldi r30, 0x0A ; 10 e23a: f1 e0 ldi r31, 0x01 ; 1 e23c: 85 91 lpm r24, Z+ e23e: 94 91 lpm r25, Z e240: 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 e242: 8f e3 ldi r24, 0x3F ; 63 e244: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e246: 08 95 ret 0000e248 : 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); e248: 8e ef ldi r24, 0xFE ; 254 e24a: 9f e0 ldi r25, 0x0F ; 15 e24c: 0f 94 23 dc call 0x3b846 ; 0x3b846 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e250: 8e 3f cpi r24, 0xFE ; 254 e252: 39 f0 breq .+14 ; 0xe262 e254: 91 e0 ldi r25, 0x01 ; 1 e256: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e25a: 28 13 cpse r18, r24 e25c: 90 e0 ldi r25, 0x00 ; 0 e25e: 89 2f mov r24, r25 e260: 08 95 ret e262: 80 e0 ldi r24, 0x00 ; 0 } e264: 08 95 ret 0000e266 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e266: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e26a: 6e ef ldi r22, 0xFE ; 254 e26c: 8e ef ldi r24, 0xFE ; 254 e26e: 9f e0 ldi r25, 0x0F ; 15 e270: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0000e274 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e274: 85 37 cpi r24, 0x75 ; 117 e276: 28 e6 ldi r18, 0x68 ; 104 e278: 92 07 cpc r25, r18 e27a: 09 f4 brne .+2 ; 0xe27e e27c: 59 c0 rjmp .+178 ; 0xe330 e27e: f8 f4 brcc .+62 ; 0xe2be e280: 8e 36 cpi r24, 0x6E ; 110 e282: 25 e6 ldi r18, 0x65 ; 101 e284: 92 07 cpc r25, r18 e286: 09 f4 brne .+2 ; 0xe28a e288: 59 c0 rjmp .+178 ; 0xe33c e28a: 50 f4 brcc .+20 ; 0xe2a0 e28c: 83 37 cpi r24, 0x73 ; 115 e28e: 23 e6 ldi r18, 0x63 ; 99 e290: 92 07 cpc r25, r18 e292: b1 f1 breq .+108 ; 0xe300 e294: 85 36 cpi r24, 0x65 ; 101 e296: 94 46 sbci r25, 0x64 ; 100 e298: b1 f1 breq .+108 ; 0xe306 //#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("??"); e29a: 8e eb ldi r24, 0xBE ; 190 e29c: 95 e6 ldi r25, 0x65 ; 101 e29e: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2a0: 82 37 cpi r24, 0x72 ; 114 e2a2: 26 e6 ldi r18, 0x66 ; 102 e2a4: 92 07 cpc r25, r18 e2a6: 91 f1 breq .+100 ; 0xe30c e2a8: 82 37 cpi r24, 0x72 ; 114 e2aa: 28 e6 ldi r18, 0x68 ; 104 e2ac: 92 07 cpc r25, r18 e2ae: 09 f4 brne .+2 ; 0xe2b2 e2b0: 42 c0 rjmp .+132 ; 0xe336 e2b2: 83 37 cpi r24, 0x73 ; 115 e2b4: 95 46 sbci r25, 0x65 ; 101 e2b6: 89 f7 brne .-30 ; 0xe29a { 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"); e2b8: 85 e1 ldi r24, 0x15 ; 21 e2ba: 96 e6 ldi r25, 0x66 ; 102 e2bc: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2be: 8c 36 cpi r24, 0x6C ; 108 e2c0: 20 e7 ldi r18, 0x70 ; 112 e2c2: 92 07 cpc r25, r18 e2c4: 31 f1 breq .+76 ; 0xe312 e2c6: 70 f4 brcc .+28 ; 0xe2e4 e2c8: 8c 36 cpi r24, 0x6C ; 108 e2ca: 2e e6 ldi r18, 0x6E ; 110 e2cc: 92 07 cpc r25, r18 e2ce: 21 f1 breq .+72 ; 0xe318 e2d0: 8f 36 cpi r24, 0x6F ; 111 e2d2: 2e e6 ldi r18, 0x6E ; 110 e2d4: 92 07 cpc r25, r18 e2d6: 31 f1 breq .+76 ; 0xe324 e2d8: 84 37 cpi r24, 0x74 ; 116 e2da: 99 46 sbci r25, 0x69 ; 105 e2dc: f1 f6 brne .-68 ; 0xe29a 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"); e2de: 83 e0 ldi r24, 0x03 ; 3 e2e0: 96 e6 ldi r25, 0x66 ; 102 e2e2: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e2e4: 8b 36 cpi r24, 0x6B ; 107 e2e6: 23 e7 ldi r18, 0x73 ; 115 e2e8: 92 07 cpc r25, r18 e2ea: f9 f0 breq .+62 ; 0xe32a e2ec: 86 37 cpi r24, 0x76 ; 118 e2ee: 23 e7 ldi r18, 0x73 ; 115 e2f0: 92 07 cpc r25, r18 e2f2: a9 f0 breq .+42 ; 0xe31e e2f4: 8f 36 cpi r24, 0x6F ; 111 e2f6: 92 47 sbci r25, 0x72 ; 114 e2f8: 81 f6 brne .-96 ; 0xe29a #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 e2fa: 81 ec ldi r24, 0xC1 ; 193 e2fc: 95 e6 ldi r25, 0x65 ; 101 e2fe: 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"); e300: 85 e2 ldi r24, 0x25 ; 37 e302: 96 e6 ldi r25, 0x66 ; 102 e304: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e306: 8d e1 ldi r24, 0x1D ; 29 e308: 96 e6 ldi r25, 0x66 ; 102 e30a: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e30c: 8c e0 ldi r24, 0x0C ; 12 e30e: 96 e6 ldi r25, 0x66 ; 102 e310: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e312: 8c ef ldi r24, 0xFC ; 252 e314: 95 e6 ldi r25, 0x65 ; 101 e316: 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 e318: 81 ef ldi r24, 0xF1 ; 241 e31a: 95 e6 ldi r25, 0x65 ; 101 e31c: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e31e: 89 ee ldi r24, 0xE9 ; 233 e320: 95 e6 ldi r25, 0x65 ; 101 e322: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e324: 83 ee ldi r24, 0xE3 ; 227 e326: 95 e6 ldi r25, 0x65 ; 101 e328: 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 e32a: 88 ed ldi r24, 0xD8 ; 216 e32c: 95 e6 ldi r25, 0x65 ; 101 e32e: 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 e330: 81 ed ldi r24, 0xD1 ; 209 e332: 95 e6 ldi r25, 0x65 ; 101 e334: 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 e336: 88 ec ldi r24, 0xC8 ; 200 e338: 95 e6 ldi r25, 0x65 ; 101 e33a: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e33c: 8d e2 ldi r24, 0x2D ; 45 e33e: 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("??"); } e340: 08 95 ret 0000e342 : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e342: cf 92 push r12 e344: df 92 push r13 e346: ef 92 push r14 e348: ff 92 push r15 e34a: 1f 93 push r17 e34c: cf 93 push r28 e34e: df 93 push r29 e350: cd b7 in r28, 0x3d ; 61 e352: de b7 in r29, 0x3e ; 62 e354: 60 97 sbiw r28, 0x10 ; 16 e356: 0f b6 in r0, 0x3f ; 63 e358: f8 94 cli e35a: de bf out 0x3e, r29 ; 62 e35c: 0f be out 0x3f, r0 ; 63 e35e: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e360: 88 23 and r24, r24 e362: c1 f1 breq .+112 ; 0xe3d4 e364: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e366: 81 30 cpi r24, 0x01 ; 1 e368: 81 f4 brne .+32 ; 0xe38a e36a: 0e 94 11 71 call 0xe222 ; 0xe222 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e36e: 60 96 adiw r28, 0x10 ; 16 e370: 0f b6 in r0, 0x3f ; 63 e372: f8 94 cli e374: de bf out 0x3e, r29 ; 62 e376: 0f be out 0x3f, r0 ; 63 e378: cd bf out 0x3d, r28 ; 61 e37a: df 91 pop r29 e37c: cf 91 pop r28 e37e: 1f 91 pop r17 e380: ff 90 pop r15 e382: ef 90 pop r14 e384: df 90 pop r13 e386: cf 90 pop r12 e388: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e38a: 8c e5 ldi r24, 0x5C ; 92 e38c: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e38e: 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--; e390: 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; e392: c1 2c mov r12, r1 e394: d1 2c mov r13, r1 e396: 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 e398: 20 e1 ldi r18, 0x10 ; 16 e39a: 30 e0 ldi r19, 0x00 ; 0 e39c: ae 01 movw r20, r28 e39e: 4f 5f subi r20, 0xFF ; 255 e3a0: 5f 4f sbci r21, 0xFF ; 255 e3a2: c7 01 movw r24, r14 e3a4: b6 01 movw r22, r12 e3a6: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc if (header.magic != LANG_MAGIC) break; //break if not valid e3aa: 89 81 ldd r24, Y+1 ; 0x01 e3ac: 9a 81 ldd r25, Y+2 ; 0x02 e3ae: ab 81 ldd r26, Y+3 ; 0x03 e3b0: bc 81 ldd r27, Y+4 ; 0x04 e3b2: 85 3a cpi r24, 0xA5 ; 165 e3b4: 9a 45 sbci r25, 0x5A ; 90 e3b6: a4 4b sbci r26, 0xB4 ; 180 e3b8: bb 44 sbci r27, 0x4B ; 75 e3ba: 79 f4 brne .+30 ; 0xe3da if (--lang == 0) return header.code; e3bc: 11 50 subi r17, 0x01 ; 1 e3be: 19 f4 brne .+6 ; 0xe3c6 e3c0: 8b 85 ldd r24, Y+11 ; 0x0b e3c2: 9c 85 ldd r25, Y+12 ; 0x0c e3c4: d4 cf rjmp .-88 ; 0xe36e addr += header.size; //calc address of next table e3c6: 8d 81 ldd r24, Y+5 ; 0x05 e3c8: 9e 81 ldd r25, Y+6 ; 0x06 e3ca: c8 0e add r12, r24 e3cc: d9 1e adc r13, r25 e3ce: e1 1c adc r14, r1 e3d0: f1 1c adc r15, r1 e3d2: e2 cf rjmp .-60 ; 0xe398 return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e3d4: 8e e6 ldi r24, 0x6E ; 110 e3d6: 95 e6 ldi r25, 0x65 ; 101 e3d8: ca cf rjmp .-108 ; 0xe36e 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; e3da: 8f e3 ldi r24, 0x3F ; 63 e3dc: 9f e3 ldi r25, 0x3F ; 63 e3de: c7 cf rjmp .-114 ; 0xe36e 0000e3e0 : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e3e0: cf 92 push r12 e3e2: df 92 push r13 e3e4: ef 92 push r14 e3e6: ff 92 push r15 e3e8: 1f 93 push r17 e3ea: cf 93 push r28 e3ec: df 93 push r29 e3ee: cd b7 in r28, 0x3d ; 61 e3f0: de b7 in r29, 0x3e ; 62 e3f2: 60 97 sbiw r28, 0x10 ; 16 e3f4: 0f b6 in r0, 0x3f ; 63 e3f6: f8 94 cli e3f8: de bf out 0x3e, r29 ; 62 e3fa: 0f be out 0x3f, r0 ; 63 e3fc: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e3fe: ee ea ldi r30, 0xAE ; 174 e400: f9 e7 ldi r31, 0x79 ; 121 e402: 85 91 lpm r24, Z+ e404: 95 91 lpm r25, Z+ e406: a5 91 lpm r26, Z+ e408: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e40a: 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) e40c: 8f 3f cpi r24, 0xFF ; 255 e40e: 9f 4f sbci r25, 0xFF ; 255 e410: af 4f sbci r26, 0xFF ; 255 e412: bf 4f sbci r27, 0xFF ; 255 e414: 09 f1 breq .+66 ; 0xe458 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e416: 8c e5 ldi r24, 0x5C ; 92 e418: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e41a: 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; e41c: c1 2c mov r12, r1 e41e: d1 2c mov r13, r1 e420: 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) e422: 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 e424: 20 e1 ldi r18, 0x10 ; 16 e426: 30 e0 ldi r19, 0x00 ; 0 e428: ae 01 movw r20, r28 e42a: 4f 5f subi r20, 0xFF ; 255 e42c: 5f 4f sbci r21, 0xFF ; 255 e42e: c7 01 movw r24, r14 e430: b6 01 movw r22, r12 e432: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc if (header.magic != LANG_MAGIC) break; //break if magic not valid e436: 89 81 ldd r24, Y+1 ; 0x01 e438: 9a 81 ldd r25, Y+2 ; 0x02 e43a: ab 81 ldd r26, Y+3 ; 0x03 e43c: bc 81 ldd r27, Y+4 ; 0x04 e43e: 85 3a cpi r24, 0xA5 ; 165 e440: 9a 45 sbci r25, 0x5A ; 90 e442: a4 4b sbci r26, 0xB4 ; 180 e444: bb 44 sbci r27, 0x4B ; 75 e446: 41 f4 brne .+16 ; 0xe458 addr += header.size; //calc address of next table e448: 8d 81 ldd r24, Y+5 ; 0x05 e44a: 9e 81 ldd r25, Y+6 ; 0x06 e44c: c8 0e add r12, r24 e44e: d9 1e adc r13, r25 e450: e1 1c adc r14, r1 e452: f1 1c adc r15, r1 count++; //inc counter e454: 1f 5f subi r17, 0xFF ; 255 e456: e6 cf rjmp .-52 ; 0xe424 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e458: 81 2f mov r24, r17 e45a: 60 96 adiw r28, 0x10 ; 16 e45c: 0f b6 in r0, 0x3f ; 63 e45e: f8 94 cli e460: de bf out 0x3e, r29 ; 62 e462: 0f be out 0x3f, r0 ; 63 e464: cd bf out 0x3d, r28 ; 61 e466: df 91 pop r29 e468: cf 91 pop r28 e46a: 1f 91 pop r17 e46c: ff 90 pop r15 e46e: ef 90 pop r14 e470: df 90 pop r13 e472: cf 90 pop r12 e474: 08 95 ret 0000e476 : 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) { e476: 0f 93 push r16 e478: 1f 93 push r17 e47a: cf 93 push r28 e47c: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e47e: 81 11 cpse r24, r1 e480: 06 c0 rjmp .+12 ; 0xe48e { lang_table = 0; e482: 10 92 59 03 sts 0x0359, r1 ; 0x800359 e486: 10 92 58 03 sts 0x0358, r1 ; 0x800358 lang_selected = lang; e48a: 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; e48e: 8c 2f mov r24, r28 e490: 0e 94 a1 71 call 0xe342 ; 0xe342 e494: 8c 01 movw r16, r24 e496: 0e 94 11 71 call 0xe222 ; 0xe222 e49a: 08 17 cp r16, r24 e49c: 19 07 cpc r17, r25 e49e: 19 f0 breq .+6 ; 0xe4a6 if (lang == LANG_ID_SEC) //current secondary language e4a0: c1 30 cpi r28, 0x01 ; 1 e4a2: 09 f0 breq .+2 ; 0xe4a6 e4a4: 3e c0 rjmp .+124 ; 0xe522 { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e4a6: e0 e0 ldi r30, 0x00 ; 0 e4a8: f1 e0 ldi r31, 0x01 ; 1 e4aa: 85 91 lpm r24, Z+ e4ac: 95 91 lpm r25, Z+ e4ae: a5 91 lpm r26, Z+ e4b0: b4 91 lpm r27, Z e4b2: 85 3a cpi r24, 0xA5 ; 165 e4b4: 9a 45 sbci r25, 0x5A ; 90 e4b6: a4 4b sbci r26, 0xB4 ; 180 e4b8: bb 44 sbci r27, 0x4B ; 75 e4ba: 09 f0 breq .+2 ; 0xe4be e4bc: 31 c0 rjmp .+98 ; 0xe520 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e4be: e4 e0 ldi r30, 0x04 ; 4 e4c0: f1 e0 ldi r31, 0x01 ; 1 e4c2: 65 91 lpm r22, Z+ e4c4: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e4c6: e8 e0 ldi r30, 0x08 ; 8 e4c8: f1 e0 ldi r31, 0x01 ; 1 e4ca: 45 91 lpm r20, Z+ e4cc: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e4ce: 30 e0 ldi r19, 0x00 ; 0 e4d0: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e4d2: 90 e0 ldi r25, 0x00 ; 0 e4d4: 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++) e4d6: 62 17 cp r22, r18 e4d8: 73 07 cpc r23, r19 e4da: 89 f5 brne .+98 ; 0xe53e sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e4dc: 84 1b sub r24, r20 e4de: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e4e0: 98 27 eor r25, r24 e4e2: 89 27 eor r24, r25 e4e4: 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)) e4e6: 48 17 cp r20, r24 e4e8: 59 07 cpc r21, r25 e4ea: d1 f4 brne .+52 ; 0xe520 if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e4ec: ec e0 ldi r30, 0x0C ; 12 e4ee: f1 e0 ldi r31, 0x01 ; 1 e4f0: 45 91 lpm r20, Z+ e4f2: 55 91 lpm r21, Z+ e4f4: 65 91 lpm r22, Z+ e4f6: 74 91 lpm r23, Z e4f8: ee ea ldi r30, 0xAE ; 174 e4fa: f9 e7 ldi r31, 0x79 ; 121 e4fc: 85 91 lpm r24, Z+ e4fe: 95 91 lpm r25, Z+ e500: a5 91 lpm r26, Z+ e502: b4 91 lpm r27, Z e504: 48 17 cp r20, r24 e506: 59 07 cpc r21, r25 e508: 6a 07 cpc r22, r26 e50a: 7b 07 cpc r23, r27 e50c: 49 f4 brne .+18 ; 0xe520 { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e50e: 80 e0 ldi r24, 0x00 ; 0 e510: 91 e0 ldi r25, 0x01 ; 1 e512: 90 93 59 03 sts 0x0359, r25 ; 0x800359 e516: 80 93 58 03 sts 0x0358, r24 ; 0x800358 lang_selected = lang; // set language id e51a: 81 e0 ldi r24, 0x01 ; 1 e51c: 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 e520: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e522: 80 91 5a 03 lds r24, 0x035A ; 0x80035a e526: 8c 13 cpse r24, r28 e528: 1c c0 rjmp .+56 ; 0xe562 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e52a: 6c 2f mov r22, r28 e52c: 8e ef ldi r24, 0xFE ; 254 e52e: 9f e0 ldi r25, 0x0F ; 15 e530: 0f 94 47 dc call 0x3b88e ; 0x3b88e return 1; e534: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e536: cf 91 pop r28 e538: 1f 91 pop r17 e53a: 0f 91 pop r16 e53c: 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); e53e: f9 01 movw r30, r18 e540: e0 50 subi r30, 0x00 ; 0 e542: ff 4f sbci r31, 0xFF ; 255 e544: e4 91 lpm r30, Z e546: f0 e0 ldi r31, 0x00 ; 0 e548: a8 e0 ldi r26, 0x08 ; 8 e54a: 20 fd sbrc r18, 0 e54c: a0 e0 ldi r26, 0x00 ; 0 e54e: 02 c0 rjmp .+4 ; 0xe554 e550: ee 0f add r30, r30 e552: ff 1f adc r31, r31 e554: aa 95 dec r26 e556: e2 f7 brpl .-8 ; 0xe550 e558: 8e 0f add r24, r30 e55a: 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++) e55c: 2f 5f subi r18, 0xFF ; 255 e55e: 3f 4f sbci r19, 0xFF ; 255 e560: ba cf rjmp .-140 ; 0xe4d6 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e562: 80 e0 ldi r24, 0x00 ; 0 e564: e8 cf rjmp .-48 ; 0xe536 0000e566 : //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. e566: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e56a: 21 11 cpse r18, r1 e56c: 04 c0 rjmp .+8 ; 0xe576 e56e: fc 01 movw r30, r24 e570: 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 } e572: cf 01 movw r24, r30 e574: 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. e576: 40 91 58 03 lds r20, 0x0358 ; 0x800358 e57a: 50 91 59 03 lds r21, 0x0359 ; 0x800359 e57e: 41 15 cp r20, r1 e580: 51 05 cpc r21, r1 e582: a9 f3 breq .-22 ; 0xe56e uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e584: fc 01 movw r30, r24 e586: 25 91 lpm r18, Z+ e588: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e58a: 2f 3f cpi r18, 0xFF ; 255 e58c: 32 07 cpc r19, r18 e58e: 79 f3 breq .-34 ; 0xe56e ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e590: f9 01 movw r30, r18 e592: 38 96 adiw r30, 0x08 ; 8 e594: ee 0f add r30, r30 e596: ff 1f adc r31, r31 e598: e4 0f add r30, r20 e59a: f5 1f adc r31, r21 e59c: 25 91 lpm r18, Z+ e59e: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e5a0: fa 01 movw r30, r20 e5a2: e2 0f add r30, r18 e5a4: f3 1f adc r31, r19 e5a6: 24 91 lpm r18, Z e5a8: 22 23 and r18, r18 e5aa: 09 f3 breq .-62 ; 0xe56e e5ac: e2 cf rjmp .-60 ; 0xe572 0000e5ae : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e5ae: cf 93 push r28 e5b0: df 93 push r29 e5b2: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e5b4: 20 e0 ldi r18, 0x00 ; 0 e5b6: 30 e0 ldi r19, 0x00 ; 0 e5b8: 4c e8 ldi r20, 0x8C ; 140 e5ba: 52 e4 ldi r21, 0x42 ; 66 e5bc: 60 91 9e 06 lds r22, 0x069E ; 0x80069e e5c0: 70 91 9f 06 lds r23, 0x069F ; 0x80069f e5c4: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 e5c8: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 e5cc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> e5d0: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e e5d4: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f e5d8: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 e5dc: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e5e0: 60 e0 ldi r22, 0x00 ; 0 e5e2: 70 e0 ldi r23, 0x00 ; 0 e5e4: 80 ea ldi r24, 0xA0 ; 160 e5e6: 91 e4 ldi r25, 0x41 ; 65 e5e8: 0f 94 50 c0 call 0x380a0 ; 0x380a0 load_filament_final_feed(); e5ec: 0e 94 9a 64 call 0xc934 ; 0xc934 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e5f0: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e5f4: 87 e3 ldi r24, 0x37 ; 55 e5f6: 9c e5 ldi r25, 0x5C ; 92 e5f8: 0e 94 b3 72 call 0xe566 ; 0xe566 e5fc: ac 01 movw r20, r24 e5fe: 60 e0 ldi r22, 0x00 ; 0 e600: 80 e0 ldi r24, 0x00 ; 0 e602: 0e 94 fb 6e call 0xddf6 ; 0xddf6 if (filament_name[0]) { e606: 88 81 ld r24, Y e608: 88 23 and r24, r24 e60a: 39 f0 breq .+14 ; 0xe61a lcd_set_cursor(0, 1); e60c: 61 e0 ldi r22, 0x01 ; 1 e60e: 80 e0 ldi r24, 0x00 ; 0 e610: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print(filament_name); e614: ce 01 movw r24, r28 e616: 0e 94 ee 70 call 0xe1dc ; 0xe1dc } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e61a: 8a ee ldi r24, 0xEA ; 234 e61c: 99 e3 ldi r25, 0x39 ; 57 e61e: 0e 94 b3 72 call 0xe566 ; 0xe566 e622: ac 01 movw r20, r24 e624: 62 e0 ldi r22, 0x02 ; 2 e626: 80 e0 ldi r24, 0x00 ; 0 e628: 0e 94 fb 6e call 0xddf6 ; 0xddf6 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 e62c: 83 e4 ldi r24, 0x43 ; 67 e62e: 9b e2 ldi r25, 0x2B ; 43 e630: 0f 94 76 20 call 0x240ec ; 0x240ec lcd_loading_filament(filament_name); st_synchronize(); } e634: df 91 pop r29 e636: 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(); e638: 0d 94 ef 42 jmp 0x285de ; 0x285de 0000e63c : * 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; e63c: 0f 94 c0 74 call 0x2e980 ; 0x2e980 e640: 8f 3f cpi r24, 0xFF ; 255 e642: 11 f1 breq .+68 ; 0xe688 lcd_update_enable(false); e644: 80 e0 ldi r24, 0x00 ; 0 e646: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); e64a: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e64e: 8e ef ldi r24, 0xFE ; 254 e650: 92 e5 ldi r25, 0x52 ; 82 e652: 0e 94 b3 72 call 0xe566 ; 0xe566 e656: ac 01 movw r20, r24 e658: 61 e0 ldi r22, 0x01 ; 1 e65a: 80 e0 ldi r24, 0x00 ; 0 e65c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e660: 80 e2 ldi r24, 0x20 ; 32 e662: 0e 94 96 6f call 0xdf2c ; 0xdf2c lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e666: 0f 94 c0 74 call 0x2e980 ; 0x2e980 e66a: 68 2f mov r22, r24 e66c: 70 e0 ldi r23, 0x00 ; 0 e66e: 6f 5f subi r22, 0xFF ; 255 e670: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e672: 07 2e mov r0, r23 e674: 00 0c add r0, r0 e676: 88 0b sbc r24, r24 e678: 99 0b sbc r25, r25 e67a: 0e 94 a0 70 call 0xe140 ; 0xe140 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e67e: 0f 94 44 ad call 0x35a88 ; 0x35a88 lcd_update_enable(true); e682: 81 e0 ldi r24, 0x01 ; 1 e684: 0c 94 2c 6f jmp 0xde58 ; 0xde58 } e688: 08 95 ret 0000e68a : } #ifdef TMC2130 bool calibrate_z_auto() { e68a: 4f 92 push r4 e68c: 5f 92 push r5 e68e: 6f 92 push r6 e690: 7f 92 push r7 e692: 8f 92 push r8 e694: 9f 92 push r9 e696: af 92 push r10 e698: bf 92 push r11 e69a: ef 92 push r14 e69c: ff 92 push r15 e69e: 0f 93 push r16 e6a0: 1f 93 push r17 e6a2: cf 93 push r28 e6a4: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e6a6: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e6aa: 84 ef ldi r24, 0xF4 ; 244 e6ac: 9d e4 ldi r25, 0x4D ; 77 e6ae: 0e 94 b3 72 call 0xe566 ; 0xe566 e6b2: ac 01 movw r20, r24 e6b4: 61 e0 ldi r22, 0x01 ; 1 e6b6: 80 e0 ldi r24, 0x00 ; 0 e6b8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e6bc: d0 91 b7 02 lds r29, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; e6c0: 81 e0 ldi r24, 0x01 ; 1 e6c2: 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); e6c6: ec e3 ldi r30, 0x3C ; 60 e6c8: fc e7 ldi r31, 0x7C ; 124 e6ca: 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); e6cc: 84 e0 ldi r24, 0x04 ; 4 e6ce: 0f 94 df 25 call 0x24bbe ; 0x24bbe current_position[Z_AXIS] = 0; e6d2: 82 e9 ldi r24, 0x92 ; 146 e6d4: e8 2e mov r14, r24 e6d6: 86 e0 ldi r24, 0x06 ; 6 e6d8: f8 2e mov r15, r24 e6da: f7 01 movw r30, r14 e6dc: 10 86 std Z+8, r1 ; 0x08 e6de: 11 86 std Z+9, r1 ; 0x09 e6e0: 12 86 std Z+10, r1 ; 0x0a e6e2: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e6e4: 0f 94 10 bf call 0x37e20 ; 0x37e20 set_destination_to_current(); e6e8: 0e 94 41 68 call 0xd082 ; 0xd082 #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); e6ec: e6 e3 ldi r30, 0x36 ; 54 e6ee: fc e7 ldi r31, 0x7C ; 124 e6f0: 85 90 lpm r8, Z+ e6f2: 95 90 lpm r9, Z+ e6f4: a5 90 lpm r10, Z+ e6f6: 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); e6f8: 04 e7 ldi r16, 0x74 ; 116 e6fa: 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); e6fc: 8c 2f mov r24, r28 e6fe: 99 27 eor r25, r25 e700: 81 95 neg r24 e702: 0c f4 brge .+2 ; 0xe706 e704: 90 95 com r25 e706: 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); e708: 07 2e mov r0, r23 e70a: 00 0c add r0, r0 e70c: 88 0b sbc r24, r24 e70e: 99 0b sbc r25, r25 e710: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> e714: 2b 01 movw r4, r22 e716: 3c 01 movw r6, r24 e718: 2d ec ldi r18, 0xCD ; 205 e71a: 3c ec ldi r19, 0xCC ; 204 e71c: 4c e8 ldi r20, 0x8C ; 140 e71e: 5f e3 ldi r21, 0x3F ; 63 e720: c5 01 movw r24, r10 e722: b4 01 movw r22, r8 e724: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> e728: 9b 01 movw r18, r22 e72a: ac 01 movw r20, r24 e72c: c3 01 movw r24, r6 e72e: b2 01 movw r22, r4 e730: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> e734: f8 01 movw r30, r16 e736: 20 85 ldd r18, Z+8 ; 0x08 e738: 31 85 ldd r19, Z+9 ; 0x09 e73a: 42 85 ldd r20, Z+10 ; 0x0a e73c: 53 85 ldd r21, Z+11 ; 0x0b e73e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> e742: f8 01 movw r30, r16 e744: 60 87 std Z+8, r22 ; 0x08 e746: 71 87 std Z+9, r23 ; 0x09 e748: 82 87 std Z+10, r24 ; 0x0a e74a: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e74c: 80 e0 ldi r24, 0x00 ; 0 e74e: 90 e0 ldi r25, 0x00 ; 0 e750: a8 e4 ldi r26, 0x48 ; 72 e752: b4 e4 ldi r27, 0x44 ; 68 e754: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e758: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e75c: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e760: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e764: 65 e5 ldi r22, 0x55 ; 85 e766: 75 e5 ldi r23, 0x55 ; 85 e768: 85 e5 ldi r24, 0x55 ; 85 e76a: 91 e4 ldi r25, 0x41 ; 65 e76c: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); e770: 0f 94 ef 42 call 0x285de ; 0x285de // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e774: 0f 94 b0 25 call 0x24b60 ; 0x24b60 e778: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[Z_AXIS] = 0; e77c: f7 01 movw r30, r14 e77e: 10 86 std Z+8, r1 ; 0x08 e780: 11 86 std Z+9, r1 ; 0x09 e782: 12 86 std Z+10, r1 ; 0x0a e784: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e786: 0f 94 10 bf call 0x37e20 ; 0x37e20 set_destination_to_current(); e78a: 0e 94 41 68 call 0xd082 ; 0xd082 destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e78e: f6 ef ldi r31, 0xF6 ; 246 e790: cf 02 muls r28, r31 e792: b0 01 movw r22, r0 e794: 11 24 eor r1, r1 e796: 07 2e mov r0, r23 e798: 00 0c add r0, r0 e79a: 88 0b sbc r24, r24 e79c: 99 0b sbc r25, r25 e79e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> e7a2: 9b 01 movw r18, r22 e7a4: ac 01 movw r20, r24 e7a6: f8 01 movw r30, r16 e7a8: 60 85 ldd r22, Z+8 ; 0x08 e7aa: 71 85 ldd r23, Z+9 ; 0x09 e7ac: 82 85 ldd r24, Z+10 ; 0x0a e7ae: 93 85 ldd r25, Z+11 ; 0x0b e7b0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> e7b4: f8 01 movw r30, r16 e7b6: 60 87 std Z+8, r22 ; 0x08 e7b8: 71 87 std Z+9, r23 ; 0x09 e7ba: 82 87 std Z+10, r24 ; 0x0a e7bc: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e7be: 80 e0 ldi r24, 0x00 ; 0 e7c0: 90 e0 ldi r25, 0x00 ; 0 e7c2: a8 ec ldi r26, 0xC8 ; 200 e7c4: b3 e4 ldi r27, 0x43 ; 67 e7c6: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 e7ca: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 e7ce: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba e7d2: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb plan_buffer_line_destinationXYZE(feedrate / 60); e7d6: 65 e5 ldi r22, 0x55 ; 85 e7d8: 75 e5 ldi r23, 0x55 ; 85 e7da: 85 ed ldi r24, 0xD5 ; 213 e7dc: 90 e4 ldi r25, 0x40 ; 64 e7de: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); e7e2: 0f 94 ef 42 call 0x285de ; 0x285de e7e6: 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; e7ea: 80 e0 ldi r24, 0x00 ; 0 e7ec: 90 e0 ldi r25, 0x00 ; 0 e7ee: a4 e5 ldi r26, 0x54 ; 84 e7f0: b3 e4 ldi r27, 0x43 ; 67 e7f2: f7 01 movw r30, r14 e7f4: 80 87 std Z+8, r24 ; 0x08 e7f6: 91 87 std Z+9, r25 ; 0x09 e7f8: a2 87 std Z+10, r26 ; 0x0a e7fa: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e7fc: 0f 94 10 bf call 0x37e20 ; 0x37e20 return true; } e800: 81 e0 ldi r24, 0x01 ; 1 e802: df 91 pop r29 e804: cf 91 pop r28 e806: 1f 91 pop r17 e808: 0f 91 pop r16 e80a: ff 90 pop r15 e80c: ef 90 pop r14 e80e: bf 90 pop r11 e810: af 90 pop r10 e812: 9f 90 pop r9 e814: 8f 90 pop r8 e816: 7f 90 pop r7 e818: 6f 90 pop r6 e81a: 5f 90 pop r5 e81c: 4f 90 pop r4 e81e: 08 95 ret 0000e820 : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e820: cf 93 push r28 e822: df 93 push r29 e824: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e826: 60 ff sbrs r22, 0 e828: 03 c0 rjmp .+6 ; 0xe830 e82a: 28 e5 ldi r18, 0x58 ; 88 e82c: 28 83 st Y, r18 e82e: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e830: 61 ff sbrs r22, 1 e832: 03 c0 rjmp .+6 ; 0xe83a e834: 29 e5 ldi r18, 0x59 ; 89 e836: 28 83 st Y, r18 e838: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e83a: 80 e2 ldi r24, 0x20 ; 32 e83c: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e83e: 80 e0 ldi r24, 0x00 ; 0 e840: 96 e3 ldi r25, 0x36 ; 54 e842: 0e 94 b3 72 call 0xe566 ; 0xe566 e846: bc 01 movw r22, r24 e848: ce 01 movw r24, r28 } e84a: df 91 pop r29 e84c: 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)); e84e: 0d 94 da d9 jmp 0x3b3b4 ; 0x3b3b4 0000e852 <__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 { e852: 1f 92 push r1 e854: 0f 92 push r0 e856: 0f b6 in r0, 0x3f ; 63 e858: 0f 92 push r0 e85a: 11 24 eor r1, r1 e85c: 0b b6 in r0, 0x3b ; 59 e85e: 0f 92 push r0 e860: 2f 93 push r18 e862: 8f 93 push r24 e864: 9f 93 push r25 e866: ef 93 push r30 e868: ff 93 push r31 switch(state){ e86a: e0 91 53 03 lds r30, 0x0353 ; 0x800353 e86e: e8 30 cpi r30, 0x08 ; 8 e870: e8 f4 brcc .+58 ; 0xe8ac <__vector_23+0x5a> e872: f0 e0 ldi r31, 0x00 ; 0 e874: 88 27 eor r24, r24 e876: e0 5c subi r30, 0xC0 ; 192 e878: fb 48 sbci r31, 0x8B ; 139 e87a: 8f 4f sbci r24, 0xFF ; 255 e87c: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> e880: 48 74 andi r20, 0x48 ; 72 e882: 62 74 andi r22, 0x42 ; 66 e884: 6d 74 andi r22, 0x4D ; 77 e886: 7b 74 andi r23, 0x4B ; 75 e888: 91 74 andi r25, 0x41 ; 65 e88a: 9a 74 andi r25, 0x4A ; 74 e88c: bd 74 andi r27, 0x4D ; 77 e88e: cf 74 andi r28, 0x4F ; 79 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin e890: 80 91 8d 06 lds r24, 0x068D ; 0x80068d e894: 81 11 cpse r24, r1 e896: 0a c0 rjmp .+20 ; 0xe8ac <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! e898: 80 91 1d 06 lds r24, 0x061D ; 0x80061d e89c: 88 0f add r24, r24 e89e: 80 93 52 03 sts 0x0352, r24 ; 0x800352 if( pwm != 0 ){ e8a2: 88 23 and r24, r24 e8a4: 19 f0 breq .+6 ; 0xe8ac <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period e8a6: 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 e8a8: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } e8ac: ff 91 pop r31 e8ae: ef 91 pop r30 e8b0: 9f 91 pop r25 e8b2: 8f 91 pop r24 e8b4: 2f 91 pop r18 e8b6: 0f 90 pop r0 e8b8: 0b be out 0x3b, r0 ; 59 e8ba: 0f 90 pop r0 e8bc: 0f be out 0x3f, r0 ; 63 e8be: 0f 90 pop r0 e8c0: 1f 90 pop r1 e8c2: 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) e8c4: 80 91 51 03 lds r24, 0x0351 ; 0x800351 e8c8: 8f 5f subi r24, 0xFF ; 255 e8ca: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter > pwm ){ e8ce: 90 91 52 03 lds r25, 0x0352 ; 0x800352 e8d2: 98 17 cp r25, r24 e8d4: 58 f3 brcs .-42 ; 0xe8ac <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 e8d6: 82 e0 ldi r24, 0x02 ; 2 e8d8: e7 cf rjmp .-50 ; 0xe8a8 <__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 e8da: 83 e0 ldi r24, 0x03 ; 3 e8dc: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e8e0: 8f e0 ldi r24, 0x0F ; 15 e8e2: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle e8e6: 8f ef ldi r24, 0xFF ; 255 e8e8: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e8ea: 81 e0 ldi r24, 0x01 ; 1 e8ec: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) e8ee: 84 b5 in r24, 0x24 ; 36 e8f0: 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 e8f2: 84 bd out 0x24, r24 ; 36 e8f4: db cf rjmp .-74 ; 0xe8ac <__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; e8f6: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e8fa: 82 95 swap r24 e8fc: 80 7f andi r24, 0xF0 ; 240 e8fe: 81 95 neg r24 e900: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ e902: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e906: 88 23 and r24, r24 e908: 21 f0 breq .+8 ; 0xe912 <__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; e90a: 81 50 subi r24, 0x01 ; 1 e90c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 e910: cd cf rjmp .-102 ; 0xe8ac <__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; e912: 84 e0 ldi r24, 0x04 ; 4 e914: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty e918: 8f ef ldi r24, 0xFF ; 255 e91a: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle e91c: 8e ef ldi r24, 0xFE ; 254 e91e: 86 bd out 0x26, r24 ; 38 e920: c5 cf rjmp .-118 ; 0xe8ac <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; e922: 85 e0 ldi r24, 0x05 ; 5 e924: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty e928: 8f ef ldi r24, 0xFF ; 255 e92a: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle e92c: 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 e92e: 82 e0 ldi r24, 0x02 ; 2 e930: 85 bd out 0x25, r24 ; 37 e932: bc cf rjmp .-136 ; 0xe8ac <__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; e934: 2f ef ldi r18, 0xFF ; 255 e936: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin e938: 80 91 8d 06 lds r24, 0x068D ; 0x80068d e93c: 81 11 cpse r24, r1 e93e: b6 cf rjmp .-148 ; 0xe8ac <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less e940: 80 91 51 03 lds r24, 0x0351 ; 0x800351 e944: 8f 5f subi r24, 0xFF ; 255 e946: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter < pwm ){ e94a: 90 91 52 03 lds r25, 0x0352 ; 0x800352 e94e: 89 17 cp r24, r25 e950: 08 f4 brcc .+2 ; 0xe954 <__vector_23+0x102> e952: ac cf rjmp .-168 ; 0xe8ac <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain e954: 80 91 1d 06 lds r24, 0x061D ; 0x80061d e958: 90 e0 ldi r25, 0x00 ; 0 e95a: 8f 37 cpi r24, 0x7F ; 127 e95c: 91 05 cpc r25, r1 e95e: 0c f0 brlt .+2 ; 0xe962 <__vector_23+0x110> e960: a5 cf rjmp .-182 ; 0xe8ac <__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; e962: 86 e0 ldi r24, 0x06 ; 6 e964: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE e968: 8f e0 ldi r24, 0x0F ; 15 e96a: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle e96e: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz e970: 81 e0 ldi r24, 0x01 ; 1 e972: 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 e974: 84 b5 in r24, 0x24 ; 36 e976: 80 61 ori r24, 0x10 ; 16 e978: bc cf rjmp .-136 ; 0xe8f2 <__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 e97a: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e97e: 82 95 swap r24 e980: 80 7f andi r24, 0xF0 ; 240 e982: 81 95 neg r24 e984: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ e986: 80 91 50 03 lds r24, 0x0350 ; 0x800350 e98a: 81 11 cpse r24, r1 e98c: be cf rjmp .-132 ; 0xe90a <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; e98e: 87 e0 ldi r24, 0x07 ; 7 e990: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes 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: 87 cf rjmp .-242 ; 0xe8ac <__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 e99e: 10 92 53 03 sts 0x0353, r1 ; 0x800353 TCNT0 = 128; e9a2: 80 e8 ldi r24, 0x80 ; 128 e9a4: 86 bd out 0x26, r24 ; 38 OCR0B = 255; e9a6: 8f ef ldi r24, 0xFF ; 255 e9a8: 88 bd out 0x28, r24 ; 40 e9aa: c1 cf rjmp .-126 ; 0xe92e <__vector_23+0xdc> 0000e9ac : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { e9ac: cf 93 push r28 e9ae: c8 2f mov r28, r24 e9b0: 68 2f mov r22, r24 e9b2: 87 e6 ldi r24, 0x67 ; 103 e9b4: 9f e0 ldi r25, 0x0F ; 15 e9b6: 0f 94 47 dc call 0x3b88e ; 0x3b88e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { e9ba: cc 23 and r28, r28 e9bc: 19 f0 breq .+6 ; 0xe9c4 fsensor.init(); } else { fsensor.deinit(); } } e9be: 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(); e9c0: 0d 94 40 7b jmp 0x2f680 ; 0x2f680 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; e9c4: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa filter = 0; e9c8: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } e9cc: cf 91 pop r28 e9ce: 08 95 ret 0000e9d0 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; e9d0: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f extruder_autofan_last_check = _millis(); e9d4: 0f 94 53 29 call 0x252a6 ; 0x252a6 e9d8: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 e9dc: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 e9e0: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 e9e4: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 } e9e8: 08 95 ret 0000e9ea <__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) { e9ea: 1f 92 push r1 e9ec: 0f 92 push r0 e9ee: 0f b6 in r0, 0x3f ; 63 e9f0: 0f 92 push r0 e9f2: 11 24 eor r1, r1 e9f4: 2f 93 push r18 e9f6: 4f 93 push r20 e9f8: 5f 93 push r21 e9fa: 6f 93 push r22 e9fc: 7f 93 push r23 e9fe: 8f 93 push r24 ea00: 9f 93 push r25 ea02: af 93 push r26 ea04: 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; ea06: 80 91 6f 06 lds r24, 0x066F ; 0x80066f ea0a: 88 23 and r24, r24 ea0c: f1 f0 breq .+60 ; 0xea4a <__vector_8+0x60> ea0e: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 ea12: 8b 34 cpi r24, 0x4B ; 75 ea14: d0 f0 brcs .+52 ; 0xea4a <__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 ea16: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ea1a: 86 ff sbrs r24, 6 ea1c: 24 c0 rjmp .+72 ; 0xea66 <__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; ea1e: 80 91 3b 06 lds r24, 0x063B ; 0x80063b ea22: 90 91 3c 06 lds r25, 0x063C ; 0x80063c ea26: a0 91 3d 06 lds r26, 0x063D ; 0x80063d ea2a: b0 91 3e 06 lds r27, 0x063E ; 0x80063e t_fan_rising_edge = millis_nc(); ea2e: 80 93 49 03 sts 0x0349, r24 ; 0x800349 ea32: 90 93 4a 03 sts 0x034A, r25 ; 0x80034a ea36: a0 93 4b 03 sts 0x034B, r26 ; 0x80034b ea3a: 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 ea3e: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ea42: 90 e4 ldi r25, 0x40 ; 64 ea44: 89 27 eor r24, r25 ea46: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ea4a: bf 91 pop r27 ea4c: af 91 pop r26 ea4e: 9f 91 pop r25 ea50: 8f 91 pop r24 ea52: 7f 91 pop r23 ea54: 6f 91 pop r22 ea56: 5f 91 pop r21 ea58: 4f 91 pop r20 ea5a: 2f 91 pop r18 ea5c: 0f 90 pop r0 ea5e: 0f be out 0x3f, r0 ; 63 ea60: 0f 90 pop r0 ea62: 1f 90 pop r1 ea64: 18 95 reti ea66: 80 91 3b 06 lds r24, 0x063B ; 0x80063b ea6a: 90 91 3c 06 lds r25, 0x063C ; 0x80063c ea6e: a0 91 3d 06 lds r26, 0x063D ; 0x80063d ea72: 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 ea76: 40 91 49 03 lds r20, 0x0349 ; 0x800349 ea7a: 50 91 4a 03 lds r21, 0x034A ; 0x80034a ea7e: 60 91 4b 03 lds r22, 0x034B ; 0x80034b ea82: 70 91 4c 03 lds r23, 0x034C ; 0x80034c ea86: 84 1b sub r24, r20 ea88: 95 0b sbc r25, r21 ea8a: a6 0b sbc r26, r22 ea8c: b7 0b sbc r27, r23 ea8e: 20 91 e7 03 lds r18, 0x03E7 ; 0x8003e7 ea92: 44 e0 ldi r20, 0x04 ; 4 ea94: 50 e0 ldi r21, 0x00 ; 0 ea96: 60 e0 ldi r22, 0x00 ; 0 ea98: 70 e0 ldi r23, 0x00 ; 0 ea9a: 25 36 cpi r18, 0x65 ; 101 ea9c: 20 f0 brcs .+8 ; 0xeaa6 <__vector_8+0xbc> ea9e: 43 e0 ldi r20, 0x03 ; 3 eaa0: 50 e0 ldi r21, 0x00 ; 0 eaa2: 60 e0 ldi r22, 0x00 ; 0 eaa4: 70 e0 ldi r23, 0x00 ; 0 eaa6: 84 17 cp r24, r20 eaa8: 95 07 cpc r25, r21 eaaa: a6 07 cpc r26, r22 eaac: b7 07 cpc r27, r23 eaae: 38 f2 brcs .-114 ; 0xea3e <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse eab0: 80 91 e4 05 lds r24, 0x05E4 ; 0x8005e4 eab4: 90 91 e5 05 lds r25, 0x05E5 ; 0x8005e5 eab8: 02 96 adiw r24, 0x02 ; 2 eaba: 90 93 e5 05 sts 0x05E5, r25 ; 0x8005e5 eabe: 80 93 e4 05 sts 0x05E4, r24 ; 0x8005e4 eac2: bd cf rjmp .-134 ; 0xea3e <__vector_8+0x54> 0000eac4 : 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; eac4: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d newFanSpeed = 0; if (fanState & 0x01) eac8: 80 fd sbrc r24, 0 eaca: 1c c0 rjmp .+56 ; 0xeb04 { //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; eacc: 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); ead0: 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) ead4: 8f ef ldi r24, 0xFF ; 255 ead6: 82 0f add r24, r18 ead8: 8e 3f cpi r24, 0xFE ; 254 eada: e8 f0 brcs .+58 ; 0xeb16 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); eadc: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eae0: 87 7f andi r24, 0xF7 ; 247 eae2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; eae6: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eaea: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); eaee: 9f b7 in r25, 0x3f ; 63 eaf0: 22 23 and r18, r18 eaf2: 61 f0 breq .+24 ; 0xeb0c eaf4: f8 94 cli eaf6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eafa: 80 62 ori r24, 0x20 ; 32 eafc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eb00: 9f bf out 0x3f, r25 ; 63 eb02: 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; eb04: 8f ef ldi r24, 0xFF ; 255 eb06: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b eb0a: e2 cf rjmp .-60 ; 0xead0 eb0c: f8 94 cli eb0e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> eb12: 8f 7d andi r24, 0xDF ; 223 eb14: f3 cf rjmp .-26 ; 0xeafc 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; eb16: ef b7 in r30, 0x3f ; 63 eb18: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); eb1a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eb1e: 88 60 ori r24, 0x08 ; 8 eb20: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; eb24: 30 e0 ldi r19, 0x00 ; 0 eb26: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> eb2a: 4f ef ldi r20, 0xFF ; 255 eb2c: 50 e0 ldi r21, 0x00 ; 0 eb2e: 81 ff sbrs r24, 1 eb30: 04 c0 rjmp .+8 ; 0xeb3a eb32: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> eb36: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> eb3a: 24 9f mul r18, r20 eb3c: c0 01 movw r24, r0 eb3e: 25 9f mul r18, r21 eb40: 90 0d add r25, r0 eb42: 34 9f mul r19, r20 eb44: 90 0d add r25, r0 eb46: 11 24 eor r1, r1 eb48: 6f ef ldi r22, 0xFF ; 255 eb4a: 70 e0 ldi r23, 0x00 ; 0 eb4c: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> eb50: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eb54: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; eb58: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } eb5a: 08 95 ret 0000eb5c : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { eb5c: 1f 93 push r17 eb5e: cf 93 push r28 eb60: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) eb62: d0 91 4d 03 lds r29, 0x034D ; 0x80034d eb66: d1 fd sbrc r29, 1 eb68: 1d c0 rjmp .+58 ; 0xeba4 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; eb6a: 10 91 1b 05 lds r17, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; eb6e: c1 e0 ldi r28, 0x01 ; 1 eb70: 20 e0 ldi r18, 0x00 ; 0 eb72: 30 e0 ldi r19, 0x00 ; 0 eb74: 48 e4 ldi r20, 0x48 ; 72 eb76: 52 e4 ldi r21, 0x42 ; 66 eb78: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 eb7c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 eb80: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 eb84: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 eb88: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> eb8c: 18 16 cp r1, r24 eb8e: 0c f0 brlt .+2 ; 0xeb92 eb90: 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; eb92: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; eb94: cd 2b or r28, r29 eb96: 81 e0 ldi r24, 0x01 ; 1 eb98: 11 11 cpse r17, r1 eb9a: 01 c0 rjmp .+2 ; 0xeb9e eb9c: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); eb9e: c8 2b or r28, r24 eba0: c0 93 4d 03 sts 0x034D, r28 ; 0x80034d } setExtruderAutoFanState(fanState); eba4: 80 91 4d 03 lds r24, 0x034D ; 0x80034d #endif } eba8: df 91 pop r29 ebaa: cf 91 pop r28 ebac: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); ebae: 0c 94 62 75 jmp 0xeac4 ; 0xeac4 0000ebb2 : 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) { ebb2: ef 92 push r14 ebb4: ff 92 push r15 ebb6: 0f 93 push r16 ebb8: 1f 93 push r17 ebba: cf 93 push r28 ebbc: df 93 push r29 ebbe: ec 01 movw r28, r24 ebc0: 8b 01 movw r16, r22 ebc2: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) ebc4: 0e 94 c2 5b call 0xb784 ; 0xb784 ebc8: 81 11 cpse r24, r1 ebca: 0b c0 rjmp .+22 ; 0xebe2 #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); ebcc: a8 01 movw r20, r16 ebce: be 01 movw r22, r28 ebd0: 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); } ebd2: df 91 pop r29 ebd4: cf 91 pop r28 ebd6: 1f 91 pop r17 ebd8: 0f 91 pop r16 ebda: ff 90 pop r15 ebdc: 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); ebde: 0d 94 37 dc jmp 0x3b86e ; 0x3b86e } 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); } ebe2: df 91 pop r29 ebe4: cf 91 pop r28 ebe6: 1f 91 pop r17 ebe8: 0f 91 pop r16 ebea: ff 90 pop r15 ebec: ef 90 pop r14 ebee: 08 95 ret 0000ebf0 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { ebf0: 0f 93 push r16 ebf2: 1f 93 push r17 ebf4: cf 93 push r28 ebf6: df 93 push r29 ebf8: 8c 01 movw r16, r24 ebfa: d6 2f mov r29, r22 ebfc: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); ebfe: 0f 94 31 dc call 0x3b862 ; 0x3b862 if (val == EEPROM_EMPTY_VALUE16) { ec02: 8f 3f cpi r24, 0xFF ; 255 ec04: 98 07 cpc r25, r24 ec06: 39 f4 brne .+14 ; 0xec16 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); ec08: 6d 2f mov r22, r29 ec0a: 7c 2f mov r23, r28 ec0c: c8 01 movw r24, r16 ec0e: 0f 94 81 dc call 0x3b902 ; 0x3b902 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; ec12: 8d 2f mov r24, r29 ec14: 9c 2f mov r25, r28 } return val; } ec16: df 91 pop r29 ec18: cf 91 pop r28 ec1a: 1f 91 pop r17 ec1c: 0f 91 pop r16 ec1e: 08 95 ret 0000ec20 : 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) { ec20: 0f 93 push r16 ec22: 1f 93 push r17 ec24: cf 93 push r28 ec26: 8c 01 movw r16, r24 ec28: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ec2a: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (val == EEPROM_EMPTY_VALUE) { ec2e: 8f 3f cpi r24, 0xFF ; 255 ec30: 29 f4 brne .+10 ; 0xec3c 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); ec32: 6c 2f mov r22, r28 ec34: c8 01 movw r24, r16 ec36: 0f 94 6b dc call 0x3b8d6 ; 0x3b8d6 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; ec3a: 8c 2f mov r24, r28 } return val; } ec3c: cf 91 pop r28 ec3e: 1f 91 pop r17 ec40: 0f 91 pop r16 ec42: 08 95 ret 0000ec44 : 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) { ec44: cf 93 push r28 ec46: df 93 push r29 ec48: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ec4a: 0f 94 31 dc call 0x3b862 ; 0x3b862 ec4e: bc 01 movw r22, r24 ec50: 6f 5f subi r22, 0xFF ; 255 ec52: 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); ec54: 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); } ec56: df 91 pop r29 ec58: 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); ec5a: 0d 94 81 dc jmp 0x3b902 ; 0x3b902 0000ec5e : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { ec5e: cf 93 push r28 ec60: df 93 push r29 ec62: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); ec64: 0f 94 23 dc call 0x3b846 ; 0x3b846 ec68: 61 e0 ldi r22, 0x01 ; 1 ec6a: 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); ec6c: 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); } ec6e: df 91 pop r29 ec70: 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); ec72: 0d 94 6b dc jmp 0x3b8d6 ; 0x3b8d6 0000ec76 : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { ec76: cf 93 push r28 ec78: df 93 push r29 ec7a: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); ec7c: 0f 94 23 dc call 0x3b846 ; 0x3b846 ec80: 61 e0 ldi r22, 0x01 ; 1 ec82: 81 11 cpse r24, r1 ec84: 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); ec86: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } ec88: df 91 pop r29 ec8a: 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); ec8c: 0d 94 6b dc jmp 0x3b8d6 ; 0x3b8d6 0000ec90 : 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); ec90: 2b e0 ldi r18, 0x0B ; 11 ec92: 82 9f mul r24, r18 ec94: c0 01 movw r24, r0 ec96: 11 24 eor r1, r1 ec98: 80 5b subi r24, 0xB0 ; 176 ec9a: 92 4f sbci r25, 0xF2 ; 242 ec9c: 0f 94 31 dc call 0x3b862 ; 0x3b862 eca0: 21 e0 ldi r18, 0x01 ; 1 eca2: 01 96 adiw r24, 0x01 ; 1 eca4: 09 f4 brne .+2 ; 0xeca8 eca6: 20 e0 ldi r18, 0x00 ; 0 } eca8: 82 2f mov r24, r18 ecaa: 08 95 ret 0000ecac : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { ecac: cf 93 push r28 ecae: df 93 push r29 ecb0: c8 2f mov r28, r24 ecb2: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; ecb4: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; ecb6: c8 30 cpi r28, 0x08 ; 8 ecb8: 0c f0 brlt .+2 ; 0xecbc ecba: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; ecbc: 8c 2f mov r24, r28 ecbe: 0e 94 48 76 call 0xec90 ; 0xec90 ecc2: 81 11 cpse r24, r1 ecc4: 03 c0 rjmp .+6 ; 0xeccc ecc6: 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) ecc8: a9 f7 brne .-22 ; 0xecb4 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; ecca: cf ef ldi r28, 0xFF ; 255 } eccc: 8c 2f mov r24, r28 ecce: df 91 pop r29 ecd0: cf 91 pop r28 ecd2: 08 95 ret 0000ecd4 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); ecd4: 81 ea ldi r24, 0xA1 ; 161 ecd6: 9d e0 ldi r25, 0x0D ; 13 ecd8: 0f 94 23 dc call 0x3b846 ; 0x3b846 sheet = eeprom_next_initialized_sheet(sheet); ecdc: 0e 94 56 76 call 0xecac ; 0xecac if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); ece0: 87 fd sbrc r24, 7 ece2: 05 c0 rjmp .+10 ; 0xecee if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ece4: 68 2f mov r22, r24 ece6: 81 ea ldi r24, 0xA1 ; 161 ece8: 9d e0 ldi r25, 0x0D ; 13 ecea: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e { 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); } ecee: 08 95 ret 0000ecf0 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { ecf0: 0f 93 push r16 ecf2: 1f 93 push r17 ecf4: cf 93 push r28 ecf6: c8 2f mov r28, r24 ecf8: 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")); ecfa: 62 e1 ldi r22, 0x12 ; 18 ecfc: 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) ecfe: 82 30 cpi r24, 0x02 ; 2 ed00: 70 f0 brcs .+28 ; 0xed1e { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); ed02: 6b e0 ldi r22, 0x0B ; 11 ed04: 79 e7 ldi r23, 0x79 ; 121 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) ed06: 84 30 cpi r24, 0x04 ; 4 ed08: 50 f0 brcs .+20 ; 0xed1e { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); ed0a: 63 e0 ldi r22, 0x03 ; 3 ed0c: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) ed0e: 84 30 cpi r24, 0x04 ; 4 ed10: 31 f0 breq .+12 ; 0xed1e { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); ed12: 6b ef ldi r22, 0xFB ; 251 ed14: 78 e7 ldi r23, 0x78 ; 120 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) ed16: 85 30 cpi r24, 0x05 ; 5 ed18: 11 f0 breq .+4 ; 0xed1e { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); ed1a: 64 ef ldi r22, 0xF4 ; 244 ed1c: 78 e7 ldi r23, 0x78 ; 120 ed1e: c8 01 movw r24, r16 ed20: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 } if (index <4 || index >5) ed24: 8c ef ldi r24, 0xFC ; 252 ed26: 8c 0f add r24, r28 ed28: 82 30 cpi r24, 0x02 ; 2 ed2a: 28 f0 brcs .+10 ; 0xed36 { sheetName.c[6] = '0' + ((index % 2)+1); ed2c: c1 70 andi r28, 0x01 ; 1 ed2e: cf 5c subi r28, 0xCF ; 207 ed30: f8 01 movw r30, r16 ed32: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; ed34: 17 82 std Z+7, r1 ; 0x07 } } ed36: cf 91 pop r28 ed38: 1f 91 pop r17 ed3a: 0f 91 pop r16 ed3c: 08 95 ret 0000ed3e : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); ed3e: 61 e0 ldi r22, 0x01 ; 1 ed40: 80 ec ldi r24, 0xC0 ; 192 ed42: 9f e0 ldi r25, 0x0F ; 15 ed44: 0f 94 47 dc call 0x3b88e ; 0x3b88e ed48: 60 e0 ldi r22, 0x00 ; 0 ed4a: 8f eb ldi r24, 0xBF ; 191 ed4c: 9f e0 ldi r25, 0x0F ; 15 ed4e: 0f 94 47 dc call 0x3b88e ; 0x3b88e ed52: 60 e0 ldi r22, 0x00 ; 0 ed54: 8e eb ldi r24, 0xBE ; 190 ed56: 9f e0 ldi r25, 0x0F ; 15 ed58: 0f 94 47 dc call 0x3b88e ; 0x3b88e ed5c: 60 e0 ldi r22, 0x00 ; 0 ed5e: 8d eb ldi r24, 0xBD ; 189 ed60: 9f e0 ldi r25, 0x0F ; 15 ed62: 0f 94 47 dc call 0x3b88e ; 0x3b88e ed66: 60 e0 ldi r22, 0x00 ; 0 ed68: 8c eb ldi r24, 0xBC ; 188 ed6a: 9f e0 ldi r25, 0x0F ; 15 ed6c: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0000ed70 : } void print_hex_byte(uint8_t val) { ed70: cf 93 push r28 ed72: c8 2f mov r28, r24 print_hex_nibble(val >> 4); ed74: 82 95 swap r24 ed76: 8f 70 andi r24, 0x0F ; 15 ed78: 0e 94 dc 63 call 0xc7b8 ; 0xc7b8 print_hex_nibble(val & 15); ed7c: 8c 2f mov r24, r28 ed7e: 8f 70 andi r24, 0x0F ; 15 } ed80: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); ed82: 0c 94 dc 63 jmp 0xc7b8 ; 0xc7b8 0000ed86 : // 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) { ed86: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 ed8a: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 ed8e: 18 16 cp r1, r24 ed90: 19 06 cpc r1, r25 ed92: 0c f0 brlt .+2 ; 0xed96 ed94: 43 c0 rjmp .+134 ; 0xee1c SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { ed96: 01 97 sbiw r24, 0x01 ; 1 ed98: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 ed9c: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 eda0: 89 2b or r24, r25 eda2: a1 f4 brne .+40 ; 0xedcc // Empty buffer. if (serial_count == 0) eda4: 80 91 9e 10 lds r24, 0x109E ; 0x80109e eda8: 90 91 9f 10 lds r25, 0x109F ; 0x80109f edac: 89 2b or r24, r25 edae: 21 f4 brne .+8 ; 0xedb8 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; edb0: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> edb4: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> bufindr = bufindw; edb8: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> edbc: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> edc0: 90 93 93 12 sts 0x1293, r25 ; 0x801293 edc4: 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; edc8: 81 e0 ldi r24, 0x01 ; 1 edca: 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) ; edcc: 80 91 92 12 lds r24, 0x1292 ; 0x801292 edd0: 90 91 93 12 lds r25, 0x1293 ; 0x801293 edd4: 03 96 adiw r24, 0x03 ; 3 edd6: fc 01 movw r30, r24 edd8: eb 55 subi r30, 0x5B ; 91 edda: ff 4e sbci r31, 0xEF ; 239 eddc: 20 81 ld r18, Z edde: 01 96 adiw r24, 0x01 ; 1 ede0: 21 11 cpse r18, r1 ede2: f9 cf rjmp .-14 ; 0xedd6 ede4: fc 01 movw r30, r24 ede6: eb 55 subi r30, 0x5B ; 91 ede8: 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) ; edea: 8d 3e cpi r24, 0xED ; 237 edec: 21 e0 ldi r18, 0x01 ; 1 edee: 92 07 cpc r25, r18 edf0: 40 f4 brcc .+16 ; 0xee02 edf2: 41 91 ld r20, Z+ edf4: 9c 01 movw r18, r24 edf6: 2f 5f subi r18, 0xFF ; 255 edf8: 3f 4f sbci r19, 0xFF ; 255 edfa: 41 11 cpse r20, r1 edfc: e1 cf rjmp .-62 ; 0xedc0 edfe: c9 01 movw r24, r18 ee00: f4 cf rjmp .-24 ; 0xedea // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { ee02: e5 ea ldi r30, 0xA5 ; 165 ee04: f0 e1 ldi r31, 0x10 ; 16 ee06: 8d 3e cpi r24, 0xED ; 237 ee08: 21 e0 ldi r18, 0x01 ; 1 ee0a: 92 07 cpc r25, r18 ee0c: c9 f6 brne .-78 ; 0xedc0 ee0e: cf 01 movw r24, r30 ee10: 85 5a subi r24, 0xA5 ; 165 ee12: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; ee14: 21 91 ld r18, Z+ ee16: 22 23 and r18, r18 ee18: d1 f3 breq .-12 ; 0xee0e ee1a: d2 cf rjmp .-92 ; 0xedc0 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; ee1c: 80 e0 ldi r24, 0x00 ; 0 } ee1e: 08 95 ret 0000ee20 : 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; ee20: 80 91 99 04 lds r24, 0x0499 ; 0x800499 ee24: 90 91 9a 04 lds r25, 0x049A ; 0x80049a ee28: 20 91 9b 04 lds r18, 0x049B ; 0x80049b ee2c: 30 91 9c 04 lds r19, 0x049C ; 0x80049c ee30: 82 1b sub r24, r18 ee32: 93 0b sbc r25, r19 } ee34: 8f 77 andi r24, 0x7F ; 127 ee36: 99 27 eor r25, r25 ee38: 08 95 ret 0000ee3a : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; ee3a: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) ee3c: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; ee3e: 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; ee40: db 01 movw r26, r22 ee42: 4d 91 ld r20, X+ ee44: bd 01 movw r22, r26 ee46: 40 32 cpi r20, 0x20 ; 32 ee48: 49 f0 breq .+18 ; 0xee5c if (i == 8) ee4a: 28 30 cpi r18, 0x08 ; 8 ee4c: 11 f4 brne .+4 ; 0xee52 { *pos++='.'; ee4e: 30 83 st Z, r19 ee50: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; ee52: db 01 movw r26, r22 ee54: 11 97 sbiw r26, 0x01 ; 1 ee56: 4c 91 ld r20, X ee58: 40 83 st Z, r20 ee5a: 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++) ee5c: 2f 5f subi r18, 0xFF ; 255 ee5e: 2b 30 cpi r18, 0x0B ; 11 ee60: 79 f7 brne .-34 ; 0xee40 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; ee62: 10 82 st Z, r1 return buffer; } ee64: 08 95 ret 0000ee66 : 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);} ee66: 40 e0 ldi r20, 0x00 ; 0 ee68: 50 e0 ldi r21, 0x00 ; 0 ee6a: ba 01 movw r22, r20 ee6c: 0d 94 99 56 jmp 0x2ad32 ; 0x2ad32 0000ee70 : 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();} ee70: fc 01 movw r30, r24 ee72: 23 81 ldd r18, Z+3 ; 0x03 ee74: 21 11 cpse r18, r1 ee76: 0d 94 77 58 jmp 0x2b0ee ; 0x2b0ee ee7a: 08 95 ret 0000ee7c : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) ee7c: 90 91 39 05 lds r25, 0x0539 ; 0x800539 ee80: 91 11 cpse r25, r1 ee82: 07 c0 rjmp .+14 ; 0xee92 { while (!((M_UCSRxA) & (1 << M_UDREx))); ee84: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> ee88: 95 ff sbrs r25, 5 ee8a: fc cf rjmp .-8 ; 0xee84 M_UDRx = c; ee8c: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> ee90: 08 95 ret } else if (selectedSerialPort == 1) ee92: 91 30 cpi r25, 0x01 ; 1 ee94: 31 f4 brne .+12 ; 0xeea2 { while (!((UCSR1A) & (1 << UDRE1))); ee96: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> ee9a: 95 ff sbrs r25, 5 ee9c: fc cf rjmp .-8 ; 0xee96 UDR1 = c; ee9e: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } eea2: 08 95 ret 0000eea4 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); eea4: 0e 94 3e 77 call 0xee7c ; 0xee7c return 0; } eea8: 90 e0 ldi r25, 0x00 ; 0 eeaa: 80 e0 ldi r24, 0x00 ; 0 eeac: 08 95 ret 0000eeae : 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) { eeae: cf 93 push r28 eeb0: df 93 push r29 eeb2: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { eeb4: fe 01 movw r30, r28 eeb6: 84 91 lpm r24, Z eeb8: 88 23 and r24, r24 eeba: 21 f0 breq .+8 ; 0xeec4 MYSERIAL.write((char)ch); eebc: 0e 94 3e 77 call 0xee7c ; 0xee7c ++str; eec0: 21 96 adiw r28, 0x01 ; 1 eec2: f8 cf rjmp .-16 ; 0xeeb4 } } eec4: df 91 pop r29 eec6: cf 91 pop r28 eec8: 08 95 ret 0000eeca : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { eeca: cf 92 push r12 eecc: df 92 push r13 eece: ef 92 push r14 eed0: 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]; eed2: c0 90 b0 0d lds r12, 0x0DB0 ; 0x800db0 eed6: d0 90 b1 0d lds r13, 0x0DB1 ; 0x800db1 eeda: e0 90 b2 0d lds r14, 0x0DB2 ; 0x800db2 eede: f0 90 b3 0d lds r15, 0x0DB3 ; 0x800db3 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); eee2: 89 e2 ldi r24, 0x29 ; 41 eee4: 9e e7 ldi r25, 0x7E ; 126 eee6: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); eeea: 42 e0 ldi r20, 0x02 ; 2 eeec: c7 01 movw r24, r14 eeee: b6 01 movw r22, r12 eef0: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); eef4: 81 e2 ldi r24, 0x21 ; 33 eef6: 9e e7 ldi r25, 0x7E ; 126 eef8: 0e 94 57 77 call 0xeeae ; 0xeeae eefc: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee ef00: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef ef04: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 ef08: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 ef0c: 41 e0 ldi r20, 0x01 ; 1 ef0e: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } ef12: ff 90 pop r15 ef14: ef 90 pop r14 ef16: df 90 pop r13 ef18: 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(); ef1a: 0d 94 04 d6 jmp 0x3ac08 ; 0x3ac08 0000ef1e : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { ef1e: 4f 92 push r4 ef20: 5f 92 push r5 ef22: 6f 92 push r6 ef24: 7f 92 push r7 ef26: 8f 92 push r8 ef28: 9f 92 push r9 ef2a: af 92 push r10 ef2c: bf 92 push r11 ef2e: cf 92 push r12 ef30: df 92 push r13 ef32: ef 92 push r14 ef34: ff 92 push r15 ef36: 0f 93 push r16 ef38: 1f 93 push r17 ef3a: cf 93 push r28 ef3c: df 93 push r29 ef3e: cc 24 eor r12, r12 ef40: ca 94 dec r12 ef42: dc 2c mov r13, r12 ef44: 76 01 movw r14, r12 ef46: 0e ea ldi r16, 0xAE ; 174 ef48: 1f e0 ldi r17, 0x0F ; 15 ef4a: 93 e2 ldi r25, 0x23 ; 35 ef4c: 89 2e mov r8, r25 ef4e: 91 2c mov r9, r1 ef50: a1 2c mov r10, r1 ef52: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; ef54: 41 2c mov r4, r1 ef56: 51 2c mov r5, r1 ef58: 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; ef5a: d0 e0 ldi r29, 0x00 ; 0 ef5c: 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) { ef5e: 8f ef ldi r24, 0xFF ; 255 ef60: c8 16 cp r12, r24 ef62: 09 f4 brne .+2 ; 0xef66 ef64: 5d c0 rjmp .+186 ; 0xf020 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); ef66: c8 01 movw r24, r16 ef68: 0f 94 31 dc call 0x3b862 ; 0x3b862 ef6c: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; ef6e: bc 01 movw r22, r24 ef70: 99 0f add r25, r25 ef72: 88 0b sbc r24, r24 ef74: 99 0b sbc r25, r25 ef76: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> ef7a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca ef7e: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb ef82: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc ef86: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd ef8a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> ef8e: 2b 01 movw r4, r22 ef90: 3c 01 movw r6, r24 ef92: c7 01 movw r24, r14 ef94: b6 01 movw r22, r12 ef96: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); ef9a: 8d e7 ldi r24, 0x7D ; 125 ef9c: 9d e7 ldi r25, 0x7D ; 125 ef9e: 0e 94 57 77 call 0xeeae ; 0xeeae efa2: c5 01 movw r24, r10 efa4: b4 01 movw r22, r8 efa6: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); efaa: 8d e7 ldi r24, 0x7D ; 125 efac: 9d e7 ldi r25, 0x7D ; 125 efae: 0e 94 57 77 call 0xeeae ; 0xeeae print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); efb2: be 01 movw r22, r28 efb4: 0d 2e mov r0, r29 efb6: 00 0c add r0, r0 efb8: 88 0b sbc r24, r24 efba: 99 0b sbc r25, r25 efbc: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); efc0: 8d e7 ldi r24, 0x7D ; 125 efc2: 9d e7 ldi r25, 0x7D ; 125 efc4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN(mm * 1000); efc8: 20 e0 ldi r18, 0x00 ; 0 efca: 30 e0 ldi r19, 0x00 ; 0 efcc: 4a e7 ldi r20, 0x7A ; 122 efce: 54 e4 ldi r21, 0x44 ; 68 efd0: c3 01 movw r24, r6 efd2: b2 01 movw r22, r4 efd4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> efd8: 0f 94 bb 74 call 0x2e976 ; 0x2e976 efdc: 85 e0 ldi r24, 0x05 ; 5 efde: 88 0e add r8, r24 efe0: 91 1c adc r9, r1 efe2: a1 1c adc r10, r1 efe4: b1 1c adc r11, r1 efe6: 0e 5f subi r16, 0xFE ; 254 efe8: 1f 4f sbci r17, 0xFF ; 255 efea: 8f ef ldi r24, 0xFF ; 255 efec: c8 1a sub r12, r24 efee: d8 0a sbc r13, r24 eff0: e8 0a sbc r14, r24 eff2: 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++) { eff4: 0a 3b cpi r16, 0xBA ; 186 eff6: 8f e0 ldi r24, 0x0F ; 15 eff8: 18 07 cpc r17, r24 effa: 09 f0 breq .+2 ; 0xeffe effc: b0 cf rjmp .-160 ; 0xef5e SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } effe: df 91 pop r29 f000: cf 91 pop r28 f002: 1f 91 pop r17 f004: 0f 91 pop r16 f006: ff 90 pop r15 f008: ef 90 pop r14 f00a: df 90 pop r13 f00c: cf 90 pop r12 f00e: bf 90 pop r11 f010: af 90 pop r10 f012: 9f 90 pop r9 f014: 8f 90 pop r8 f016: 7f 90 pop r7 f018: 6f 90 pop r6 f01a: 5f 90 pop r5 f01c: 4f 90 pop r4 f01e: 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); f020: 86 ee ldi r24, 0xE6 ; 230 f022: 97 e4 ldi r25, 0x47 ; 71 f024: 0e 94 57 77 call 0xeeae ; 0xeeae f028: b8 cf rjmp .-144 ; 0xef9a 0000f02a : /// @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) { f02a: 88 23 and r24, r24 f02c: 71 f1 breq .+92 ; 0xf08a currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f02e: 81 e7 ldi r24, 0x71 ; 113 f030: 9d e7 ldi r25, 0x7D ; 125 f032: 0e 94 57 77 call 0xeeae ; 0xeeae f036: 60 91 49 13 lds r22, 0x1349 ; 0x801349 f03a: 70 e0 ldi r23, 0x00 ; 0 f03c: 90 e0 ldi r25, 0x00 ; 0 f03e: 80 e0 ldi r24, 0x00 ; 0 f040: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f044: 80 91 49 13 lds r24, 0x1349 ; 0x801349 f048: 84 30 cpi r24, 0x04 ; 4 f04a: d8 f0 brcs .+54 ; 0xf082 f04c: 10 92 49 13 sts 0x1349, r1 ; 0x801349 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f050: 8c e6 ldi r24, 0x6C ; 108 f052: 9d e7 ldi r25, 0x7D ; 125 f054: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN((int)currentMMUSlot); f058: 80 91 49 13 lds r24, 0x1349 ; 0x801349 f05c: 90 e0 ldi r25, 0x00 ; 0 f05e: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 return currentMMUSlot; f062: 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; f066: 20 91 ac 05 lds r18, 0x05AC ; 0x8005ac f06a: 30 91 ad 05 lds r19, 0x05AD ; 0x8005ad f06e: 30 93 b7 0d sts 0x0DB7, r19 ; 0x800db7 f072: 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); f076: 0f 94 b7 0e call 0x21d6e ; 0x21d6e load_filament_final_feed(); // @@TODO verify f07a: 0e 94 9a 64 call 0xc934 ; 0xc934 st_synchronize(); f07e: 0d 94 ef 42 jmp 0x285de ; 0x285de { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f082: 8f 5f subi r24, 0xFF ; 255 f084: 80 93 49 13 sts 0x1349, r24 ; 0x801349 f088: e3 cf rjmp .-58 ; 0xf050 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); f08a: 8d ea ldi r24, 0xAD ; 173 f08c: 9b e3 ldi r25, 0x3B ; 59 f08e: 0e 94 b3 72 call 0xe566 ; 0xe566 f092: 70 e0 ldi r23, 0x00 ; 0 f094: 60 e0 ldi r22, 0x00 ; 0 f096: 0e 94 08 e4 call 0x1c810 ; 0x1c810 f09a: e5 cf rjmp .-54 ; 0xf066 0000f09c : return final_result; } void gcode_M114() { f09c: cf 93 push r28 f09e: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f0a0: 89 e6 ldi r24, 0x69 ; 105 f0a2: 9d e7 ldi r25, 0x7D ; 125 f0a4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOL(current_position[X_AXIS]); f0a8: c2 e9 ldi r28, 0x92 ; 146 f0aa: d6 e0 ldi r29, 0x06 ; 6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f0ac: 68 81 ld r22, Y f0ae: 79 81 ldd r23, Y+1 ; 0x01 f0b0: 8a 81 ldd r24, Y+2 ; 0x02 f0b2: 9b 81 ldd r25, Y+3 ; 0x03 f0b4: 42 e0 ldi r20, 0x02 ; 2 f0b6: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOLPGM(" Y:"); f0ba: 85 e6 ldi r24, 0x65 ; 101 f0bc: 9d e7 ldi r25, 0x7D ; 125 f0be: 0e 94 57 77 call 0xeeae ; 0xeeae f0c2: 6c 81 ldd r22, Y+4 ; 0x04 f0c4: 7d 81 ldd r23, Y+5 ; 0x05 f0c6: 8e 81 ldd r24, Y+6 ; 0x06 f0c8: 9f 81 ldd r25, Y+7 ; 0x07 f0ca: 42 e0 ldi r20, 0x02 ; 2 f0cc: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f0d0: 81 e6 ldi r24, 0x61 ; 97 f0d2: 9d e7 ldi r25, 0x7D ; 125 f0d4: 0e 94 57 77 call 0xeeae ; 0xeeae f0d8: 68 85 ldd r22, Y+8 ; 0x08 f0da: 79 85 ldd r23, Y+9 ; 0x09 f0dc: 8a 85 ldd r24, Y+10 ; 0x0a f0de: 9b 85 ldd r25, Y+11 ; 0x0b f0e0: 42 e0 ldi r20, 0x02 ; 2 f0e2: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f0e6: 8d e5 ldi r24, 0x5D ; 93 f0e8: 9d e7 ldi r25, 0x7D ; 125 f0ea: 0e 94 57 77 call 0xeeae ; 0xeeae f0ee: 6c 85 ldd r22, Y+12 ; 0x0c f0f0: 7d 85 ldd r23, Y+13 ; 0x0d f0f2: 8e 85 ldd r24, Y+14 ; 0x0e f0f4: 9f 85 ldd r25, Y+15 ; 0x0f f0f6: 42 e0 ldi r20, 0x02 ; 2 f0f8: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f0fc: 85 e3 ldi r24, 0x35 ; 53 f0fe: 96 e6 ldi r25, 0x66 ; 102 f100: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f104: 80 e0 ldi r24, 0x00 ; 0 f106: 0f 94 cd 42 call 0x2859a ; 0x2859a f10a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f10e: ce eb ldi r28, 0xBE ; 190 f110: dd e0 ldi r29, 0x0D ; 13 f112: 2c 81 ldd r18, Y+4 ; 0x04 f114: 3d 81 ldd r19, Y+5 ; 0x05 f116: 4e 81 ldd r20, Y+6 ; 0x06 f118: 5f 81 ldd r21, Y+7 ; 0x07 f11a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> f11e: 42 e0 ldi r20, 0x02 ; 2 f120: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOLPGM(" Y:"); f124: 89 e5 ldi r24, 0x59 ; 89 f126: 9d e7 ldi r25, 0x7D ; 125 f128: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f12c: 81 e0 ldi r24, 0x01 ; 1 f12e: 0f 94 cd 42 call 0x2859a ; 0x2859a f132: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f136: 28 85 ldd r18, Y+8 ; 0x08 f138: 39 85 ldd r19, Y+9 ; 0x09 f13a: 4a 85 ldd r20, Y+10 ; 0x0a f13c: 5b 85 ldd r21, Y+11 ; 0x0b f13e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> f142: 42 e0 ldi r20, 0x02 ; 2 f144: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOLPGM(" Z:"); f148: 85 e5 ldi r24, 0x55 ; 85 f14a: 9d e7 ldi r25, 0x7D ; 125 f14c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f150: 82 e0 ldi r24, 0x02 ; 2 f152: 0f 94 cd 42 call 0x2859a ; 0x2859a f156: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f15a: 2c 85 ldd r18, Y+12 ; 0x0c f15c: 3d 85 ldd r19, Y+13 ; 0x0d f15e: 4e 85 ldd r20, Y+14 ; 0x0e f160: 5f 85 ldd r21, Y+15 ; 0x0f f162: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> f166: 42 e0 ldi r20, 0x02 ; 2 f168: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOLPGM(" E:"); f16c: 81 e5 ldi r24, 0x51 ; 81 f16e: 9d e7 ldi r25, 0x7D ; 125 f170: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f174: 83 e0 ldi r24, 0x03 ; 3 f176: 0f 94 cd 42 call 0x2859a ; 0x2859a f17a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f17e: 28 89 ldd r18, Y+16 ; 0x10 f180: 39 89 ldd r19, Y+17 ; 0x11 f182: 4a 89 ldd r20, Y+18 ; 0x12 f184: 5b 89 ldd r21, Y+19 ; 0x13 f186: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> } f18a: df 91 pop r29 f18c: 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]); f18e: 0d 94 bb 74 jmp 0x2e976 ; 0x2e976 0000f192 : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f192: 80 e6 ldi r24, 0x60 ; 96 f194: 9c e7 ldi r25, 0x7C ; 124 f196: 0e 94 57 77 call 0xeeae ; 0xeeae f19a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 f19e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 f1a2: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 f1a6: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 f1aa: 41 e0 ldi r20, 0x01 ; 1 f1ac: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f1b0: 8d e5 ldi r24, 0x5D ; 93 f1b2: 9c e7 ldi r25, 0x7C ; 124 f1b4: 0e 94 57 77 call 0xeeae ; 0xeeae return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f1b8: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 f1bc: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 f1c0: 07 2e mov r0, r23 f1c2: 00 0c add r0, r0 f1c4: 88 0b sbc r24, r24 f1c6: 99 0b sbc r25, r25 f1c8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f1cc: 41 e0 ldi r20, 0x01 ; 1 f1ce: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f1d2: 89 e5 ldi r24, 0x59 ; 89 f1d4: 9c e7 ldi r25, 0x7C ; 124 f1d6: 0e 94 57 77 call 0xeeae ; 0xeeae f1da: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f1de: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f1e2: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f1e6: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f1ea: 41 e0 ldi r20, 0x01 ; 1 f1ec: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f1f0: 86 e5 ldi r24, 0x56 ; 86 f1f2: 9c e7 ldi r25, 0x7C ; 124 f1f4: 0e 94 57 77 call 0xeeae ; 0xeeae }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f1f8: 60 91 72 06 lds r22, 0x0672 ; 0x800672 f1fc: 70 91 73 06 lds r23, 0x0673 ; 0x800673 f200: 07 2e mov r0, r23 f202: 00 0c add r0, r0 f204: 88 0b sbc r24, r24 f206: 99 0b sbc r25, r25 f208: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f20c: 41 e0 ldi r20, 0x01 ; 1 f20e: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f212: 81 e5 ldi r24, 0x51 ; 81 f214: 9c e7 ldi r25, 0x7C ; 124 f216: 0e 94 57 77 call 0xeeae ; 0xeeae f21a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 f21e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 f222: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 f226: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 f22a: 41 e0 ldi r20, 0x01 ; 1 f22c: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f230: 8e e4 ldi r24, 0x4E ; 78 f232: 9c e7 ldi r25, 0x7C ; 124 f234: 0e 94 57 77 call 0xeeae ; 0xeeae return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f238: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 f23c: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 f240: 07 2e mov r0, r23 f242: 00 0c add r0, r0 f244: 88 0b sbc r24, r24 f246: 99 0b sbc r25, r25 f248: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f24c: 41 e0 ldi r20, 0x01 ; 1 f24e: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f252: 8a e4 ldi r24, 0x4A ; 74 f254: 9c e7 ldi r25, 0x7C ; 124 f256: 0e 94 57 77 call 0xeeae ; 0xeeae print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f25a: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> f25e: 70 e0 ldi r23, 0x00 ; 0 f260: 90 e0 ldi r25, 0x00 ; 0 f262: 80 e0 ldi r24, 0x00 ; 0 f264: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f268: 85 e4 ldi r24, 0x45 ; 69 f26a: 9c e7 ldi r25, 0x7C ; 124 f26c: 0e 94 57 77 call 0xeeae ; 0xeeae f270: 60 91 1d 06 lds r22, 0x061D ; 0x80061d f274: 70 e0 ldi r23, 0x00 ; 0 f276: 90 e0 ldi r25, 0x00 ; 0 f278: 80 e0 ldi r24, 0x00 ; 0 f27a: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f27e: 81 e4 ldi r24, 0x41 ; 65 f280: 9c e7 ldi r25, 0x7C ; 124 f282: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f286: 60 91 99 03 lds r22, 0x0399 ; 0x800399 f28a: 70 91 9a 03 lds r23, 0x039A ; 0x80039a f28e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b f292: 90 91 9c 03 lds r25, 0x039C ; 0x80039c f296: 41 e0 ldi r20, 0x01 ; 1 f298: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f29c: 8d e3 ldi r24, 0x3D ; 61 f29e: 9c e7 ldi r25, 0x7C ; 124 f2a0: 0e 94 57 77 call 0xeeae ; 0xeeae f2a4: 60 91 56 06 lds r22, 0x0656 ; 0x800656 f2a8: 70 91 57 06 lds r23, 0x0657 ; 0x800657 f2ac: 80 91 58 06 lds r24, 0x0658 ; 0x800658 f2b0: 90 91 59 06 lds r25, 0x0659 ; 0x800659 f2b4: 41 e0 ldi r20, 0x01 ; 1 f2b6: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f2ba: 0d 94 04 d6 jmp 0x3ac08 ; 0x3ac08 0000f2be : } } 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); } f2be: 20 91 88 14 lds r18, 0x1488 ; 0x801488 f2c2: 30 e0 ldi r19, 0x00 ; 0 f2c4: a8 ee ldi r26, 0xE8 ; 232 f2c6: b3 e0 ldi r27, 0x03 ; 3 f2c8: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> f2cc: ab 01 movw r20, r22 f2ce: bc 01 movw r22, r24 f2d0: 89 e8 ldi r24, 0x89 ; 137 f2d2: 94 e1 ldi r25, 0x14 ; 20 f2d4: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f2d8: 88 23 and r24, r24 f2da: 99 f0 breq .+38 ; 0xf302 f2dc: 80 91 87 14 lds r24, 0x1487 ; 0x801487 { if(autoReportFeatures.Temp()){ f2e0: 80 fd sbrc r24, 0 gcode_M105(); f2e2: 0e 94 c9 78 call 0xf192 ; 0xf192 f2e6: 80 91 87 14 lds r24, 0x1487 ; 0x801487 } if(autoReportFeatures.Pos()){ f2ea: 82 fd sbrc r24, 2 gcode_M114(); f2ec: 0e 94 4e 78 call 0xf09c ; 0xf09c f2f0: 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()){ f2f4: 81 fd sbrc r24, 1 gcode_M123(); f2f6: 0e 94 8b 66 call 0xcd16 ; 0xcd16 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f2fa: 89 e8 ldi r24, 0x89 ; 137 f2fc: 94 e1 ldi r25, 0x14 ; 20 f2fe: 0d 94 f6 2b jmp 0x257ec ; 0x257ec ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f302: 08 95 ret 0000f304 : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f304: 0e 94 57 77 call 0xeeae ; 0xeeae MYSERIAL.println(); f308: 0d 94 04 d6 jmp 0x3ac08 ; 0x3ac08 0000f30c : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f30c: 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))); f30e: 81 ea ldi r24, 0xA1 ; 161 f310: 9d e0 ldi r25, 0x0D ; 13 f312: 0f 94 23 dc call 0x3b846 ; 0x3b846 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f316: cb e0 ldi r28, 0x0B ; 11 f318: 8c 9f mul r24, r28 f31a: c0 01 movw r24, r0 f31c: 11 24 eor r1, r1 f31e: 80 5b subi r24, 0xB0 ; 176 f320: 92 4f sbci r25, 0xF2 ; 242 f322: 0f 94 31 dc call 0x3b862 ; 0x3b862 s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f326: 81 56 subi r24, 0x61 ; 97 f328: 90 4f sbci r25, 0xF0 ; 240 f32a: 80 3a cpi r24, 0xA0 ; 160 f32c: 9f 40 sbci r25, 0x0F ; 15 f32e: c8 f0 brcs .+50 ; 0xf362 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"); f330: 88 ef ldi r24, 0xF8 ; 248 f332: 9d e7 ldi r25, 0x7D ; 125 f334: 0e 94 82 79 call 0xf304 ; 0xf304 eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f338: 81 ea ldi r24, 0xA1 ; 161 f33a: 9d e0 ldi r25, 0x0D ; 13 f33c: 0f 94 23 dc call 0x3b846 ; 0x3b846 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-> f340: 8c 9f mul r24, r28 f342: c0 01 movw r24, r0 f344: 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); f346: 70 e0 ldi r23, 0x00 ; 0 f348: 60 e0 ldi r22, 0x00 ; 0 f34a: 80 5b subi r24, 0xB0 ; 176 f34c: 92 4f sbci r25, 0xF2 ; 242 f34e: 0f 94 81 dc call 0x3b902 ; 0x3b902 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.")); f352: 8b eb ldi r24, 0xBB ; 187 f354: 9d e7 ldi r25, 0x7D ; 125 f356: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_update_enable(true); f35a: 81 e0 ldi r24, 0x01 ; 1 } } f35c: 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); f35e: 0c 94 2c 6f jmp 0xde58 ; 0xde58 } } f362: cf 91 pop r28 f364: 08 95 ret 0000f366 : // 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) { f366: ff 92 push r15 f368: 0f 93 push r16 f36a: 1f 93 push r17 f36c: cf 93 push r28 f36e: df 93 push r29 if(Stopped == false) { f370: 90 91 11 05 lds r25, 0x0511 ; 0x800511 f374: 91 11 cpse r25, r1 f376: 4f c0 rjmp .+158 ; 0xf416 f378: c8 2f mov r28, r24 Stopped = true; f37a: 81 e0 ldi r24, 0x01 ; 1 f37c: 80 93 11 05 sts 0x0511, r24 ; 0x800511 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f380: cc 23 and r28, r28 f382: 11 f1 breq .+68 ; 0xf3c8 f384: 0e 94 97 67 call 0xcf2e ; 0xcf2e f388: 88 23 and r24, r24 f38a: f1 f0 breq .+60 ; 0xf3c8 if (!printingIsPaused()) { f38c: 0e 94 8c 67 call 0xcf18 ; 0xcf18 f390: 81 11 cpse r24, r1 f392: 22 c0 rjmp .+68 ; 0xf3d8 lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f394: 81 ea ldi r24, 0xA1 ; 161 f396: 96 e3 ldi r25, 0x36 ; 54 f398: 0e 94 b3 72 call 0xe566 ; 0xe566 f39c: 63 e0 ldi r22, 0x03 ; 3 f39e: 0e 94 24 f1 call 0x1e248 ; 0x1e248 // 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; f3a2: f0 90 ae 05 lds r15, 0x05AE ; 0x8005ae uint16_t ext_temp = saved_extruder_temperature; f3a6: 00 91 ac 05 lds r16, 0x05AC ; 0x8005ac f3aa: 10 91 ad 05 lds r17, 0x05AD ; 0x8005ad uint8_t fan_speed = saved_fan_speed; f3ae: d0 91 ab 05 lds r29, 0x05AB ; 0x8005ab lcd_pause_print(); f3b2: 0f 94 5f 29 call 0x252be ; 0x252be saved_bed_temperature = bed_temp; f3b6: f0 92 ae 05 sts 0x05AE, r15 ; 0x8005ae saved_extruder_temperature = ext_temp; f3ba: 10 93 ad 05 sts 0x05AD, r17 ; 0x8005ad f3be: 00 93 ac 05 sts 0x05AC, r16 ; 0x8005ac saved_fan_speed = fan_speed; f3c2: d0 93 ab 05 sts 0x05AB, r29 ; 0x8005ab f3c6: 08 c0 rjmp .+16 ; 0xf3d8 } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f3c8: 61 e0 ldi r22, 0x01 ; 1 f3ca: 80 e0 ldi r24, 0x00 ; 0 f3cc: 0e 94 a1 f4 call 0x1e942 ; 0x1e942 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f3d0: 88 ea ldi r24, 0xA8 ; 168 f3d2: 9b ea ldi r25, 0xAB ; 171 f3d4: cc 23 and r28, r28 f3d6: 11 f0 breq .+4 ; 0xf3dc f3d8: 80 ed ldi r24, 0xD0 ; 208 f3da: 9b ea ldi r25, 0xAB ; 171 f3dc: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f3e0: 8e ea ldi r24, 0xAE ; 174 f3e2: 96 e6 ldi r25, 0x66 ; 102 f3e4: 0e 94 82 79 call 0xf304 ; 0xf304 // 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)); f3e8: 86 e9 ldi r24, 0x96 ; 150 f3ea: 96 e3 ldi r25, 0x36 ; 54 f3ec: 0e 94 b3 72 call 0xe566 ; 0xe566 f3f0: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 // 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); f3f4: 9f b7 in r25, 0x3f ; 63 f3f6: f8 94 cli f3f8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f3fc: 84 60 ori r24, 0x04 ; 4 f3fe: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f402: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f404: 0f 94 ad 1e call 0x23d5a ; 0x23d5a if(!allow_recovery) { f408: c1 11 cpse r28, r1 f40a: 05 c0 rjmp .+10 ; 0xf416 // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f40c: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 f410: 81 60 ori r24, 0x01 ; 1 f412: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 } } } f416: df 91 pop r29 f418: cf 91 pop r28 f41a: 1f 91 pop r17 f41c: 0f 91 pop r16 f41e: ff 90 pop r15 f420: 08 95 ret 0000f422 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f422: ec 01 movw r28, r24 cli(); // Stop interrupts f424: f8 94 cli disable_heater(); f426: 0f 94 1f 2f call 0x25e3e ; 0x25e3e disable_x(); f42a: 17 9a sbi 0x02, 7 ; 2 f42c: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); f430: 16 9a sbi 0x02, 6 ; 2 f432: 10 92 90 06 sts 0x0690, r1 ; 0x800690 poweroff_z(); disable_e0(); f436: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f438: 88 ea ldi r24, 0xA8 ; 168 f43a: 9b ea ldi r25, 0xAB ; 171 f43c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f440: 8c e9 ldi r24, 0x9C ; 156 f442: 9d e7 ldi r25, 0x7D ; 125 f444: 0e 94 82 79 call 0xf304 ; 0xf304 if (full_screen_message != NULL) { f448: 20 97 sbiw r28, 0x00 ; 0 f44a: 79 f0 breq .+30 ; 0xf46a SERIAL_ERRORLNRPGM(full_screen_message); f44c: ce 01 movw r24, r28 f44e: 0e 94 82 79 call 0xf304 ; 0xf304 f452: be 01 movw r22, r28 f454: 85 e9 ldi r24, 0x95 ; 149 f456: 9c e0 ldi r25, 0x0C ; 12 f458: 0f 94 81 dc call 0x3b902 ; 0x3b902 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); f45c: 62 e4 ldi r22, 0x42 ; 66 f45e: 84 e9 ldi r24, 0x94 ; 148 f460: 9c e0 ldi r25, 0x0C ; 12 f462: 0f 94 6b dc call 0x3b8d6 ; 0x3b8d6 // 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(); f466: 0e 94 53 67 call 0xcea6 ; 0xcea6 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f46a: c4 e9 ldi r28, 0x94 ; 148 f46c: dd e7 ldi r29, 0x7D ; 125 f46e: f1 cf rjmp .-30 ; 0xf452 0000f470 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f470: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f474: 86 fd sbrc r24, 6 f476: 35 c0 rjmp .+106 ; 0xf4e2 FORCE_HIGH_POWER_END; f478: 80 e0 ldi r24, 0x00 ; 0 f47a: 0e 94 b7 66 call 0xcd6e ; 0xcd6e current_position[Z_AXIS] = 0; f47e: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f482: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f486: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f48a: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f48e: 0f 94 10 bf call 0x37e20 ; 0x37e20 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f492: 20 e0 ldi r18, 0x00 ; 0 f494: 30 e0 ldi r19, 0x00 ; 0 f496: 40 ea ldi r20, 0xA0 ; 160 f498: 50 e4 ldi r21, 0x40 ; 64 f49a: 60 91 9a 06 lds r22, 0x069A ; 0x80069a f49e: 70 91 9b 06 lds r23, 0x069B ; 0x80069b f4a2: 80 91 9c 06 lds r24, 0x069C ; 0x80069c f4a6: 90 91 9d 06 lds r25, 0x069D ; 0x80069d f4aa: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> f4ae: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a f4b2: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b f4b6: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c f4ba: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f4be: e0 91 71 02 lds r30, 0x0271 ; 0x800271 f4c2: f0 91 72 02 lds r31, 0x0272 ; 0x800272 f4c6: 60 85 ldd r22, Z+8 ; 0x08 f4c8: 71 85 ldd r23, Z+9 ; 0x09 f4ca: 82 85 ldd r24, Z+10 ; 0x0a f4cc: 93 85 ldd r25, Z+11 ; 0x0b f4ce: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); f4d2: 0f 94 ef 42 call 0x285de ; 0x285de kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f4d6: 81 e5 ldi r24, 0x51 ; 81 f4d8: 94 e6 ldi r25, 0x64 ; 100 f4da: 0e 94 b3 72 call 0xe566 ; 0xe566 f4de: 0e 94 11 7a call 0xf422 ; 0xf422 } } f4e2: 08 95 ret 0000f4e4 : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f4e4: 2f 92 push r2 f4e6: 3f 92 push r3 f4e8: 4f 92 push r4 f4ea: 5f 92 push r5 f4ec: 6f 92 push r6 f4ee: 7f 92 push r7 f4f0: 8f 92 push r8 f4f2: 9f 92 push r9 f4f4: af 92 push r10 f4f6: bf 92 push r11 f4f8: cf 92 push r12 f4fa: df 92 push r13 f4fc: ef 92 push r14 f4fe: ff 92 push r15 f500: 0f 93 push r16 f502: 1f 93 push r17 f504: cf 93 push r28 f506: df 93 push r29 f508: cd b7 in r28, 0x3d ; 61 f50a: de b7 in r29, 0x3e ; 62 f50c: 60 97 sbiw r28, 0x10 ; 16 f50e: 0f b6 in r0, 0x3f ; 63 f510: f8 94 cli f512: de bf out 0x3e, r29 ; 62 f514: 0f be out 0x3f, r0 ; 63 f516: cd bf out 0x3d, r28 ; 61 f518: 28 2e mov r2, r24 f51a: 6e 87 std Y+14, r22 ; 0x0e f51c: 5a 87 std Y+10, r21 ; 0x0a f51e: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f520: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> f524: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f526: 77 24 eor r7, r7 f528: 73 94 inc r7 f52a: 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) f52e: 42 e0 ldi r20, 0x02 ; 2 f530: 84 17 cp r24, r20 f532: 09 f4 brne .+2 ; 0xf536 f534: d4 c1 rjmp .+936 ; 0xf8de 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); f536: 08 2f mov r16, r24 f538: 10 e0 ldi r17, 0x00 ; 0 f53a: f8 01 movw r30, r16 f53c: e6 5c subi r30, 0xC6 ; 198 f53e: 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); f540: 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); f542: 83 2d mov r24, r3 f544: 03 2c mov r0, r3 f546: 00 0c add r0, r0 f548: 99 0b sbc r25, r25 f54a: 9c 87 std Y+12, r25 ; 0x0c f54c: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f54e: d8 01 movw r26, r16 f550: aa 0f add r26, r26 f552: bb 1f adc r27, r27 f554: aa 0f add r26, r26 f556: bb 1f adc r27, r27 f558: ba 83 std Y+2, r27 ; 0x02 f55a: a9 83 std Y+1, r26 ; 0x01 f55c: fd 01 movw r30, r26 f55e: e3 53 subi r30, 0x33 ; 51 f560: fd 4f sbci r31, 0xFD ; 253 f562: 80 81 ld r24, Z f564: 91 81 ldd r25, Z+1 ; 0x01 f566: a2 81 ldd r26, Z+2 ; 0x02 f568: b3 81 ldd r27, Z+3 ; 0x03 f56a: 8b 83 std Y+3, r24 ; 0x03 f56c: 9c 83 std Y+4, r25 ; 0x04 f56e: ad 83 std Y+5, r26 ; 0x05 f570: be 83 std Y+6, r27 ; 0x06 f572: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f576: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f57a: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f57e: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f582: bc 01 movw r22, r24 f584: cd 01 movw r24, r26 f586: 0e 94 ce 66 call 0xcd9c ; 0xcd9c f58a: 6b 01 movw r12, r22 f58c: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f58e: 81 e0 ldi r24, 0x01 ; 1 f590: 02 2c mov r0, r2 f592: 01 c0 rjmp .+2 ; 0xf596 f594: 88 0f add r24, r24 f596: 0a 94 dec r0 f598: ea f7 brpl .-6 ; 0xf594 f59a: 0f 94 df 25 call 0x24bbe ; 0x24bbe // 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; f59e: a9 81 ldd r26, Y+1 ; 0x01 f5a0: ba 81 ldd r27, Y+2 ; 0x02 f5a2: ae 56 subi r26, 0x6E ; 110 f5a4: b9 4f sbci r27, 0xF9 ; 249 f5a6: b8 87 std Y+8, r27 ; 0x08 f5a8: af 83 std Y+7, r26 ; 0x07 f5aa: fd 01 movw r30, r26 f5ac: 10 82 st Z, r1 f5ae: 11 82 std Z+1, r1 ; 0x01 f5b0: 12 82 std Z+2, r1 ; 0x02 f5b2: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f5b4: 0f 94 10 bf call 0x37e20 ; 0x37e20 set_destination_to_current(); f5b8: 0e 94 41 68 call 0xd082 ; 0xd082 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f5bc: 63 2d mov r22, r3 f5be: 03 2c mov r0, r3 f5c0: 00 0c add r0, r0 f5c2: 77 0b sbc r23, r23 f5c4: 88 0b sbc r24, r24 f5c6: 99 0b sbc r25, r25 f5c8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f5cc: 4b 01 movw r8, r22 f5ce: 5c 01 movw r10, r24 f5d0: 49 81 ldd r20, Y+1 ; 0x01 f5d2: 5a 81 ldd r21, Y+2 ; 0x02 f5d4: 4c 58 subi r20, 0x8C ; 140 f5d6: 59 4f sbci r21, 0xF9 ; 249 f5d8: 58 8b std Y+16, r21 ; 0x10 f5da: 4f 87 std Y+15, r20 ; 0x0f f5dc: 20 e0 ldi r18, 0x00 ; 0 f5de: 30 e0 ldi r19, 0x00 ; 0 f5e0: 40 e4 ldi r20, 0x40 ; 64 f5e2: 50 ec ldi r21, 0xC0 ; 192 f5e4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f5e8: af 85 ldd r26, Y+15 ; 0x0f f5ea: b8 89 ldd r27, Y+16 ; 0x10 f5ec: 6d 93 st X+, r22 f5ee: 7d 93 st X+, r23 f5f0: 8d 93 st X+, r24 f5f2: 9c 93 st X, r25 f5f4: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f5f6: c7 01 movw r24, r14 f5f8: b6 01 movw r22, r12 f5fa: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f5fe: 0f 94 ef 42 call 0x285de ; 0x285de // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f602: 0f 94 05 4e call 0x29c0a ; 0x29c0a f606: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[axis] = 0; f60a: ef 81 ldd r30, Y+7 ; 0x07 f60c: f8 85 ldd r31, Y+8 ; 0x08 f60e: 10 82 st Z, r1 f610: 11 82 std Z+1, r1 ; 0x01 f612: 12 82 std Z+2, r1 ; 0x02 f614: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f616: 0f 94 10 bf call 0x37e20 ; 0x37e20 destination[axis] = 1. * axis_home_dir; f61a: af 85 ldd r26, Y+15 ; 0x0f f61c: b8 89 ldd r27, Y+16 ; 0x10 f61e: 8d 92 st X+, r8 f620: 9d 92 st X+, r9 f622: ad 92 st X+, r10 f624: bc 92 st X, r11 f626: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f628: c7 01 movw r24, r14 f62a: b6 01 movw r22, r12 f62c: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f630: 0f 94 ef 42 call 0x285de ; 0x285de f634: 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); f638: e9 81 ldd r30, Y+1 ; 0x01 f63a: fa 81 ldd r31, Y+2 ; 0x02 f63c: e2 5d subi r30, 0xD2 ; 210 f63e: 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); f640: 45 90 lpm r4, Z+ f642: 55 90 lpm r5, Z+ f644: 65 90 lpm r6, Z+ f646: 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); f648: 2d ec ldi r18, 0xCD ; 205 f64a: 3c ec ldi r19, 0xCC ; 204 f64c: 4c e8 ldi r20, 0x8C ; 140 f64e: 5f e3 ldi r21, 0x3F ; 63 f650: c5 01 movw r24, r10 f652: b4 01 movw r22, r8 f654: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f658: a3 01 movw r20, r6 f65a: 92 01 movw r18, r4 f65c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f660: ef 85 ldd r30, Y+15 ; 0x0f f662: f8 89 ldd r31, Y+16 ; 0x10 f664: 60 83 st Z, r22 f666: 71 83 std Z+1, r23 ; 0x01 f668: 82 83 std Z+2, r24 ; 0x02 f66a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f66c: c7 01 movw r24, r14 f66e: b6 01 movw r22, r12 f670: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f674: 0f 94 ef 42 call 0x285de ; 0x285de f678: 71 2c mov r7, r1 f67a: 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; f67c: 4f 80 ldd r4, Y+7 ; 0x07 f67e: 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(); f680: 0f 94 05 4e call 0x29c0a ; 0x29c0a f684: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(false); current_position[axis] = 0; f688: d2 01 movw r26, r4 f68a: 1d 92 st X+, r1 f68c: 1d 92 st X+, r1 f68e: 1d 92 st X+, r1 f690: 1c 92 st X, r1 f692: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f694: 0f 94 10 bf call 0x37e20 ; 0x37e20 destination[axis] = -10.f * axis_home_dir; f698: 20 e0 ldi r18, 0x00 ; 0 f69a: 30 e0 ldi r19, 0x00 ; 0 f69c: 40 e2 ldi r20, 0x20 ; 32 f69e: 51 ec ldi r21, 0xC1 ; 193 f6a0: c5 01 movw r24, r10 f6a2: b4 01 movw r22, r8 f6a4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f6a8: ef 85 ldd r30, Y+15 ; 0x0f f6aa: f8 89 ldd r31, Y+16 ; 0x10 f6ac: 60 83 st Z, r22 f6ae: 71 83 std Z+1, r23 ; 0x01 f6b0: 82 83 std Z+2, r24 ; 0x02 f6b2: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f6b4: c7 01 movw r24, r14 f6b6: b6 01 movw r22, r12 f6b8: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f6bc: 0f 94 ef 42 call 0x285de ; 0x285de endstops_hit_on_purpose(); f6c0: 0f 94 05 4e call 0x29c0a ; 0x29c0a f6c4: f1 e0 ldi r31, 0x01 ; 1 f6c6: 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; f6ca: 20 e0 ldi r18, 0x00 ; 0 f6cc: 30 e0 ldi r19, 0x00 ; 0 f6ce: 40 e3 ldi r20, 0x30 ; 48 f6d0: 51 e4 ldi r21, 0x41 ; 65 f6d2: c5 01 movw r24, r10 f6d4: b4 01 movw r22, r8 f6d6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f6da: af 85 ldd r26, Y+15 ; 0x0f f6dc: b8 89 ldd r27, Y+16 ; 0x10 f6de: 6d 93 st X+, r22 f6e0: 7d 93 st X+, r23 f6e2: 8d 93 st X+, r24 f6e4: 9c 93 st X, r25 f6e6: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; f6e8: 8b 81 ldd r24, Y+3 ; 0x03 f6ea: 9c 81 ldd r25, Y+4 ; 0x04 f6ec: ad 81 ldd r26, Y+5 ; 0x05 f6ee: be 81 ldd r27, Y+6 ; 0x06 f6f0: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f6f4: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f6f8: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f6fc: 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); f700: c7 01 movw r24, r14 f702: b6 01 movw r22, r12 f704: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f708: 0f 94 ef 42 call 0x285de ; 0x285de #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); f70c: 82 2d mov r24, r2 f70e: 0f 94 7c 24 call 0x248f8 ; 0x248f8 f712: 9c 01 movw r18, r24 f714: 44 e0 ldi r20, 0x04 ; 4 f716: 36 95 lsr r19 f718: 27 95 ror r18 f71a: 4a 95 dec r20 f71c: e1 f7 brne .-8 ; 0xf716 if (pstep) pstep[i] = mscnt >> 4; f71e: a9 85 ldd r26, Y+9 ; 0x09 f720: ba 85 ldd r27, Y+10 ; 0x0a f722: 10 97 sbiw r26, 0x00 ; 0 f724: 21 f0 breq .+8 ; 0xf72e f726: fd 01 movw r30, r26 f728: e6 0d add r30, r6 f72a: f7 1d adc r31, r7 f72c: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); f72e: 9f 93 push r25 f730: 8f 93 push r24 f732: 3f 93 push r19 f734: 2f 93 push r18 f736: 7f 92 push r7 f738: 6f 92 push r6 f73a: e6 e1 ldi r30, 0x16 ; 22 f73c: fc e7 ldi r31, 0x7C ; 124 f73e: ff 93 push r31 f740: ef 93 push r30 f742: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca f746: 4f ef ldi r20, 0xFF ; 255 f748: 64 1a sub r6, r20 f74a: 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++) f74c: 0f b6 in r0, 0x3f ; 63 f74e: f8 94 cli f750: de bf out 0x3e, r29 ; 62 f752: 0f be out 0x3f, r0 ; 63 f754: cd bf out 0x3d, r28 ; 61 f756: 9e 85 ldd r25, Y+14 ; 0x0e f758: 69 16 cp r6, r25 f75a: 08 f4 brcc .+2 ; 0xf75e f75c: 91 cf rjmp .-222 ; 0xf680 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(); f75e: 0f 94 05 4e call 0x29c0a ; 0x29c0a f762: 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)) f766: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 f76a: 88 23 and r24, r24 f76c: 09 f4 brne .+2 ; 0xf770 f76e: b2 c0 rjmp .+356 ; 0xf8d4 } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; f770: f8 01 movw r30, r16 f772: ed 50 subi r30, 0x0D ; 13 f774: fb 4f sbci r31, 0xFB ; 251 f776: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) f778: 60 34 cpi r22, 0x40 ; 64 f77a: 08 f0 brcs .+2 ; 0xf77e f77c: ab c0 rjmp .+342 ; 0xf8d4 endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; f77e: f8 01 movw r30, r16 f780: e6 5a subi r30, 0xA6 ; 166 f782: fd 4f sbci r31, 0xFD ; 253 f784: a0 81 ld r26, Z f786: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); f788: f8 01 movw r30, r16 f78a: eb 50 subi r30, 0x0B ; 11 f78c: fb 4f sbci r31, 0xFB ; 251 f78e: 80 81 ld r24, Z f790: 40 e0 ldi r20, 0x00 ; 0 f792: 51 e0 ldi r21, 0x01 ; 1 f794: 02 c0 rjmp .+4 ; 0xf79a f796: 56 95 lsr r21 f798: 47 95 ror r20 f79a: 8a 95 dec r24 f79c: e2 f7 brpl .-8 ; 0xf796 if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); f79e: 82 2d mov r24, r2 f7a0: 0f 94 aa 8b call 0x31754 ; 0x31754 if (back > 0) f7a4: bb 81 ldd r27, Y+3 ; 0x03 f7a6: bb 23 and r27, r27 f7a8: 39 f0 breq .+14 ; 0xf7b8 tmc2130_do_steps(axis, back, -axis_home_dir, 1000); f7aa: 43 2d mov r20, r3 f7ac: 41 95 neg r20 f7ae: 6b 2f mov r22, r27 f7b0: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); f7b2: 82 2d mov r24, r2 f7b4: 0f 94 7b 8b call 0x316f6 ; 0x316f6 tmc2130_home_exit(); f7b8: 0f 94 b0 25 call 0x24b60 ; 0x24b60 #endif //TMC2130 axis_is_at_home(axis); f7bc: 82 2d mov r24, r2 f7be: 0e 94 b1 5a call 0xb562 ; 0xb562 axis_known_position[axis] = true; f7c2: f8 01 movw r30, r16 f7c4: e1 57 subi r30, 0x71 ; 113 f7c6: f9 4f sbci r31, 0xF9 ; 249 f7c8: 81 e0 ldi r24, 0x01 ; 1 f7ca: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; f7cc: 6b 85 ldd r22, Y+11 ; 0x0b f7ce: 7c 85 ldd r23, Y+12 ; 0x0c f7d0: 71 95 neg r23 f7d2: 61 95 neg r22 f7d4: 71 09 sbc r23, r1 f7d6: 07 2e mov r0, r23 f7d8: 00 0c add r0, r0 f7da: 88 0b sbc r24, r24 f7dc: 99 0b sbc r25, r25 f7de: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f7e2: 2a e0 ldi r18, 0x0A ; 10 f7e4: 37 ed ldi r19, 0xD7 ; 215 f7e6: 43 e2 ldi r20, 0x23 ; 35 f7e8: 5c e3 ldi r21, 0x3C ; 60 f7ea: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f7ee: 4b 01 movw r8, r22 f7f0: 5c 01 movw r10, r24 f7f2: f8 01 movw r30, r16 f7f4: e8 5a subi r30, 0xA8 ; 168 f7f6: fd 4f sbci r31, 0xFD ; 253 f7f8: 60 81 ld r22, Z f7fa: 70 e0 ldi r23, 0x00 ; 0 f7fc: 90 e0 ldi r25, 0x00 ; 0 f7fe: 80 e0 ldi r24, 0x00 ; 0 f800: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f804: 9b 01 movw r18, r22 f806: ac 01 movw r20, r24 f808: c5 01 movw r24, r10 f80a: b4 01 movw r22, r8 f80c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f810: 4b 01 movw r8, r22 f812: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; f814: e9 81 ldd r30, Y+1 ; 0x01 f816: fa 81 ldd r31, Y+2 ; 0x02 f818: ee 56 subi r30, 0x6E ; 110 f81a: f9 4f sbci r31, 0xF9 ; 249 f81c: fc 83 std Y+4, r31 ; 0x04 f81e: eb 83 std Y+3, r30 ; 0x03 f820: ac 01 movw r20, r24 f822: 9b 01 movw r18, r22 f824: 60 81 ld r22, Z f826: 71 81 ldd r23, Z+1 ; 0x01 f828: 82 81 ldd r24, Z+2 ; 0x02 f82a: 93 81 ldd r25, Z+3 ; 0x03 f82c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> f830: ab 81 ldd r26, Y+3 ; 0x03 f832: bc 81 ldd r27, Y+4 ; 0x04 f834: 6d 93 st X+, r22 f836: 7d 93 st X+, r23 f838: 8d 93 st X+, r24 f83a: 9c 93 st X, r25 f83c: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f83e: 0f 94 10 bf call 0x37e20 ; 0x37e20 current_position[axis] += dist; f842: eb 81 ldd r30, Y+3 ; 0x03 f844: fc 81 ldd r31, Y+4 ; 0x04 f846: 20 81 ld r18, Z f848: 31 81 ldd r19, Z+1 ; 0x01 f84a: 42 81 ldd r20, Z+2 ; 0x02 f84c: 53 81 ldd r21, Z+3 ; 0x03 f84e: c5 01 movw r24, r10 f850: b4 01 movw r22, r8 f852: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> f856: ab 81 ldd r26, Y+3 ; 0x03 f858: bc 81 ldd r27, Y+4 ; 0x04 f85a: 6d 93 st X+, r22 f85c: 7d 93 st X+, r23 f85e: 8d 93 st X+, r24 f860: 9c 93 st X, r25 f862: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; f864: e9 81 ldd r30, Y+1 ; 0x01 f866: fa 81 ldd r31, Y+2 ; 0x02 f868: ec 58 subi r30, 0x8C ; 140 f86a: f9 4f sbci r31, 0xF9 ; 249 f86c: 60 83 st Z, r22 f86e: 71 83 std Z+1, r23 ; 0x01 f870: 82 83 std Z+2, r24 ; 0x02 f872: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); f874: 20 e0 ldi r18, 0x00 ; 0 f876: 30 e0 ldi r19, 0x00 ; 0 f878: 40 e0 ldi r20, 0x00 ; 0 f87a: 5f e3 ldi r21, 0x3F ; 63 f87c: c7 01 movw r24, r14 f87e: b6 01 movw r22, r12 f880: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f884: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f888: 0f 94 ef 42 call 0x285de ; 0x285de feedrate = 0.0; f88c: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 f890: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 f894: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba f898: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb f89c: fd 85 ldd r31, Y+13 ; 0x0d f89e: f0 93 b7 02 sts 0x02B7, r31 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } f8a2: 60 96 adiw r28, 0x10 ; 16 f8a4: 0f b6 in r0, 0x3f ; 63 f8a6: f8 94 cli f8a8: de bf out 0x3e, r29 ; 62 f8aa: 0f be out 0x3f, r0 ; 63 f8ac: cd bf out 0x3d, r28 ; 61 f8ae: df 91 pop r29 f8b0: cf 91 pop r28 f8b2: 1f 91 pop r17 f8b4: 0f 91 pop r16 f8b6: ff 90 pop r15 f8b8: ef 90 pop r14 f8ba: df 90 pop r13 f8bc: cf 90 pop r12 f8be: bf 90 pop r11 f8c0: af 90 pop r10 f8c2: 9f 90 pop r9 f8c4: 8f 90 pop r8 f8c6: 7f 90 pop r7 f8c8: 6f 90 pop r6 f8ca: 5f 90 pop r5 f8cc: 4f 90 pop r4 f8ce: 3f 90 pop r3 f8d0: 2f 90 pop r2 f8d2: 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); f8d4: 43 2d mov r20, r3 f8d6: 41 95 neg r20 f8d8: 68 e0 ldi r22, 0x08 ; 8 f8da: 70 e0 ldi r23, 0x00 ; 0 f8dc: 6a cf rjmp .-300 ; 0xf7b2 feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; f8de: 81 e0 ldi r24, 0x01 ; 1 f8e0: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #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); f8e4: ec e3 ldi r30, 0x3C ; 60 f8e6: fc e7 ldi r31, 0x7C ; 124 f8e8: b4 91 lpm r27, Z f8ea: 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; f8ec: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f8f0: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f8f4: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f8f8: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f8fc: 0f 94 10 bf call 0x37e20 ; 0x37e20 #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); f900: e6 e3 ldi r30, 0x36 ; 54 f902: fc e7 ldi r31, 0x7C ; 124 f904: 85 90 lpm r8, Z+ f906: 95 90 lpm r9, Z+ f908: a5 90 lpm r10, Z+ f90a: 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; f90c: e9 81 ldd r30, Y+1 ; 0x01 f90e: 6e 2f mov r22, r30 f910: ee 0f add r30, r30 f912: 77 0b sbc r23, r23 f914: 88 0b sbc r24, r24 f916: 99 0b sbc r25, r25 f918: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> f91c: 6b 01 movw r12, r22 f91e: 7c 01 movw r14, r24 f920: 20 e0 ldi r18, 0x00 ; 0 f922: 30 e0 ldi r19, 0x00 ; 0 f924: 40 ec ldi r20, 0xC0 ; 192 f926: 5f e3 ldi r21, 0x3F ; 63 f928: c5 01 movw r24, r10 f92a: b4 01 movw r22, r8 f92c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f930: a7 01 movw r20, r14 f932: 96 01 movw r18, r12 f934: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f938: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f93c: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f940: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f944: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f feedrate = homing_feedrate[axis]; f948: 80 e0 ldi r24, 0x00 ; 0 f94a: 90 e0 ldi r25, 0x00 ; 0 f94c: a8 e4 ldi r26, 0x48 ; 72 f94e: b4 e4 ldi r27, 0x44 ; 68 f950: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f954: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f958: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f95c: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb float feedrate_mm_s = get_feedrate_mm_s(feedrate); f960: bc 01 movw r22, r24 f962: cd 01 movw r24, r26 f964: 0e 94 ce 66 call 0xcd9c ; 0xcd9c f968: 4b 01 movw r8, r22 f96a: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); f96c: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f970: 0f 94 ef 42 call 0x285de ; 0x285de #ifdef TMC2130 check_Z_crash(); f974: 0e 94 38 7a call 0xf470 ; 0xf470 #endif //TMC2130 current_position[axis] = 0; f978: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a f97c: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b f980: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c f984: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d plan_set_position_curposXYZE(); f988: 0f 94 10 bf call 0x37e20 ; 0x37e20 #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); f98c: e2 e1 ldi r30, 0x12 ; 18 f98e: fc e7 ldi r31, 0x7C ; 124 f990: 65 91 lpm r22, Z+ f992: 75 91 lpm r23, Z+ f994: 85 91 lpm r24, Z+ f996: 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; f998: 90 58 subi r25, 0x80 ; 128 f99a: a7 01 movw r20, r14 f99c: 96 01 movw r18, r12 f99e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f9a2: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f9a6: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f9aa: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f9ae: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f plan_buffer_line_destinationXYZE(feedrate_mm_s); f9b2: c5 01 movw r24, r10 f9b4: b4 01 movw r22, r8 f9b6: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); f9ba: 0f 94 ef 42 call 0x285de ; 0x285de #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); f9be: e2 e1 ldi r30, 0x12 ; 18 f9c0: fc e7 ldi r31, 0x7C ; 124 f9c2: 65 91 lpm r22, Z+ f9c4: 75 91 lpm r23, Z+ f9c6: 85 91 lpm r24, Z+ f9c8: 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; f9ca: 9b 01 movw r18, r22 f9cc: ac 01 movw r20, r24 f9ce: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> f9d2: a7 01 movw r20, r14 f9d4: 96 01 movw r18, r12 f9d6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> f9da: 60 93 7c 06 sts 0x067C, r22 ; 0x80067c f9de: 70 93 7d 06 sts 0x067D, r23 ; 0x80067d f9e2: 80 93 7e 06 sts 0x067E, r24 ; 0x80067e f9e6: 90 93 7f 06 sts 0x067F, r25 ; 0x80067f feedrate = homing_feedrate[axis] / 2; f9ea: 80 e0 ldi r24, 0x00 ; 0 f9ec: 90 e0 ldi r25, 0x00 ; 0 f9ee: a8 ec ldi r26, 0xC8 ; 200 f9f0: b3 e4 ldi r27, 0x43 ; 67 f9f2: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 f9f6: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 f9fa: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba f9fe: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb feedrate_mm_s = get_feedrate_mm_s(feedrate); fa02: bc 01 movw r22, r24 fa04: cd 01 movw r24, r26 fa06: 0e 94 ce 66 call 0xcd9c ; 0xcd9c plan_buffer_line_destinationXYZE(feedrate_mm_s); fa0a: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); fa0e: 0f 94 ef 42 call 0x285de ; 0x285de #ifdef TMC2130 check_Z_crash(); fa12: 0e 94 38 7a call 0xf470 ; 0xf470 #endif //TMC2130 axis_is_at_home(axis); fa16: 82 e0 ldi r24, 0x02 ; 2 fa18: 0e 94 b1 5a call 0xb562 ; 0xb562 destination[axis] = current_position[axis]; fa1c: 80 91 9a 06 lds r24, 0x069A ; 0x80069a fa20: 90 91 9b 06 lds r25, 0x069B ; 0x80069b fa24: a0 91 9c 06 lds r26, 0x069C ; 0x80069c fa28: b0 91 9d 06 lds r27, 0x069D ; 0x80069d fa2c: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c fa30: 90 93 7d 06 sts 0x067D, r25 ; 0x80067d fa34: a0 93 7e 06 sts 0x067E, r26 ; 0x80067e fa38: b0 93 7f 06 sts 0x067F, r27 ; 0x80067f feedrate = 0.0; fa3c: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 fa40: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 fa44: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fa48: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb endstops_hit_on_purpose(); fa4c: 0f 94 05 4e call 0x29c0a ; 0x29c0a axis_known_position[axis] = true; fa50: 70 92 91 06 sts 0x0691, r7 ; 0x800691 #ifdef TMC2130 FORCE_HIGH_POWER_END; fa54: 80 e0 ldi r24, 0x00 ; 0 fa56: 0e 94 b7 66 call 0xcd6e ; 0xcd6e fa5a: 20 cf rjmp .-448 ; 0xf89c 0000fa5c : #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 { fa5c: 2f 92 push r2 fa5e: 3f 92 push r3 fa60: 4f 92 push r4 fa62: 5f 92 push r5 fa64: 6f 92 push r6 fa66: 7f 92 push r7 fa68: 8f 92 push r8 fa6a: 9f 92 push r9 fa6c: af 92 push r10 fa6e: bf 92 push r11 fa70: cf 92 push r12 fa72: df 92 push r13 fa74: ef 92 push r14 fa76: ff 92 push r15 fa78: 0f 93 push r16 fa7a: 1f 93 push r17 fa7c: cf 93 push r28 fa7e: df 93 push r29 fa80: 00 d0 rcall .+0 ; 0xfa82 fa82: 1f 92 push r1 fa84: 1f 92 push r1 fa86: cd b7 in r28, 0x3d ; 61 fa88: de b7 in r29, 0x3e ; 62 fa8a: d8 2e mov r13, r24 fa8c: 2a 01 movw r4, r20 fa8e: 3b 01 movw r6, r22 fa90: 32 2e mov r3, r18 fa92: e9 82 std Y+1, r14 ; 0x01 fa94: fa 82 std Y+2, r15 ; 0x02 fa96: 0b 83 std Y+3, r16 ; 0x03 fa98: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fa9a: 0f 94 ef 42 call 0x285de ; 0x285de homing_flag = true; fa9e: 81 e0 ldi r24, 0x01 ; 1 faa0: 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; faa4: fc 2c mov r15, r12 faa6: e3 2c mov r14, r3 faa8: d3 10 cpse r13, r3 faaa: 10 c0 rjmp .+32 ; 0xfacc faac: ed 2c mov r14, r13 faae: dc 10 cpse r13, r12 fab0: 0d c0 rjmp .+26 ; 0xfacc // 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); fab2: 60 e0 ldi r22, 0x00 ; 0 fab4: 70 e0 ldi r23, 0x00 ; 0 fab6: 80 ea ldi r24, 0xA0 ; 160 fab8: 90 e4 ldi r25, 0x40 ; 64 faba: 0e 94 67 6e call 0xdcce ; 0xdcce // 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; fabe: ff 24 eor r15, r15 fac0: f3 94 inc r15 fac2: ee 24 eor r14, r14 fac4: e3 94 inc r14 fac6: 22 24 eor r2, r2 fac8: 23 94 inc r2 faca: 01 c0 rjmp .+2 ; 0xface 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; facc: 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(); face: 0f 94 3d ce call 0x39c7a ; 0x39c7a // 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; fad2: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 fad6: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; fad8: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); fadc: 82 e0 ldi r24, 0x02 ; 2 fade: 0f 94 db 42 call 0x285b6 ; 0x285b6 fae2: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fae6: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b faea: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c faee: 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) faf2: f1 10 cpse r15, r1 babystep_undo(); faf4: 0f 94 e2 c9 call 0x393c4 ; 0x393c4 int l_feedmultiply = setup_for_endstop_move(); faf8: 81 e0 ldi r24, 0x01 ; 1 fafa: 0e 94 ef 66 call 0xcdde ; 0xcdde fafe: 8c 01 movw r16, r24 set_destination_to_current(); fb00: 0e 94 41 68 call 0xd082 ; 0xd082 feedrate = 0.0; fb04: 10 92 b8 02 sts 0x02B8, r1 ; 0x8002b8 fb08: 10 92 b9 02 sts 0x02B9, r1 ; 0x8002b9 fb0c: 10 92 ba 02 sts 0x02BA, r1 ; 0x8002ba fb10: 10 92 bb 02 sts 0x02BB, r1 ; 0x8002bb current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fb14: 22 20 and r2, r2 fb16: 09 f4 brne .+2 ; 0xfb1a fb18: 77 c1 rjmp .+750 ; 0xfe08 { if (!calib) fb1a: 9b 8d ldd r25, Y+27 ; 0x1b fb1c: 91 11 cpse r25, r1 fb1e: 6a c1 rjmp .+724 ; 0xfdf4 homeaxis(X_AXIS); fb20: 50 e0 ldi r21, 0x00 ; 0 fb22: 40 e0 ldi r20, 0x00 ; 0 fb24: 61 e0 ldi r22, 0x01 ; 1 fb26: 80 e0 ldi r24, 0x00 ; 0 fb28: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 else tmc2130_home_calibrate(X_AXIS); } if(home_y) fb2c: ee 20 and r14, r14 fb2e: 31 f0 breq .+12 ; 0xfb3c { if (!calib) homeaxis(Y_AXIS); fb30: 50 e0 ldi r21, 0x00 ; 0 fb32: 40 e0 ldi r20, 0x00 ; 0 fb34: 61 e0 ldi r22, 0x01 ; 1 fb36: 81 e0 ldi r24, 0x01 ; 1 fb38: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fb3c: dd 20 and r13, r13 fb3e: e9 f0 breq .+58 ; 0xfb7a fb40: 41 14 cp r4, r1 fb42: 51 04 cpc r5, r1 fb44: 61 04 cpc r6, r1 fb46: 71 04 cpc r7, r1 fb48: c1 f0 breq .+48 ; 0xfb7a current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fb4a: c3 01 movw r24, r6 fb4c: b2 01 movw r22, r4 fb4e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> fb52: 9b 01 movw r18, r22 fb54: ac 01 movw r20, r24 fb56: 60 91 16 0e lds r22, 0x0E16 ; 0x800e16 fb5a: 70 91 17 0e lds r23, 0x0E17 ; 0x800e17 fb5e: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 fb62: 90 91 19 0e lds r25, 0x0E19 ; 0x800e19 fb66: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> fb6a: 60 93 92 06 sts 0x0692, r22 ; 0x800692 fb6e: 70 93 93 06 sts 0x0693, r23 ; 0x800693 fb72: 80 93 94 06 sts 0x0694, r24 ; 0x800694 fb76: 90 93 95 06 sts 0x0695, r25 ; 0x800695 if(home_y_axis && home_y_value != 0) fb7a: 33 20 and r3, r3 fb7c: 01 f1 breq .+64 ; 0xfbbe fb7e: 89 81 ldd r24, Y+1 ; 0x01 fb80: 9a 81 ldd r25, Y+2 ; 0x02 fb82: ab 81 ldd r26, Y+3 ; 0x03 fb84: bc 81 ldd r27, Y+4 ; 0x04 fb86: 00 97 sbiw r24, 0x00 ; 0 fb88: a1 05 cpc r26, r1 fb8a: b1 05 cpc r27, r1 fb8c: c1 f0 breq .+48 ; 0xfbbe current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; fb8e: bc 01 movw r22, r24 fb90: cd 01 movw r24, r26 fb92: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> fb96: 9b 01 movw r18, r22 fb98: ac 01 movw r20, r24 fb9a: 60 91 1a 0e lds r22, 0x0E1A ; 0x800e1a fb9e: 70 91 1b 0e lds r23, 0x0E1B ; 0x800e1b fba2: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c fba6: 90 91 1d 0e lds r25, 0x0E1D ; 0x800e1d fbaa: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> fbae: 60 93 96 06 sts 0x0696, r22 ; 0x800696 fbb2: 70 93 97 06 sts 0x0697, r23 ; 0x800697 fbb6: 80 93 98 06 sts 0x0698, r24 ; 0x800698 fbba: 90 93 99 06 sts 0x0699, r25 ; 0x800699 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { fbbe: ff 20 and r15, r15 fbc0: 09 f4 brne .+2 ; 0xfbc4 fbc2: a2 c0 rjmp .+324 ; 0xfd08 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); fbc4: 60 e0 ldi r22, 0x00 ; 0 fbc6: 70 e0 ldi r23, 0x00 ; 0 fbc8: 80 ea ldi r24, 0xA0 ; 160 fbca: 90 e4 ldi r25, 0x40 ; 64 fbcc: 0e 94 67 6e call 0xdcce ; 0xdcce if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fbd0: 80 91 8f 06 lds r24, 0x068F ; 0x80068f fbd4: 81 11 cpse r24, r1 fbd6: 05 c0 rjmp .+10 ; 0xfbe2 fbd8: 50 e0 ldi r21, 0x00 ; 0 fbda: 40 e0 ldi r20, 0x00 ; 0 fbdc: 61 e0 ldi r22, 0x01 ; 1 fbde: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); fbe2: 80 91 90 06 lds r24, 0x0690 ; 0x800690 fbe6: 81 11 cpse r24, r1 fbe8: 06 c0 rjmp .+12 ; 0xfbf6 fbea: 50 e0 ldi r21, 0x00 ; 0 fbec: 40 e0 ldi r20, 0x00 ; 0 fbee: 61 e0 ldi r22, 0x01 ; 1 fbf0: 81 e0 ldi r24, 0x01 ; 1 fbf2: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); fbf6: 0f 94 a2 ce call 0x39d44 ; 0x39d44 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); fbfa: ec ee ldi r30, 0xEC ; 236 fbfc: f5 ea ldi r31, 0xA5 ; 165 fbfe: 85 91 lpm r24, Z+ fc00: 95 91 lpm r25, Z+ fc02: a5 91 lpm r26, Z+ fc04: b4 91 lpm r27, Z fc06: e8 ee ldi r30, 0xE8 ; 232 fc08: f5 ea ldi r31, 0xA5 ; 165 fc0a: 45 91 lpm r20, Z+ fc0c: 55 91 lpm r21, Z+ fc0e: 65 91 lpm r22, Z+ fc10: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; fc12: 40 93 74 06 sts 0x0674, r20 ; 0x800674 fc16: 50 93 75 06 sts 0x0675, r21 ; 0x800675 fc1a: 60 93 76 06 sts 0x0676, r22 ; 0x800676 fc1e: 70 93 77 06 sts 0x0677, r23 ; 0x800677 out_y = y; fc22: 80 93 78 06 sts 0x0678, r24 ; 0x800678 fc26: 90 93 79 06 sts 0x0679, r25 ; 0x800679 fc2a: a0 93 7a 06 sts 0x067A, r26 ; 0x80067a fc2e: b0 93 7b 06 sts 0x067B, r27 ; 0x80067b world2machine(out_x, out_y); fc32: 68 e7 ldi r22, 0x78 ; 120 fc34: 76 e0 ldi r23, 0x06 ; 6 fc36: 84 e7 ldi r24, 0x74 ; 116 fc38: 96 e0 ldi r25, 0x06 ; 6 fc3a: 0e 94 09 6a call 0xd412 ; 0xd412 world2machine_reset(); fc3e: 0f 94 04 ce call 0x39c08 ; 0x39c08 if (destination[Y_AXIS] < Y_MIN_POS) fc42: 20 e0 ldi r18, 0x00 ; 0 fc44: 30 e0 ldi r19, 0x00 ; 0 fc46: 40 e8 ldi r20, 0x80 ; 128 fc48: 50 ec ldi r21, 0xC0 ; 192 fc4a: 60 91 78 06 lds r22, 0x0678 ; 0x800678 fc4e: 70 91 79 06 lds r23, 0x0679 ; 0x800679 fc52: 80 91 7a 06 lds r24, 0x067A ; 0x80067a fc56: 90 91 7b 06 lds r25, 0x067B ; 0x80067b fc5a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> fc5e: 87 ff sbrs r24, 7 fc60: 0c c0 rjmp .+24 ; 0xfc7a destination[Y_AXIS] = Y_MIN_POS; fc62: 80 e0 ldi r24, 0x00 ; 0 fc64: 90 e0 ldi r25, 0x00 ; 0 fc66: a0 e8 ldi r26, 0x80 ; 128 fc68: b0 ec ldi r27, 0xC0 ; 192 fc6a: 80 93 78 06 sts 0x0678, r24 ; 0x800678 fc6e: 90 93 79 06 sts 0x0679, r25 ; 0x800679 fc72: a0 93 7a 06 sts 0x067A, r26 ; 0x80067a fc76: b0 93 7b 06 sts 0x067B, r27 ; 0x80067b feedrate = homing_feedrate[X_AXIS] / 20; fc7a: 80 e0 ldi r24, 0x00 ; 0 fc7c: 90 e0 ldi r25, 0x00 ; 0 fc7e: a6 e1 ldi r26, 0x16 ; 22 fc80: b3 e4 ldi r27, 0x43 ; 67 fc82: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 fc86: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 fc8a: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba fc8e: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb fc92: 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(); fc96: 0f 94 10 bf call 0x37e20 ; 0x37e20 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); fc9a: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 fc9e: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 fca2: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba fca6: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb fcaa: 0f 94 1d c0 call 0x3803a ; 0x3803a st_synchronize(); fcae: 0f 94 ef 42 call 0x285de ; 0x285de current_position[X_AXIS] = destination[X_AXIS]; fcb2: 80 91 74 06 lds r24, 0x0674 ; 0x800674 fcb6: 90 91 75 06 lds r25, 0x0675 ; 0x800675 fcba: a0 91 76 06 lds r26, 0x0676 ; 0x800676 fcbe: b0 91 77 06 lds r27, 0x0677 ; 0x800677 fcc2: 80 93 92 06 sts 0x0692, r24 ; 0x800692 fcc6: 90 93 93 06 sts 0x0693, r25 ; 0x800693 fcca: a0 93 94 06 sts 0x0694, r26 ; 0x800694 fcce: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = destination[Y_AXIS]; fcd2: 80 91 78 06 lds r24, 0x0678 ; 0x800678 fcd6: 90 91 79 06 lds r25, 0x0679 ; 0x800679 fcda: a0 91 7a 06 lds r26, 0x067A ; 0x80067a fcde: b0 91 7b 06 lds r27, 0x067B ; 0x80067b fce2: 80 93 96 06 sts 0x0696, r24 ; 0x800696 fce6: 90 93 97 06 sts 0x0697, r25 ; 0x800697 fcea: a0 93 98 06 sts 0x0698, r26 ; 0x800698 fcee: b0 93 99 06 sts 0x0699, r27 ; 0x800699 fcf2: 81 e0 ldi r24, 0x01 ; 1 fcf4: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); endstops_hit_on_purpose(); fcf8: 0f 94 05 4e call 0x29c0a ; 0x29c0a homeaxis(Z_AXIS); fcfc: 50 e0 ldi r21, 0x00 ; 0 fcfe: 40 e0 ldi r20, 0x00 ; 0 fd00: 61 e0 ldi r22, 0x01 ; 1 fd02: 82 e0 ldi r24, 0x02 ; 2 fd04: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) fd08: cc 20 and r12, r12 fd0a: e9 f0 breq .+58 ; 0xfd46 fd0c: 81 14 cp r8, r1 fd0e: 91 04 cpc r9, r1 fd10: a1 04 cpc r10, r1 fd12: b1 04 cpc r11, r1 fd14: c1 f0 breq .+48 ; 0xfd46 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; fd16: c5 01 movw r24, r10 fd18: b4 01 movw r22, r8 fd1a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> fd1e: 9b 01 movw r18, r22 fd20: ac 01 movw r20, r24 fd22: 60 91 1e 0e lds r22, 0x0E1E ; 0x800e1e fd26: 70 91 1f 0e lds r23, 0x0E1F ; 0x800e1f fd2a: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 fd2e: 90 91 21 0e lds r25, 0x0E21 ; 0x800e21 fd32: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> fd36: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fd3a: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fd3e: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fd42: 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(); fd46: 0f 94 10 bf call 0x37e20 ; 0x37e20 clean_up_after_endstop_move(l_feedmultiply); fd4a: c8 01 movw r24, r16 fd4c: 0e 94 d5 66 call 0xcdaa ; 0xcdaa endstops_hit_on_purpose(); fd50: 0f 94 05 4e call 0x29c0a ; 0x29c0a // Load the machine correction matrix world2machine_initialize(); fd54: 0f 94 a2 ce call 0x39d44 ; 0x39d44 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); fd58: 0f 94 40 cc call 0x39880 ; 0x39880 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) fd5c: d1 10 cpse r13, r1 fd5e: 07 c0 rjmp .+14 ; 0xfd6e fd60: 31 10 cpse r3, r1 fd62: 05 c0 rjmp .+10 ; 0xfd6e fd64: 8c 8d ldd r24, Y+28 ; 0x1c fd66: 81 11 cpse r24, r1 fd68: 02 c0 rjmp .+4 ; 0xfd6e fd6a: cc 20 and r12, r12 fd6c: 39 f1 breq .+78 ; 0xfdbc { if (! home_z && mbl_was_active) { fd6e: f1 10 cpse r15, r1 fd70: 25 c0 rjmp .+74 ; 0xfdbc fd72: 9d 81 ldd r25, Y+5 ; 0x05 fd74: 99 23 and r25, r25 fd76: 11 f1 breq .+68 ; 0xfdbc // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; fd78: 81 e0 ldi r24, 0x01 ; 1 fd7a: 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)); fd7e: 0f 94 db 42 call 0x285b6 ; 0x285b6 fd82: 6b 01 movw r12, r22 fd84: 7c 01 movw r14, r24 fd86: 80 e0 ldi r24, 0x00 ; 0 fd88: 0f 94 db 42 call 0x285b6 ; 0x285b6 fd8c: a7 01 movw r20, r14 fd8e: 96 01 movw r18, r12 fd90: 0f 94 b8 a1 call 0x34370 ; 0x34370 fd94: 9b 01 movw r18, r22 fd96: ac 01 movw r20, r24 fd98: 60 91 9a 06 lds r22, 0x069A ; 0x80069a fd9c: 70 91 9b 06 lds r23, 0x069B ; 0x80069b fda0: 80 91 9c 06 lds r24, 0x069C ; 0x80069c fda4: 90 91 9d 06 lds r25, 0x069D ; 0x80069d fda8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> fdac: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a fdb0: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b fdb4: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c fdb8: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } #endif prusa_statistics(20); st_synchronize(); fdbc: 0f 94 ef 42 call 0x285de ; 0x285de homing_flag = false; fdc0: 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 } fdc4: 0f 90 pop r0 fdc6: 0f 90 pop r0 fdc8: 0f 90 pop r0 fdca: 0f 90 pop r0 fdcc: 0f 90 pop r0 fdce: df 91 pop r29 fdd0: cf 91 pop r28 fdd2: 1f 91 pop r17 fdd4: 0f 91 pop r16 fdd6: ff 90 pop r15 fdd8: ef 90 pop r14 fdda: df 90 pop r13 fddc: cf 90 pop r12 fdde: bf 90 pop r11 fde0: af 90 pop r10 fde2: 9f 90 pop r9 fde4: 8f 90 pop r8 fde6: 7f 90 pop r7 fde8: 6f 90 pop r6 fdea: 5f 90 pop r5 fdec: 4f 90 pop r4 fdee: 3f 90 pop r3 fdf0: 2f 90 pop r2 fdf2: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); fdf4: 80 e0 ldi r24, 0x00 ; 0 fdf6: 0f 94 a2 22 call 0x24544 ; 0x24544 } if(home_y) fdfa: ee 20 and r14, r14 fdfc: 09 f4 brne .+2 ; 0xfe00 fdfe: 9e ce rjmp .-708 ; 0xfb3c { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); fe00: 81 e0 ldi r24, 0x01 ; 1 fe02: 0f 94 a2 22 call 0x24544 ; 0x24544 fe06: 9a ce rjmp .-716 ; 0xfb3c homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) fe08: ee 20 and r14, r14 fe0a: 09 f4 brne .+2 ; 0xfe0e fe0c: 97 ce rjmp .-722 ; 0xfb3c { if (!calib) fe0e: ab 8d ldd r26, Y+27 ; 0x1b fe10: aa 23 and r26, r26 fe12: 09 f4 brne .+2 ; 0xfe16 fe14: 8d ce rjmp .-742 ; 0xfb30 fe16: f4 cf rjmp .-24 ; 0xfe00 0000fe18 : 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) { fe18: 8f 92 push r8 fe1a: 9f 92 push r9 fe1c: af 92 push r10 fe1e: bf 92 push r11 fe20: cf 92 push r12 fe22: ef 92 push r14 fe24: ff 92 push r15 fe26: 0f 93 push r16 fe28: 1f 93 push r17 fe2a: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); fe2c: 91 e0 ldi r25, 0x01 ; 1 fe2e: 9f 93 push r25 fe30: 1f 92 push r1 fe32: 81 2c mov r8, r1 fe34: 91 2c mov r9, r1 fe36: 54 01 movw r10, r8 fe38: c4 2e mov r12, r20 fe3a: e1 2c mov r14, r1 fe3c: f1 2c mov r15, r1 fe3e: 87 01 movw r16, r14 fe40: 40 e0 ldi r20, 0x00 ; 0 fe42: 50 e0 ldi r21, 0x00 ; 0 fe44: ba 01 movw r22, r20 fe46: 0e 94 2e 7d call 0xfa5c ; 0xfa5c fe4a: 0f 90 pop r0 fe4c: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } fe4e: 1f 91 pop r17 fe50: 0f 91 pop r16 fe52: ff 90 pop r15 fe54: ef 90 pop r14 fe56: cf 90 pop r12 fe58: bf 90 pop r11 fe5a: af 90 pop r10 fe5c: 9f 90 pop r9 fe5e: 8f 90 pop r8 fe60: 08 95 ret 0000fe62 : // 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(); fe62: 86 e8 ldi r24, 0x86 ; 134 fe64: 93 e0 ldi r25, 0x03 ; 3 fe66: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) fe6a: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 fe6e: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 fe72: 89 2b or r24, r25 fe74: 79 f0 breq .+30 ; 0xfe94 fe76: e0 91 92 12 lds r30, 0x1292 ; 0x801292 fe7a: f0 91 93 12 lds r31, 0x1293 ; 0x801293 fe7e: eb 55 subi r30, 0x5B ; 91 fe80: ff 4e sbci r31, 0xEF ; 239 fe82: 80 81 ld r24, Z fe84: 81 30 cpi r24, 0x01 ; 1 fe86: 11 f0 breq .+4 ; 0xfe8c fe88: 86 30 cpi r24, 0x06 ; 6 fe8a: 21 f4 brne .+8 ; 0xfe94 SERIAL_PROTOCOLLNRPGM(MSG_OK); fe8c: 8b eb ldi r24, 0xBB ; 187 fe8e: 9d e6 ldi r25, 0x6D ; 109 fe90: 0c 94 82 79 jmp 0xf304 ; 0xf304 } fe94: 08 95 ret 0000fe96 : void cmdqueue_reset() { while (buflen) fe96: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 fe9a: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 fe9e: 89 2b or r24, r25 fea0: 29 f0 breq .+10 ; 0xfeac { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); fea2: 0e 94 31 7f call 0xfe62 ; 0xfe62 cmdqueue_pop_front(); fea6: 0e 94 c3 76 call 0xed86 ; 0xed86 feaa: f5 cf rjmp .-22 ; 0xfe96 } bufindr = 0; feac: 10 92 93 12 sts 0x1293, r1 ; 0x801293 feb0: 10 92 92 12 sts 0x1292, r1 ; 0x801292 bufindw = 0; feb4: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> feb8: 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; febc: 81 e0 ldi r24, 0x01 ; 1 febe: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 } fec2: 08 95 ret 0000fec4 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { fec4: ef 92 push r14 fec6: ff 92 push r15 fec8: 0f 93 push r16 feca: 1f 93 push r17 fecc: cf 93 push r28 fece: df 93 push r29 if (mbl.active) { fed0: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 fed4: 88 23 and r24, r24 fed6: 89 f1 breq .+98 ; 0xff3a } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); fed8: 86 e2 ldi r24, 0x26 ; 38 feda: 9d e7 ldi r25, 0x7D ; 125 fedc: 0e 94 82 79 call 0xf304 ; 0xf304 SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); fee0: 80 e1 ldi r24, 0x10 ; 16 fee2: 9d e7 ldi r25, 0x7D ; 125 fee4: 0e 94 82 79 call 0xf304 ; 0xf304 SERIAL_PROTOCOLLNPGM("Measured points:"); fee8: 8f ef ldi r24, 0xFF ; 255 feea: 9c e7 ldi r25, 0x7C ; 124 feec: 0e 94 82 79 call 0xf304 ; 0xf304 for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { fef0: c7 e0 ldi r28, 0x07 ; 7 fef2: dc e1 ldi r29, 0x1C ; 28 fef4: c1 50 subi r28, 0x01 ; 1 fef6: 58 f1 brcs .+86 ; 0xff4e fef8: cd 9f mul r28, r29 fefa: 70 01 movw r14, r0 fefc: 11 24 eor r1, r1 fefe: 01 e0 ldi r16, 0x01 ; 1 ff00: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); ff02: 8c ef ldi r24, 0xFC ; 252 ff04: 9c e7 ldi r25, 0x7C ; 124 ff06: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOL_F(z_values[y][x], 5); ff0a: f8 01 movw r30, r16 ff0c: ee 0f add r30, r30 ff0e: ff 1f adc r31, r31 ff10: ee 0f add r30, r30 ff12: ff 1f adc r31, r31 ff14: ee 0d add r30, r14 ff16: ff 1d adc r31, r15 ff18: e1 54 subi r30, 0x41 ; 65 ff1a: fc 4e sbci r31, 0xEC ; 236 ff1c: 60 81 ld r22, Z ff1e: 71 81 ldd r23, Z+1 ; 0x01 ff20: 82 81 ldd r24, Z+2 ; 0x02 ff22: 93 81 ldd r25, Z+3 ; 0x03 ff24: 45 e0 ldi r20, 0x05 ; 5 ff26: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c ff2a: 0f 5f subi r16, 0xFF ; 255 ff2c: 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++) { ff2e: 08 30 cpi r16, 0x08 ; 8 ff30: 11 05 cpc r17, r1 ff32: 39 f7 brne .-50 ; 0xff02 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); ff34: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 ff38: dd cf rjmp .-70 ; 0xfef4 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); ff3a: 83 e3 ldi r24, 0x33 ; 51 ff3c: 9d e7 ldi r25, 0x7D ; 125 return; } ff3e: df 91 pop r29 ff40: cf 91 pop r28 ff42: 1f 91 pop r17 ff44: 0f 91 pop r16 ff46: ff 90 pop r15 ff48: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); ff4a: 0c 94 82 79 jmp 0xf304 ; 0xf304 return; } ff4e: df 91 pop r29 ff50: cf 91 pop r28 ff52: 1f 91 pop r17 ff54: 0f 91 pop r16 ff56: ff 90 pop r15 ff58: ef 90 pop r14 ff5a: 08 95 ret 0000ff5c : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { ff5c: 8f 92 push r8 ff5e: 9f 92 push r9 ff60: af 92 push r10 ff62: bf 92 push r11 ff64: cf 92 push r12 ff66: df 92 push r13 ff68: ef 92 push r14 ff6a: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); ff6c: 0f 94 53 29 call 0x252a6 ; 0x252a6 ff70: 6b 01 movw r12, r22 ff72: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { ff74: 20 91 2f 02 lds r18, 0x022F ; 0x80022f ff78: 22 23 and r18, r18 ff7a: 09 f1 breq .+66 ; 0xffbe ff7c: 40 91 be 02 lds r20, 0x02BE ; 0x8002be ff80: 41 30 cpi r20, 0x01 ; 1 ff82: e9 f0 breq .+58 ; 0xffbe if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; ff84: 80 91 10 02 lds r24, 0x0210 ; 0x800210 ff88: 90 91 11 02 lds r25, 0x0211 ; 0x800211 ff8c: a0 91 12 02 lds r26, 0x0212 ; 0x800212 ff90: b0 91 13 02 lds r27, 0x0213 ; 0x800213 ff94: 46 01 movw r8, r12 ff96: 57 01 movw r10, r14 ff98: 88 1a sub r8, r24 ff9a: 99 0a sbc r9, r25 ff9c: aa 0a sbc r10, r26 ff9e: bb 0a sbc r11, r27 ffa0: 30 e0 ldi r19, 0x00 ; 0 ffa2: a8 ee ldi r26, 0xE8 ; 232 ffa4: b3 e0 ldi r27, 0x03 ; 3 ffa6: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> ffaa: 86 16 cp r8, r22 ffac: 97 06 cpc r9, r23 ffae: a8 06 cpc r10, r24 ffb0: b9 06 cpc r11, r25 ffb2: 6c f0 brlt .+26 ; 0xffce switch (busy_state) { ffb4: 44 30 cpi r20, 0x04 ; 4 ffb6: 31 f1 breq .+76 ; 0x10004 ffb8: 9c f4 brge .+38 ; 0xffe0 ffba: 42 30 cpi r20, 0x02 ; 2 ffbc: d4 f4 brge .+52 ; 0xfff2 break; default: break; } } prev_busy_signal_ms = ms; ffbe: c0 92 10 02 sts 0x0210, r12 ; 0x800210 ffc2: d0 92 11 02 sts 0x0211, r13 ; 0x800211 ffc6: e0 92 12 02 sts 0x0212, r14 ; 0x800212 ffca: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } ffce: ff 90 pop r15 ffd0: ef 90 pop r14 ffd2: df 90 pop r13 ffd4: cf 90 pop r12 ffd6: bf 90 pop r11 ffd8: af 90 pop r10 ffda: 9f 90 pop r9 ffdc: 8f 90 pop r8 ffde: 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) { ffe0: 45 30 cpi r20, 0x05 ; 5 ffe2: 69 f7 brne .-38 ; 0xffbe case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; ffe4: 80 ed ldi r24, 0xD0 ; 208 ffe6: 9b ea ldi r25, 0xAB ; 171 ffe8: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("busy: paused for input"); ffec: 88 ea ldi r24, 0xA8 ; 168 ffee: 9b e7 ldi r25, 0x7B ; 123 fff0: 06 c0 rjmp .+12 ; 0xfffe 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; fff2: 80 ed ldi r24, 0xD0 ; 208 fff4: 9b ea ldi r25, 0xAB ; 171 fff6: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("busy: processing"); fffa: 85 ed ldi r24, 0xD5 ; 213 fffc: 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"); fffe: 0e 94 82 79 call 0xf304 ; 0xf304 10002: dd cf rjmp .-70 ; 0xffbe case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 10004: 80 ed ldi r24, 0xD0 ; 208 10006: 9b ea ldi r25, 0xAB ; 171 10008: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("busy: paused for user"); 1000c: 8f eb ldi r24, 0xBF ; 191 1000e: 9b e7 ldi r25, 0x7B ; 123 10010: f6 cf rjmp .-20 ; 0xfffe 00010012 : //} } #endif //TACH_0 void checkFans() { 10012: cf 92 push r12 10014: df 92 push r13 10016: ef 92 push r14 10018: ff 92 push r15 1001a: 0f 93 push r16 1001c: 1f 93 push r17 1001e: cf 93 push r28 10020: df 93 push r29 10022: 1f 92 push r1 10024: 1f 92 push r1 10026: cd b7 in r28, 0x3d ; 61 10028: 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)) { 1002a: 0f 94 53 29 call 0x252a6 ; 0x252a6 1002e: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 10032: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10036: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 1003a: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 1003e: 60 1b sub r22, r16 10040: 71 0b sbc r23, r17 10042: 82 0b sbc r24, r18 10044: 93 0b sbc r25, r19 10046: 69 38 cpi r22, 0x89 ; 137 10048: 73 41 sbci r23, 0x13 ; 19 1004a: 81 05 cpc r24, r1 1004c: 91 05 cpc r25, r1 1004e: d0 f0 brcs .+52 ; 0x10084 10050: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 10054: 81 11 cpse r24, r1 10056: 16 c0 rjmp .+44 ; 0x10084 extruder_autofan_last_check = _millis(); 10058: 0f 94 53 29 call 0x252a6 ; 0x252a6 1005c: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 10060: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 10064: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 10068: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fanSpeedBckp = fanSpeedSoftPwm; 1006c: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 10070: 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 10074: 8b 34 cpi r24, 0x4B ; 75 10076: 18 f0 brcs .+6 ; 0x1007e // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 10078: 8f ef ldi r24, 0xFF ; 255 1007a: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 } fan_measuring = true; 1007e: 81 e0 ldi r24, 0x01 ; 1 10080: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 10084: 0f 94 53 29 call 0x252a6 ; 0x252a6 10088: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 1008c: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10090: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 10094: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 10098: 60 1b sub r22, r16 1009a: 71 0b sbc r23, r17 1009c: 82 0b sbc r24, r18 1009e: 93 0b sbc r25, r19 100a0: 65 36 cpi r22, 0x65 ; 101 100a2: 71 05 cpc r23, r1 100a4: 81 05 cpc r24, r1 100a6: 91 05 cpc r25, r1 100a8: 08 f4 brcc .+2 ; 0x100ac 100aa: 57 c1 rjmp .+686 ; 0x1035a 100ac: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 100b0: 88 23 and r24, r24 100b2: 09 f4 brne .+2 ; 0x100b6 100b4: 52 c1 rjmp .+676 ; 0x1035a #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))); 100b6: 60 91 e2 05 lds r22, 0x05E2 ; 0x8005e2 100ba: 70 91 e3 05 lds r23, 0x05E3 ; 0x8005e3 100be: 07 2e mov r0, r23 100c0: 00 0c add r0, r0 100c2: 88 0b sbc r24, r24 100c4: 99 0b sbc r25, r25 100c6: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 100ca: 6b 01 movw r12, r22 100cc: 7c 01 movw r14, r24 100ce: 0f 94 53 29 call 0x252a6 ; 0x252a6 100d2: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 100d6: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 100da: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 100de: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 100e2: 60 1b sub r22, r16 100e4: 71 0b sbc r23, r17 100e6: 82 0b sbc r24, r18 100e8: 93 0b sbc r25, r19 100ea: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 100ee: 9b 01 movw r18, r22 100f0: ac 01 movw r20, r24 100f2: 60 e0 ldi r22, 0x00 ; 0 100f4: 70 e0 ldi r23, 0x00 ; 0 100f6: 8a e7 ldi r24, 0x7A ; 122 100f8: 93 e4 ldi r25, 0x43 ; 67 100fa: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 100fe: a7 01 movw r20, r14 10100: 96 01 movw r18, r12 10102: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 10106: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1010a: 70 93 ca 03 sts 0x03CA, r23 ; 0x8003ca 1010e: 60 93 c9 03 sts 0x03C9, r22 ; 0x8003c9 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 10112: 60 91 e4 05 lds r22, 0x05E4 ; 0x8005e4 10116: 70 91 e5 05 lds r23, 0x05E5 ; 0x8005e5 1011a: 07 2e mov r0, r23 1011c: 00 0c add r0, r0 1011e: 88 0b sbc r24, r24 10120: 99 0b sbc r25, r25 10122: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 10126: 6b 01 movw r12, r22 10128: 7c 01 movw r14, r24 1012a: 0f 94 53 29 call 0x252a6 ; 0x252a6 1012e: 00 91 c0 17 lds r16, 0x17C0 ; 0x8017c0 10132: 10 91 c1 17 lds r17, 0x17C1 ; 0x8017c1 10136: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 1013a: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 1013e: 60 1b sub r22, r16 10140: 71 0b sbc r23, r17 10142: 82 0b sbc r24, r18 10144: 93 0b sbc r25, r19 10146: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 1014a: 9b 01 movw r18, r22 1014c: ac 01 movw r20, r24 1014e: 60 e0 ldi r22, 0x00 ; 0 10150: 70 e0 ldi r23, 0x00 ; 0 10152: 8a e7 ldi r24, 0x7A ; 122 10154: 93 e4 ldi r25, 0x43 ; 67 10156: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1015a: a7 01 movw r20, r14 1015c: 96 01 movw r18, r12 1015e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 10162: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 10166: 8b 01 movw r16, r22 10168: 70 93 cc 03 sts 0x03CC, r23 ; 0x8003cc 1016c: 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; 10170: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 10174: 10 92 e2 05 sts 0x05E2, r1 ; 0x8005e2 fan_edge_counter[1] = 0; 10178: 10 92 e5 05 sts 0x05E5, r1 ; 0x8005e5 1017c: 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) 10180: 83 e0 ldi r24, 0x03 ; 3 10182: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 10184: 82 e0 ldi r24, 0x02 ; 2 10186: 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) 10188: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1018c: 88 23 and r24, r24 1018e: 51 f0 breq .+20 ; 0x101a4 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 10190: 87 e8 ldi r24, 0x87 ; 135 10192: 9f e0 ldi r25, 0x0F ; 15 10194: 0f 94 23 dc call 0x3b846 ; 0x3b846 10198: 91 e0 ldi r25, 0x01 ; 1 1019a: 81 11 cpse r24, r1 1019c: 01 c0 rjmp .+2 ; 0x101a0 1019e: 90 e0 ldi r25, 0x00 ; 0 101a0: 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]++;} 101a4: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 101a8: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 101ac: 44 97 sbiw r24, 0x14 ; 20 101ae: 0c f0 brlt .+2 ; 0x101b2 101b0: 9d c0 rjmp .+314 ; 0x102ec 101b2: 20 e0 ldi r18, 0x00 ; 0 101b4: 30 e0 ldi r19, 0x00 ; 0 101b6: 48 e4 ldi r20, 0x48 ; 72 101b8: 52 e4 ldi r21, 0x42 ; 66 101ba: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 101be: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 101c2: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 101c6: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 101ca: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 101ce: 18 16 cp r1, r24 101d0: 0c f0 brlt .+2 ; 0x101d4 101d2: 8c c0 rjmp .+280 ; 0x102ec 101d4: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 101d8: 8f 5f subi r24, 0xFF ; 255 101da: 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]++; 101de: 05 30 cpi r16, 0x05 ; 5 101e0: 11 05 cpc r17, r1 101e2: 0c f0 brlt .+2 ; 0x101e6 101e4: 89 c0 rjmp .+274 ; 0x102f8 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); 101e6: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 101ea: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 101ee: 98 17 cp r25, r24 101f0: 09 f4 brne .+2 ; 0x101f4 101f2: 7f c0 rjmp .+254 ; 0x102f2 101f4: e0 91 a6 0d lds r30, 0x0DA6 ; 0x800da6 101f8: 8e e6 ldi r24, 0x6E ; 110 101fa: e8 9f mul r30, r24 101fc: f0 01 movw r30, r0 101fe: 11 24 eor r1, r1 10200: e5 5f subi r30, 0xF5 ; 245 10202: f8 4f sbci r31, 0xF8 ; 248 10204: 80 81 ld r24, Z 10206: 8c 34 cpi r24, 0x4C ; 76 10208: 08 f4 brcc .+2 ; 0x1020c 1020a: 76 c0 rjmp .+236 ; 0x102f8 1020c: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10210: 8f 5f subi r24, 0xFF ; 255 10212: 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){ 10216: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 1021a: 81 11 cpse r24, r1 1021c: 0b c0 rjmp .+22 ; 0x10234 1021e: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10222: 81 11 cpse r24, r1 10224: 07 c0 rjmp .+14 ; 0x10234 10226: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1022a: 82 30 cpi r24, 0x02 ; 2 1022c: 19 f4 brne .+6 ; 0x10234 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 1022e: 81 e0 ldi r24, 0x01 ; 1 10230: 80 93 e6 03 sts 0x03E6, r24 ; 0x8003e6 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 10234: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10238: 81 30 cpi r24, 0x01 ; 1 1023a: 61 f4 brne .+24 ; 0x10254 1023c: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 10240: 81 11 cpse r24, r1 10242: 08 c0 rjmp .+16 ; 0x10254 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 10244: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 10248: 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 1024c: 83 e7 ldi r24, 0x73 ; 115 1024e: 90 e7 ldi r25, 0x70 ; 112 10250: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 10254: 80 91 38 02 lds r24, 0x0238 ; 0x800238 10258: 88 23 and r24, r24 1025a: 09 f4 brne .+2 ; 0x1025e 1025c: 6e c0 rjmp .+220 ; 0x1033a 1025e: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10262: 82 30 cpi r24, 0x02 ; 2 10264: 09 f4 brne .+2 ; 0x10268 10266: 69 c0 rjmp .+210 ; 0x1033a 10268: 8e e4 ldi r24, 0x4E ; 78 1026a: e8 2e mov r14, r24 1026c: 83 e0 ldi r24, 0x03 ; 3 1026e: f8 2e mov r15, r24 10270: fe 01 movw r30, r28 10272: 31 96 adiw r30, 0x01 ; 1 10274: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 10276: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 10278: 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]) 1027a: f7 01 movw r30, r14 1027c: 91 91 ld r25, Z+ 1027e: 7f 01 movw r14, r30 10280: f6 01 movw r30, r12 10282: 81 91 ld r24, Z+ 10284: 6f 01 movw r12, r30 10286: 89 17 cp r24, r25 10288: 68 f5 brcc .+90 ; 0x102e4 { fan_speed_errors[fan] = 0; 1028a: f7 01 movw r30, r14 1028c: 31 97 sbiw r30, 0x01 ; 1 1028e: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 10290: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 10294: 82 30 cpi r24, 0x02 ; 2 10296: 31 f1 breq .+76 ; 0x102e4 fan_check_error = EFCE_REPORTED; 10298: 00 93 e6 03 sts 0x03E6, r16 ; 0x8003e6 if (printJobOngoing()) { 1029c: 0e 94 97 67 call 0xcf2e ; 0xcf2e 102a0: 88 23 and r24, r24 102a2: 81 f1 breq .+96 ; 0x10304 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 102a4: 0e 94 8c 67 call 0xcf18 ; 0xcf18 102a8: 81 11 cpse r24, r1 102aa: 06 c0 rjmp .+12 ; 0x102b8 if (usb_timer.running()) 102ac: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 102b0: 88 23 and r24, r24 102b2: 29 f1 breq .+74 ; 0x102fe lcd_pause_usb_print(); 102b4: 0f 94 a0 14 call 0x22940 ; 0x22940 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 102b8: 11 30 cpi r17, 0x01 ; 1 102ba: 59 f1 breq .+86 ; 0x10312 //! 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); 102bc: 89 e1 ldi r24, 0x19 ; 25 102be: 99 e7 ldi r25, 0x79 ; 121 102c0: 0e 94 82 79 call 0xf304 ; 0xf304 if (get_message_level() == 0) { 102c4: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 102c8: 81 11 cpse r24, r1 102ca: 0c c0 rjmp .+24 ; 0x102e4 Sound_MakeCustom(200,0,true); 102cc: 41 e0 ldi r20, 0x01 ; 1 102ce: 70 e0 ldi r23, 0x00 ; 0 102d0: 60 e0 ldi r22, 0x00 ; 0 102d2: 88 ec ldi r24, 0xC8 ; 200 102d4: 90 e0 ldi r25, 0x00 ; 0 102d6: 0f 94 4d 51 call 0x2a29a ; 0x2a29a LCD_ALERTMESSAGERPGM(lcdMsg); 102da: 62 e0 ldi r22, 0x02 ; 2 102dc: 82 ee ldi r24, 0xE2 ; 226 102de: 9a e6 ldi r25, 0x6A ; 106 102e0: 0e 94 24 f1 call 0x1e248 ; 0x1e248 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++) 102e4: 11 30 cpi r17, 0x01 ; 1 102e6: 49 f1 breq .+82 ; 0x1033a 102e8: 11 e0 ldi r17, 0x01 ; 1 102ea: c7 cf rjmp .-114 ; 0x1027a 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; 102ec: 10 92 4e 03 sts 0x034E, r1 ; 0x80034e 102f0: 76 cf rjmp .-276 ; 0x101de #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]++; 102f2: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 102f6: 87 cf rjmp .-242 ; 0x10206 else fan_speed_errors[1] = 0; 102f8: 10 92 4f 03 sts 0x034F, r1 ; 0x80034f 102fc: 8c cf rjmp .-232 ; 0x10216 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 102fe: 0f 94 5f 29 call 0x252be ; 0x252be 10302: da cf rjmp .-76 ; 0x102b8 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 10304: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 10308: 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; 1030c: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 10310: d3 cf rjmp .-90 ; 0x102b8 //! 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); 10312: 81 e4 ldi r24, 0x41 ; 65 10314: 99 e7 ldi r25, 0x79 ; 121 10316: 0e 94 82 79 call 0xf304 ; 0xf304 if (get_message_level() == 0) { 1031a: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 1031e: 81 11 cpse r24, r1 10320: 0c c0 rjmp .+24 ; 0x1033a Sound_MakeCustom(200,0,true); 10322: 41 e0 ldi r20, 0x01 ; 1 10324: 70 e0 ldi r23, 0x00 ; 0 10326: 60 e0 ldi r22, 0x00 ; 0 10328: 88 ec ldi r24, 0xC8 ; 200 1032a: 90 e0 ldi r25, 0x00 ; 0 1032c: 0f 94 4d 51 call 0x2a29a ; 0x2a29a LCD_ALERTMESSAGERPGM(lcdMsg); 10330: 62 e0 ldi r22, 0x02 ; 2 10332: 8e ec ldi r24, 0xCE ; 206 10334: 9a e6 ldi r25, 0x6A ; 106 10336: 0e 94 24 f1 call 0x1e248 ; 0x1e248 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 1033a: 80 91 14 02 lds r24, 0x0214 ; 0x800214 1033e: 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(); 10342: 0f 94 53 29 call 0x252a6 ; 0x252a6 10346: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 1034a: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 1034e: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 10352: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fan_measuring = false; 10356: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 1035a: 0f 90 pop r0 1035c: 0f 90 pop r0 1035e: df 91 pop r29 10360: cf 91 pop r28 10362: 1f 91 pop r17 10364: 0f 91 pop r16 10366: ff 90 pop r15 10368: ef 90 pop r14 1036a: df 90 pop r13 1036c: 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(); 1036e: 0c 94 ae 75 jmp 0xeb5c ; 0xeb5c 00010372 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 10372: cf 92 push r12 10374: df 92 push r13 10376: ef 92 push r14 10378: ff 92 push r15 1037a: 6b 01 movw r12, r22 1037c: 7c 01 movw r14, r24 la10c_orig_jerk = j; 1037e: c0 92 54 03 sts 0x0354, r12 ; 0x800354 10382: d0 92 55 03 sts 0x0355, r13 ; 0x800355 10386: e0 92 56 03 sts 0x0356, r14 ; 0x800356 1038a: f0 92 57 03 sts 0x0357, r15 ; 0x800357 if(la10c_mode != LA10C_LA10) 1038e: 80 91 70 03 lds r24, 0x0370 ; 0x800370 10392: 82 30 cpi r24, 0x02 ; 2 10394: b1 f4 brne .+44 ; 0x103c2 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) 10396: 20 e0 ldi r18, 0x00 ; 0 10398: 30 e0 ldi r19, 0x00 ; 0 1039a: 40 e9 ldi r20, 0x90 ; 144 1039c: 50 e4 ldi r21, 0x40 ; 64 1039e: c7 01 movw r24, r14 103a0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 103a4: 87 ff sbrs r24, 7 103a6: 14 c0 rjmp .+40 ; 0x103d0 103a8: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 103ac: 90 91 ef 0d lds r25, 0x0DEF ; 0x800def 103b0: a0 91 f0 0d lds r26, 0x0DF0 ; 0x800df0 103b4: b0 91 f1 0d lds r27, 0x0DF1 ; 0x800df1 103b8: 80 3d cpi r24, 0xD0 ; 208 103ba: 97 40 sbci r25, 0x07 ; 7 103bc: a1 05 cpc r26, r1 103be: b1 05 cpc r27, r1 103c0: 20 f5 brcc .+72 ; 0x1040a j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 103c2: c7 01 movw r24, r14 103c4: b6 01 movw r22, r12 103c6: ff 90 pop r15 103c8: ef 90 pop r14 103ca: df 90 pop r13 103cc: cf 90 pop r12 103ce: 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: 103d0: 2a e9 ldi r18, 0x9A ; 154 103d2: 39 e9 ldi r19, 0x99 ; 153 103d4: 49 e9 ldi r20, 0x99 ; 153 103d6: 5e e3 ldi r21, 0x3E ; 62 103d8: c7 01 movw r24, r14 103da: b6 01 movw r22, r12 103dc: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 103e0: 87 ff sbrs r24, 7 103e2: 0a c0 rjmp .+20 ; 0x103f8 103e4: 20 e0 ldi r18, 0x00 ; 0 103e6: 30 e0 ldi r19, 0x00 ; 0 103e8: 48 e3 ldi r20, 0x38 ; 56 103ea: 51 e4 ldi r21, 0x41 ; 65 103ec: c7 01 movw r24, r14 103ee: b6 01 movw r22, r12 103f0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 103f4: 6b 01 movw r12, r22 103f6: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 103f8: 85 e9 ldi r24, 0x95 ; 149 103fa: 99 e7 ldi r25, 0x79 ; 121 103fc: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(j); 10400: c7 01 movw r24, r14 10402: b6 01 movw r22, r12 10404: 0f 94 bb 74 call 0x2e976 ; 0x2e976 10408: dc cf rjmp .-72 ; 0x103c2 // 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: 1040a: 2a e9 ldi r18, 0x9A ; 154 1040c: 39 e9 ldi r19, 0x99 ; 153 1040e: 49 e9 ldi r20, 0x99 ; 153 10410: 5e e3 ldi r21, 0x3E ; 62 10412: c7 01 movw r24, r14 10414: b6 01 movw r22, r12 10416: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1041a: 87 fd sbrc r24, 7 1041c: e3 cf rjmp .-58 ; 0x103e4 j < 4.5? j * 0.25 + 3.375: 1041e: 20 e0 ldi r18, 0x00 ; 0 10420: 30 e0 ldi r19, 0x00 ; 0 10422: 40 e8 ldi r20, 0x80 ; 128 10424: 5e e3 ldi r21, 0x3E ; 62 10426: c7 01 movw r24, r14 10428: b6 01 movw r22, r12 1042a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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: 1042e: 20 e0 ldi r18, 0x00 ; 0 10430: 30 e0 ldi r19, 0x00 ; 0 10432: 48 e5 ldi r20, 0x58 ; 88 10434: 50 e4 ldi r21, 0x40 ; 64 10436: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1043a: dc cf rjmp .-72 ; 0x103f4 0001043c : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 1043c: cf 92 push r12 1043e: df 92 push r13 10440: ef 92 push r14 10442: ff 92 push r15 10444: cf 93 push r28 if(mode == la10c_mode) return; 10446: 90 91 70 03 lds r25, 0x0370 ; 0x800370 1044a: 98 17 cp r25, r24 1044c: b9 f1 breq .+110 ; 0x104bc 1044e: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10450: c0 90 54 03 lds r12, 0x0354 ; 0x800354 10454: d0 90 55 03 lds r13, 0x0355 ; 0x800355 10458: e0 90 56 03 lds r14, 0x0356 ; 0x800356 1045c: f0 90 57 03 lds r15, 0x0357 ; 0x800357 10460: 20 e0 ldi r18, 0x00 ; 0 10462: 30 e0 ldi r19, 0x00 ; 0 10464: a9 01 movw r20, r18 10466: c7 01 movw r24, r14 10468: b6 01 movw r22, r12 1046a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1046e: 88 23 and r24, r24 10470: 41 f0 breq .+16 ; 0x10482 cs.max_jerk[E_AXIS] = la10c_orig_jerk; 10472: c0 92 12 0e sts 0x0E12, r12 ; 0x800e12 10476: d0 92 13 0e sts 0x0E13, r13 ; 0x800e13 1047a: e0 92 14 0e sts 0x0E14, r14 ; 0x800e14 1047e: f0 92 15 0e sts 0x0E15, r15 ; 0x800e15 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 10482: 88 e7 ldi r24, 0x78 ; 120 10484: 99 e7 ldi r25, 0x79 ; 121 10486: 0e 94 57 77 call 0xeeae ; 0xeeae switch(mode) 1048a: c1 30 cpi r28, 0x01 ; 1 1048c: 11 f1 breq .+68 ; 0x104d2 1048e: e0 f0 brcs .+56 ; 0x104c8 10490: c2 30 cpi r28, 0x02 ; 2 10492: 11 f1 breq .+68 ; 0x104d8 { 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; 10494: 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]); 10498: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 1049c: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 104a0: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 104a4: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 104a8: 0e 94 b9 81 call 0x10372 ; 0x10372 104ac: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 104b0: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 104b4: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 104b8: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 } 104bc: cf 91 pop r28 104be: ff 90 pop r15 104c0: ef 90 pop r14 104c2: df 90 pop r13 104c4: cf 90 pop r12 104c6: 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; 104c8: 80 e7 ldi r24, 0x70 ; 112 104ca: 99 e7 ldi r25, 0x79 ; 121 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 104cc: 0e 94 82 79 call 0xf304 ; 0xf304 104d0: e1 cf rjmp .-62 ; 0x10494 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 104d2: 8c e6 ldi r24, 0x6C ; 108 104d4: 99 e7 ldi r25, 0x79 ; 121 104d6: fa cf rjmp .-12 ; 0x104cc case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 104d8: 88 e6 ldi r24, 0x68 ; 104 104da: 99 e7 ldi r25, 0x79 ; 121 104dc: f7 cf rjmp .-18 ; 0x104cc 000104de : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 104de: 0f 94 ef 42 call 0x285de ; 0x285de disable_x(); 104e2: 17 9a sbi 0x02, 7 ; 2 104e4: ef e8 ldi r30, 0x8F ; 143 104e6: f6 e0 ldi r31, 0x06 ; 6 104e8: 10 82 st Z, r1 disable_y(); 104ea: 16 9a sbi 0x02, 6 ; 2 104ec: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 104ee: 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); } 104f0: 80 e0 ldi r24, 0x00 ; 0 104f2: 0e 94 1e 82 call 0x1043c ; 0x1043c return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 104f6: 8f ef ldi r24, 0xFF ; 255 104f8: 9f ef ldi r25, 0xFF ; 255 104fa: 90 93 b2 02 sts 0x02B2, r25 ; 0x8002b2 104fe: 80 93 b1 02 sts 0x02B1, r24 ; 0x8002b1 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 10502: 2f ef ldi r18, 0xFF ; 255 10504: 20 93 ae 02 sts 0x02AE, r18 ; 0x8002ae print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 10508: 90 93 b6 02 sts 0x02B6, r25 ; 0x8002b6 1050c: 80 93 b5 02 sts 0x02B5, r24 ; 0x8002b5 print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10510: 20 93 ad 02 sts 0x02AD, r18 ; 0x8002ad print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 10514: 90 93 b0 02 sts 0x02B0, r25 ; 0x8002b0 10518: 80 93 af 02 sts 0x02AF, r24 ; 0x8002af print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 1051c: 90 93 b4 02 sts 0x02B4, r25 ; 0x8002b4 10520: 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(); } 10524: 08 95 ret 00010526 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10526: 41 ed ldi r20, 0xD1 ; 209 10528: 50 e0 ldi r21, 0x00 ; 0 1052a: 63 e2 ldi r22, 0x23 ; 35 1052c: 78 e7 ldi r23, 0x78 ; 120 1052e: 8e eb ldi r24, 0xBE ; 190 10530: 9d e0 ldi r25, 0x0D ; 13 10532: 0f 94 bd d9 call 0x3b37a ; 0x3b37a // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 10536: 0f 94 66 63 call 0x2c6cc ; 0x2c6cc #ifdef PIDTEMP updatePID(); 1053a: 0f 94 da 3a call 0x275b4 ; 0x275b4 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 1053e: 0f 94 af 31 call 0x2635e ; 0x2635e #endif calculate_extruder_multipliers(); 10542: 0e 94 c0 65 call 0xcb80 ; 0xcb80 SERIAL_ECHO_START; 10546: 80 ed ldi r24, 0xD0 ; 208 10548: 9b ea ldi r25, 0xAB ; 171 1054a: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 1054e: 81 e0 ldi r24, 0x01 ; 1 10550: 98 e7 ldi r25, 0x78 ; 120 10552: 0c 94 82 79 jmp 0xf304 ; 0xf304 00010556 : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 10556: cf 93 push r28 10558: df 93 push r29 strcpy_P(cs.version, default_conf.version); 1055a: 63 e2 ldi r22, 0x23 ; 35 1055c: 78 e7 ldi r23, 0x78 ; 120 1055e: 8e eb ldi r24, 0xBE ; 190 10560: 9d e0 ldi r25, 0x0D ; 13 10562: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 #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); 10566: 41 ed ldi r20, 0xD1 ; 209 10568: 50 e0 ldi r21, 0x00 ; 0 1056a: 64 e1 ldi r22, 0x14 ; 20 1056c: 70 e0 ldi r23, 0x00 ; 0 1056e: 8e eb ldi r24, 0xBE ; 190 10570: 9d e0 ldi r25, 0x0D ; 13 10572: 0f 94 37 dc call 0x3b86e ; 0x3b86e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10576: 60 91 1d 05 lds r22, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 1057a: 82 e0 ldi r24, 0x02 ; 2 1057c: 9d e0 ldi r25, 0x0D ; 13 1057e: 0f 94 47 dc call 0x3b88e ; 0x3b88e } 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); 10582: c0 eb ldi r28, 0xB0 ; 176 10584: 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); 10586: 4a a5 ldd r20, Y+42 ; 0x2a 10588: 5b a5 ldd r21, Y+43 ; 0x2b 1058a: 6c a5 ldd r22, Y+44 ; 0x2c 1058c: 7d a5 ldd r23, Y+45 ; 0x2d 1058e: 8e ef ldi r24, 0xFE ; 254 10590: 9c e0 ldi r25, 0x0C ; 12 10592: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 10596: 4e a5 ldd r20, Y+46 ; 0x2e 10598: 5f a5 ldd r21, Y+47 ; 0x2f 1059a: 68 a9 ldd r22, Y+48 ; 0x30 1059c: 79 a9 ldd r23, Y+49 ; 0x31 1059e: 82 ea ldi r24, 0xA2 ; 162 105a0: 9c e0 ldi r25, 0x0C ; 12 105a2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 105a6: 4a a9 ldd r20, Y+50 ; 0x32 105a8: 5b a9 ldd r21, Y+51 ; 0x33 105aa: 6c a9 ldd r22, Y+52 ; 0x34 105ac: 7d a9 ldd r23, Y+53 ; 0x35 105ae: 8e e9 ldi r24, 0x9E ; 158 105b0: 9c e0 ldi r25, 0x0C ; 12 105b2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 105b6: 4e a9 ldd r20, Y+54 ; 0x36 105b8: 5f a9 ldd r21, Y+55 ; 0x37 105ba: 68 ad ldd r22, Y+56 ; 0x38 105bc: 79 ad ldd r23, Y+57 ; 0x39 105be: 8a ef ldi r24, 0xFA ; 250 105c0: 9c e0 ldi r25, 0x0C ; 12 105c2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 105c6: 4a ad ldd r20, Y+58 ; 0x3a 105c8: 5b ad ldd r21, Y+59 ; 0x3b 105ca: 6c ad ldd r22, Y+60 ; 0x3c 105cc: 7d ad ldd r23, Y+61 ; 0x3d 105ce: 8a e9 ldi r24, 0x9A ; 154 105d0: 9c e0 ldi r25, 0x0C ; 12 105d2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 105d6: 6e ad ldd r22, Y+62 ; 0x3e 105d8: 7f ad ldd r23, Y+63 ; 0x3f 105da: 88 e9 ldi r24, 0x98 ; 152 105dc: 9c e0 ldi r25, 0x0C ; 12 105de: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca #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); 105e2: 40 e4 ldi r20, 0x40 ; 64 105e4: 50 e0 ldi r21, 0x00 ; 0 105e6: 6a eb ldi r22, 0xBA ; 186 105e8: 7c e0 ldi r23, 0x0C ; 12 105ea: 80 ef ldi r24, 0xF0 ; 240 105ec: 92 e1 ldi r25, 0x12 ; 18 105ee: 0f 94 37 dc call 0x3b86e ; 0x3b86e if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 105f2: 40 91 30 13 lds r20, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 105f6: 50 91 31 13 lds r21, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 105fa: 60 91 32 13 lds r22, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 105fe: 70 91 33 13 lds r23, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 10602: 86 eb ldi r24, 0xB6 ; 182 10604: 9c e0 ldi r25, 0x0C ; 12 10606: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 1060a: 40 91 34 13 lds r20, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 1060e: 50 91 35 13 lds r21, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 10612: 60 91 36 13 lds r22, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 10616: 70 91 37 13 lds r23, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 1061a: 82 eb ldi r24, 0xB2 ; 178 1061c: 9c e0 ldi r25, 0x0C ; 12 1061e: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 10622: 40 91 38 13 lds r20, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 10626: 50 91 39 13 lds r21, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 1062a: 60 91 3a 13 lds r22, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 1062e: 70 91 3b 13 lds r23, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 10632: 8e ea ldi r24, 0xAE ; 174 10634: 9c e0 ldi r25, 0x0C ; 12 10636: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 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; 1063a: 80 ed ldi r24, 0xD0 ; 208 1063c: 9b ea ldi r25, 0xAB ; 171 1063e: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("Settings Stored"); 10642: 8d ea ldi r24, 0xAD ; 173 10644: 97 e7 ldi r25, 0x77 ; 119 } 10646: df 91 pop r29 10648: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 1064a: 0c 94 82 79 jmp 0xf304 ; 0xf304 0001064e : { cmdbuffer_front_already_processed = true; } void get_command() { 1064e: 2f 92 push r2 10650: 3f 92 push r3 10652: 4f 92 push r4 10654: 5f 92 push r5 10656: 6f 92 push r6 10658: 7f 92 push r7 1065a: 8f 92 push r8 1065c: 9f 92 push r9 1065e: af 92 push r10 10660: bf 92 push r11 10662: cf 92 push r12 10664: df 92 push r13 10666: ef 92 push r14 10668: ff 92 push r15 1066a: 0f 93 push r16 1066c: 1f 93 push r17 1066e: cf 93 push r28 10670: df 93 push r29 10672: cd b7 in r28, 0x3d ; 61 10674: de b7 in r29, 0x3e ; 62 10676: a2 97 sbiw r28, 0x22 ; 34 10678: 0f b6 in r0, 0x3f ; 63 1067a: f8 94 cli 1067c: de bf out 0x3e, r29 ; 62 1067e: 0f be out 0x3f, r0 ; 63 10680: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 10682: 8f e5 ldi r24, 0x5F ; 95 10684: 90 e0 ldi r25, 0x00 ; 0 10686: 0e 94 49 5c call 0xb892 ; 0xb892 1068a: 88 23 and r24, r24 1068c: 09 f4 brne .+2 ; 0x10690 1068e: 91 c0 rjmp .+290 ; 0x107b2 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 10690: 0e 94 10 77 call 0xee20 ; 0xee20 10694: 8f 37 cpi r24, 0x7F ; 127 10696: 91 05 cpc r25, r1 10698: 61 f4 brne .+24 ; 0x106b2 // 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; 1069a: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 1069e: 90 91 9c 04 lds r25, 0x049C ; 0x80049c 106a2: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 106a6: 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 106aa: 8e e9 ldi r24, 0x9E ; 158 106ac: 97 e7 ldi r25, 0x77 ; 119 106ae: 0e 94 82 79 call 0xf304 ; 0xf304 106b2: 1e 01 movw r2, r28 106b4: 2f e1 ldi r18, 0x1F ; 31 106b6: 22 0e add r2, r18 106b8: 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; 106ba: dd 24 eor r13, r13 106bc: 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 106be: 0e 94 10 77 call 0xee20 ; 0xee20 106c2: 18 16 cp r1, r24 106c4: 19 06 cpc r1, r25 106c6: 0c f0 brlt .+2 ; 0x106ca 106c8: 68 c0 rjmp .+208 ; 0x1079a 106ca: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 106ce: 88 23 and r24, r24 106d0: 29 f0 breq .+10 ; 0x106dc 106d2: 0e 94 8c 67 call 0xcf18 ; 0xcf18 106d6: 88 23 and r24, r24 106d8: 09 f4 brne .+2 ; 0x106dc 106da: 5f c0 rjmp .+190 ; 0x1079a 106dc: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 106e0: 81 11 cpse r24, r1 106e2: 5b c0 rjmp .+182 ; 0x1079a #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 106e4: 0f 94 0b d6 call 0x3ac16 ; 0x3ac16 if (rec < 0) continue; 106e8: 97 fd sbrc r25, 7 106ea: e9 cf rjmp .-46 ; 0x106be mp_handle_rx_char((uint8_t)rec); 106ec: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 106ee: 8f 3f cpi r24, 0xFF ; 255 106f0: 09 f0 breq .+2 ; 0x106f4 106f2: 7b c0 rjmp .+246 ; 0x107ea if (mp_cmd_count > 0) { 106f4: 80 91 40 03 lds r24, 0x0340 ; 0x800340 106f8: 88 23 and r24, r24 106fa: 09 f4 brne .+2 ; 0x106fe 106fc: 73 c0 rjmp .+230 ; 0x107e4 mp_cmd_active = 1; 106fe: d0 92 3f 03 sts 0x033F, r13 ; 0x80033f mp_cmd_count = 0; 10702: 10 92 40 03 sts 0x0340, r1 ; 0x800340 char c_res[2] = {0, 0}; 10706: 1f 8e std Y+31, r1 ; 0x1f 10708: 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) { 1070a: c0 90 43 03 lds r12, 0x0343 ; 0x800343 1070e: cc 20 and r12, r12 10710: b1 f2 breq .-84 ; 0x106be 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]; 10712: 80 91 41 03 lds r24, 0x0341 ; 0x800341 10716: 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) 10718: 91 e0 ldi r25, 0x01 ; 1 1071a: 9c 15 cp r25, r12 1071c: 18 f4 brcc .+6 ; 0x10724 out[i] = (char)mp_char_out_buf[i]; 1071e: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10722: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10724: 10 92 43 03 sts 0x0343, r1 ; 0x800343 10728: 3a a2 std Y+34, r3 ; 0x22 1072a: 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]; 1072c: 89 a1 ldd r24, Y+33 ; 0x21 1072e: 82 19 sub r24, r2 10730: 8c 15 cp r24, r12 10732: 28 f6 brcc .-118 ; 0x106be 10734: e9 a1 ldd r30, Y+33 ; 0x21 10736: fa a1 ldd r31, Y+34 ; 0x22 10738: 11 91 ld r17, Z+ 1073a: fa a3 std Y+34, r31 ; 0x22 1073c: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 1073e: 86 e4 ldi r24, 0x46 ; 70 10740: 93 e0 ldi r25, 0x03 ; 3 10742: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> if (serial_char < 0) 10746: 17 fd sbrc r17, 7 10748: f1 cf rjmp .-30 ; 0x1072c 1074a: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 1074e: 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' || 10752: 1a 30 cpi r17, 0x0A ; 10 10754: 09 f4 brne .+2 ; 0x10758 10756: 4a c1 rjmp .+660 ; 0x109ec 10758: 1d 30 cpi r17, 0x0D ; 13 1075a: 09 f4 brne .+2 ; 0x1075e 1075c: 47 c1 rjmp .+654 ; 0x109ec serial_char == '\r' || 1075e: 8f 35 cpi r24, 0x5F ; 95 10760: 91 05 cpc r25, r1 10762: 0c f0 brlt .+2 ; 0x10766 10764: 48 c1 rjmp .+656 ; 0x109f6 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; 10766: 1b 33 cpi r17, 0x3B ; 59 10768: 11 f4 brne .+4 ; 0x1076e 1076a: d0 92 45 03 sts 0x0345, r13 ; 0x800345 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 1076e: 20 91 45 03 lds r18, 0x0345 ; 0x800345 10772: 21 11 cpse r18, r1 10774: db cf rjmp .-74 ; 0x1072c 10776: 9c 01 movw r18, r24 10778: 2f 5f subi r18, 0xFF ; 255 1077a: 3f 4f sbci r19, 0xFF ; 255 1077c: 30 93 9f 10 sts 0x109F, r19 ; 0x80109f 10780: 20 93 9e 10 sts 0x109E, r18 ; 0x80109e 10784: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10788: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 1078c: 2b 55 subi r18, 0x5B ; 91 1078e: 3f 4e sbci r19, 0xEF ; 239 10790: 82 0f add r24, r18 10792: 93 1f adc r25, r19 10794: fc 01 movw r30, r24 10796: 13 83 std Z+3, r17 ; 0x03 10798: c9 cf rjmp .-110 ; 0x1072c #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 1079a: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 1079e: 90 91 9f 10 lds r25, 0x109F ; 0x80109f 107a2: 18 16 cp r1, r24 107a4: 19 06 cpc r1, r25 107a6: 0c f4 brge .+2 ; 0x107aa 107a8: 56 c2 rjmp .+1196 ; 0x10c56 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 107aa: 80 91 90 14 lds r24, 0x1490 ; 0x801490 107ae: 81 11 cpse r24, r1 107b0: 66 c2 rjmp .+1228 ; 0x10c7e prusa_statistics(6); } } #endif //SDSUPPORT } 107b2: a2 96 adiw r28, 0x22 ; 34 107b4: 0f b6 in r0, 0x3f ; 63 107b6: f8 94 cli 107b8: de bf out 0x3e, r29 ; 62 107ba: 0f be out 0x3f, r0 ; 63 107bc: cd bf out 0x3d, r28 ; 61 107be: df 91 pop r29 107c0: cf 91 pop r28 107c2: 1f 91 pop r17 107c4: 0f 91 pop r16 107c6: ff 90 pop r15 107c8: ef 90 pop r14 107ca: df 90 pop r13 107cc: cf 90 pop r12 107ce: bf 90 pop r11 107d0: af 90 pop r10 107d2: 9f 90 pop r9 107d4: 8f 90 pop r8 107d6: 7f 90 pop r7 107d8: 6f 90 pop r6 107da: 5f 90 pop r5 107dc: 4f 90 pop r4 107de: 3f 90 pop r3 107e0: 2f 90 pop r2 107e2: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 107e4: d0 92 40 03 sts 0x0340, r13 ; 0x800340 107e8: 8e cf rjmp .-228 ; 0x10706 return; } if (mp_cmd_active > 0) { 107ea: 30 91 3f 03 lds r19, 0x033F ; 0x80033f 107ee: 33 23 and r19, r19 107f0: 09 f4 brne .+2 ; 0x107f4 107f2: 57 c0 rjmp .+174 ; 0x108a2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 107f4: 89 3f cpi r24, 0xF9 ; 249 107f6: 09 f4 brne .+2 ; 0x107fa 107f8: 3f c0 rjmp .+126 ; 0x10878 107fa: 80 f5 brcc .+96 ; 0x1085c 107fc: 86 3f cpi r24, 0xF6 ; 246 107fe: 09 f4 brne .+2 ; 0x10802 10800: 48 c0 rjmp .+144 ; 0x10892 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10802: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10806: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10808: 27 3f cpi r18, 0xF7 ; 247 1080a: 79 f1 breq .+94 ; 0x1086a 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. 1080c: 89 e6 ldi r24, 0x69 ; 105 1080e: 97 e7 ldi r25, 0x77 ; 119 10810: 0e 94 57 77 call 0xeeae ; 0xeeae // 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); 10814: 84 e6 ldi r24, 0x64 ; 100 10816: 97 e7 ldi r25, 0x77 ; 119 10818: 0e 94 57 77 call 0xeeae ; 0xeeae // Echo current state if (mp_config & MPConfig_Active) 1081c: 10 91 3e 03 lds r17, 0x033E ; 0x80033e SERIAL_ECHOPGM(" ON"); 10820: 80 e6 ldi r24, 0x60 ; 96 10822: 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) 10824: 10 fd sbrc r17, 0 10826: 02 c0 rjmp .+4 ; 0x1082c SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10828: 8b e5 ldi r24, 0x5B ; 91 1082a: 97 e7 ldi r25, 0x77 ; 119 1082c: 0e 94 57 77 call 0xeeae ; 0xeeae if (mp_config & MPConfig_NoSpaces) 10830: 01 2f mov r16, r17 10832: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10834: 86 e5 ldi r24, 0x56 ; 86 10836: 97 e7 ldi r25, 0x77 ; 119 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10838: 11 fd sbrc r17, 1 1083a: 02 c0 rjmp .+4 ; 0x10840 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 1083c: 81 e5 ldi r24, 0x51 ; 81 1083e: 97 e7 ldi r25, 0x77 ; 119 10840: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM(""); 10844: 80 e5 ldi r24, 0x50 ; 80 10846: 97 e7 ldi r25, 0x77 ; 119 10848: 0e 94 82 79 call 0xf304 ; 0xf304 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 1084c: 00 23 and r16, r16 1084e: 29 f1 breq .+74 ; 0x1089a MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10850: 45 e4 ldi r20, 0x45 ; 69 10852: 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; 10856: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 1085a: 55 cf rjmp .-342 ; 0x10706 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 1085c: 8a 3f cpi r24, 0xFA ; 250 1085e: 41 f0 breq .+16 ; 0x10870 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10860: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10864: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10866: 2b 3f cpi r18, 0xFB ; 251 10868: 89 f6 brne .-94 ; 0x1080c #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 1086a: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e 1086e: ce cf rjmp .-100 ; 0x1080c #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10870: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10874: 8e 7f andi r24, 0xFE ; 254 10876: f9 cf rjmp .-14 ; 0x1086a return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10878: 10 92 43 03 sts 0x0343, r1 ; 0x800343 mp_cmd_active = MPCommand_None; 1087c: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f mp_config = MPConfig_None; 10880: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_char_buf = 0; 10884: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_cmd_count = 0; 10888: 10 92 40 03 sts 0x0340, r1 ; 0x800340 mp_cmd_active = 0; mp_full_char_queue = 0; 1088c: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c 10890: bd cf rjmp .-134 ; 0x1080c #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10892: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10896: 8d 7f andi r24, 0xFD ; 253 10898: e8 cf rjmp .-48 ; 0x1086a // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 1089a: 50 e2 ldi r21, 0x20 ; 32 1089c: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 108a0: da cf rjmp .-76 ; 0x10856 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 108a2: 20 91 40 03 lds r18, 0x0340 ; 0x800340 108a6: 40 91 3e 03 lds r20, 0x033E ; 0x80033e 108aa: 22 23 and r18, r18 108ac: 31 f1 breq .+76 ; 0x108fa 108ae: 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) { 108b2: 40 ff sbrs r20, 0 108b4: 49 c0 rjmp .+146 ; 0x10948 if (mp_full_char_queue > 0) { 108b6: 30 91 3c 03 lds r19, 0x033C ; 0x80033c 108ba: 33 23 and r19, r19 108bc: 09 f4 brne .+2 ; 0x108c0 108be: 40 c0 rjmp .+128 ; 0x10940 #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; 108c0: 21 e0 ldi r18, 0x01 ; 1 108c2: 2e 0f add r18, r30 108c4: 20 93 43 03 sts 0x0343, r18 ; 0x800343 108c8: ae 2f mov r26, r30 108ca: b0 e0 ldi r27, 0x00 ; 0 108cc: af 5b subi r26, 0xBF ; 191 108ce: bc 4f sbci r27, 0xFC ; 252 108d0: ff ef ldi r31, 0xFF ; 255 108d2: 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) { 108d4: 50 91 3d 03 lds r21, 0x033D ; 0x80033d 108d8: 55 23 and r21, r21 108da: 51 f0 breq .+20 ; 0x108f0 #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; 108dc: ee 5f subi r30, 0xFE ; 254 108de: e0 93 43 03 sts 0x0343, r30 ; 0x800343 108e2: e2 2f mov r30, r18 108e4: f0 e0 ldi r31, 0x00 ; 0 108e6: ef 5b subi r30, 0xBF ; 191 108e8: fc 4f sbci r31, 0xFC ; 252 108ea: 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; 108ec: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 108f0: 31 50 subi r19, 0x01 ; 1 108f2: 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; 108f6: 10 92 40 03 sts 0x0340, r1 ; 0x800340 108fa: 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) { 108fe: 40 ff sbrs r20, 0 10900: 6c c0 rjmp .+216 ; 0x109da if (mp_full_char_queue > 0) { 10902: 20 91 3c 03 lds r18, 0x033C ; 0x80033c 10906: 22 23 and r18, r18 10908: 49 f1 breq .+82 ; 0x1095c #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; 1090a: 91 e0 ldi r25, 0x01 ; 1 1090c: 9e 0f add r25, r30 1090e: 90 93 43 03 sts 0x0343, r25 ; 0x800343 10912: ae 2f mov r26, r30 10914: b0 e0 ldi r27, 0x00 ; 0 10916: af 5b subi r26, 0xBF ; 191 10918: bc 4f sbci r27, 0xFC ; 252 1091a: 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) { 1091c: 80 91 3d 03 lds r24, 0x033D ; 0x80033d 10920: 88 23 and r24, r24 10922: 51 f0 breq .+20 ; 0x10938 #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; 10924: ee 5f subi r30, 0xFE ; 254 10926: e0 93 43 03 sts 0x0343, r30 ; 0x800343 1092a: e9 2f mov r30, r25 1092c: f0 e0 ldi r31, 0x00 ; 0 1092e: ef 5b subi r30, 0xBF ; 191 10930: fc 4f sbci r31, 0xFC ; 252 10932: 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; 10934: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 10938: 21 50 subi r18, 0x01 ; 1 1093a: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 1093e: e3 ce rjmp .-570 ; 0x10706 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; 10940: 22 e0 ldi r18, 0x02 ; 2 10942: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10946: d7 cf rjmp .-82 ; 0x108f6 #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; 10948: 21 e0 ldi r18, 0x01 ; 1 1094a: 2e 0f add r18, r30 1094c: 20 93 43 03 sts 0x0343, r18 ; 0x800343 10950: f0 e0 ldi r31, 0x00 ; 0 10952: ef 5b subi r30, 0xBF ; 191 10954: fc 4f sbci r31, 0xFC ; 252 10956: 5f ef ldi r21, 0xFF ; 255 10958: 50 83 st Z, r21 1095a: cd cf rjmp .-102 ; 0x108f6 1095c: a8 2f mov r26, r24 1095e: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10960: 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; 10962: 31 e0 ldi r19, 0x01 ; 1 10964: af 30 cpi r26, 0x0F ; 15 10966: 29 f0 breq .+10 ; 0x10972 10968: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 1096a: a0 50 subi r26, 0x00 ; 0 1096c: be 4f sbci r27, 0xFE ; 254 1096e: 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; 10970: 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; 10972: 58 2f mov r21, r24 10974: 50 7f andi r21, 0xF0 ; 240 10976: 50 3f cpi r21, 0xF0 ; 240 10978: 59 f4 brne .+22 ; 0x10990 1097a: 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) { 1097c: 30 ff sbrs r19, 0 1097e: 13 c0 rjmp .+38 ; 0x109a6 ++mp_full_char_queue; 10980: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10984: 31 ff sbrs r19, 1 10986: 0c c0 rjmp .+24 ; 0x109a0 10988: 82 e0 ldi r24, 0x02 ; 2 1098a: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 1098e: bb ce rjmp .-650 ; 0x10706 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 10990: 82 95 swap r24 10992: 8f 70 andi r24, 0x0F ; 15 10994: a8 2f mov r26, r24 10996: b0 e0 ldi r27, 0x00 ; 0 10998: a0 50 subi r26, 0x00 ; 0 1099a: be 4f sbci r27, 0xFE ; 254 1099c: 2c 91 ld r18, X 1099e: ee cf rjmp .-36 ; 0x1097c 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]; 109a0: 20 93 3d 03 sts 0x033D, r18 ; 0x80033d 109a4: b0 ce rjmp .-672 ; 0x10706 #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; 109a6: 81 e0 ldi r24, 0x01 ; 1 109a8: 8e 0f add r24, r30 109aa: 80 93 43 03 sts 0x0343, r24 ; 0x800343 109ae: ae 2f mov r26, r30 109b0: b0 e0 ldi r27, 0x00 ; 0 109b2: af 5b subi r26, 0xBF ; 191 109b4: bc 4f sbci r27, 0xFC ; 252 109b6: 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') { 109b8: 4a 30 cpi r20, 0x0A ; 10 109ba: 09 f4 brne .+2 ; 0x109be 109bc: a4 ce rjmp .-696 ; 0x10706 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 109be: 31 ff sbrs r19, 1 109c0: 03 c0 rjmp .+6 ; 0x109c8 109c2: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c 109c6: 9f ce rjmp .-706 ; 0x10706 #ifdef MP_DEBUG uint32_t mp_chars_decoded = 0; #endif void FORCE_INLINE mp_handle_output_char(const uint8_t c) { mp_char_out_buf[mp_char_out_count++] = c; 109c8: ee 5f subi r30, 0xFE ; 254 109ca: e0 93 43 03 sts 0x0343, r30 ; 0x800343 109ce: e8 2f mov r30, r24 109d0: f0 e0 ldi r31, 0x00 ; 0 109d2: ef 5b subi r30, 0xBF ; 191 109d4: fc 4f sbci r31, 0xFC ; 252 109d6: 20 83 st Z, r18 109d8: 96 ce rjmp .-724 ; 0x10706 109da: 91 e0 ldi r25, 0x01 ; 1 109dc: 9e 0f add r25, r30 109de: 90 93 43 03 sts 0x0343, r25 ; 0x800343 109e2: f0 e0 ldi r31, 0x00 ; 0 109e4: ef 5b subi r30, 0xBF ; 191 109e6: fc 4f sbci r31, 0xFC ; 252 109e8: 80 83 st Z, r24 109ea: 8d ce rjmp .-742 ; 0x10706 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 109ec: 00 97 sbiw r24, 0x00 ; 0 109ee: 19 f4 brne .+6 ; 0x109f6 comment_mode = false; //for new command 109f0: 10 92 45 03 sts 0x0345, r1 ; 0x800345 109f4: de ce rjmp .-580 ; 0x107b2 109f6: 00 91 a0 10 lds r16, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 109fa: 10 91 a1 10 lds r17, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 109fe: 08 55 subi r16, 0x58 ; 88 10a00: 1f 4e sbci r17, 0xEF ; 239 10a02: 80 0f add r24, r16 10a04: 91 1f adc r25, r17 10a06: fc 01 movw r30, r24 10a08: 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) 10a0a: 1a 83 std Y+2, r17 ; 0x02 10a0c: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10a0e: 80 91 45 03 lds r24, 0x0345 ; 0x800345 10a12: 81 11 cpse r24, r1 10a14: 03 c1 rjmp .+518 ; 0x10c1c long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10a16: f8 01 movw r30, r16 10a18: 80 81 ld r24, Z 10a1a: 8e 34 cpi r24, 0x4E ; 78 10a1c: 09 f0 breq .+2 ; 0x10a20 10a1e: 8a c0 rjmp .+276 ; 0x10b34 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10a20: 4a e0 ldi r20, 0x0A ; 10 10a22: 50 e0 ldi r21, 0x00 ; 0 10a24: be 01 movw r22, r28 10a26: 6f 5f subi r22, 0xFF ; 255 10a28: 7f 4f sbci r23, 0xFF ; 255 10a2a: c8 01 movw r24, r16 10a2c: 01 96 adiw r24, 0x01 ; 1 10a2e: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 10a32: 2b 01 movw r4, r22 10a34: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10a36: e9 80 ldd r14, Y+1 ; 0x01 10a38: fa 80 ldd r15, Y+2 ; 0x02 10a3a: f7 01 movw r30, r14 10a3c: 80 81 ld r24, Z 10a3e: 80 32 cpi r24, 0x20 ; 32 10a40: 31 f4 brne .+12 ; 0x10a4e 10a42: ff ef ldi r31, 0xFF ; 255 10a44: ef 1a sub r14, r31 10a46: ff 0a sbc r15, r31 10a48: fa 82 std Y+2, r15 ; 0x02 10a4a: e9 82 std Y+1, r14 ; 0x01 10a4c: f4 cf rjmp .-24 ; 0x10a36 // 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)) { 10a4e: 80 90 7a 03 lds r8, 0x037A ; 0x80037a 10a52: 90 90 7b 03 lds r9, 0x037B ; 0x80037b 10a56: a0 90 7c 03 lds r10, 0x037C ; 0x80037c 10a5a: b0 90 7d 03 lds r11, 0x037D ; 0x80037d 10a5e: d5 01 movw r26, r10 10a60: c4 01 movw r24, r8 10a62: 01 96 adiw r24, 0x01 ; 1 10a64: a1 1d adc r26, r1 10a66: b1 1d adc r27, r1 10a68: 84 15 cp r24, r4 10a6a: 95 05 cpc r25, r5 10a6c: a6 05 cpc r26, r6 10a6e: b7 05 cpc r27, r7 10a70: 49 f0 breq .+18 ; 0x10a84 10a72: 44 e0 ldi r20, 0x04 ; 4 10a74: 50 e0 ldi r21, 0x00 ; 0 10a76: 69 e9 ldi r22, 0x99 ; 153 10a78: 77 e7 ldi r23, 0x77 ; 119 10a7a: c7 01 movw r24, r14 10a7c: 0f 94 02 da call 0x3b404 ; 0x3b404 10a80: 89 2b or r24, r25 10a82: a1 f4 brne .+40 ; 0x10aac FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10a84: 6a e2 ldi r22, 0x2A ; 42 10a86: 70 e0 ldi r23, 0x00 ; 0 10a88: c7 01 movw r24, r14 10a8a: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 10a8e: 90 93 96 03 sts 0x0396, r25 ; 0x800396 10a92: 80 93 95 03 sts 0x0395, r24 ; 0x800395 10a96: 00 97 sbiw r24, 0x00 ; 0 10a98: 09 f4 brne .+2 ; 0x10a9c 10a9a: 45 c0 rjmp .+138 ; 0x10b26 10a9c: f8 01 movw r30, r16 { byte checksum = 0; 10a9e: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10aa0: e8 17 cp r30, r24 10aa2: f9 07 cpc r31, r25 10aa4: 71 f0 breq .+28 ; 0x10ac2 checksum = checksum^(*p++); 10aa6: 21 91 ld r18, Z+ 10aa8: f2 26 eor r15, r18 10aaa: fa cf rjmp .-12 ; 0x10aa0 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; 10aac: 88 ea ldi r24, 0xA8 ; 168 10aae: 9b ea ldi r25, 0xAB ; 171 10ab0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10ab4: 8a e4 ldi r24, 0x4A ; 74 10ab6: 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 10ab8: 0e 94 57 77 call 0xeeae ; 0xeeae 10abc: c5 01 movw r24, r10 10abe: b4 01 movw r22, r8 10ac0: 15 c0 rjmp .+42 ; 0x10aec { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10ac2: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 10ac6: f8 16 cp r15, r24 10ac8: 19 06 cpc r1, r25 10aca: d9 f0 breq .+54 ; 0x10b02 SERIAL_ERROR_START; 10acc: 88 ea ldi r24, 0xA8 ; 168 10ace: 9b ea ldi r25, 0xAB ; 171 10ad0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10ad4: 8b e2 ldi r24, 0x2B ; 43 10ad6: 95 e6 ldi r25, 0x65 ; 101 10ad8: 0e 94 57 77 call 0xeeae ; 0xeeae 10adc: 60 91 7a 03 lds r22, 0x037A ; 0x80037a 10ae0: 70 91 7b 03 lds r23, 0x037B ; 0x80037b 10ae4: 80 91 7c 03 lds r24, 0x037C ; 0x80037c 10ae8: 90 91 7d 03 lds r25, 0x037D ; 0x80037d 10aec: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10af0: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10af4: 0e 94 94 5b call 0xb728 ; 0xb728 serial_count = 0; 10af8: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10afc: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e 10b00: 58 ce rjmp .-848 ; 0x107b2 return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10b02: e0 91 95 03 lds r30, 0x0395 ; 0x800395 10b06: f0 91 96 03 lds r31, 0x0396 ; 0x800396 10b0a: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10b0c: e9 80 ldd r14, Y+1 ; 0x01 10b0e: fa 80 ldd r15, Y+2 ; 0x02 10b10: 64 e9 ldi r22, 0x94 ; 148 10b12: 77 e7 ldi r23, 0x77 ; 119 10b14: c7 01 movw r24, r14 10b16: 0f 94 d1 d9 call 0x3b3a2 ; 0x3b3a2 10b1a: 89 2b or r24, r25 10b1c: 39 f5 brne .+78 ; 0x10b6c kill(MSG_M112_KILL); 10b1e: 85 e6 ldi r24, 0x65 ; 101 10b20: 98 e6 ldi r25, 0x68 ; 104 10b22: 0e 94 11 7a call 0xf422 ; 0xf422 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10b26: 88 ea ldi r24, 0xA8 ; 168 10b28: 9b ea ldi r25, 0xAB ; 171 10b2a: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10b2e: 81 e0 ldi r24, 0x01 ; 1 10b30: 95 e6 ldi r25, 0x65 ; 101 10b32: c2 cf rjmp .-124 ; 0x10ab8 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10b34: 89 81 ldd r24, Y+1 ; 0x01 10b36: 9a 81 ldd r25, Y+2 ; 0x02 10b38: fc 01 movw r30, r24 10b3a: 20 81 ld r18, Z 10b3c: 20 32 cpi r18, 0x20 ; 32 10b3e: 21 f4 brne .+8 ; 0x10b48 10b40: 01 96 adiw r24, 0x01 ; 1 10b42: 9a 83 std Y+2, r25 ; 0x02 10b44: 89 83 std Y+1, r24 ; 0x01 10b46: f6 cf rjmp .-20 ; 0x10b34 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10b48: 6a e2 ldi r22, 0x2A ; 42 10b4a: 70 e0 ldi r23, 0x00 ; 0 10b4c: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 10b50: 89 2b or r24, r25 10b52: 39 f0 breq .+14 ; 0x10b62 { SERIAL_ERROR_START; 10b54: 88 ea ldi r24, 0xA8 ; 168 10b56: 9b ea ldi r25, 0xAB ; 171 10b58: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10b5c: 87 ed ldi r24, 0xD7 ; 215 10b5e: 94 e6 ldi r25, 0x64 ; 100 10b60: bb cf rjmp .-138 ; 0x10ad8 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 10b62: 44 24 eor r4, r4 10b64: 4a 94 dec r4 10b66: 54 2c mov r5, r4 10b68: 32 01 movw r6, r4 10b6a: d0 cf rjmp .-96 ; 0x10b0c 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) 10b6c: 44 e0 ldi r20, 0x04 ; 4 10b6e: 50 e0 ldi r21, 0x00 ; 0 10b70: 6f e8 ldi r22, 0x8F ; 143 10b72: 77 e7 ldi r23, 0x77 ; 119 10b74: c7 01 movw r24, r14 10b76: 0f 94 02 da call 0x3b404 ; 0x3b404 10b7a: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10b7c: f7 01 movw r30, r14 10b7e: 80 81 ld r24, Z 10b80: 87 34 cpi r24, 0x47 ; 71 10b82: 81 f4 brne .+32 ; 0x10ba4 10b84: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 10b88: 85 30 cpi r24, 0x05 ; 5 10b8a: 61 f0 breq .+24 ; 0x10ba4 usb_timer.start(); 10b8c: 8e e0 ldi r24, 0x0E ; 14 10b8e: 95 e0 ldi r25, 0x05 ; 5 10b90: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10b94: f6 e0 ldi r31, 0x06 ; 6 10b96: 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); 10b9a: 60 e0 ldi r22, 0x00 ; 0 10b9c: 85 ea ldi r24, 0xA5 ; 165 10b9e: 9f e0 ldi r25, 0x0F ; 15 10ba0: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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) { 10ba4: ab 28 or r10, r11 10ba6: 21 f0 breq .+8 ; 0x10bb0 10ba8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 10bac: 81 11 cpse r24, r1 10bae: a4 cf rjmp .-184 ; 0x10af8 } // 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; 10bb0: 26 e0 ldi r18, 0x06 ; 6 10bb2: 77 fc sbrc r7, 7 10bb4: 21 e0 ldi r18, 0x01 ; 1 10bb6: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10bba: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10bbe: fc 01 movw r30, r24 10bc0: eb 55 subi r30, 0x5B ; 91 10bc2: ff 4e sbci r31, 0xEF ; 239 10bc4: 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) 10bc6: 49 81 ldd r20, Y+1 ; 0x01 10bc8: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10bca: 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) 10bcc: da 01 movw r26, r20 10bce: 40 17 cp r20, r16 10bd0: 51 07 cpc r21, r17 10bd2: a1 f5 brne .+104 ; 0x10c3c cmd_len = strlen(cmd_start) + 1; 10bd4: 01 90 ld r0, Z+ 10bd6: 00 20 and r0, r0 10bd8: e9 f7 brne .-6 ; 0x10bd4 10bda: 9f 01 movw r18, r30 10bdc: 20 1b sub r18, r16 10bde: 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; 10be0: 03 96 adiw r24, 0x03 ; 3 10be2: 28 0f add r18, r24 10be4: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10be6: 2d 3e cpi r18, 0xED ; 237 10be8: f1 e0 ldi r31, 0x01 ; 1 10bea: 3f 07 cpc r19, r31 10bec: 79 f1 breq .+94 ; 0x10c4c // 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; 10bee: 30 93 a1 10 sts 0x10A1, r19 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10bf2: 20 93 a0 10 sts 0x10A0, r18 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10bf6: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10bfa: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10bfe: 01 96 adiw r24, 0x01 ; 1 10c00: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10c04: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 // Update the processed gcode line if (gcode_N >= 0) 10c08: 77 fc sbrc r7, 7 10c0a: 08 c0 rjmp .+16 ; 0x10c1c gcode_LastN = gcode_N; 10c0c: 40 92 7a 03 sts 0x037A, r4 ; 0x80037a 10c10: 50 92 7b 03 sts 0x037B, r5 ; 0x80037b 10c14: 60 92 7c 03 sts 0x037C, r6 ; 0x80037c 10c18: 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 10c1c: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10c20: 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)) 10c24: 0e 94 10 77 call 0xee20 ; 0xee20 10c28: 89 2b or r24, r25 10c2a: 09 f4 brne .+2 ; 0x10c2e 10c2c: c2 cd rjmp .-1148 ; 0x107b2 10c2e: 8f e5 ldi r24, 0x5F ; 95 10c30: 90 e0 ldi r25, 0x00 ; 0 10c32: 0e 94 49 5c call 0xb892 ; 0xb892 10c36: 81 11 cpse r24, r1 10c38: 79 cd rjmp .-1294 ; 0x1072c 10c3a: bb cd rjmp .-1162 ; 0x107b2 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]; } 10c3c: 6d 91 ld r22, X+ 10c3e: 61 93 st Z+, r22 10c40: 9d 01 movw r18, r26 10c42: 24 1b sub r18, r20 10c44: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10c46: 61 11 cpse r22, r1 10c48: f9 cf rjmp .-14 ; 0x10c3c 10c4a: ca cf rjmp .-108 ; 0x10be0 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10c4c: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10c50: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10c54: d0 cf rjmp .-96 ; 0x10bf6 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10c56: 60 ed ldi r22, 0xD0 ; 208 10c58: 77 e0 ldi r23, 0x07 ; 7 10c5a: 86 e4 ldi r24, 0x46 ; 70 10c5c: 93 e0 ldi r25, 0x03 ; 3 10c5e: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 10c62: 88 23 and r24, r24 10c64: 09 f4 brne .+2 ; 0x10c68 10c66: a1 cd rjmp .-1214 ; 0x107aa comment_mode = false; 10c68: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; 10c6c: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10c70: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e SERIAL_ECHOLNPGM("RX timeout"); 10c74: 84 e8 ldi r24, 0x84 ; 132 10c76: 97 e7 ldi r25, 0x77 ; 119 10c78: 0e 94 82 79 call 0xf304 ; 0xf304 10c7c: 9a cd rjmp .-1228 ; 0x107b2 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10c7e: 80 91 23 17 lds r24, 0x1723 ; 0x801723 10c82: 88 23 and r24, r24 10c84: 09 f4 brne .+2 ; 0x10c88 10c86: 95 cd rjmp .-1238 ; 0x107b2 10c88: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10c8c: 90 91 9f 10 lds r25, 0x109F ; 0x80109f 10c90: 89 2b or r24, r25 10c92: 09 f0 breq .+2 ; 0x10c96 10c94: 8e cd rjmp .-1252 ; 0x107b2 //'#' 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; 10c96: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10c9a: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10c9e: 89 2b or r24, r25 10ca0: 11 f4 brne .+4 ; 0x10ca6 10ca2: 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; 10ca6: 2d e9 ldi r18, 0x9D ; 157 10ca8: e2 2e mov r14, r18 10caa: 20 e1 ldi r18, 0x10 ; 16 10cac: 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; 10cae: 32 e0 ldi r19, 0x02 ; 2 10cb0: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10cb2: cc 24 eor r12, r12 10cb4: 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) { 10cb6: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10cba: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10cbe: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10cc2: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10cc6: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10cca: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10cce: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10cd2: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10cd6: 48 17 cp r20, r24 10cd8: 59 07 cpc r21, r25 10cda: 6a 07 cpc r22, r26 10cdc: 7b 07 cpc r23, r27 10cde: 08 f0 brcs .+2 ; 0x10ce2 10ce0: 2f c1 rjmp .+606 ; 0x10f40 10ce2: 80 91 44 03 lds r24, 0x0344 ; 0x800344 10ce6: 81 11 cpse r24, r1 10ce8: 2b c1 rjmp .+598 ; 0x10f40 : "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() ){ 10cea: 0f 94 8a 7a call 0x2f514 ; 0x2f514 10cee: 88 23 and r24, r24 10cf0: 49 f1 breq .+82 ; 0x10d44 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; 10cf2: 20 91 3b 17 lds r18, 0x173B ; 0x80173b 10cf6: 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; 10cfa: 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; 10cfc: 9b ef ldi r25, 0xFB ; 251 10cfe: 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 == ';' ){ 10d00: f8 01 movw r30, r16 10d02: 80 81 ld r24, Z 10d04: 8b 33 cpi r24, 0x3B ; 59 10d06: 51 f5 brne .+84 ; 0x10d5c // 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); 10d08: f8 01 movw r30, r16 00010d0a : 10d0a: 61 91 ld r22, Z+ 10d0c: 6a 30 cpi r22, 0x0A ; 10 10d0e: e9 f7 brne .-6 ; 0x10d0a 10d10: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10d12: cf 01 movw r24, r30 10d14: 8d 59 subi r24, 0x9D ; 157 10d16: 9e 40 sbci r25, 0x0E ; 14 10d18: 81 30 cpi r24, 0x01 ; 1 10d1a: 92 40 sbci r25, 0x02 ; 2 10d1c: d4 f0 brlt .+52 ; 0x10d52 // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10d1e: c8 01 movw r24, r16 10d20: 82 1b sub r24, r18 10d22: 93 0b sbc r25, r19 10d24: 01 97 sbiw r24, 0x01 ; 1 10d26: 0f 94 7b 7a call 0x2f4f6 ; 0x2f4f6 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10d2a: 80 e2 ldi r24, 0x20 ; 32 10d2c: 97 e1 ldi r25, 0x17 ; 23 10d2e: 0f 94 20 56 call 0x2ac40 ; 0x2ac40 10d32: 88 23 and r24, r24 10d34: 39 f0 breq .+14 ; 0x10d44 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10d36: 0f 94 8a 7a call 0x2f514 ; 0x2f514 rdPtr = start = blockBuffBegin; 10d3a: 2d e9 ldi r18, 0x9D ; 157 10d3c: 3e e0 ldi r19, 0x0E ; 14 10d3e: 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 10d40: 81 11 cpse r24, r1 10d42: e2 cf rjmp .-60 ; 0x10d08 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10d44: f0 92 3c 17 sts 0x173C, r15 ; 0x80173c 10d48: e0 92 3b 17 sts 0x173B, r14 ; 0x80173b return -1; 10d4c: 0f ef ldi r16, 0xFF ; 255 10d4e: 1f ef ldi r17, 0xFF ; 255 10d50: 37 c0 rjmp .+110 ; 0x10dc0 10d52: 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){ 10d54: b1 10 cpse r11, r1 10d56: d5 c0 rjmp .+426 ; 0x10f02 // 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 10d58: 01 50 subi r16, 0x01 ; 1 10d5a: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10d5c: c8 01 movw r24, r16 10d5e: 82 1b sub r24, r18 10d60: 93 0b sbc r25, r19 10d62: 01 96 adiw r24, 0x01 ; 1 10d64: 0f 94 7b 7a call 0x2f4f6 ; 0x2f4f6 int16_t rv = *rdPtr++; 10d68: c8 01 movw r24, r16 10d6a: 01 96 adiw r24, 0x01 ; 1 10d6c: f8 01 movw r30, r16 10d6e: 00 81 ld r16, Z 10d70: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10d72: 80 90 28 17 lds r8, 0x1728 ; 0x801728 10d76: 90 90 29 17 lds r9, 0x1729 ; 0x801729 10d7a: a0 90 2a 17 lds r10, 0x172A ; 0x80172a 10d7e: b0 90 2b 17 lds r11, 0x172B ; 0x80172b 10d82: 40 91 31 17 lds r20, 0x1731 ; 0x801731 10d86: 50 91 32 17 lds r21, 0x1732 ; 0x801732 10d8a: 60 91 33 17 lds r22, 0x1733 ; 0x801733 10d8e: 70 91 34 17 lds r23, 0x1734 ; 0x801734 10d92: 84 16 cp r8, r20 10d94: 95 06 cpc r9, r21 10d96: a6 06 cpc r10, r22 10d98: b7 06 cpc r11, r23 10d9a: a0 f6 brcc .-88 ; 0x10d44 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 10d9c: 9c 01 movw r18, r24 10d9e: 2d 59 subi r18, 0x9D ; 157 10da0: 3e 40 sbci r19, 0x0E ; 14 10da2: 21 15 cp r18, r1 10da4: 32 40 sbci r19, 0x02 ; 2 10da6: 44 f0 brlt .+16 ; 0x10db8 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10da8: 80 e2 ldi r24, 0x20 ; 32 10daa: 97 e1 ldi r25, 0x17 ; 23 10dac: 0f 94 20 56 call 0x2ac40 ; 0x2ac40 10db0: 88 23 and r24, r24 10db2: 41 f2 breq .-112 ; 0x10d44 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 10db4: 8d e9 ldi r24, 0x9D ; 157 10db6: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 10db8: 90 93 3c 17 sts 0x173C, r25 ; 0x80173c 10dbc: 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_;} 10dc0: 40 91 28 17 lds r20, 0x1728 ; 0x801728 10dc4: 50 91 29 17 lds r21, 0x1729 ; 0x801729 10dc8: 60 91 2a 17 lds r22, 0x172A ; 0x80172a 10dcc: 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(); 10dd0: 40 93 a4 17 sts 0x17A4, r20 ; 0x8017a4 10dd4: 50 93 a5 17 sts 0x17A5, r21 ; 0x8017a5 10dd8: 60 93 a6 17 sts 0x17A6, r22 ; 0x8017a6 10ddc: 70 93 a7 17 sts 0x17A7, r23 ; 0x8017a7 10de0: 80 91 9e 10 lds r24, 0x109E ; 0x80109e 10de4: 90 91 9f 10 lds r25, 0x109F ; 0x80109f int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 10de8: 0a 30 cpi r16, 0x0A ; 10 10dea: 61 f0 breq .+24 ; 0x10e04 || serial_char == '\r' 10dec: 0d 30 cpi r16, 0x0D ; 13 10dee: 51 f0 breq .+20 ; 0x10e04 || serial_char == '#' 10df0: 03 32 cpi r16, 0x23 ; 35 10df2: 09 f4 brne .+2 ; 0x10df6 10df4: 8c c0 rjmp .+280 ; 0x10f0e || serial_count >= (MAX_CMD_SIZE - 1) 10df6: 8f 35 cpi r24, 0x5F ; 95 10df8: 91 05 cpc r25, r1 10dfa: 3c f4 brge .+14 ; 0x10e0a || n==-1 10dfc: 0f 3f cpi r16, 0xFF ; 255 10dfe: 10 07 cpc r17, r16 10e00: 09 f0 breq .+2 ; 0x10e04 10e02: 8c c0 rjmp .+280 ; 0x10f1c ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 10e04: 00 97 sbiw r24, 0x00 ; 0 10e06: 09 f4 brne .+2 ; 0x10e0a 10e08: d4 cc rjmp .-1624 ; 0x107b2 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); }; 10e0a: 20 91 23 17 lds r18, 0x1723 ; 0x801723 10e0e: 21 11 cpse r18, r1 10e10: 03 c0 rjmp .+6 ; 0x10e18 10e12: 40 e0 ldi r20, 0x00 ; 0 10e14: 50 e0 ldi r21, 0x00 ; 0 10e16: 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; 10e18: 20 91 82 03 lds r18, 0x0382 ; 0x800382 10e1c: 30 91 83 03 lds r19, 0x0383 ; 0x800383 10e20: 42 1b sub r20, r18 10e22: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 10e24: a0 91 a0 10 lds r26, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10e28: b0 91 a1 10 lds r27, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10e2c: fd 01 movw r30, r26 10e2e: eb 55 subi r30, 0x5B ; 91 10e30: ff 4e sbci r31, 0xEF ; 239 10e32: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 10e34: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 10e36: 52 83 std Z+2, r21 ; 0x02 10e38: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 10e3a: 8b 55 subi r24, 0x5B ; 91 10e3c: 9f 4e sbci r25, 0xEF ; 239 10e3e: fc 01 movw r30, r24 10e40: ea 0f add r30, r26 10e42: fb 1f adc r31, r27 10e44: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 10e46: ab 55 subi r26, 0x5B ; 91 10e48: bf 4e sbci r27, 0xEF ; 239 10e4a: fd 01 movw r30, r26 10e4c: 01 90 ld r0, Z+ 10e4e: 00 20 and r0, r0 10e50: e9 f7 brne .-6 ; 0x10e4c 10e52: 31 97 sbiw r30, 0x01 ; 1 10e54: ea 1b sub r30, r26 10e56: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 10e58: 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; 10e5a: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 10e5e: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 10e62: 01 96 adiw r24, 0x01 ; 1 10e64: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 10e68: 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); 10e6c: 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; 10e6e: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10e72: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10e76: e8 0f add r30, r24 10e78: f9 2f mov r31, r25 10e7a: f1 1d adc r31, r1 10e7c: f0 93 a1 10 sts 0x10A1, r31 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10e80: e0 93 a0 10 sts 0x10A0, r30 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10e84: 80 91 23 17 lds r24, 0x1723 ; 0x801723 10e88: 88 23 and r24, r24 10e8a: 09 f4 brne .+2 ; 0x10e8e 10e8c: 43 c0 rjmp .+134 ; 0x10f14 10e8e: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 10e92: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 10e96: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 10e9a: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 sdpos_atomic = card.get_sdpos(); 10e9e: 80 93 82 03 sts 0x0382, r24 ; 0x800382 10ea2: 90 93 83 03 sts 0x0383, r25 ; 0x800383 10ea6: a0 93 84 03 sts 0x0384, r26 ; 0x800384 10eaa: b0 93 85 03 sts 0x0385, r27 ; 0x800385 if (bufindw == sizeof(cmdbuffer)) 10eae: ed 3e cpi r30, 0xED ; 237 10eb0: f1 40 sbci r31, 0x01 ; 1 10eb2: 21 f4 brne .+8 ; 0x10ebc bufindw = 0; 10eb4: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10eb8: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> sei(); 10ebc: 78 94 sei comment_mode = false; //for new command 10ebe: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; //clear buffer 10ec2: 10 92 9f 10 sts 0x109F, r1 ; 0x80109f 10ec6: 10 92 9e 10 sts 0x109E, r1 ; 0x80109e if(card.eof()) break; 10eca: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10ece: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10ed2: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10ed6: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10eda: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10ede: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10ee2: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10ee6: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10eea: 48 17 cp r20, r24 10eec: 59 07 cpc r21, r25 10eee: 6a 07 cpc r22, r26 10ef0: 7b 07 cpc r23, r27 10ef2: 30 f5 brcc .+76 ; 0x10f40 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 10ef4: 8f e5 ldi r24, 0x5F ; 95 10ef6: 90 e0 ldi r25, 0x00 ; 0 10ef8: 0e 94 49 5c call 0xb892 ; 0xb892 10efc: 81 11 cpse r24, r1 10efe: db ce rjmp .-586 ; 0x10cb6 10f00: 58 cc rjmp .-1872 ; 0x107b2 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 == ';' ){ 10f02: f8 01 movw r30, r16 10f04: 80 81 ld r24, Z 10f06: 8b 33 cpi r24, 0x3B ; 59 10f08: 09 f4 brne .+2 ; 0x10f0c 10f0a: fa ce rjmp .-524 ; 0x10d00 10f0c: 25 cf rjmp .-438 ; 0x10d58 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10f0e: c0 92 44 03 sts 0x0344, r12 ; 0x800344 10f12: 78 cf rjmp .-272 ; 0x10e04 10f14: 80 e0 ldi r24, 0x00 ; 0 10f16: 90 e0 ldi r25, 0x00 ; 0 10f18: dc 01 movw r26, r24 10f1a: c1 cf rjmp .-126 ; 0x10e9e return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10f1c: 9c 01 movw r18, r24 10f1e: 2f 5f subi r18, 0xFF ; 255 10f20: 3f 4f sbci r19, 0xFF ; 255 10f22: 30 93 9f 10 sts 0x109F, r19 ; 0x80109f 10f26: 20 93 9e 10 sts 0x109E, r18 ; 0x80109e 10f2a: 20 91 a0 10 lds r18, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 10f2e: 30 91 a1 10 lds r19, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 10f32: 2b 55 subi r18, 0x5B ; 91 10f34: 3f 4e sbci r19, 0xEF ; 239 10f36: 82 0f add r24, r18 10f38: 93 1f adc r25, r19 10f3a: fc 01 movw r30, r24 10f3c: 03 83 std Z+3, r16 ; 0x03 10f3e: bb ce rjmp .-650 ; 0x10cb6 } } if(card.eof()) 10f40: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 10f44: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 10f48: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 10f4c: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 10f50: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 10f54: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 10f58: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 10f5c: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 10f60: 48 17 cp r20, r24 10f62: 59 07 cpc r21, r25 10f64: 6a 07 cpc r22, r26 10f66: 7b 07 cpc r23, r27 10f68: 08 f4 brcc .+2 ; 0x10f6c 10f6a: 23 cc rjmp .-1978 ; 0x107b2 { // 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()) 10f6c: 0e 94 1a 5b call 0xb634 ; 0xb634 10f70: 89 2b or r24, r25 10f72: 09 f0 breq .+2 ; 0x10f76 10f74: 1e cc rjmp .-1988 ; 0x107b2 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 10f76: 80 e2 ldi r24, 0x20 ; 32 10f78: 97 e1 ldi r25, 0x17 ; 23 10f7a: 0f 94 42 58 call 0x2b084 ; 0x2b084 file.close(); 10f7e: 80 e2 ldi r24, 0x20 ; 32 10f80: 97 e1 ldi r25, 0x17 ; 23 10f82: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee saving = false; 10f86: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 10f8a: 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 10f8e: 84 ec ldi r24, 0xC4 ; 196 10f90: 94 e6 ldi r25, 0x64 ; 100 10f92: 0e 94 82 79 call 0xf304 ; 0xf304 char time[30]; uint32_t t = print_job_timer.duration() / 60; 10f96: 0f 94 aa 3e call 0x27d54 ; 0x27d54 10f9a: 6b 01 movw r12, r22 10f9c: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 10f9e: 0e 94 26 66 call 0xcc4c ; 0xcc4c // 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; 10fa2: 8c e3 ldi r24, 0x3C ; 60 10fa4: 88 2e mov r8, r24 10fa6: 91 2c mov r9, r1 10fa8: a1 2c mov r10, r1 10faa: b1 2c mov r11, r1 10fac: c7 01 movw r24, r14 10fae: b6 01 movw r22, r12 10fb0: a5 01 movw r20, r10 10fb2: 94 01 movw r18, r8 10fb4: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> int hours, minutes; minutes = t % 60; 10fb8: ca 01 movw r24, r20 10fba: b9 01 movw r22, r18 10fbc: a5 01 movw r20, r10 10fbe: 94 01 movw r18, r8 10fc0: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10fc4: 7f 93 push r23 10fc6: 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; 10fc8: c7 01 movw r24, r14 10fca: b6 01 movw r22, r12 10fcc: 20 e1 ldi r18, 0x10 ; 16 10fce: 3e e0 ldi r19, 0x0E ; 14 10fd0: 40 e0 ldi r20, 0x00 ; 0 10fd2: 50 e0 ldi r21, 0x00 ; 0 10fd4: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 10fd8: 3f 93 push r19 10fda: 2f 93 push r18 10fdc: 80 e7 ldi r24, 0x70 ; 112 10fde: 97 e7 ldi r25, 0x77 ; 119 10fe0: 9f 93 push r25 10fe2: 8f 93 push r24 10fe4: 8e 01 movw r16, r28 10fe6: 0f 5f subi r16, 0xFF ; 255 10fe8: 1f 4f sbci r17, 0xFF ; 255 10fea: 1f 93 push r17 10fec: 0f 93 push r16 10fee: 0f 94 3a db call 0x3b674 ; 0x3b674 SERIAL_ECHO_START; 10ff2: 80 ed ldi r24, 0xD0 ; 208 10ff4: 9b ea ldi r25, 0xAB ; 171 10ff6: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(time); 10ffa: c8 01 movw r24, r16 10ffc: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e lcd_setstatus(time); 11000: c8 01 movw r24, r16 11002: 0e 94 90 f4 call 0x1e920 ; 0x1e920 card.printingHasFinished(); 11006: 0f 94 8a 80 call 0x30114 ; 0x30114 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 1100a: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> if(!mounted) 1100e: 0f b6 in r0, 0x3f ; 63 11010: f8 94 cli 11012: de bf out 0x3e, r29 ; 62 11014: 0f be out 0x3f, r0 ; 63 11016: cd bf out 0x3d, r28 ; 61 11018: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1101c: 88 23 and r24, r24 1101e: 19 f0 breq .+6 ; 0x11026 11020: 0f 94 be 75 call 0x2eb7c ; 0x2eb7c 11024: c6 cb rjmp .-2164 ; 0x107b2 { mount(); 11026: 81 e0 ldi r24, 0x01 ; 1 11028: 0f 94 c9 80 call 0x30192 ; 0x30192 if(!mounted) //fail 1102c: 80 91 91 14 lds r24, 0x1491 ; 0x801491 11030: 81 11 cpse r24, r1 11032: f6 cf rjmp .-20 ; 0x11020 11034: be cb rjmp .-2180 ; 0x107b2 00011036 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 11036: cf 93 push r28 11038: df 93 push r29 1103a: ec 01 movw r28, r24 { while (*str) 1103c: 89 91 ld r24, Y+ 1103e: 88 23 and r24, r24 11040: 19 f0 breq .+6 ; 0x11048 write(*str++); 11042: 0e 94 3e 77 call 0xee7c ; 0xee7c 11046: fa cf rjmp .-12 ; 0x1103c } 11048: df 91 pop r29 1104a: cf 91 pop r28 1104c: 08 95 ret 0001104e : //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) { 1104e: ff 92 push r15 11050: 0f 93 push r16 11052: 1f 93 push r17 11054: cf 93 push r28 11056: df 93 push r29 11058: ec 01 movw r28, r24 1105a: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 1105c: 66 23 and r22, r22 1105e: 09 f4 brne .+2 ; 0x11062 11060: 4b c0 rjmp .+150 ; 0x110f8 #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); 11062: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> 11066: 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)) { 11068: c8 01 movw r24, r16 1106a: 0e 94 49 5c call 0xb892 ; 0xb892 1106e: 88 23 and r24, r24 11070: 09 f4 brne .+2 ; 0x11074 11072: 53 c0 rjmp .+166 ; 0x1111a // 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; 11074: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 11078: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 1107c: fc 01 movw r30, r24 1107e: eb 55 subi r30, 0x5B ; 91 11080: ff 4e sbci r31, 0xEF ; 239 11082: 23 e0 ldi r18, 0x03 ; 3 11084: 20 83 st Z, r18 11086: 88 55 subi r24, 0x58 ; 88 11088: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 1108a: 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) 1108c: ff 20 and r15, r15 1108e: e9 f1 breq .+122 ; 0x1110a strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 11090: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 11094: 80 ed ldi r24, 0xD0 ; 208 11096: 9b ea ldi r25, 0xAB ; 171 11098: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(MSG_Enqueing); 1109c: 89 eb ldi r24, 0xB9 ; 185 1109e: 94 e6 ldi r25, 0x64 ; 100 110a0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 110a4: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 110a8: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 110ac: 88 55 subi r24, 0x58 ; 88 110ae: 9f 4e sbci r25, 0xEF ; 239 110b0: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_ECHOLNPGM("\""); 110b4: 8e e4 ldi r24, 0x4E ; 78 110b6: 97 e7 ldi r25, 0x77 ; 119 110b8: 0e 94 82 79 call 0xf304 ; 0xf304 bufindw += len + (CMDHDRSIZE + 1); 110bc: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 110c0: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 110c4: 04 96 adiw r24, 0x04 ; 4 110c6: 08 0f add r16, r24 110c8: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 110ca: 0d 3e cpi r16, 0xED ; 237 110cc: 81 e0 ldi r24, 0x01 ; 1 110ce: 18 07 cpc r17, r24 110d0: f9 f0 breq .+62 ; 0x11110 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 110d2: 10 93 a1 10 sts 0x10A1, r17 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 110d6: 00 93 a0 10 sts 0x10A0, r16 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 110da: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 110de: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 110e2: 01 96 adiw r24, 0x01 ; 1 110e4: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 110e8: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 110ec: df 91 pop r29 110ee: cf 91 pop r28 110f0: 1f 91 pop r17 110f2: 0f 91 pop r16 110f4: ff 90 pop r15 110f6: 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); 110f8: fc 01 movw r30, r24 110fa: 01 90 ld r0, Z+ 110fc: 00 20 and r0, r0 110fe: e9 f7 brne .-6 ; 0x110fa 11100: 31 97 sbiw r30, 0x01 ; 1 11102: 8f 01 movw r16, r30 11104: 08 1b sub r16, r24 11106: 19 0b sbc r17, r25 11108: af cf rjmp .-162 ; 0x11068 // 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); 1110a: 0f 94 8e e2 call 0x3c51c ; 0x3c51c 1110e: c2 cf rjmp .-124 ; 0x11094 SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11110: 10 92 a1 10 sts 0x10A1, r1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 11114: 10 92 a0 10 sts 0x10A0, r1 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 11118: e0 cf rjmp .-64 ; 0x110da ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 1111a: 88 ea ldi r24, 0xA8 ; 168 1111c: 9b ea ldi r25, 0xAB ; 171 1111e: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(MSG_Enqueing); 11122: 89 eb ldi r24, 0xB9 ; 185 11124: 94 e6 ldi r25, 0x64 ; 100 11126: 0e 94 57 77 call 0xeeae ; 0xeeae if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 1112a: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 1112c: ff 20 and r15, r15 1112e: 59 f0 breq .+22 ; 0x11146 SERIAL_PROTOCOLRPGM(cmd); 11130: 0e 94 57 77 call 0xeeae ; 0xeeae else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11134: 81 e9 ldi r24, 0x91 ; 145 11136: 9b ea ldi r25, 0xAB ; 171 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11138: df 91 pop r29 1113a: cf 91 pop r28 1113c: 1f 91 pop r17 1113e: 0f 91 pop r16 11140: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11142: 0c 94 82 79 jmp 0xf304 ; 0xf304 11146: 0e 94 1b 88 call 0x11036 ; 0x11036 1114a: f4 cf rjmp .-24 ; 0x11134 0001114c : { 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) { 1114c: 0f 93 push r16 1114e: 1f 93 push r17 11150: cf 93 push r28 11152: df 93 push r29 11154: d6 2f mov r29, r22 11156: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 11158: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 1115a: f8 01 movw r30, r16 1115c: 85 91 lpm r24, Z+ 1115e: 94 91 lpm r25, Z 11160: 61 e0 ldi r22, 0x01 ; 1 11162: 0e 94 27 88 call 0x1104e ; 0x1104e 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) 11166: cf 5f subi r28, 0xFF ; 255 11168: 0e 5f subi r16, 0xFE ; 254 1116a: 1f 4f sbci r17, 0xFF ; 255 1116c: dc 13 cpse r29, r28 1116e: f5 cf rjmp .-22 ; 0x1115a { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 11170: df 91 pop r29 11172: cf 91 pop r28 11174: 1f 91 pop r17 11176: 0f 91 pop r16 11178: 08 95 ret 0001117a : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 1117a: cf 93 push r28 1117c: df 93 push r29 1117e: cd b7 in r28, 0x3d ; 61 11180: de b7 in r29, 0x3e ; 62 11182: 6e 97 sbiw r28, 0x1e ; 30 11184: 0f b6 in r0, 0x3f ; 63 11186: f8 94 cli 11188: de bf out 0x3e, r29 ; 62 1118a: 0f be out 0x3f, r0 ; 63 1118c: cd bf out 0x3d, r28 ; 61 1118e: 9e 01 movw r18, r28 11190: 2c 5d subi r18, 0xDC ; 220 11192: 3f 4f sbci r19, 0xFF ; 255 11194: f9 01 movw r30, r18 11196: 41 91 ld r20, Z+ 11198: 51 91 ld r21, Z+ 1119a: 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); 1119c: 6e e1 ldi r22, 0x1E ; 30 1119e: 70 e0 ldi r23, 0x00 ; 0 111a0: ce 01 movw r24, r28 111a2: 01 96 adiw r24, 0x01 ; 1 111a4: 0f 94 79 db call 0x3b6f2 ; 0x3b6f2 va_end(ap); enquecommand(cmd_buffer, false); 111a8: 60 e0 ldi r22, 0x00 ; 0 111aa: ce 01 movw r24, r28 111ac: 01 96 adiw r24, 0x01 ; 1 111ae: 0e 94 27 88 call 0x1104e ; 0x1104e } 111b2: 6e 96 adiw r28, 0x1e ; 30 111b4: 0f b6 in r0, 0x3f ; 63 111b6: f8 94 cli 111b8: de bf out 0x3e, r29 ; 62 111ba: 0f be out 0x3f, r0 ; 63 111bc: cd bf out 0x3d, r28 ; 61 111be: df 91 pop r29 111c0: cf 91 pop r28 111c2: 08 95 ret 000111c4 : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 111c4: ef 92 push r14 111c6: ff 92 push r15 111c8: 0f 93 push r16 111ca: 1f 93 push r17 111cc: cf 93 push r28 111ce: df 93 push r29 111d0: cd b7 in r28, 0x3d ; 61 111d2: de b7 in r29, 0x3e ; 62 111d4: 6b 97 sbiw r28, 0x1b ; 27 111d6: 0f b6 in r0, 0x3f ; 63 111d8: f8 94 cli 111da: de bf out 0x3e, r29 ; 62 111dc: 0f be out 0x3f, r0 ; 63 111de: cd bf out 0x3d, r28 ; 61 char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); 111e0: 8a e5 ldi r24, 0x5A ; 90 111e2: 9f e0 ldi r25, 0x0F ; 15 111e4: 0f 94 23 dc call 0x3b846 ; 0x3b846 111e8: e8 2e mov r14, r24 111ea: 0a e0 ldi r16, 0x0A ; 10 111ec: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 111ee: 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); 111f0: 48 e0 ldi r20, 0x08 ; 8 111f2: 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++) { 111f4: fe 14 cp r15, r14 111f6: 79 f0 breq .+30 ; 0x11216 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 111f8: b8 01 movw r22, r16 111fa: ce 01 movw r24, r28 111fc: 0e 96 adiw r24, 0x0e ; 14 111fe: 0f 94 13 dc call 0x3b826 ; 0x3b826 dir_name[8] = '\0'; 11202: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 11204: 60 e0 ldi r22, 0x00 ; 0 11206: ce 01 movw r24, r28 11208: 0e 96 adiw r24, 0x0e ; 14 1120a: 0f 94 1b 7e call 0x2fc36 ; 0x2fc36 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++) { 1120e: f3 94 inc r15 11210: 08 5f subi r16, 0xF8 ; 248 11212: 1f 4f sbci r17, 0xFF ; 255 11214: ed cf rjmp .-38 ; 0x111f0 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); 11216: 65 e9 ldi r22, 0x95 ; 149 11218: 7f e0 ldi r23, 0x0F ; 15 1121a: 8e 01 movw r16, r28 1121c: 0f 5f subi r16, 0xFF ; 255 1121e: 1f 4f sbci r17, 0xFF ; 255 11220: c8 01 movw r24, r16 11222: 0f 94 13 dc call 0x3b826 ; 0x3b826 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 11226: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 11228: 8e e2 ldi r24, 0x2E ; 46 1122a: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 1122c: 43 e0 ldi r20, 0x03 ; 3 1122e: 50 e0 ldi r21, 0x00 ; 0 11230: 61 e9 ldi r22, 0x91 ; 145 11232: 7c e0 ldi r23, 0x0C ; 12 11234: ce 01 movw r24, r28 11236: 48 96 adiw r24, 0x18 ; 24 11238: 0f 94 13 dc call 0x3b826 ; 0x3b826 extension_ptr[4] = '\0'; 1123c: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 1123e: be 01 movw r22, r28 11240: 69 5e subi r22, 0xE9 ; 233 11242: 7f 4f sbci r23, 0xFF ; 255 11244: c8 01 movw r24, r16 11246: 0f 94 6f e2 call 0x3c4de ; 0x3c4de enquecommandf_P(MSG_M23, filename); 1124a: 1f 93 push r17 1124c: 0f 93 push r16 1124e: 85 ef ldi r24, 0xF5 ; 245 11250: 90 e7 ldi r25, 0x70 ; 112 11252: 9f 93 push r25 11254: 8f 93 push r24 11256: 0e 94 bd 88 call 0x1117a ; 0x1117a 1125a: 0f 90 pop r0 1125c: 0f 90 pop r0 1125e: 0f 90 pop r0 11260: 0f 90 pop r0 } 11262: 6b 96 adiw r28, 0x1b ; 27 11264: 0f b6 in r0, 0x3f ; 63 11266: f8 94 cli 11268: de bf out 0x3e, r29 ; 62 1126a: 0f be out 0x3f, r0 ; 63 1126c: cd bf out 0x3d, r28 ; 61 1126e: df 91 pop r29 11270: cf 91 pop r28 11272: 1f 91 pop r17 11274: 0f 91 pop r16 11276: ff 90 pop r15 11278: ef 90 pop r14 1127a: 08 95 ret 0001127c : //! 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) { 1127c: bf 92 push r11 1127e: cf 92 push r12 11280: df 92 push r13 11282: ef 92 push r14 11284: ff 92 push r15 11286: 0f 93 push r16 11288: 1f 93 push r17 1128a: cf 93 push r28 1128c: df 93 push r29 if (saved_printing) return; 1128e: e0 91 a9 0d lds r30, 0x0DA9 ; 0x800da9 11292: e1 11 cpse r30, r1 11294: b1 c0 rjmp .+354 ; 0x113f8 11296: 05 2f mov r16, r21 11298: 14 2f mov r17, r20 1129a: e9 01 movw r28, r18 1129c: 6b 01 movw r12, r22 1129e: 7c 01 movw r14, r24 cli(); 112a0: f8 94 cli save_print_file_state(); 112a2: 0e 94 41 65 call 0xca82 ; 0xca82 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 112a6: b0 90 a8 0d lds r11, 0x0DA8 ; 0x800da8 112aa: b1 10 cpse r11, r1 112ac: 02 c0 rjmp .+4 ; 0x112b2 112ae: b0 90 a7 0d lds r11, 0x0DA7 ; 0x800da7 save_planner_global_state(); 112b2: 0e 94 f7 64 call 0xc9ee ; 0xc9ee planner_abort_hard(); //abort printing 112b6: 0f 94 ca c1 call 0x38394 ; 0x38394 memcpy(saved_pos, current_position, sizeof(saved_pos)); 112ba: 80 e1 ldi r24, 0x10 ; 16 112bc: e2 e9 ldi r30, 0x92 ; 146 112be: f6 e0 ldi r31, 0x06 ; 6 112c0: a3 e7 ldi r26, 0x73 ; 115 112c2: b2 e0 ldi r27, 0x02 ; 2 112c4: 01 90 ld r0, Z+ 112c6: 0d 92 st X+, r0 112c8: 8a 95 dec r24 112ca: e1 f7 brne .-8 ; 0x112c4 if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 112cc: bb 20 and r11, r11 112ce: 61 f0 breq .+24 ; 0x112e8 112d0: 80 e0 ldi r24, 0x00 ; 0 112d2: 90 e0 ldi r25, 0x00 ; 0 112d4: a0 e8 ldi r26, 0x80 ; 128 112d6: bf eb ldi r27, 0xBF ; 191 112d8: 80 93 73 02 sts 0x0273, r24 ; 0x800273 112dc: 90 93 74 02 sts 0x0274, r25 ; 0x800274 112e0: a0 93 75 02 sts 0x0275, r26 ; 0x800275 112e4: b0 93 76 02 sts 0x0276, r27 ; 0x800276 saved_feedmultiply2 = feedmultiply; //save feedmultiply 112e8: 80 91 39 02 lds r24, 0x0239 ; 0x800239 112ec: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 112f0: 90 93 72 03 sts 0x0372, r25 ; 0x800372 112f4: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 112f8: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 112fc: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 11300: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 11304: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_bed_temperature = (uint8_t)degTargetBed(); 11308: 80 91 72 06 lds r24, 0x0672 ; 0x800672 1130c: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11310: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 11314: 83 fb bst r24, 3 11316: 88 27 eor r24, r24 11318: 80 f9 bld r24, 0 1131a: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; 1131e: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 11322: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab cmdqueue_reset(); //empty cmdqueue 11326: 0e 94 4b 7f call 0xfe96 ; 0xfe96 card.sdprinting = false; 1132a: 10 92 90 14 sts 0x1490, r1 ; 0x801490 // card.closefile(); saved_printing = true; 1132e: 81 e0 ldi r24, 0x01 ; 1 11330: 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(); 11334: 0f 94 49 43 call 0x28692 ; 0x28692 sei(); 11338: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 1133a: 20 e0 ldi r18, 0x00 ; 0 1133c: 30 e0 ldi r19, 0x00 ; 0 1133e: a9 01 movw r20, r18 11340: c7 01 movw r24, r14 11342: b6 01 movw r22, r12 11344: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__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) 11348: 20 e0 ldi r18, 0x00 ; 0 1134a: 30 e0 ldi r19, 0x00 ; 0 1134c: a9 01 movw r20, r18 1134e: f8 01 movw r30, r16 11350: 6c 2f mov r22, r28 11352: 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 11354: 81 11 cpse r24, r1 11356: 5a c0 rjmp .+180 ; 0x1140c 11358: 8f 2f mov r24, r31 1135a: 90 2f mov r25, r16 1135c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 11360: 88 23 and r24, r24 11362: 09 f4 brne .+2 ; 0x11366 11364: 49 c0 rjmp .+146 ; 0x113f8 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 11366: 80 91 64 05 lds r24, 0x0564 ; 0x800564 1136a: 81 11 cpse r24, r1 1136c: 05 c0 rjmp .+10 ; 0x11378 enquecommand_P(MSG_M83); 1136e: 61 e0 ldi r22, 0x01 ; 1 11370: 80 ee ldi r24, 0xE0 ; 224 11372: 9b e6 ldi r25, 0x6B ; 107 11374: 0e 94 27 88 call 0x1104e ; 0x1104e // 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); 11378: 0f 93 push r16 1137a: 1f 93 push r17 1137c: df 93 push r29 1137e: cf 93 push r28 11380: 8a e5 ldi r24, 0x5A ; 90 11382: 9e e6 ldi r25, 0x6E ; 110 11384: 9f 93 push r25 11386: 8f 93 push r24 11388: 0e 94 bd 88 call 0x1117a ; 0x1117a } if(z_move) 1138c: 0f 90 pop r0 1138e: 0f 90 pop r0 11390: 0f 90 pop r0 11392: 0f 90 pop r0 11394: 0f 90 pop r0 11396: 0f 90 pop r0 11398: 20 e0 ldi r18, 0x00 ; 0 1139a: 30 e0 ldi r19, 0x00 ; 0 1139c: a9 01 movw r20, r18 1139e: c7 01 movw r24, r14 113a0: b6 01 movw r22, r12 113a2: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 113a6: 88 23 and r24, r24 113a8: 21 f1 breq .+72 ; 0x113f2 { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 113aa: 84 e4 ldi r24, 0x44 ; 68 113ac: 8f 93 push r24 113ae: 88 e4 ldi r24, 0x48 ; 72 113b0: 8f 93 push r24 113b2: 1f 92 push r1 113b4: 1f 92 push r1 113b6: 20 91 7b 02 lds r18, 0x027B ; 0x80027b 113ba: 30 91 7c 02 lds r19, 0x027C ; 0x80027c 113be: 40 91 7d 02 lds r20, 0x027D ; 0x80027d 113c2: 50 91 7e 02 lds r21, 0x027E ; 0x80027e 113c6: c7 01 movw r24, r14 113c8: b6 01 movw r22, r12 113ca: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 113ce: 9f 93 push r25 113d0: 8f 93 push r24 113d2: 7f 93 push r23 113d4: 6f 93 push r22 113d6: 8c e2 ldi r24, 0x2C ; 44 113d8: 9e e7 ldi r25, 0x7E ; 126 113da: 9f 93 push r25 113dc: 8f 93 push r24 113de: 0e 94 bd 88 call 0x1117a ; 0x1117a 113e2: 8d b7 in r24, 0x3d ; 61 113e4: 9e b7 in r25, 0x3e ; 62 113e6: 0a 96 adiw r24, 0x0a ; 10 113e8: 0f b6 in r0, 0x3f ; 63 113ea: f8 94 cli 113ec: 9e bf out 0x3e, r25 ; 62 113ee: 0f be out 0x3f, r0 ; 63 113f0: 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; 113f2: 81 e0 ldi r24, 0x01 ; 1 113f4: 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(); } } 113f8: df 91 pop r29 113fa: cf 91 pop r28 113fc: 1f 91 pop r17 113fe: 0f 91 pop r16 11400: ff 90 pop r15 11402: ef 90 pop r14 11404: df 90 pop r13 11406: cf 90 pop r12 11408: bf 90 pop r11 1140a: 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) 1140c: 8f 2f mov r24, r31 1140e: 90 2f mov r25, r16 11410: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 11414: 88 23 and r24, r24 11416: 49 f2 breq .-110 ; 0x113aa 11418: a6 cf rjmp .-180 ; 0x11366 0001141a : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 1141a: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1141e: 88 23 and r24, r24 11420: 21 f1 breq .+72 ; 0x1146a if (backlightMode == BACKLIGHT_MODE_AUTO) 11422: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 11426: 82 30 cpi r24, 0x02 ; 2 11428: e9 f4 brne .+58 ; 0x11464 { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 1142a: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 1142e: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 11432: 28 ee ldi r18, 0xE8 ; 232 11434: 33 e0 ldi r19, 0x03 ; 3 11436: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__usmulhisi3> 1143a: ab 01 movw r20, r22 1143c: bc 01 movw r22, r24 1143e: 87 e3 ldi r24, 0x37 ; 55 11440: 93 e0 ldi r25, 0x03 ; 3 11442: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 11446: 88 23 and r24, r24 11448: 31 f0 breq .+12 ; 0x11456 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); 1144a: 60 91 00 04 lds r22, 0x0400 ; 0x800400 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 1144e: 70 e0 ldi r23, 0x00 ; 0 11450: 85 e0 ldi r24, 0x05 ; 5 11452: 0c 94 1d e9 jmp 0x1d23a ; 0x1d23a 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); 11456: 80 91 37 03 lds r24, 0x0337 ; 0x800337 1145a: 88 23 and r24, r24 1145c: 31 f0 breq .+12 ; 0x1146a 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); 1145e: 60 91 01 04 lds r22, 0x0401 ; 0x800401 11462: f5 cf rjmp .-22 ; 0x1144e { 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); 11464: 81 11 cpse r24, r1 11466: fb cf rjmp .-10 ; 0x1145e 11468: f0 cf rjmp .-32 ; 0x1144a else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 1146a: 08 95 ret 0001146c : 1146c: 60 91 01 04 lds r22, 0x0401 ; 0x800401 11470: 84 e3 ldi r24, 0x34 ; 52 11472: 9d e0 ldi r25, 0x0D ; 13 11474: 0f 94 47 dc call 0x3b88e ; 0x3b88e 11478: 60 91 00 04 lds r22, 0x0400 ; 0x800400 1147c: 83 e3 ldi r24, 0x33 ; 51 1147e: 9d e0 ldi r25, 0x0D ; 13 11480: 0f 94 47 dc call 0x3b88e ; 0x3b88e 11484: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 11488: 82 e3 ldi r24, 0x32 ; 50 1148a: 9d e0 ldi r25, 0x0D ; 13 1148c: 0f 94 47 dc call 0x3b88e ; 0x3b88e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 11490: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 11494: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 11498: 80 e3 ldi r24, 0x30 ; 48 1149a: 9d e0 ldi r25, 0x0D ; 13 1149c: 0d 94 65 dc jmp 0x3b8ca ; 0x3b8ca 000114a0 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 114a0: 88 23 and r24, r24 114a2: 61 f0 breq .+24 ; 0x114bc { backlightMode = BACKLIGHT_MODE_BRIGHT; 114a4: 81 e0 ldi r24, 0x01 ; 1 114a6: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; 114aa: 80 91 01 04 lds r24, 0x0401 ; 0x800401 114ae: 8e 31 cpi r24, 0x1E ; 30 114b0: 18 f4 brcc .+6 ; 0x114b8 114b2: 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); 114b4: 80 93 01 04 sts 0x0401, r24 ; 0x800401 } backlight_update(); 114b8: 0c 94 0d 8a jmp 0x1141a ; 0x1141a backlightMode = BACKLIGHT_MODE_BRIGHT; if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); 114bc: 82 e3 ldi r24, 0x32 ; 50 114be: 9d e0 ldi r25, 0x0D ; 13 114c0: 0f 94 23 dc call 0x3b846 ; 0x3b846 114c4: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 114c8: 84 e3 ldi r24, 0x34 ; 52 114ca: 9d e0 ldi r25, 0x0D ; 13 114cc: 0f 94 23 dc call 0x3b846 ; 0x3b846 114d0: f1 cf rjmp .-30 ; 0x114b4 000114d2 : 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; 114d2: 80 91 02 04 lds r24, 0x0402 ; 0x800402 114d6: 88 23 and r24, r24 114d8: 31 f0 breq .+12 ; 0x114e6 backlightTimer.start(); 114da: 87 e3 ldi r24, 0x37 ; 55 114dc: 93 e0 ldi r25, 0x03 ; 3 114de: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> backlight_update(); 114e2: 0c 94 0d 8a jmp 0x1141a ; 0x1141a } 114e6: 08 95 ret 000114e8 : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 114e8: ff 92 push r15 114ea: 0f 93 push r16 114ec: 1f 93 push r17 114ee: cf 93 push r28 114f0: df 93 push r29 if (!backlightSupport) return; 114f2: 90 91 02 04 lds r25, 0x0402 ; 0x800402 114f6: 99 23 and r25, r25 114f8: 99 f1 breq .+102 ; 0x11560 if (flashNo) 114fa: 88 23 and r24, r24 114fc: 51 f1 breq .+84 ; 0x11552 { uint8_t backlightMode_bck = backlightMode; 114fe: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 11502: c8 2f mov r28, r24 11504: d0 e0 ldi r29, 0x00 ; 0 11506: cc 0f add r28, r28 11508: dd 1f adc r29, r29 1150a: 10 e0 ldi r17, 0x00 ; 0 1150c: ff 24 eor r15, r15 1150e: f3 94 inc r15 11510: 21 2f mov r18, r17 11512: 30 e0 ldi r19, 0x00 ; 0 11514: 80 91 37 03 lds r24, 0x0337 ; 0x800337 11518: 8f 25 eor r24, r15 1151a: 02 30 cpi r16, 0x02 ; 2 1151c: 09 f0 breq .+2 ; 0x11520 1151e: 80 e0 ldi r24, 0x00 ; 0 11520: 8c 0f add r24, r28 11522: 9d 2f mov r25, r29 11524: 91 1d adc r25, r1 11526: 28 17 cp r18, r24 11528: 39 07 cpc r19, r25 1152a: 8c f4 brge .+34 ; 0x1154e { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 1152c: 81 e0 ldi r24, 0x01 ; 1 1152e: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 11532: 91 11 cpse r25, r1 11534: 80 e0 ldi r24, 0x00 ; 0 11536: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 1153a: 0e 94 0d 8a call 0x1141a ; 0x1141a _delay(BL_FLASH_DELAY_MS); 1153e: 69 e1 ldi r22, 0x19 ; 25 11540: 70 e0 ldi r23, 0x00 ; 0 11542: 80 e0 ldi r24, 0x00 ; 0 11544: 90 e0 ldi r25, 0x00 ; 0 11546: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 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++) 1154a: 1f 5f subi r17, 0xFF ; 255 1154c: e1 cf rjmp .-62 ; 0x11510 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 1154e: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 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 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 1155c: 0c 94 69 8a jmp 0x114d2 ; 0x114d2 } 11560: df 91 pop r29 11562: cf 91 pop r28 11564: 1f 91 pop r17 11566: 0f 91 pop r16 11568: ff 90 pop r15 1156a: 08 95 ret 0001156c : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 1156c: 0f 93 push r16 1156e: 1f 93 push r17 11570: cf 93 push r28 11572: df 93 push r29 11574: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 11576: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1157a: 81 30 cpi r24, 0x01 ; 1 1157c: 09 f4 brne .+2 ; 0x11580 1157e: 41 c0 rjmp .+130 ; 0x11602 11580: 82 30 cpi r24, 0x02 ; 2 11582: 09 f4 brne .+2 ; 0x11586 11584: 57 c0 rjmp .+174 ; 0x11634 * * 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) 11586: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 1158a: 81 11 cpse r24, r1 1158c: f9 c0 rjmp .+498 ; 0x11780 1158e: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 11592: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 11596: 00 97 sbiw r24, 0x00 ; 0 11598: 39 f4 brne .+14 ; 0x115a8 1159a: 20 91 72 06 lds r18, 0x0672 ; 0x800672 1159e: 30 91 73 06 lds r19, 0x0673 ; 0x800673 115a2: 23 2b or r18, r19 115a4: 09 f4 brne .+2 ; 0x115a8 115a6: ec c0 rjmp .+472 ; 0x11780 115a8: 40 91 30 02 lds r20, 0x0230 ; 0x800230 115ac: 50 91 31 02 lds r21, 0x0231 ; 0x800231 115b0: 60 91 32 02 lds r22, 0x0232 ; 0x800232 115b4: 70 91 33 02 lds r23, 0x0233 ; 0x800233 115b8: 41 15 cp r20, r1 115ba: 51 05 cpc r21, r1 115bc: 61 05 cpc r22, r1 115be: 71 05 cpc r23, r1 115c0: 09 f4 brne .+2 ; 0x115c4 115c2: de c0 rjmp .+444 ; 0x11780 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 115c4: 89 2b or r24, r25 115c6: 31 f4 brne .+12 ; 0x115d4 115c8: 80 91 72 06 lds r24, 0x0672 ; 0x800672 115cc: 90 91 73 06 lds r25, 0x0673 ; 0x800673 115d0: 89 2b or r24, r25 115d2: 29 f0 breq .+10 ; 0x115de 115d4: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 115d8: 88 23 and r24, r24 115da: 09 f4 brne .+2 ; 0x115de 115dc: 39 c1 rjmp .+626 ; 0x11850 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 115de: 8a ed ldi r24, 0xDA ; 218 115e0: 95 e0 ldi r25, 0x05 ; 5 115e2: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 115e6: 88 23 and r24, r24 115e8: 09 f4 brne .+2 ; 0x115ec 115ea: cc c0 rjmp .+408 ; 0x11784 { disable_heater(); 115ec: 0f 94 1f 2f call 0x25e3e ; 0x25e3e lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 115f0: 82 e7 ldi r24, 0x72 ; 114 115f2: 96 e3 ldi r25, 0x36 ; 54 115f4: 0e 94 b3 72 call 0xe566 ; 0xe566 115f8: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_return_to_status(); 115fc: 0f 94 ad 1e call 0x23d5a ; 0x23d5a 11600: c1 c0 rjmp .+386 ; 0x11784 case State::initializing: if (!updatePAT9125()) { 11602: 0f 94 ef 7b call 0x2f7de ; 0x2f7de 11606: 88 23 and r24, r24 11608: 09 f4 brne .+2 ; 0x1160c 1160a: bd cf rjmp .-134 ; 0x11586 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 1160c: 81 e0 ldi r24, 0x01 ; 1 1160e: 90 91 b7 17 lds r25, 0x17B7 ; 0x8017b7 11612: 91 11 cpse r25, r1 11614: 01 c0 rjmp .+2 ; 0x11618 11616: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 11618: 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; 1161c: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 11620: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 11624: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 11628: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 state = State::ready; 1162c: 82 e0 ldi r24, 0x02 ; 2 1162e: 80 93 aa 17 sts 0x17AA, r24 ; 0x8017aa 11632: a9 cf rjmp .-174 ; 0x11586 break; case State::ready: { updatePAT9125(); 11634: 0f 94 ef 7b call 0x2f7de ; 0x2f7de postponedLoadEvent = false; 11638: 10 92 ae 17 sts 0x17AE, r1 ; 0x8017ae sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 1163c: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 11640: 82 30 cpi r24, 0x02 ; 2 11642: 09 f0 breq .+2 ; 0x11646 11644: a0 cf rjmp .-192 ; 0x11586 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11646: 80 91 af 17 lds r24, 0x17AF ; 0x8017af 1164a: 81 11 cpse r24, r1 1164c: 40 c0 rjmp .+128 ; 0x116ce 1164e: d0 91 b7 17 lds r29, 0x17B7 ; 0x8017b7 11652: 81 e0 ldi r24, 0x01 ; 1 11654: d1 11 cpse r29, r1 11656: 01 c0 rjmp .+2 ; 0x1165a 11658: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 1165a: 90 91 ad 17 lds r25, 0x17AD ; 0x8017ad 1165e: 89 17 cp r24, r25 11660: 09 f4 brne .+2 ; 0x11664 11662: 91 cf rjmp .-222 ; 0x11586 oldFilamentPresent = newFilamentPresent; 11664: 80 93 ad 17 sts 0x17AD, r24 ; 0x8017ad eventBlankingTimer.start(); 11668: 8f ea ldi r24, 0xAF ; 175 1166a: 97 e1 ldi r25, 0x17 ; 23 1166c: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> if (newFilamentPresent) { // filament insertion 11670: dd 23 and r29, r29 11672: b1 f1 breq .+108 ; 0x116e0 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11674: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 11678: 88 23 and r24, r24 1167a: 11 f1 breq .+68 ; 0x116c0 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1167c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 11680: 81 11 cpse r24, r1 11682: 1e c0 rjmp .+60 ; 0x116c0 && !( 11684: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 11688: 81 30 cpi r24, 0x01 ; 1 1168a: d1 f0 breq .+52 ; 0x116c0 } //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); 1168c: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 11690: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 11694: 89 1b sub r24, r25 11696: 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 11698: 99 f4 brne .+38 ; 0x116c0 || printJobOngoing() 1169a: 0e 94 97 67 call 0xcf2e ; 0xcf2e 1169e: 81 11 cpse r24, r1 116a0: 0f c0 rjmp .+30 ; 0x116c0 || (lcd_commands_type == LcdCommands::Layer1Cal) 116a2: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 116a6: 84 30 cpi r24, 0x04 ; 4 116a8: 59 f0 breq .+22 ; 0x116c0 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 116aa: 8f e5 ldi r24, 0x5F ; 95 116ac: 9f e0 ldi r25, 0x0F ; 15 116ae: 0f 94 23 dc call 0x3b846 ; 0x3b846 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 116b2: 81 11 cpse r24, r1 116b4: 05 c0 rjmp .+10 ; 0x116c0 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 116b6: 61 e0 ldi r22, 0x01 ; 1 116b8: 8e ea ldi r24, 0xAE ; 174 116ba: 9a e3 ldi r25, 0x3A ; 58 116bc: 0f 94 0a d3 call 0x3a614 ; 0x3a614 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 116c0: 81 e0 ldi r24, 0x01 ; 1 116c2: 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. 116c6: 81 e0 ldi r24, 0x01 ; 1 116c8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 116cc: 5c cf rjmp .-328 ; 0x11586 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 116ce: 64 e6 ldi r22, 0x64 ; 100 116d0: 70 e0 ldi r23, 0x00 ; 0 116d2: 8f ea ldi r24, 0xAF ; 175 116d4: 97 e1 ldi r25, 0x17 ; 23 116d6: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 116da: 81 11 cpse r24, r1 116dc: b8 cf rjmp .-144 ; 0x1164e 116de: 53 cf rjmp .-346 ; 0x11586 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 116e0: 80 91 ac 17 lds r24, 0x17AC ; 0x8017ac 116e4: 88 23 and r24, r24 116e6: 79 f3 breq .-34 ; 0x116c6 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 116e8: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 116ec: 81 11 cpse r24, r1 116ee: eb cf rjmp .-42 ; 0x116c6 116f0: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 116f4: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 116f8: 89 1b sub r24, r25 116fa: 8f 70 andi r24, 0x0F ; 15 && ( 116fc: 21 f4 brne .+8 ; 0x11706 moves_planned() != 0 || printJobOngoing() 116fe: 0e 94 97 67 call 0xcf2e ; 0xcf2e 11702: 88 23 and r24, r24 11704: 01 f3 breq .-64 ; 0x116c6 ) && !( 11706: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 1170a: 81 11 cpse r24, r1 1170c: dc cf rjmp .-72 ; 0x116c6 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 1170e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 11712: 81 30 cpi r24, 0x01 ; 1 11714: c1 f2 breq .-80 ; 0x116c6 || (lcd_commands_type == LcdCommands::Layer1Cal) 11716: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1171a: 84 30 cpi r24, 0x04 ; 4 1171c: a1 f2 breq .-88 ; 0x116c6 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 1171e: 8f e5 ldi r24, 0x5F ; 95 11720: 9f e0 ldi r25, 0x0F ; 15 11722: 0f 94 23 dc call 0x3b846 ; 0x3b846 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11726: 81 11 cpse r24, r1 11728: ce cf rjmp .-100 ; 0x116c6 } //! @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); 1172a: 84 e9 ldi r24, 0x94 ; 148 1172c: 96 e6 ldi r25, 0x66 ; 102 1172e: 9f 93 push r25 11730: 8f 93 push r24 11732: 8a e7 ldi r24, 0x7A ; 122 11734: 96 e6 ldi r25, 0x66 ; 102 11736: 9f 93 push r25 11738: 8f 93 push r24 1173a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 1173e: 10 92 ac 17 sts 0x17AC, r1 ; 0x8017ac autoLoadEnabled = false; 11742: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab stop_and_save_print_to_ram(0, 0); 11746: 20 e0 ldi r18, 0x00 ; 0 11748: 30 e0 ldi r19, 0x00 ; 0 1174a: a9 01 movw r20, r18 1174c: ca 01 movw r24, r20 1174e: b9 01 movw r22, r18 11750: 0e 94 3e 89 call 0x1127c ; 0x1127c restore_print_from_ram_and_continue(0); 11754: 60 e0 ldi r22, 0x00 ; 0 11756: 70 e0 ldi r23, 0x00 ; 0 11758: cb 01 movw r24, r22 1175a: 0e 94 4b 68 call 0xd096 ; 0xd096 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 1175e: 85 e6 ldi r24, 0x65 ; 101 11760: 9f e0 ldi r25, 0x0F ; 15 11762: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11766: 81 e0 ldi r24, 0x01 ; 1 11768: 9f e0 ldi r25, 0x0F ; 15 1176a: 0e 94 22 76 call 0xec44 ; 0xec44 enquecommand_front_P(MSG_M600); 1176e: 8c ee ldi r24, 0xEC ; 236 11770: 90 e7 ldi r25, 0x70 ; 112 11772: 0f 94 04 75 call 0x2ea08 ; 0x2ea08 11776: 0f 90 pop r0 11778: 0f 90 pop r0 1177a: 0f 90 pop r0 1177c: 0f 90 pop r0 1177e: a3 cf rjmp .-186 ; 0x116c6 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11780: 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)){ 11784: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 11788: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 1178c: 03 97 sbiw r24, 0x03 ; 3 1178e: 14 f4 brge .+4 ; 0x11794 get_command(); 11790: 0e 94 27 83 call 0x1064e ; 0x1064e 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); 11794: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 11798: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 1179c: 98 17 cp r25, r24 1179e: 81 f0 breq .+32 ; 0x117c0 117a0: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 117a4: 86 30 cpi r24, 0x06 ; 6 117a6: 61 f4 brne .+24 ; 0x117c0 117a8: 68 e8 ldi r22, 0x88 ; 136 117aa: 73 e1 ldi r23, 0x13 ; 19 117ac: 8e e0 ldi r24, 0x0E ; 14 117ae: 95 e0 ldi r25, 0x05 ; 5 117b0: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 117b4: 88 23 and r24, r24 117b6: 21 f0 breq .+8 ; 0x117c0 { // 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(); 117b8: 8e e0 ldi r24, 0x0E ; 14 117ba: 95 e0 ldi r25, 0x05 ; 5 117bc: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 117c0: 40 91 7e 03 lds r20, 0x037E ; 0x80037e 117c4: 50 91 7f 03 lds r21, 0x037F ; 0x80037f 117c8: 60 91 80 03 lds r22, 0x0380 ; 0x800380 117cc: 70 91 81 03 lds r23, 0x0381 ; 0x800381 117d0: 41 15 cp r20, r1 117d2: 51 05 cpc r21, r1 117d4: 61 05 cpc r22, r1 117d6: 71 05 cpc r23, r1 117d8: 09 f0 breq .+2 ; 0x117dc 117da: 3f c0 rjmp .+126 ; 0x1185a kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 117dc: 40 91 34 02 lds r20, 0x0234 ; 0x800234 117e0: 50 91 35 02 lds r21, 0x0235 ; 0x800235 117e4: 60 91 36 02 lds r22, 0x0236 ; 0x800236 117e8: 70 91 37 02 lds r23, 0x0237 ; 0x800237 117ec: 41 15 cp r20, r1 117ee: 51 05 cpc r21, r1 117f0: 61 05 cpc r22, r1 117f2: 71 05 cpc r23, r1 117f4: a9 f0 breq .+42 ; 0x11820 117f6: 86 e8 ldi r24, 0x86 ; 134 117f8: 93 e0 ldi r25, 0x03 ; 3 117fa: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 117fe: 88 23 and r24, r24 11800: 79 f0 breq .+30 ; 0x11820 11802: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 11806: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 if(blocks_queued() == false && ignore_stepper_queue == false) { 1180a: 98 13 cpse r25, r24 1180c: 09 c0 rjmp .+18 ; 0x11820 1180e: c1 11 cpse r28, r1 11810: 07 c0 rjmp .+14 ; 0x11820 disable_x(); 11812: 17 9a sbi 0x02, 7 ; 2 11814: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 11818: 16 9a sbi 0x02, 6 ; 2 1181a: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_z(); disable_e0(); 1181e: 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; 11820: c0 91 e7 03 lds r28, 0x03E7 ; 0x8003e7 block_t *block; if(block_buffer_tail != block_buffer_head) 11824: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 11828: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1182c: 98 17 cp r25, r24 1182e: 01 f1 breq .+64 ; 0x11870 { uint8_t block_index = block_buffer_tail; 11830: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 tail_fan_speed = block_buffer[block_index].fan_speed; 11834: 9e e6 ldi r25, 0x6E ; 110 11836: 89 9f mul r24, r25 11838: f0 01 movw r30, r0 1183a: 11 24 eor r1, r1 1183c: e5 5f subi r30, 0xF5 ; 245 1183e: f8 4f sbci r31, 0xF8 ; 248 11840: c0 81 ld r28, Z while(block_index != block_buffer_head) 11842: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 11846: 98 17 cp r25, r24 11848: 99 f0 breq .+38 ; 0x11870 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); 1184a: 8f 5f subi r24, 0xFF ; 255 1184c: 8f 70 andi r24, 0x0F ; 15 1184e: f9 cf rjmp .-14 ; 0x11842 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11850: 8a ed ldi r24, 0xDA ; 218 11852: 95 e0 ldi r25, 0x05 ; 5 11854: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> 11858: 95 cf rjmp .-214 ; 0x11784 // 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)) 1185a: 86 e8 ldi r24, 0x86 ; 134 1185c: 93 e0 ldi r25, 0x03 ; 3 1185e: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 11862: 88 23 and r24, r24 11864: 09 f4 brne .+2 ; 0x11868 11866: ba cf rjmp .-140 ; 0x117dc kill(PSTR("Inactivity Shutdown")); 11868: 80 e8 ldi r24, 0x80 ; 128 1186a: 9d e7 ldi r25, 0x7D ; 125 1186c: 0e 94 11 7a call 0xf422 ; 0xf422 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) { 11870: cc 23 and r28, r28 11872: 09 f4 brne .+2 ; 0x11876 11874: 9f c0 rjmp .+318 ; 0x119b4 if (fan_kick_end == 0) { 11876: 80 91 6c 03 lds r24, 0x036C ; 0x80036c 1187a: 90 91 6d 03 lds r25, 0x036D ; 0x80036d 1187e: a0 91 6e 03 lds r26, 0x036E ; 0x80036e 11882: b0 91 6f 03 lds r27, 0x036F ; 0x80036f 11886: 89 2b or r24, r25 11888: 8a 2b or r24, r26 1188a: 8b 2b or r24, r27 1188c: 81 f4 brne .+32 ; 0x118ae // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 1188e: 0f 94 53 29 call 0x252a6 ; 0x252a6 11892: 60 5e subi r22, 0xE0 ; 224 11894: 7c 4f sbci r23, 0xFC ; 252 11896: 8f 4f sbci r24, 0xFF ; 255 11898: 9f 4f sbci r25, 0xFF ; 255 1189a: 60 93 6c 03 sts 0x036C, r22 ; 0x80036c 1189e: 70 93 6d 03 sts 0x036D, r23 ; 0x80036d 118a2: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e 118a6: 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; 118aa: cf ef ldi r28, 0xFF ; 255 118ac: 0f c0 rjmp .+30 ; 0x118cc 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()) 118ae: 0f 94 53 29 call 0x252a6 ; 0x252a6 118b2: 00 91 6c 03 lds r16, 0x036C ; 0x80036c 118b6: 10 91 6d 03 lds r17, 0x036D ; 0x80036d 118ba: 20 91 6e 03 lds r18, 0x036E ; 0x80036e 118be: 30 91 6f 03 lds r19, 0x036F ; 0x80036f 118c2: 60 17 cp r22, r16 118c4: 71 07 cpc r23, r17 118c6: 82 07 cpc r24, r18 118c8: 93 07 cpc r25, r19 118ca: 78 f3 brcs .-34 ; 0x118aa } 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 118cc: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 118d0: 88 23 and r24, r24 118d2: 09 f4 brne .+2 ; 0x118d6 118d4: 78 c0 rjmp .+240 ; 0x119c6 fanSpeedBckp = tail_fan_speed; 118d6: 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) { 118da: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 118de: 81 11 cpse r24, r1 118e0: 07 c0 rjmp .+14 ; 0x118f0 return; } avoidRecursion = true; 118e2: 81 e0 ldi r24, 0x01 ; 1 118e4: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> mmu_loop_inner(true); 118e8: 0f 94 09 a7 call 0x34e12 ; 0x34e12 avoidRecursion = false; 118ec: 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) { 118f0: 80 91 d3 05 lds r24, 0x05D3 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> 118f4: 88 23 and r24, r24 118f6: e1 f1 breq .+120 ; 0x11970 lcd_backlight_wake_trigger = false; 118f8: 10 92 d3 05 sts 0x05D3, r1 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> backlight_wake(); 118fc: 80 e0 ldi r24, 0x00 ; 0 118fe: 0e 94 74 8a call 0x114e8 ; 0x114e8 bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11902: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11904: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11906: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> 1190a: 28 2f mov r18, r24 1190c: 08 2e mov r0, r24 1190e: 00 0c add r0, r0 11910: 33 0b sbc r19, r19 11912: 37 ff sbrs r19, 7 11914: 03 c0 rjmp .+6 ; 0x1191c 11916: 31 95 neg r19 11918: 21 95 neg r18 1191a: 31 09 sbc r19, r1 1191c: 24 30 cpi r18, 0x04 ; 4 1191e: 31 05 cpc r19, r1 11920: 0c f4 brge .+2 ; 0x11924 11922: 54 c0 rjmp .+168 ; 0x119cc lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11924: 98 2f mov r25, r24 11926: 87 ff sbrs r24, 7 11928: 02 c0 rjmp .+4 ; 0x1192e 1192a: 93 e0 ldi r25, 0x03 ; 3 1192c: 98 0f add r25, r24 1192e: 95 95 asr r25 11930: 95 95 asr r25 11932: 20 91 70 06 lds r18, 0x0670 ; 0x800670 11936: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1193a: 29 0f add r18, r25 1193c: 31 1d adc r19, r1 1193e: 97 fd sbrc r25, 7 11940: 3a 95 dec r19 11942: 30 93 71 06 sts 0x0671, r19 ; 0x800671 11946: 20 93 70 06 sts 0x0670, r18 ; 0x800670 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 1194a: 83 78 andi r24, 0x83 ; 131 1194c: 87 ff sbrs r24, 7 1194e: 03 c0 rjmp .+6 ; 0x11956 11950: 81 50 subi r24, 0x01 ; 1 11952: 8c 6f ori r24, 0xFC ; 252 11954: 8f 5f subi r24, 0xFF ; 255 11956: 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; 1195a: 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); 1195c: 86 e0 ldi r24, 0x06 ; 6 1195e: 0f 94 0e 4e call 0x29c1c ; 0x29c1c if (lcd_draw_update == 0) { 11962: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11966: 81 11 cpse r24, r1 11968: 03 c0 rjmp .+6 ; 0x11970 // Update LCD rendering at minimum lcd_draw_update = 1; 1196a: 81 e0 ldi r24, 0x01 ; 1 1196c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11970: 0e 94 0d 8a call 0x1141a ; 0x1141a // handle longpress if(lcd_longpress_trigger) 11974: 80 91 d4 05 lds r24, 0x05D4 ; 0x8005d4 11978: 88 23 and r24, r24 1197a: 61 f0 breq .+24 ; 0x11994 { lcd_consume_click(); // Reset trigger to prevent recursion 1197c: 0e 94 ff 70 call 0xe1fe ; 0xe1fe // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11980: e0 91 17 04 lds r30, 0x0417 ; 0x800417 11984: f0 91 18 04 lds r31, 0x0418 ; 0x800418 11988: 30 97 sbiw r30, 0x00 ; 0 1198a: 21 f0 breq .+8 ; 0x11994 1198c: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11990: 81 11 cpse r24, r1 { lcd_longpress_func(); 11992: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11994: 0e 94 5f 79 call 0xf2be ; 0xf2be #endif //AUTO_REPORT host_keepalive(); 11998: 0e 94 ae 7f call 0xff5c ; 0xff5c bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 1199c: 40 e3 ldi r20, 0x30 ; 48 1199e: 55 e7 ldi r21, 0x75 ; 117 119a0: 60 e0 ldi r22, 0x00 ; 0 119a2: 70 e0 ldi r23, 0x00 ; 0 119a4: 8e e9 ldi r24, 0x9E ; 158 119a6: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 119a8: df 91 pop r29 119aa: cf 91 pop r28 119ac: 1f 91 pop r17 119ae: 0f 91 pop r16 119b0: 0d 94 37 2a jmp 0x2546e ; 0x2546e ::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; 119b4: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 119b8: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 119bc: 10 92 6e 03 sts 0x036E, r1 ; 0x80036e 119c0: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 119c4: 83 cf rjmp .-250 ; 0x118cc #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; 119c6: c0 93 a6 04 sts 0x04A6, r28 ; 0x8004a6 119ca: 87 cf rjmp .-242 ; 0x118da 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; 119cc: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> 119d0: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 119d2: 80 e0 ldi r24, 0x00 ; 0 119d4: c4 cf rjmp .-120 ; 0x1195e 000119d6 : #endif #endif } void delay_keep_alive(unsigned int ms) { 119d6: cf 93 push r28 119d8: df 93 push r29 119da: ec 01 movw r28, r24 for (;;) { manage_heater(); 119dc: 0f 94 63 38 call 0x270c6 ; 0x270c6 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 119e0: 81 e0 ldi r24, 0x01 ; 1 119e2: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 119e6: 80 e0 ldi r24, 0x00 ; 0 119e8: 0e 94 ae 6e call 0xdd5c ; 0xdd5c if (ms == 0) 119ec: 20 97 sbiw r28, 0x00 ; 0 119ee: 99 f0 breq .+38 ; 0x11a16 break; else if (ms >= 50) { 119f0: c2 33 cpi r28, 0x32 ; 50 119f2: d1 05 cpc r29, r1 119f4: 40 f0 brcs .+16 ; 0x11a06 _delay(50); 119f6: 62 e3 ldi r22, 0x32 ; 50 119f8: 70 e0 ldi r23, 0x00 ; 0 119fa: 80 e0 ldi r24, 0x00 ; 0 119fc: 90 e0 ldi r25, 0x00 ; 0 119fe: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 ms -= 50; 11a02: e2 97 sbiw r28, 0x32 ; 50 11a04: eb cf rjmp .-42 ; 0x119dc } else { _delay(ms); 11a06: be 01 movw r22, r28 11a08: 90 e0 ldi r25, 0x00 ; 0 11a0a: 80 e0 ldi r24, 0x00 ; 0 11a0c: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 ms = 0; 11a10: d0 e0 ldi r29, 0x00 ; 0 11a12: c0 e0 ldi r28, 0x00 ; 0 11a14: e3 cf rjmp .-58 ; 0x119dc } } } 11a16: df 91 pop r29 11a18: cf 91 pop r28 11a1a: 08 95 ret 00011a1c : /// @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) { 11a1c: cf 93 push r28 11a1e: df 93 push r29 11a20: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a22: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11a24: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 11a28: 81 e0 ldi r24, 0x01 ; 1 11a2a: 0e 94 b6 8a call 0x1156c ; 0x1156c 11a2e: 80 91 b8 13 lds r24, 0x13B8 ; 0x8013b8 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11a32: 8f 3f cpi r24, 0xFF ; 255 11a34: d9 f4 brne .+54 ; 0x11a6c // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11a36: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 11a3a: 84 30 cpi r24, 0x04 ; 4 11a3c: 21 f4 brne .+8 ; 0x11a46 }; 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 11a3e: 80 91 50 13 lds r24, 0x1350 ; 0x801350 11a42: 81 11 cpse r24, r1 11a44: ef cf rjmp .-34 ; 0x11a24 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 11a46: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 11a4a: 90 91 8c 13 lds r25, 0x138C ; 0x80138c 11a4e: 01 97 sbiw r24, 0x01 ; 1 11a50: 49 f7 brne .-46 ; 0x11a24 && lastErrorCode != ec) // The error code is not a duplicate 11a52: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 11a56: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 11a5a: 89 32 cpi r24, 0x29 ; 41 11a5c: 90 48 sbci r25, 0x80 ; 128 11a5e: 11 f3 breq .-60 ; 0x11a24 { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11a60: 60 e0 ldi r22, 0x00 ; 0 11a62: 89 e2 ldi r24, 0x29 ; 41 11a64: 90 e8 ldi r25, 0x80 ; 128 11a66: 0f 94 f5 82 call 0x305ea ; 0x305ea 11a6a: dc cf rjmp .-72 ; 0x11a24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a6c: d0 93 b8 13 sts 0x13B8, r29 ; 0x8013b8 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11a70: 85 30 cpi r24, 0x05 ; 5 11a72: 39 f4 brne .+14 ; 0x11a82 if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11a74: cf 3f cpi r28, 0xFF ; 255 11a76: f9 f2 breq .-66 ; 0x11a36 MMU2::mmu2.eject_filament(eject_slot, true); 11a78: 61 e0 ldi r22, 0x01 ; 1 11a7a: 8c 2f mov r24, r28 11a7c: 0f 94 9f ad call 0x35b3e ; 0x35b3e 11a80: d1 cf rjmp .-94 ; 0x11a24 // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11a82: 84 30 cpi r24, 0x04 ; 4 11a84: c1 f6 brne .-80 ; 0x11a36 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11a86: df 91 pop r29 11a88: cf 91 pop r28 11a8a: 08 95 ret 00011a8c <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11a8c: 1f 92 push r1 11a8e: 0f 92 push r0 11a90: 0f b6 in r0, 0x3f ; 63 11a92: 0f 92 push r0 11a94: 11 24 eor r1, r1 11a96: 0b b6 in r0, 0x3b ; 59 11a98: 0f 92 push r0 11a9a: 2f 93 push r18 11a9c: 3f 93 push r19 11a9e: 4f 93 push r20 11aa0: 5f 93 push r21 11aa2: 6f 93 push r22 11aa4: 7f 93 push r23 11aa6: 8f 93 push r24 11aa8: 9f 93 push r25 11aaa: af 93 push r26 11aac: bf 93 push r27 11aae: ef 93 push r30 11ab0: ff 93 push r31 adc_values[adc_channel] += ADC; 11ab2: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11ab6: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11aba: e0 91 36 03 lds r30, 0x0336 ; 0x800336 11abe: f0 e0 ldi r31, 0x00 ; 0 11ac0: ee 0f add r30, r30 11ac2: ff 1f adc r31, r31 11ac4: ea 5d subi r30, 0xDA ; 218 11ac6: fc 4f sbci r31, 0xFC ; 252 11ac8: 80 81 ld r24, Z 11aca: 91 81 ldd r25, Z+1 ; 0x01 11acc: 82 0f add r24, r18 11ace: 93 1f adc r25, r19 11ad0: 91 83 std Z+1, r25 ; 0x01 11ad2: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11ad4: 80 91 25 03 lds r24, 0x0325 ; 0x800325 11ad8: 8f 5f subi r24, 0xFF ; 255 11ada: 80 93 25 03 sts 0x0325, r24 ; 0x800325 11ade: 80 31 cpi r24, 0x10 ; 16 11ae0: 09 f0 breq .+2 ; 0x11ae4 <__vector_29+0x58> 11ae2: 56 c0 rjmp .+172 ; 0x11b90 <__vector_29+0x104> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11ae4: 80 91 36 03 lds r24, 0x0336 ; 0x800336 11ae8: 8f 5f subi r24, 0xFF ; 255 11aea: 80 93 36 03 sts 0x0336, r24 ; 0x800336 11aee: 88 30 cpi r24, 0x08 ; 8 11af0: 09 f0 breq .+2 ; 0x11af4 <__vector_29+0x68> 11af2: 46 c0 rjmp .+140 ; 0x11b80 <__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 11af4: 80 91 26 03 lds r24, 0x0326 ; 0x800326 11af8: 90 91 27 03 lds r25, 0x0327 ; 0x800327 11afc: 90 93 0c 06 sts 0x060C, r25 ; 0x80060c 11b00: 80 93 0b 06 sts 0x060B, r24 ; 0x80060b current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11b04: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11b08: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11b0c: 90 93 0a 06 sts 0x060A, r25 ; 0x80060a 11b10: 80 93 09 06 sts 0x0609, r24 ; 0x800609 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11b14: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11b18: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11b1c: 90 93 08 06 sts 0x0608, r25 ; 0x800608 11b20: 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 11b24: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11b28: 90 91 31 03 lds r25, 0x0331 ; 0x800331 11b2c: 90 93 16 06 sts 0x0616, r25 ; 0x800616 11b30: 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)]; 11b34: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11b38: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11b3c: 90 93 5d 06 sts 0x065D, r25 ; 0x80065d 11b40: 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 11b44: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11b48: 90 91 35 03 lds r25, 0x0335 ; 0x800335 11b4c: 90 93 5b 06 sts 0x065B, r25 ; 0x80065b 11b50: 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; 11b54: 81 e0 ldi r24, 0x01 ; 1 11b56: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11b5a: ff 91 pop r31 11b5c: ef 91 pop r30 11b5e: bf 91 pop r27 11b60: af 91 pop r26 11b62: 9f 91 pop r25 11b64: 8f 91 pop r24 11b66: 7f 91 pop r23 11b68: 6f 91 pop r22 11b6a: 5f 91 pop r21 11b6c: 4f 91 pop r20 11b6e: 3f 91 pop r19 11b70: 2f 91 pop r18 11b72: 0f 90 pop r0 11b74: 0b be out 0x3b, r0 ; 59 11b76: 0f 90 pop r0 11b78: 0f be out 0x3f, r0 ; 63 11b7a: 0f 90 pop r0 11b7c: 1f 90 pop r1 11b7e: 18 95 reti 11b80: 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)) { 11b84: 4f e5 ldi r20, 0x5F ; 95 11b86: 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) { 11b88: 8f 5f subi r24, 0xFF ; 255 11b8a: 41 f4 brne .+16 ; 0x11b9c <__vector_29+0x110> 11b8c: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11b90: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11b94: 80 64 ori r24, 0x40 ; 64 11b96: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11b9a: df cf rjmp .-66 ; 0x11b5a <__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)) { 11b9c: 9a 01 movw r18, r20 11b9e: 08 2e mov r0, r24 11ba0: 02 c0 rjmp .+4 ; 0x11ba6 <__vector_29+0x11a> 11ba2: 35 95 asr r19 11ba4: 27 95 ror r18 11ba6: 0a 94 dec r0 11ba8: e2 f7 brpl .-8 ; 0x11ba2 <__vector_29+0x116> 11baa: 20 ff sbrs r18, 0 11bac: ed cf rjmp .-38 ; 0x11b88 <__vector_29+0xfc> 11bae: 80 93 24 03 sts 0x0324, r24 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11bb2: 0e 94 5a 5b call 0xb6b4 ; 0xb6b4 adc_count = 0; 11bb6: 10 92 25 03 sts 0x0325, r1 ; 0x800325 11bba: ea cf rjmp .-44 ; 0x11b90 <__vector_29+0x104> 00011bbc : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11bbc: cf 93 push r28 11bbe: 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 11bc0: ca e7 ldi r28, 0x7A ; 122 11bc2: d0 e0 ldi r29, 0x00 ; 0 11bc4: 88 81 ld r24, Y 11bc6: 8f 7b andi r24, 0xBF ; 191 11bc8: 88 83 st Y, r24 adc_count = 0; 11bca: 10 92 25 03 sts 0x0325, r1 ; 0x800325 adc_channel = 0; 11bce: 10 92 36 03 sts 0x0336, r1 ; 0x800336 adc_channel_idx = first_channel_idx; 11bd2: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11bd6: 80 e0 ldi r24, 0x00 ; 0 11bd8: 0e 94 5a 5b call 0xb6b4 ; 0xb6b4 memset((void*)adc_values, 0, sizeof(adc_values)); 11bdc: e6 e2 ldi r30, 0x26 ; 38 11bde: f3 e0 ldi r31, 0x03 ; 3 11be0: 80 e1 ldi r24, 0x10 ; 16 11be2: df 01 movw r26, r30 11be4: 1d 92 st X+, r1 11be6: 8a 95 dec r24 11be8: e9 f7 brne .-6 ; 0x11be4 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11bea: 88 81 ld r24, Y 11bec: 80 64 ori r24, 0x40 ; 64 11bee: 88 83 st Y, r24 } 11bf0: df 91 pop r29 11bf2: cf 91 pop r28 11bf4: 08 95 ret 00011bf6 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11bf6: 2f 92 push r2 11bf8: 3f 92 push r3 11bfa: 4f 92 push r4 11bfc: 5f 92 push r5 11bfe: 6f 92 push r6 11c00: 7f 92 push r7 11c02: 8f 92 push r8 11c04: 9f 92 push r9 11c06: af 92 push r10 11c08: bf 92 push r11 11c0a: cf 92 push r12 11c0c: df 92 push r13 11c0e: ef 92 push r14 11c10: ff 92 push r15 11c12: 0f 93 push r16 11c14: 1f 93 push r17 11c16: cf 93 push r28 11c18: df 93 push r29 11c1a: cd b7 in r28, 0x3d ; 61 11c1c: de b7 in r29, 0x3e ; 62 11c1e: a4 97 sbiw r28, 0x24 ; 36 11c20: 0f b6 in r0, 0x3f ; 63 11c22: f8 94 cli 11c24: de bf out 0x3e, r29 ; 62 11c26: 0f be out 0x3f, r0 ; 63 11c28: 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(); 11c2a: 0f 94 ef 42 call 0x285de ; 0x285de if (planner_aborted) 11c2e: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 11c32: 81 11 cpse r24, r1 11c34: 17 c0 rjmp .+46 ; 0x11c64 return; mesh_bed_leveling_flag = true; 11c36: 81 e0 ldi r24, 0x01 ; 1 11c38: 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])) { 11c3c: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 11c40: 88 23 and r24, r24 11c42: 49 f0 breq .+18 ; 0x11c56 11c44: 80 91 90 06 lds r24, 0x0690 ; 0x800690 11c48: 88 23 and r24, r24 11c4a: 29 f0 breq .+10 ; 0x11c56 11c4c: 20 91 91 06 lds r18, 0x0691 ; 0x800691 11c50: 2f 83 std Y+7, r18 ; 0x07 11c52: 21 11 cpse r18, r1 11c54: 20 c0 rjmp .+64 ; 0x11c96 11c56: 81 e0 ldi r24, 0x01 ; 1 11c58: 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); 11c5c: 84 ee ldi r24, 0xE4 ; 228 11c5e: 9b e6 ldi r25, 0x6B ; 107 11c60: 0f 94 04 75 call 0x2ea08 ; 0x2ea08 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11c64: a4 96 adiw r28, 0x24 ; 36 11c66: 0f b6 in r0, 0x3f ; 63 11c68: f8 94 cli 11c6a: de bf out 0x3e, r29 ; 62 11c6c: 0f be out 0x3f, r0 ; 63 11c6e: cd bf out 0x3d, r28 ; 61 11c70: df 91 pop r29 11c72: cf 91 pop r28 11c74: 1f 91 pop r17 11c76: 0f 91 pop r16 11c78: ff 90 pop r15 11c7a: ef 90 pop r14 11c7c: df 90 pop r13 11c7e: cf 90 pop r12 11c80: bf 90 pop r11 11c82: af 90 pop r10 11c84: 9f 90 pop r9 11c86: 8f 90 pop r8 11c88: 7f 90 pop r7 11c8a: 6f 90 pop r6 11c8c: 5f 90 pop r5 11c8e: 4f 90 pop r4 11c90: 3f 90 pop r3 11c92: 2f 90 pop r2 11c94: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 11c96: 8b ea ldi r24, 0xAB ; 171 11c98: 9d e0 ldi r25, 0x0D ; 13 11c9a: 0f 94 23 dc call 0x3b846 ; 0x3b846 11c9e: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 11ca0: 8e e4 ldi r24, 0x4E ; 78 11ca2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 11ca6: 08 2f mov r16, r24 11ca8: 0e 94 6f 5b call 0xb6de ; 0xb6de 11cac: 8e 83 std Y+6, r24 ; 0x06 11cae: 00 23 and r16, r16 11cb0: 29 f0 breq .+10 ; 0x11cbc 11cb2: 87 30 cpi r24, 0x07 ; 7 11cb4: 09 f4 brne .+2 ; 0x11cb8 11cb6: c9 c0 rjmp .+402 ; 0x11e4a 11cb8: 83 30 cpi r24, 0x03 ; 3 11cba: 29 f0 breq .+10 ; 0x11cc6 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; 11cbc: 13 30 cpi r17, 0x03 ; 3 11cbe: 09 f0 breq .+2 ; 0x11cc2 11cc0: c3 c0 rjmp .+390 ; 0x11e48 11cc2: 63 e0 ldi r22, 0x03 ; 3 11cc4: 6e 83 std Y+6, r22 ; 0x06 11cc6: 80 e0 ldi r24, 0x00 ; 0 11cc8: 90 e0 ldi r25, 0x00 ; 0 11cca: a0 e8 ldi r26, 0x80 ; 128 11ccc: bf e3 ldi r27, 0x3F ; 63 11cce: 8a 83 std Y+2, r24 ; 0x02 11cd0: 9b 83 std Y+3, r25 ; 0x03 11cd2: ac 83 std Y+4, r26 ; 0x04 11cd4: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 11cd6: 8a ea ldi r24, 0xAA ; 170 11cd8: 9d e0 ldi r25, 0x0D ; 13 11cda: 0f 94 23 dc call 0x3b846 ; 0x3b846 11cde: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 11ce0: 83 e4 ldi r24, 0x43 ; 67 11ce2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 11ce6: 18 2f mov r17, r24 11ce8: 0e 94 6f 5b call 0xb6de ; 0xb6de 11cec: 11 23 and r17, r17 11cee: 29 f0 breq .+10 ; 0x11cfa 11cf0: 88 23 and r24, r24 11cf2: 19 f0 breq .+6 ; 0x11cfa 11cf4: 8b 30 cpi r24, 0x0B ; 11 11cf6: 08 f4 brcc .+2 ; 0x11cfa 11cf8: 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; 11cfa: 88 e5 ldi r24, 0x58 ; 88 11cfc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 11d00: 88 23 and r24, r24 11d02: 09 f4 brne .+2 ; 0x11d06 11d04: ab c0 rjmp .+342 ; 0x11e5c 11d06: 0e 94 a4 60 call 0xc148 ; 0xc148 11d0a: 20 e0 ldi r18, 0x00 ; 0 11d0c: 30 e0 ldi r19, 0x00 ; 0 11d0e: 48 e0 ldi r20, 0x08 ; 8 11d10: 52 e4 ldi r21, 0x42 ; 66 11d12: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 11d16: 20 e0 ldi r18, 0x00 ; 0 11d18: 30 e0 ldi r19, 0x00 ; 0 11d1a: 48 eb ldi r20, 0xB8 ; 184 11d1c: 51 e4 ldi r21, 0x41 ; 65 11d1e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 11d22: 6a 87 std Y+10, r22 ; 0x0a 11d24: 7b 87 std Y+11, r23 ; 0x0b 11d26: 8c 87 std Y+12, r24 ; 0x0c 11d28: 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; 11d2a: 89 e5 ldi r24, 0x59 ; 89 11d2c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 11d30: 88 23 and r24, r24 11d32: 09 f4 brne .+2 ; 0x11d36 11d34: 9c c0 rjmp .+312 ; 0x11e6e 11d36: 0e 94 a4 60 call 0xc148 ; 0xc148 11d3a: 20 e0 ldi r18, 0x00 ; 0 11d3c: 30 e0 ldi r19, 0x00 ; 0 11d3e: 48 e0 ldi r20, 0x08 ; 8 11d40: 52 e4 ldi r21, 0x42 ; 66 11d42: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 11d46: 20 e0 ldi r18, 0x00 ; 0 11d48: 30 e0 ldi r19, 0x00 ; 0 11d4a: 40 ea ldi r20, 0xA0 ; 160 11d4c: 50 e4 ldi r21, 0x40 ; 64 11d4e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 11d52: 6c 8b std Y+20, r22 ; 0x14 11d54: 7d 8b std Y+21, r23 ; 0x15 11d56: 8e 8b std Y+22, r24 ; 0x16 11d58: 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; 11d5a: 87 e5 ldi r24, 0x57 ; 87 11d5c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 11d60: 88 23 and r24, r24 11d62: 09 f4 brne .+2 ; 0x11d66 11d64: 89 c0 rjmp .+274 ; 0x11e78 11d66: 0e 94 a4 60 call 0xc148 ; 0xc148 11d6a: 2a 85 ldd r18, Y+10 ; 0x0a 11d6c: 3b 85 ldd r19, Y+11 ; 0x0b 11d6e: 4c 85 ldd r20, Y+12 ; 0x0c 11d70: 5d 85 ldd r21, Y+13 ; 0x0d 11d72: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 11d76: 20 e0 ldi r18, 0x00 ; 0 11d78: 30 e0 ldi r19, 0x00 ; 0 11d7a: 48 e8 ldi r20, 0x88 ; 136 11d7c: 52 e4 ldi r21, 0x42 ; 66 11d7e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 11d82: 69 8f std Y+25, r22 ; 0x19 11d84: 7a 8f std Y+26, r23 ; 0x1a 11d86: 8b 8f std Y+27, r24 ; 0x1b 11d88: 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; 11d8a: 88 e4 ldi r24, 0x48 ; 72 11d8c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 11d90: 88 23 and r24, r24 11d92: 09 f4 brne .+2 ; 0x11d96 11d94: 7a c0 rjmp .+244 ; 0x11e8a 11d96: 0e 94 a4 60 call 0xc148 ; 0xc148 11d9a: 2c 89 ldd r18, Y+20 ; 0x14 11d9c: 3d 89 ldd r19, Y+21 ; 0x15 11d9e: 4e 89 ldd r20, Y+22 ; 0x16 11da0: 5f 89 ldd r21, Y+23 ; 0x17 11da2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 11da6: 20 e0 ldi r18, 0x00 ; 0 11da8: 30 e0 ldi r19, 0x00 ; 0 11daa: 48 e8 ldi r20, 0x88 ; 136 11dac: 52 e4 ldi r21, 0x42 ; 66 11dae: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 11db2: 6d 8f std Y+29, r22 ; 0x1d 11db4: 7e 8f std Y+30, r23 ; 0x1e 11db6: 8f 8f std Y+31, r24 ; 0x1f 11db8: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 11dba: 0f 94 54 8c call 0x318a8 ; 0x318a8 mbl.z_values[0][0] = min_pos[Z_AXIS]; 11dbe: 80 91 29 02 lds r24, 0x0229 ; 0x800229 11dc2: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 11dc6: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 11dca: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 11dce: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 11dd2: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 11dd6: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 11dda: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 11dde: 0f 94 e2 c9 call 0x393c4 ; 0x393c4 11de2: 05 ec ldi r16, 0xC5 ; 197 11de4: 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) 11de6: c8 01 movw r24, r16 11de8: 0f 94 31 dc call 0x3b862 ; 0x3b862 11dec: 01 96 adiw r24, 0x01 ; 1 11dee: 09 f0 breq .+2 ; 0x11df2 11df0: 51 c0 rjmp .+162 ; 0x11e94 11df2: 0e 5f subi r16, 0xFE ; 254 11df4: 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) { 11df6: 05 3d cpi r16, 0xD5 ; 213 11df8: 8f e0 ldi r24, 0x0F ; 15 11dfa: 18 07 cpc r17, r24 11dfc: a1 f7 brne .-24 ; 0x11de6 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 11dfe: 21 2c mov r2, r1 11e00: a2 ec ldi r26, 0xC2 ; 194 11e02: b3 e1 ldi r27, 0x13 ; 19 11e04: ba a3 std Y+34, r27 ; 0x22 11e06: 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; 11e08: b9 87 std Y+9, r27 ; 0x09 11e0a: a8 87 std Y+8, r26 ; 0x08 11e0c: 51 2c mov r5, r1 11e0e: 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; 11e10: 31 2c mov r3, r1 11e12: 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)); 11e14: 84 2d mov r24, r4 11e16: 63 e0 ldi r22, 0x03 ; 3 11e18: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 11e1c: 98 8b std Y+16, r25 ; 0x10 11e1e: 68 84 ldd r6, Y+8 ; 0x08 11e20: 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++) { 11e22: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 11e24: f8 89 ldd r31, Y+16 ; 0x10 11e26: f1 11 cpse r31, r1 11e28: 37 c0 rjmp .+110 ; 0x11e98 11e2a: 81 2f mov r24, r17 11e2c: 63 e0 ldi r22, 0x03 ; 3 11e2e: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 11e32: 91 11 cpse r25, r1 11e34: 31 c0 rjmp .+98 ; 0x11e98 if (isOn3x3Mesh) { if (has_z && (row || col)) { 11e36: 21 10 cpse r2, r1 11e38: 3f c1 rjmp .+638 ; 0x120b8 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11e3a: 7e 81 ldd r23, Y+6 ; 0x06 11e3c: 73 30 cpi r23, 0x03 ; 3 11e3e: 09 f4 brne .+2 ; 0x11e42 11e40: 70 c0 rjmp .+224 ; 0x11f22 11e42: 8f 81 ldd r24, Y+7 ; 0x07 11e44: 8e 87 std Y+14, r24 ; 0x0e 11e46: 37 c0 rjmp .+110 ; 0x11eb6 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; 11e48: 1e 83 std Y+6, r17 ; 0x06 11e4a: 6a e9 ldi r22, 0x9A ; 154 11e4c: 79 e9 ldi r23, 0x99 ; 153 11e4e: 89 e1 ldi r24, 0x19 ; 25 11e50: 9f e3 ldi r25, 0x3F ; 63 11e52: 6a 83 std Y+2, r22 ; 0x02 11e54: 7b 83 std Y+3, r23 ; 0x03 11e56: 8c 83 std Y+4, r24 ; 0x04 11e58: 9d 83 std Y+5, r25 ; 0x05 11e5a: 3d cf rjmp .-390 ; 0x11cd6 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; 11e5c: 80 e0 ldi r24, 0x00 ; 0 11e5e: 90 e0 ldi r25, 0x00 ; 0 11e60: a0 e8 ldi r26, 0x80 ; 128 11e62: bf ef ldi r27, 0xFF ; 255 11e64: 8a 87 std Y+10, r24 ; 0x0a 11e66: 9b 87 std Y+11, r25 ; 0x0b 11e68: ac 87 std Y+12, r26 ; 0x0c 11e6a: bd 87 std Y+13, r27 ; 0x0d 11e6c: 5e cf rjmp .-324 ; 0x11d2a const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 11e6e: 60 e0 ldi r22, 0x00 ; 0 11e70: 70 e0 ldi r23, 0x00 ; 0 11e72: 80 e8 ldi r24, 0x80 ; 128 11e74: 9f ef ldi r25, 0xFF ; 255 11e76: 6d cf rjmp .-294 ; 0x11d52 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 11e78: 80 e0 ldi r24, 0x00 ; 0 11e7a: 90 e0 ldi r25, 0x00 ; 0 11e7c: a0 e8 ldi r26, 0x80 ; 128 11e7e: bf e7 ldi r27, 0x7F ; 127 11e80: 89 8f std Y+25, r24 ; 0x19 11e82: 9a 8f std Y+26, r25 ; 0x1a 11e84: ab 8f std Y+27, r26 ; 0x1b 11e86: bc 8f std Y+28, r27 ; 0x1c 11e88: 80 cf rjmp .-256 ; 0x11d8a const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 11e8a: 60 e0 ldi r22, 0x00 ; 0 11e8c: 70 e0 ldi r23, 0x00 ; 0 11e8e: 80 e8 ldi r24, 0x80 ; 128 11e90: 9f e7 ldi r25, 0x7F ; 127 11e92: 8f cf rjmp .-226 ; 0x11db2 11e94: 2f 80 ldd r2, Y+7 ; 0x07 11e96: b4 cf rjmp .-152 ; 0x11e00 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; } 11e98: 60 e0 ldi r22, 0x00 ; 0 11e9a: 70 e0 ldi r23, 0x00 ; 0 11e9c: 80 ec ldi r24, 0xC0 ; 192 11e9e: 9f e7 ldi r25, 0x7F ; 127 11ea0: d3 01 movw r26, r6 11ea2: 11 96 adiw r26, 0x01 ; 1 11ea4: 6d 93 st X+, r22 11ea6: 7d 93 st X+, r23 11ea8: 8d 93 st X+, r24 11eaa: 9c 93 st X, r25 11eac: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 11eae: be 81 ldd r27, Y+6 ; 0x06 11eb0: b3 30 cpi r27, 0x03 ; 3 11eb2: c1 f1 breq .+112 ; 0x11f24 11eb4: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 11eb6: 81 2f mov r24, r17 11eb8: 0f 94 3c ca call 0x39478 ; 0x39478 11ebc: 4b 01 movw r8, r22 11ebe: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 11ec0: 80 2f mov r24, r16 11ec2: 0f 94 3c ca call 0x39478 ; 0x39478 11ec6: 6b 01 movw r12, r22 11ec8: 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)) { 11eca: a5 01 movw r20, r10 11ecc: 94 01 movw r18, r8 11ece: 6a 85 ldd r22, Y+10 ; 0x0a 11ed0: 7b 85 ldd r23, Y+11 ; 0x0b 11ed2: 8c 85 ldd r24, Y+12 ; 0x0c 11ed4: 9d 85 ldd r25, Y+13 ; 0x0d 11ed6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 11eda: 18 16 cp r1, r24 11edc: 0c f4 brge .+2 ; 0x11ee0 11ede: 1c c1 rjmp .+568 ; 0x12118 11ee0: 29 8d ldd r18, Y+25 ; 0x19 11ee2: 3a 8d ldd r19, Y+26 ; 0x1a 11ee4: 4b 8d ldd r20, Y+27 ; 0x1b 11ee6: 5c 8d ldd r21, Y+28 ; 0x1c 11ee8: c5 01 movw r24, r10 11eea: b4 01 movw r22, r8 11eec: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 11ef0: 18 16 cp r1, r24 11ef2: 0c f4 brge .+2 ; 0x11ef6 11ef4: 11 c1 rjmp .+546 ; 0x12118 11ef6: a7 01 movw r20, r14 11ef8: 96 01 movw r18, r12 11efa: 6c 89 ldd r22, Y+20 ; 0x14 11efc: 7d 89 ldd r23, Y+21 ; 0x15 11efe: 8e 89 ldd r24, Y+22 ; 0x16 11f00: 9f 89 ldd r25, Y+23 ; 0x17 11f02: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 11f06: 18 16 cp r1, r24 11f08: 0c f4 brge .+2 ; 0x11f0c 11f0a: 06 c1 rjmp .+524 ; 0x12118 11f0c: 2d 8d ldd r18, Y+29 ; 0x1d 11f0e: 3e 8d ldd r19, Y+30 ; 0x1e 11f10: 4f 8d ldd r20, Y+31 ; 0x1f 11f12: 58 a1 ldd r21, Y+32 ; 0x20 11f14: c7 01 movw r24, r14 11f16: b6 01 movw r22, r12 11f18: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 11f1c: 18 16 cp r1, r24 11f1e: 0c f4 brge .+2 ; 0x11f22 11f20: fb c0 rjmp .+502 ; 0x12118 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 11f22: 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++) { 11f24: 1f 5f subi r17, 0xFF ; 255 11f26: 24 e0 ldi r18, 0x04 ; 4 11f28: 62 0e add r6, r18 11f2a: 71 1c adc r7, r1 11f2c: 17 30 cpi r17, 0x07 ; 7 11f2e: 09 f0 breq .+2 ; 0x11f32 11f30: 79 cf rjmp .-270 ; 0x11e24 11f32: 6f ef ldi r22, 0xFF ; 255 11f34: 46 1a sub r4, r22 11f36: 56 0a sbc r5, r22 11f38: 88 85 ldd r24, Y+8 ; 0x08 11f3a: 99 85 ldd r25, Y+9 ; 0x09 11f3c: 4c 96 adiw r24, 0x1c ; 28 11f3e: 99 87 std Y+9, r25 ; 0x09 11f40: 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++) { 11f42: 97 e0 ldi r25, 0x07 ; 7 11f44: 49 16 cp r4, r25 11f46: 51 04 cpc r5, r1 11f48: 09 f0 breq .+2 ; 0x11f4c 11f4a: 63 cf rjmp .-314 ; 0x11e12 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 11f4c: 0f 94 fd a2 call 0x345fa ; 0x345fa // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 11f50: a0 91 c4 06 lds r26, 0x06C4 ; 0x8006c4 11f54: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 11f56: b0 91 f7 03 lds r27, 0x03F7 ; 0x8003f7 11f5a: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 11f5c: 81 e0 ldi r24, 0x01 ; 1 11f5e: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = meshPointsToProbe + 10; 11f62: 8a e0 ldi r24, 0x0A ; 10 11f64: 83 0d add r24, r3 11f66: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 lcd_update(1); 11f6a: 81 e0 ldi r24, 0x01 ; 1 11f6c: 0e 94 ae 6e call 0xdd5c ; 0xdd5c // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 11f70: 80 e0 ldi r24, 0x00 ; 0 11f72: 90 e0 ldi r25, 0x00 ; 0 11f74: a0 ea ldi r26, 0xA0 ; 160 11f76: b0 e4 ldi r27, 0x40 ; 64 11f78: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 11f7c: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 11f80: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 11f84: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 11f88: 65 e5 ldi r22, 0x55 ; 85 11f8a: 75 e5 ldi r23, 0x55 ; 85 11f8c: 85 e5 ldi r24, 0x55 ; 85 11f8e: 91 e4 ldi r25, 0x41 ; 65 11f90: 0f 94 50 c0 call 0x380a0 ; 0x380a0 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 11f94: 80 e0 ldi r24, 0x00 ; 0 11f96: 0e 94 ef 66 call 0xcdde ; 0xcdde 11f9a: 9c a3 std Y+36, r25 ; 0x24 11f9c: 8b a3 std Y+35, r24 ; 0x23 11f9e: 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 11fa0: 83 2d mov r24, r3 11fa2: 67 e0 ldi r22, 0x07 ; 7 11fa4: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 11fa8: f8 2e mov r15, r24 11faa: 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 11fac: 68 2f mov r22, r24 11fae: 70 e0 ldi r23, 0x00 ; 0 11fb0: 7f 87 std Y+15, r23 ; 0x0f 11fb2: 6e 87 std Y+14, r22 ; 0x0e 11fb4: 80 ff sbrs r24, 0 11fb6: 03 c0 rjmp .+6 ; 0x11fbe 11fb8: 76 e0 ldi r23, 0x06 ; 6 11fba: 79 1b sub r23, r25 11fbc: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 11fbe: 80 2f mov r24, r16 11fc0: 63 e0 ldi r22, 0x03 ; 3 11fc2: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 11fc6: 91 11 cpse r25, r1 11fc8: 05 c0 rjmp .+10 ; 0x11fd4 11fca: 8f 2d mov r24, r15 11fcc: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 11fd0: 11 e0 ldi r17, 0x01 ; 1 11fd2: 91 11 cpse r25, r1 11fd4: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 11fd6: 80 2f mov r24, r16 11fd8: 0f 94 3c ca call 0x39478 ; 0x39478 11fdc: 68 8b std Y+16, r22 ; 0x10 11fde: 79 8b std Y+17, r23 ; 0x11 11fe0: 8a 8b std Y+18, r24 ; 0x12 11fe2: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 11fe4: 8f 2d mov r24, r15 11fe6: 0f 94 3c ca call 0x39478 ; 0x39478 11fea: 4b 01 movw r8, r22 11fec: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 11fee: 8e 81 ldd r24, Y+6 ; 0x06 11ff0: 83 30 cpi r24, 0x03 ; 3 11ff2: 09 f0 breq .+2 ; 0x11ff6 11ff4: 99 c0 rjmp .+306 ; 0x12128 if (!isOn3x3Mesh) { 11ff6: 11 11 cpse r17, r1 11ff8: c8 c0 rjmp .+400 ; 0x1218a 11ffa: 27 e0 ldi r18, 0x07 ; 7 11ffc: ae 85 ldd r26, Y+14 ; 0x0e 11ffe: bf 85 ldd r27, Y+15 ; 0x0f 12000: 2a 9f mul r18, r26 12002: f0 01 movw r30, r0 12004: 2b 9f mul r18, r27 12006: f0 0d add r31, r0 12008: 11 24 eor r1, r1 1200a: e0 0f add r30, r16 1200c: f1 1d adc r31, r1 1200e: ee 0f add r30, r30 12010: ff 1f adc r31, r31 12012: ee 0f add r30, r30 12014: ff 1f adc r31, r31 12016: ee 53 subi r30, 0x3E ; 62 12018: fc 4e sbci r31, 0xEC ; 236 1201a: 60 e0 ldi r22, 0x00 ; 0 1201c: 70 e0 ldi r23, 0x00 ; 0 1201e: 80 ec ldi r24, 0xC0 ; 192 12020: 9f e7 ldi r25, 0x7F ; 127 12022: 61 83 std Z+1, r22 ; 0x01 12024: 72 83 std Z+2, r23 ; 0x02 12026: 83 83 std Z+3, r24 ; 0x03 12028: 94 83 std Z+4, r25 ; 0x04 1202a: 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) { 1202c: e1 e3 ldi r30, 0x31 ; 49 1202e: 3e 12 cpse r3, r30 12030: b7 cf rjmp .-146 ; 0x11fa0 custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12032: 80 e0 ldi r24, 0x00 ; 0 12034: 90 e0 ldi r25, 0x00 ; 0 12036: a0 ea ldi r26, 0xA0 ; 160 12038: b0 e4 ldi r27, 0x40 ; 64 1203a: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 1203e: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 12042: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 12046: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 1204a: 65 e5 ldi r22, 0x55 ; 85 1204c: 75 e5 ldi r23, 0x55 ; 85 1204e: 85 e5 ldi r24, 0x55 ; 85 12050: 91 e4 ldi r25, 0x41 ; 65 12052: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 12056: 0f 94 ef 42 call 0x285de ; 0x285de static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 1205a: b1 e3 ldi r27, 0x31 ; 49 1205c: 3b 16 cp r3, r27 1205e: 09 f4 brne .+2 ; 0x12062 12060: 33 c2 rjmp .+1126 ; 0x124c8 if (g80_fail_cnt++ >= 1) { 12062: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 12066: 91 e0 ldi r25, 0x01 ; 1 12068: 98 0f add r25, r24 1206a: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 1206e: 88 23 and r24, r24 12070: 09 f4 brne .+2 ; 0x12074 12072: d3 c1 rjmp .+934 ; 0x1241a print_stop(); 12074: 60 e0 ldi r22, 0x00 ; 0 12076: 80 e0 ldi r24, 0x00 ; 0 12078: 0e 94 a1 f4 call 0x1e942 ; 0x1e942 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 1207c: 86 e4 ldi r24, 0x46 ; 70 1207e: 96 e3 ldi r25, 0x36 ; 54 12080: 0e 94 b3 72 call 0xe566 ; 0xe566 12084: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_z_calibration_prompt(false); 12088: 80 e0 ldi r24, 0x00 ; 0 1208a: 0f 94 bd 0c call 0x2197a ; 0x2197a current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 1208e: 81 e0 ldi r24, 0x01 ; 1 12090: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 12094: 83 e7 ldi r24, 0x73 ; 115 12096: 90 e7 ldi r25, 0x70 ; 112 12098: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 custom_message_type = custom_message_type_old; 1209c: 2f 81 ldd r18, Y+7 ; 0x07 1209e: 20 93 c4 06 sts 0x06C4, r18 ; 0x8006c4 custom_message_state = custom_message_state_old; 120a2: 68 85 ldd r22, Y+8 ; 0x08 120a4: 60 93 f7 03 sts 0x03F7, r22 ; 0x8003f7 lcd_update(2); 120a8: 82 e0 ldi r24, 0x02 ; 2 120aa: 0e 94 ae 6e call 0xdd5c ; 0xdd5c st_synchronize(); 120ae: 0f 94 ef 42 call 0x285de ; 0x285de mesh_bed_leveling_flag = false; 120b2: 10 92 a8 0d sts 0x0DA8, r1 ; 0x800da8 120b6: d6 cd rjmp .-1108 ; 0x11c64 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)) { 120b8: 01 11 cpse r16, r1 120ba: 03 c0 rjmp .+6 ; 0x120c2 120bc: 11 23 and r17, r17 120be: 09 f4 brne .+2 ; 0x120c2 120c0: bc ce rjmp .-648 ; 0x11e3a // 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))); 120c2: 81 2f mov r24, r17 120c4: 63 e0 ldi r22, 0x03 ; 3 120c6: 0f 94 de dc call 0x3b9bc ; 0x3b9bc <__divmodqi4> 120ca: 84 0d add r24, r4 120cc: 95 2d mov r25, r5 120ce: 91 1d adc r25, r1 120d0: 88 0f add r24, r24 120d2: 99 1f adc r25, r25 120d4: 8d 53 subi r24, 0x3D ; 61 120d6: 90 4f sbci r25, 0xF0 ; 240 120d8: 0f 94 31 dc call 0x3b862 ; 0x3b862 const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 120dc: bc 01 movw r22, r24 120de: 99 0f add r25, r25 120e0: 88 0b sbc r24, r24 120e2: 99 0b sbc r25, r25 120e4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 120e8: 2a e0 ldi r18, 0x0A ; 10 120ea: 37 ed ldi r19, 0xD7 ; 215 120ec: 43 e2 ldi r20, 0x23 ; 35 120ee: 5c e3 ldi r21, 0x3C ; 60 120f0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 120f4: 9b 01 movw r18, r22 120f6: ac 01 movw r20, r24 120f8: 60 91 c3 13 lds r22, 0x13C3 ; 0x8013c3 120fc: 70 91 c4 13 lds r23, 0x13C4 ; 0x8013c4 12100: 80 91 c5 13 lds r24, 0x13C5 ; 0x8013c5 12104: 90 91 c6 13 lds r25, 0x13C6 ; 0x8013c6 12108: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1210c: f3 01 movw r30, r6 1210e: 61 83 std Z+1, r22 ; 0x01 12110: 72 83 std Z+2, r23 ; 0x02 12112: 83 83 std Z+3, r24 ; 0x03 12114: 94 83 std Z+4, r25 ; 0x04 12116: 91 ce rjmp .-734 ; 0x11e3a 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)) { 12118: fe 85 ldd r31, Y+14 ; 0x0e 1211a: ff 23 and r31, r31 1211c: 09 f4 brne .+2 ; 0x12120 1211e: 02 cf rjmp .-508 ; 0x11f24 12120: 22 20 and r2, r2 12122: 09 f4 brne .+2 ; 0x12126 12124: fe ce rjmp .-516 ; 0x11f22 12126: fe ce rjmp .-516 ; 0x11f24 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)) { 12128: 28 89 ldd r18, Y+16 ; 0x10 1212a: 39 89 ldd r19, Y+17 ; 0x11 1212c: 4a 89 ldd r20, Y+18 ; 0x12 1212e: 5b 89 ldd r21, Y+19 ; 0x13 12130: 6a 85 ldd r22, Y+10 ; 0x0a 12132: 7b 85 ldd r23, Y+11 ; 0x0b 12134: 8c 85 ldd r24, Y+12 ; 0x0c 12136: 9d 85 ldd r25, Y+13 ; 0x0d 12138: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1213c: 18 16 cp r1, r24 1213e: 04 f1 brlt .+64 ; 0x12180 12140: 28 89 ldd r18, Y+16 ; 0x10 12142: 39 89 ldd r19, Y+17 ; 0x11 12144: 4a 89 ldd r20, Y+18 ; 0x12 12146: 5b 89 ldd r21, Y+19 ; 0x13 12148: 69 8d ldd r22, Y+25 ; 0x19 1214a: 7a 8d ldd r23, Y+26 ; 0x1a 1214c: 8b 8d ldd r24, Y+27 ; 0x1b 1214e: 9c 8d ldd r25, Y+28 ; 0x1c 12150: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 12154: 87 fd sbrc r24, 7 12156: 14 c0 rjmp .+40 ; 0x12180 12158: a5 01 movw r20, r10 1215a: 94 01 movw r18, r8 1215c: 6c 89 ldd r22, Y+20 ; 0x14 1215e: 7d 89 ldd r23, Y+21 ; 0x15 12160: 8e 89 ldd r24, Y+22 ; 0x16 12162: 9f 89 ldd r25, Y+23 ; 0x17 12164: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 12168: 18 16 cp r1, r24 1216a: 54 f0 brlt .+20 ; 0x12180 1216c: a5 01 movw r20, r10 1216e: 94 01 movw r18, r8 12170: 6d 8d ldd r22, Y+29 ; 0x1d 12172: 7e 8d ldd r23, Y+30 ; 0x1e 12174: 8f 8d ldd r24, Y+31 ; 0x1f 12176: 98 a1 ldd r25, Y+32 ; 0x20 12178: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1217c: 87 ff sbrs r24, 7 1217e: 05 c0 rjmp .+10 ; 0x1218a 12180: 11 23 and r17, r17 12182: 09 f4 brne .+2 ; 0x12186 12184: 52 cf rjmp .-348 ; 0x1202a 12186: 21 10 cpse r2, r1 12188: 50 cf rjmp .-352 ; 0x1202a mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 1218a: 10 e0 ldi r17, 0x00 ; 0 1218c: a7 e0 ldi r26, 0x07 ; 7 1218e: 8e 85 ldd r24, Y+14 ; 0x0e 12190: 9f 85 ldd r25, Y+15 ; 0x0f 12192: a8 9f mul r26, r24 12194: f0 01 movw r30, r0 12196: a9 9f mul r26, r25 12198: f0 0d add r31, r0 1219a: 11 24 eor r1, r1 1219c: e0 0f add r30, r16 1219e: f1 1f adc r31, r17 121a0: ee 0f add r30, r30 121a2: ff 1f adc r31, r31 121a4: ee 0f add r30, r30 121a6: ff 1f adc r31, r31 121a8: ee 53 subi r30, 0x3E ; 62 121aa: fc 4e sbci r31, 0xEC ; 236 121ac: 41 80 ldd r4, Z+1 ; 0x01 121ae: 52 80 ldd r5, Z+2 ; 0x02 121b0: 63 80 ldd r6, Z+3 ; 0x03 121b2: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 121b4: c1 2c mov r12, r1 121b6: d1 2c mov r13, r1 121b8: e0 ea ldi r30, 0xA0 ; 160 121ba: ee 2e mov r14, r30 121bc: e0 e4 ldi r30, 0x40 ; 64 121be: fe 2e mov r15, r30 121c0: 22 20 and r2, r2 121c2: 51 f0 breq .+20 ; 0x121d8 121c4: 23 e3 ldi r18, 0x33 ; 51 121c6: 33 e3 ldi r19, 0x33 ; 51 121c8: 43 eb ldi r20, 0xB3 ; 179 121ca: 5e e3 ldi r21, 0x3E ; 62 121cc: c3 01 movw r24, r6 121ce: b2 01 movw r22, r4 121d0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 121d4: 6b 01 movw r12, r22 121d6: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 121d8: a7 01 movw r20, r14 121da: 96 01 movw r18, r12 121dc: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 121e0: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 121e4: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 121e8: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 121ec: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 121f0: 87 ff sbrs r24, 7 121f2: 10 c0 rjmp .+32 ; 0x12214 current_position[Z_AXIS] = init_z_bckp; 121f4: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 121f8: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 121fc: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 12200: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12204: 65 e5 ldi r22, 0x55 ; 85 12206: 75 e5 ldi r23, 0x55 ; 85 12208: 85 e5 ldi r24, 0x55 ; 85 1220a: 91 e4 ldi r25, 0x41 ; 65 1220c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 12210: 0f 94 ef 42 call 0x285de ; 0x285de } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12214: 68 89 ldd r22, Y+16 ; 0x10 12216: 79 89 ldd r23, Y+17 ; 0x11 12218: 8a 89 ldd r24, Y+18 ; 0x12 1221a: 9b 89 ldd r25, Y+19 ; 0x13 1221c: 60 93 92 06 sts 0x0692, r22 ; 0x800692 12220: 70 93 93 06 sts 0x0693, r23 ; 0x800693 12224: 80 93 94 06 sts 0x0694, r24 ; 0x800694 12228: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = y_pos; 1222c: 80 92 96 06 sts 0x0696, r8 ; 0x800696 12230: 90 92 97 06 sts 0x0697, r9 ; 0x800697 12234: a0 92 98 06 sts 0x0698, r10 ; 0x800698 12238: b0 92 99 06 sts 0x0699, r11 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1223c: 66 e9 ldi r22, 0x96 ; 150 1223e: 76 e0 ldi r23, 0x06 ; 6 12240: 82 e9 ldi r24, 0x92 ; 146 12242: 96 e0 ldi r25, 0x06 ; 6 12244: 0e 94 b1 6a call 0xd562 ; 0xd562 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 12248: 60 e0 ldi r22, 0x00 ; 0 1224a: 70 e0 ldi r23, 0x00 ; 0 1224c: 86 e1 ldi r24, 0x16 ; 22 1224e: 93 e4 ldi r25, 0x43 ; 67 12250: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 12254: 0f 94 ef 42 call 0x285de ; 0x285de if (planner_aborted) 12258: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 1225c: 88 23 and r24, r24 1225e: 39 f0 breq .+14 ; 0x1226e { custom_message_type = custom_message_type_old; 12260: 7f 81 ldd r23, Y+7 ; 0x07 12262: 70 93 c4 06 sts 0x06C4, r23 ; 0x8006c4 custom_message_state = custom_message_state_old; 12266: 88 85 ldd r24, Y+8 ; 0x08 12268: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 1226c: fb cc rjmp .-1546 ; 0x11c64 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 1226e: 81 2c mov r8, r1 12270: 91 2c mov r9, r1 12272: 70 e2 ldi r23, 0x20 ; 32 12274: a7 2e mov r10, r23 12276: 71 ec ldi r23, 0xC1 ; 193 12278: b7 2e mov r11, r23 1227a: 22 20 and r2, r2 1227c: 51 f0 breq .+20 ; 0x12292 1227e: 2a 81 ldd r18, Y+2 ; 0x02 12280: 3b 81 ldd r19, Y+3 ; 0x03 12282: 4c 81 ldd r20, Y+4 ; 0x04 12284: 5d 81 ldd r21, Y+5 ; 0x05 12286: c3 01 movw r24, r6 12288: b2 01 movw r22, r4 1228a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1228e: 4b 01 movw r8, r22 12290: 5c 01 movw r10, r24 12292: 48 8d ldd r20, Y+24 ; 0x18 12294: c5 01 movw r24, r10 12296: b4 01 movw r22, r8 12298: 0f 94 5e 8c call 0x318bc ; 0x318bc 1229c: 81 11 cpse r24, r1 1229e: 0b c0 rjmp .+22 ; 0x122b6 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)); 122a0: 81 e5 ldi r24, 0x51 ; 81 122a2: 94 e6 ldi r25, 0x64 ; 100 122a4: 0e 94 b3 72 call 0xe566 ; 0xe566 122a8: 9f 93 push r25 122aa: 8f 93 push r24 122ac: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 122b0: 0f 90 pop r0 122b2: 0f 90 pop r0 122b4: be ce rjmp .-644 ; 0x12032 // 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. 122b6: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 122ba: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 122be: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 122c2: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 122c6: c7 01 movw r24, r14 122c8: b6 01 movw r22, r12 122ca: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 122ce: 20 e0 ldi r18, 0x00 ; 0 122d0: 30 e0 ldi r19, 0x00 ; 0 122d2: a9 01 movw r20, r18 122d4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 122d8: 87 ff sbrs r24, 7 122da: 36 c0 rjmp .+108 ; 0x12348 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 122dc: 60 e0 ldi r22, 0x00 ; 0 122de: 70 e0 ldi r23, 0x00 ; 0 122e0: 80 ea ldi r24, 0xA0 ; 160 122e2: 90 e4 ldi r25, 0x40 ; 64 122e4: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 122e8: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 122ec: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 122f0: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 122f4: 65 e5 ldi r22, 0x55 ; 85 122f6: 75 e5 ldi r23, 0x55 ; 85 122f8: 85 e5 ldi r24, 0x55 ; 85 122fa: 91 e4 ldi r25, 0x41 ; 65 122fc: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 12300: 0f 94 ef 42 call 0x285de ; 0x285de 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 12304: 48 8d ldd r20, Y+24 ; 0x18 12306: c5 01 movw r24, r10 12308: b4 01 movw r22, r8 1230a: 0f 94 5e 8c call 0x318bc ; 0x318bc 1230e: 88 23 and r24, r24 12310: 39 f2 breq .-114 ; 0x122a0 printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 12312: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 12316: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 1231a: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 1231e: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 12322: 60 e0 ldi r22, 0x00 ; 0 12324: 70 e0 ldi r23, 0x00 ; 0 12326: 80 ea ldi r24, 0xA0 ; 160 12328: 90 e4 ldi r25, 0x40 ; 64 1232a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1232e: 2d ec ldi r18, 0xCD ; 205 12330: 3c ec ldi r19, 0xCC ; 204 12332: 4c ec ldi r20, 0xCC ; 204 12334: 5d e3 ldi r21, 0x3D ; 61 12336: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1233a: 87 ff sbrs r24, 7 1233c: 05 c0 rjmp .+10 ; 0x12348 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1233e: 8d ec ldi r24, 0xCD ; 205 12340: 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")); 12342: 0f 94 0c db call 0x3b618 ; 0x3b618 12346: 75 ce rjmp .-790 ; 0x12032 12348: c0 90 9a 06 lds r12, 0x069A ; 0x80069a 1234c: d0 90 9b 06 lds r13, 0x069B ; 0x80069b 12350: e0 90 9c 06 lds r14, 0x069C ; 0x80069c 12354: 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 12358: 22 20 and r2, r2 1235a: a1 f0 breq .+40 ; 0x12384 1235c: a7 01 movw r20, r14 1235e: 96 01 movw r18, r12 12360: c3 01 movw r24, r6 12362: b2 01 movw r22, r4 12364: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 12368: 9b 01 movw r18, r22 1236a: ac 01 movw r20, r24 1236c: 5f 77 andi r21, 0x7F ; 127 1236e: 6a 81 ldd r22, Y+2 ; 0x02 12370: 7b 81 ldd r23, Y+3 ; 0x03 12372: 8c 81 ldd r24, Y+4 ; 0x04 12374: 9d 81 ldd r25, Y+5 ; 0x05 12376: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1237a: 87 ff sbrs r24, 7 1237c: 03 c0 rjmp .+6 ; 0x12384 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 1237e: 84 e9 ldi r24, 0x94 ; 148 12380: 9c e7 ldi r25, 0x7C ; 124 12382: df cf rjmp .-66 ; 0x12342 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12384: 8f ea ldi r24, 0xAF ; 175 12386: 9f e0 ldi r25, 0x0F ; 15 12388: 0f 94 23 dc call 0x3b846 ; 0x3b846 1238c: 88 23 and r24, r24 1238e: 09 f4 brne .+2 ; 0x12392 12390: 40 c0 rjmp .+128 ; 0x12412 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); } 12392: 86 ea ldi r24, 0xA6 ; 166 12394: 9f e0 ldi r25, 0x0F ; 15 12396: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (!calibration_status_pinda()) return 0; 1239a: 88 23 and r24, r24 1239c: d1 f1 breq .+116 ; 0x12412 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 1239e: 60 91 99 03 lds r22, 0x0399 ; 0x800399 123a2: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 123a6: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 123aa: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 123ae: 0e 94 91 5c call 0xb922 ; 0xb922 123b2: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 123b6: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 123ba: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 123be: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 123c2: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 123c6: 9b 01 movw r18, r22 123c8: ac 01 movw r20, r24 123ca: e7 e0 ldi r30, 0x07 ; 7 123cc: ae 85 ldd r26, Y+14 ; 0x0e 123ce: bf 85 ldd r27, Y+15 ; 0x0f 123d0: ea 9f mul r30, r26 123d2: c0 01 movw r24, r0 123d4: eb 9f mul r30, r27 123d6: 90 0d add r25, r0 123d8: 11 24 eor r1, r1 123da: 08 0f add r16, r24 123dc: 19 1f adc r17, r25 123de: 00 0f add r16, r16 123e0: 11 1f adc r17, r17 123e2: 00 0f add r16, r16 123e4: 11 1f adc r17, r17 123e6: 0e 53 subi r16, 0x3E ; 62 123e8: 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; 123ea: c7 01 movw r24, r14 123ec: b6 01 movw r22, r12 123ee: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 123f2: d8 01 movw r26, r16 123f4: 11 96 adiw r26, 0x01 ; 1 123f6: 6d 93 st X+, r22 123f8: 7d 93 st X+, r23 123fa: 8d 93 st X+, r24 123fc: 9c 93 st X, r25 123fe: 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--; 12400: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 12404: 81 50 subi r24, 0x01 ; 1 12406: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 mesh_point++; lcd_update(1); 1240a: 81 e0 ldi r24, 0x01 ; 1 1240c: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 12410: 0c ce rjmp .-1000 ; 0x1202a } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12412: 20 e0 ldi r18, 0x00 ; 0 12414: 30 e0 ldi r19, 0x00 ; 0 12416: a9 01 movw r20, r18 12418: d8 cf rjmp .-80 ; 0x123ca 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); 1241a: 85 e0 ldi r24, 0x05 ; 5 1241c: 0f 94 0e 4e call 0x29c1c ; 0x29c1c 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; 12420: c1 2c mov r12, r1 12422: d1 2c mov r13, r1 12424: 90 ea ldi r25, 0xA0 ; 160 12426: e9 2e mov r14, r25 12428: 90 e4 ldi r25, 0x40 ; 64 1242a: 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)); 1242c: 82 e1 ldi r24, 0x12 ; 18 1242e: 96 e3 ldi r25, 0x36 ; 54 12430: 0e 94 b3 72 call 0xe566 ; 0xe566 12434: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 12438: 8e e1 ldi r24, 0x1E ; 30 1243a: 90 e0 ldi r25, 0x00 ; 0 1243c: 0f 94 36 3a call 0x2746c ; 0x2746c calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 12440: 0e 94 45 73 call 0xe68a ; 0xe68a #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); 12444: 80 e0 ldi r24, 0x00 ; 0 12446: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 1244a: 18 2f mov r17, r24 raise_z(-1); 1244c: 60 e0 ldi r22, 0x00 ; 0 1244e: 70 e0 ldi r23, 0x00 ; 0 12450: 80 e8 ldi r24, 0x80 ; 128 12452: 9f eb ldi r25, 0xBF ; 191 12454: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 enable_z_endstop(true); 12458: 81 e0 ldi r24, 0x01 ; 1 1245a: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1245e: 84 e0 ldi r24, 0x04 ; 4 12460: 0f 94 df 25 call 0x24bbe ; 0x24bbe #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12464: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 12468: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 1246c: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 12470: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12474: 65 e5 ldi r22, 0x55 ; 85 12476: 75 e5 ldi r23, 0x55 ; 85 12478: 85 e5 ldi r24, 0x55 ; 85 1247a: 91 e4 ldi r25, 0x41 ; 65 1247c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 12480: 0f 94 ef 42 call 0x285de ; 0x285de #ifdef TMC2130 tmc2130_home_exit(); 12484: 0f 94 b0 25 call 0x24b60 ; 0x24b60 #endif // TMC2130 enable_z_endstop(bState); 12488: 81 2f mov r24, r17 1248a: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 1248e: 82 e0 ldi r24, 0x02 ; 2 12490: 0f 94 db 42 call 0x285b6 ; 0x285b6 12494: 20 e0 ldi r18, 0x00 ; 0 12496: 30 e0 ldi r19, 0x00 ; 0 12498: 40 ea ldi r20, 0xA0 ; 160 1249a: 50 e4 ldi r21, 0x40 ; 64 1249c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 124a0: 18 16 cp r1, r24 124a2: 24 f2 brlt .-120 ; 0x1242c custom_message_type = custom_message_type_old; 124a4: ef 81 ldd r30, Y+7 ; 0x07 124a6: e0 93 c4 06 sts 0x06C4, r30 ; 0x8006c4 custom_message_state = custom_message_state_old; 124aa: f8 85 ldd r31, Y+8 ; 0x08 124ac: f0 93 f7 03 sts 0x03F7, r31 ; 0x8003f7 lcd_update_enable(true); // display / status-line recovery 124b0: 81 e0 ldi r24, 0x01 ; 1 124b2: 0e 94 2c 6f call 0xde58 ; 0xde58 gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 124b6: 41 e0 ldi r20, 0x01 ; 1 124b8: 61 e0 ldi r22, 0x01 ; 1 124ba: 81 e0 ldi r24, 0x01 ; 1 124bc: 0e 94 0c 7f call 0xfe18 ; 0xfe18 124c0: 81 e0 ldi r24, 0x01 ; 1 124c2: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 124c6: ce cb rjmp .-2148 ; 0x11c64 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 124c8: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a clean_up_after_endstop_move(l_feedmultiply); 124cc: 8b a1 ldd r24, Y+35 ; 0x23 124ce: 9c a1 ldd r25, Y+36 ; 0x24 124d0: 0e 94 d5 66 call 0xcdaa ; 0xcdaa } } void babystep_apply() { babystep_load(); 124d4: 0f 94 8c c9 call 0x39318 ; 0x39318 shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 124d8: 60 91 8a 06 lds r22, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> 124dc: 70 91 8b 06 lds r23, 0x068B ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 124e0: 07 2e mov r0, r23 124e2: 00 0c add r0, r0 124e4: 88 0b sbc r24, r24 124e6: 99 0b sbc r25, r25 124e8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 124ec: 90 58 subi r25, 0x80 ; 128 124ee: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 124f2: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 124f6: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 124fa: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 124fe: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 12502: 0f 94 a8 c9 call 0x39350 ; 0x39350 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; 12506: 80 ec ldi r24, 0xC0 ; 192 12508: 9f e0 ldi r25, 0x0F ; 15 1250a: 0f 94 23 dc call 0x3b846 ; 0x3b846 1250e: 91 e0 ldi r25, 0x01 ; 1 12510: 81 30 cpi r24, 0x01 ; 1 12512: 09 f0 breq .+2 ; 0x12516 12514: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12516: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 12518: 4f eb ldi r20, 0xBF ; 191 1251a: 5f e0 ldi r21, 0x0F ; 15 1251c: 6c e4 ldi r22, 0x4C ; 76 1251e: ce 01 movw r24, r28 12520: 01 96 adiw r24, 0x01 ; 1 12522: 0e 94 f2 5b call 0xb7e4 ; 0xb7e4 12526: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 12528: 4e eb ldi r20, 0xBE ; 190 1252a: 5f e0 ldi r21, 0x0F ; 15 1252c: 62 e5 ldi r22, 0x52 ; 82 1252e: ce 01 movw r24, r28 12530: 01 96 adiw r24, 0x01 ; 1 12532: 0e 94 f2 5b call 0xb7e4 ; 0xb7e4 12536: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 12538: 4d eb ldi r20, 0xBD ; 189 1253a: 5f e0 ldi r21, 0x0F ; 15 1253c: 66 e4 ldi r22, 0x46 ; 70 1253e: ce 01 movw r24, r28 12540: 01 96 adiw r24, 0x01 ; 1 12542: 0e 94 f2 5b call 0xb7e4 ; 0xb7e4 12546: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 12548: 4c eb ldi r20, 0xBC ; 188 1254a: 5f e0 ldi r21, 0x0F ; 15 1254c: 62 e4 ldi r22, 0x42 ; 66 1254e: ce 01 movw r24, r28 12550: 01 96 adiw r24, 0x01 ; 1 12552: 0e 94 f2 5b call 0xb7e4 ; 0xb7e4 12556: 21 2f mov r18, r17 12558: 11 0f add r17, r17 1255a: 33 0b sbc r19, r19 1255c: 08 2e mov r0, r24 1255e: 00 0c add r0, r0 12560: 99 0b sbc r25, r25 12562: 5c 01 movw r10, r24 12564: a2 1a sub r10, r18 12566: b3 0a sbc r11, r19 12568: 8f 2d mov r24, r15 1256a: ff 0c add r15, r15 1256c: 99 0b sbc r25, r25 1256e: 28 0f add r18, r24 12570: 39 1f adc r19, r25 12572: 46 e0 ldi r20, 0x06 ; 6 12574: 42 9f mul r20, r18 12576: 60 01 movw r12, r0 12578: 43 9f mul r20, r19 1257a: d0 0c add r13, r0 1257c: 11 24 eor r1, r1 1257e: f1 2c mov r15, r1 12580: e1 2c mov r14, r1 12582: 00 2e mov r0, r16 12584: 00 0c add r0, r0 12586: 11 0b sbc r17, r17 12588: 08 1b sub r16, r24 1258a: 19 0b sbc r17, r25 1258c: b7 01 movw r22, r14 1258e: 6d 53 subi r22, 0x3D ; 61 12590: 7c 4e sbci r23, 0xEC ; 236 12592: 3b 01 movw r6, r22 12594: 46 01 movw r8, r12 12596: 77 e0 ldi r23, 0x07 ; 7 12598: 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 * ( 1259a: d3 01 movw r26, r6 1259c: 2d 90 ld r2, X+ 1259e: 3d 90 ld r3, X+ 125a0: 4d 90 ld r4, X+ 125a2: 5d 90 ld r5, X+ 125a4: 3d 01 movw r6, r26 125a6: fd 01 movw r30, r26 125a8: 34 97 sbiw r30, 0x04 ; 4 125aa: fb 87 std Y+11, r31 ; 0x0b 125ac: ea 87 std Y+10, r30 ; 0x0a 125ae: b4 01 movw r22, r8 125b0: 09 2c mov r0, r9 125b2: 00 0c add r0, r0 125b4: 88 0b sbc r24, r24 125b6: 99 0b sbc r25, r25 125b8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 125bc: 2f e3 ldi r18, 0x3F ; 63 125be: 33 ec ldi r19, 0xC3 ; 195 125c0: 4e e2 ldi r20, 0x2E ; 46 125c2: 59 e3 ldi r21, 0x39 ; 57 125c4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 125c8: a2 01 movw r20, r4 125ca: 91 01 movw r18, r2 125cc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 125d0: aa 85 ldd r26, Y+10 ; 0x0a 125d2: bb 85 ldd r27, Y+11 ; 0x0b 125d4: 6d 93 st X+, r22 125d6: 7d 93 st X+, r23 125d8: 8d 93 st X+, r24 125da: 9c 93 st X, r25 125dc: 13 97 sbiw r26, 0x03 ; 3 125de: ba 81 ldd r27, Y+2 ; 0x02 125e0: b1 50 subi r27, 0x01 ; 1 125e2: ba 83 std Y+2, r27 ; 0x02 125e4: 80 0e add r8, r16 125e6: 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++) { 125e8: b1 11 cpse r27, r1 125ea: d7 cf rjmp .-82 ; 0x1259a 125ec: ca 0c add r12, r10 125ee: db 1c adc r13, r11 125f0: ec e1 ldi r30, 0x1C ; 28 125f2: ee 0e add r14, r30 125f4: 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++) { 125f6: f4 ec ldi r31, 0xC4 ; 196 125f8: ef 16 cp r14, r31 125fa: f1 04 cpc r15, r1 125fc: 39 f6 brne .-114 ; 0x1258c + 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) 125fe: 0f 94 fd a2 call 0x345fa ; 0x345fa { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 12602: 8d e4 ldi r24, 0x4D ; 77 12604: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 12608: 88 23 and r24, r24 1260a: 09 f4 brne .+2 ; 0x1260e 1260c: 84 c0 rjmp .+264 ; 0x12716 1260e: 0e 94 6f 5b call 0xb6de ; 0xb6de if (nMeasPoints == 7 && useMagnetCompensation) { 12612: 2e 81 ldd r18, Y+6 ; 0x06 12614: 27 30 cpi r18, 0x07 ; 7 12616: 09 f0 breq .+2 ; 0x1261a 12618: 94 c0 rjmp .+296 ; 0x12742 1261a: 88 23 and r24, r24 1261c: 09 f4 brne .+2 ; 0x12620 1261e: 91 c0 rjmp .+290 ; 0x12742 12620: bb 24 eor r11, r11 12622: b3 94 inc r11 12624: aa 24 eor r10, r10 12626: aa 94 dec r10 12628: ab 0c add r10, r11 1262a: 09 a1 ldd r16, Y+33 ; 0x21 1262c: 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++) { 1262e: 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++; } 12630: 8e ef ldi r24, 0xFE ; 254 12632: 88 2e mov r8, r24 12634: 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)) { 12636: 6a 2d mov r22, r10 12638: 86 2d mov r24, r6 1263a: 0f 94 57 c9 call 0x392ae ; 0x392ae 1263e: 99 24 eor r9, r9 12640: 93 94 inc r9 12642: 96 0c add r9, r6 12644: 81 11 cpse r24, r1 12646: 6e c0 rjmp .+220 ; 0x12724 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++; } 12648: 6b 2d mov r22, r11 1264a: 86 2d mov r24, r6 1264c: 0f 94 57 c9 call 0x392ae ; 0x392ae } 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; 12650: c1 2c mov r12, r1 12652: d1 2c mov r13, r1 12654: 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; 12656: 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++; } 12658: 88 23 and r24, r24 1265a: 81 f0 breq .+32 ; 0x1267c 1265c: 20 e0 ldi r18, 0x00 ; 0 1265e: 30 e0 ldi r19, 0x00 ; 0 12660: a9 01 movw r20, r18 12662: d8 01 movw r26, r16 12664: 5d 96 adiw r26, 0x1d ; 29 12666: 6d 91 ld r22, X+ 12668: 7d 91 ld r23, X+ 1266a: 8d 91 ld r24, X+ 1266c: 9c 91 ld r25, X 1266e: 90 97 sbiw r26, 0x20 ; 32 12670: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 12674: 6b 01 movw r12, r22 12676: 7c 01 movw r14, r24 12678: 77 24 eor r7, r7 1267a: 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++; } 1267c: 68 2d mov r22, r8 1267e: 86 2d mov r24, r6 12680: 0f 94 57 c9 call 0x392ae ; 0x392ae 12684: 88 23 and r24, r24 12686: 69 f0 breq .+26 ; 0x126a2 12688: f8 01 movw r30, r16 1268a: 7b 97 sbiw r30, 0x1b ; 27 1268c: 20 81 ld r18, Z 1268e: 31 81 ldd r19, Z+1 ; 0x01 12690: 42 81 ldd r20, Z+2 ; 0x02 12692: 53 81 ldd r21, Z+3 ; 0x03 12694: c7 01 movw r24, r14 12696: b6 01 movw r22, r12 12698: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1269c: 6b 01 movw r12, r22 1269e: 7c 01 movw r14, r24 126a0: 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++; } 126a2: 6a 2d mov r22, r10 126a4: 89 2d mov r24, r9 126a6: 0f 94 57 c9 call 0x392ae ; 0x392ae 126aa: 88 23 and r24, r24 126ac: 61 f0 breq .+24 ; 0x126c6 126ae: f8 01 movw r30, r16 126b0: 25 81 ldd r18, Z+5 ; 0x05 126b2: 36 81 ldd r19, Z+6 ; 0x06 126b4: 47 81 ldd r20, Z+7 ; 0x07 126b6: 50 85 ldd r21, Z+8 ; 0x08 126b8: c7 01 movw r24, r14 126ba: b6 01 movw r22, r12 126bc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 126c0: 6b 01 movw r12, r22 126c2: 7c 01 movw r14, r24 126c4: 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++; } 126c6: 6a 2d mov r22, r10 126c8: 8f ef ldi r24, 0xFF ; 255 126ca: 86 0d add r24, r6 126cc: 0f 94 57 c9 call 0x392ae ; 0x392ae 126d0: 88 23 and r24, r24 126d2: 31 f1 breq .+76 ; 0x12720 126d4: f8 01 movw r30, r16 126d6: 33 97 sbiw r30, 0x03 ; 3 126d8: 20 81 ld r18, Z 126da: 31 81 ldd r19, Z+1 ; 0x01 126dc: 42 81 ldd r20, Z+2 ; 0x02 126de: 53 81 ldd r21, Z+3 ; 0x03 126e0: c7 01 movw r24, r14 126e2: b6 01 movw r22, r12 126e4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 126e8: 6b 01 movw r12, r22 126ea: 7c 01 movw r14, r24 126ec: 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 126ee: 67 2d mov r22, r7 126f0: 70 e0 ldi r23, 0x00 ; 0 126f2: 90 e0 ldi r25, 0x00 ; 0 126f4: 80 e0 ldi r24, 0x00 ; 0 126f6: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 126fa: 9b 01 movw r18, r22 126fc: ac 01 movw r20, r24 126fe: c7 01 movw r24, r14 12700: b6 01 movw r22, r12 12702: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 12706: d8 01 movw r26, r16 12708: 11 96 adiw r26, 0x01 ; 1 1270a: 6d 93 st X+, r22 1270c: 7d 93 st X+, r23 1270e: 8d 93 st X+, r24 12710: 9c 93 st X, r25 12712: 14 97 sbiw r26, 0x04 ; 4 12714: 07 c0 rjmp .+14 ; 0x12724 } 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); 12716: 8c ea ldi r24, 0xAC ; 172 12718: 9d e0 ldi r25, 0x0D ; 13 1271a: 0f 94 23 dc call 0x3b846 ; 0x3b846 1271e: 79 cf rjmp .-270 ; 0x12612 12720: 71 10 cpse r7, r1 12722: e5 cf rjmp .-54 ; 0x126ee //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++) { 12724: 69 2c mov r6, r9 12726: 0c 5f subi r16, 0xFC ; 252 12728: 1f 4f sbci r17, 0xFF ; 255 1272a: b7 e0 ldi r27, 0x07 ; 7 1272c: 9b 12 cpse r9, r27 1272e: 83 cf rjmp .-250 ; 0x12636 12730: b3 94 inc r11 12732: e9 a1 ldd r30, Y+33 ; 0x21 12734: fa a1 ldd r31, Y+34 ; 0x22 12736: 7c 96 adiw r30, 0x1c ; 28 12738: fa a3 std Y+34, r31 ; 0x22 1273a: 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++) { 1273c: f8 e0 ldi r31, 0x08 ; 8 1273e: bf 12 cpse r11, r31 12740: 71 cf rjmp .-286 ; 0x12624 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12742: 81 e0 ldi r24, 0x01 ; 1 12744: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 if (code_seen('O') && !code_value_uint8()) { 12748: 8f e4 ldi r24, 0x4F ; 79 1274a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1274e: 81 11 cpse r24, r1 12750: 03 c0 rjmp .+6 ; 0x12758 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12752: 0f 94 fd c9 call 0x393fa ; 0x393fa 12756: 9b cc rjmp .-1738 ; 0x1208e } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 12758: 0e 94 6f 5b call 0xb6de ; 0xb6de 1275c: 81 11 cpse r24, r1 1275e: f9 cf rjmp .-14 ; 0x12752 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12760: 0e 94 ca 66 call 0xcd94 ; 0xcd94 12764: 94 cc rjmp .-1752 ; 0x1208e 00012766 : //! @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() { 12766: 4f 92 push r4 12768: 5f 92 push r5 1276a: 6f 92 push r6 1276c: 7f 92 push r7 1276e: 8f 92 push r8 12770: 9f 92 push r9 12772: af 92 push r10 12774: bf 92 push r11 12776: ef 92 push r14 12778: ff 92 push r15 1277a: 0f 93 push r16 1277c: 1f 93 push r17 1277e: cf 93 push r28 12780: df 93 push r29 12782: 1f 92 push r1 12784: cd b7 in r28, 0x3d ; 61 12786: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 12788: 44 e0 ldi r20, 0x04 ; 4 1278a: 50 e0 ldi r21, 0x00 ; 0 1278c: 64 e1 ldi r22, 0x14 ; 20 1278e: 70 e0 ldi r23, 0x00 ; 0 12790: 8e eb ldi r24, 0xBE ; 190 12792: 9d e0 ldi r25, 0x0D ; 13 12794: 0f 94 13 dc call 0x3b826 ; 0x3b826 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 12798: 43 e0 ldi r20, 0x03 ; 3 1279a: 50 e0 ldi r21, 0x00 ; 0 1279c: 63 e2 ldi r22, 0x23 ; 35 1279e: 78 e7 ldi r23, 0x78 ; 120 127a0: 8e eb ldi r24, 0xBE ; 190 127a2: 9d e0 ldi r25, 0x0D ; 13 127a4: 0f 94 02 da call 0x3b404 ; 0x3b404 127a8: 89 2b or r24, r25 127aa: 09 f0 breq .+2 ; 0x127ae 127ac: a0 c1 rjmp .+832 ; 0x12aee { // 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)); 127ae: e7 ee ldi r30, 0xE7 ; 231 127b0: f8 e7 ldi r31, 0x78 ; 120 127b2: 45 91 lpm r20, Z+ 127b4: 55 91 lpm r21, Z+ 127b6: 65 91 lpm r22, Z+ 127b8: 74 91 lpm r23, Z 127ba: 88 ed ldi r24, 0xD8 ; 216 127bc: 90 e0 ldi r25, 0x00 ; 0 127be: 0e 94 2e 64 call 0xc85c ; 0xc85c eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 127c2: eb ee ldi r30, 0xEB ; 235 127c4: f8 e7 ldi r31, 0x78 ; 120 127c6: 45 91 lpm r20, Z+ 127c8: 55 91 lpm r21, Z+ 127ca: 65 91 lpm r22, Z+ 127cc: 74 91 lpm r23, Z 127ce: 8c ed ldi r24, 0xDC ; 220 127d0: 90 e0 ldi r25, 0x00 ; 0 127d2: 0e 94 2e 64 call 0xc85c ; 0xc85c eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 127d6: ef ee ldi r30, 0xEF ; 239 127d8: f8 e7 ldi r31, 0x78 ; 120 127da: 64 91 lpm r22, Z 127dc: 80 ee ldi r24, 0xE0 ; 224 127de: 90 e0 ldi r25, 0x00 ; 0 127e0: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 127e4: e0 ef ldi r30, 0xF0 ; 240 127e6: f8 e7 ldi r31, 0x78 ; 120 127e8: 65 91 lpm r22, Z+ 127ea: 74 91 lpm r23, Z 127ec: 81 ee ldi r24, 0xE1 ; 225 127ee: 90 e0 ldi r25, 0x00 ; 0 127f0: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 127f4: e2 ef ldi r30, 0xF2 ; 242 127f6: f8 e7 ldi r31, 0x78 ; 120 127f8: 65 91 lpm r22, Z+ 127fa: 74 91 lpm r23, Z 127fc: 83 ee ldi r24, 0xE3 ; 227 127fe: 90 e0 ldi r25, 0x00 ; 0 12800: 0e 94 f8 75 call 0xebf0 ; 0xebf0 // 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)); 12804: e3 ee ldi r30, 0xE3 ; 227 12806: f8 e7 ldi r31, 0x78 ; 120 12808: 45 91 lpm r20, Z+ 1280a: 55 91 lpm r21, Z+ 1280c: 65 91 lpm r22, Z+ 1280e: 74 91 lpm r23, Z 12810: 84 ed ldi r24, 0xD4 ; 212 12812: 90 e0 ldi r25, 0x00 ; 0 12814: 0e 94 2e 64 call 0xc85c ; 0xc85c // 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); 12818: 4f eb ldi r20, 0xBF ; 191 1281a: 58 e7 ldi r21, 0x78 ; 120 1281c: 60 e1 ldi r22, 0x10 ; 16 1281e: 70 e0 ldi r23, 0x00 ; 0 12820: 80 eb ldi r24, 0xB0 ; 176 12822: 90 e0 ldi r25, 0x00 ; 0 12824: 0e 94 d9 75 call 0xebb2 ; 0xebb2 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); 12828: 4f ec ldi r20, 0xCF ; 207 1282a: 58 e7 ldi r21, 0x78 ; 120 1282c: 60 e1 ldi r22, 0x10 ; 16 1282e: 70 e0 ldi r23, 0x00 ; 0 12830: 80 ec ldi r24, 0xC0 ; 192 12832: 90 e0 ldi r25, 0x00 ; 0 12834: 0e 94 d9 75 call 0xebb2 ; 0xebb2 #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 12838: 4f ed ldi r20, 0xDF ; 223 1283a: 58 e7 ldi r21, 0x78 ; 120 1283c: 64 e0 ldi r22, 0x04 ; 4 1283e: 70 e0 ldi r23, 0x00 ; 0 12840: 80 ed ldi r24, 0xD0 ; 208 12842: 90 e0 ldi r25, 0x00 ; 0 12844: 0e 94 d9 75 call 0xebb2 ; 0xebb2 #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 12848: 41 ed ldi r20, 0xD1 ; 209 1284a: 50 e0 ldi r21, 0x00 ; 0 1284c: 64 e1 ldi r22, 0x14 ; 20 1284e: 70 e0 ldi r23, 0x00 ; 0 12850: 8e eb ldi r24, 0xBE ; 190 12852: 9d e0 ldi r25, 0x0D ; 13 12854: 0f 94 13 dc call 0x3b826 ; 0x3b826 calculate_extruder_multipliers(); 12858: 0e 94 c0 65 call 0xcb80 ; 0xcb80 1285c: 0e eb ldi r16, 0xBE ; 190 1285e: 1d e0 ldi r17, 0x0D ; 13 12860: 8a e5 ldi r24, 0x5A ; 90 12862: e8 2e mov r14, r24 12864: 8e e0 ldi r24, 0x0E ; 14 12866: 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; 12868: 94 ec ldi r25, 0xC4 ; 196 1286a: 89 2e mov r8, r25 1286c: 99 e0 ldi r25, 0x09 ; 9 1286e: 99 2e mov r9, r25 12870: a1 2c mov r10, r1 12872: 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; 12874: 20 ec ldi r18, 0xC0 ; 192 12876: 42 2e mov r4, r18 12878: 23 e0 ldi r18, 0x03 ; 3 1287a: 52 2e mov r5, r18 1287c: 61 2c mov r6, r1 1287e: 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) 12880: 20 e0 ldi r18, 0x00 ; 0 12882: 30 e0 ldi r19, 0x00 ; 0 12884: 48 e4 ldi r20, 0x48 ; 72 12886: 53 e4 ldi r21, 0x43 ; 67 12888: f8 01 movw r30, r16 1288a: 64 89 ldd r22, Z+20 ; 0x14 1288c: 75 89 ldd r23, Z+21 ; 0x15 1288e: 86 89 ldd r24, Z+22 ; 0x16 12890: 97 89 ldd r25, Z+23 ; 0x17 12892: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 12896: 18 16 cp r1, r24 12898: 4c f4 brge .+18 ; 0x128ac cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 1289a: 80 e0 ldi r24, 0x00 ; 0 1289c: 90 e0 ldi r25, 0x00 ; 0 1289e: a8 e4 ldi r26, 0x48 ; 72 128a0: b3 e4 ldi r27, 0x43 ; 67 128a2: f8 01 movw r30, r16 128a4: 84 8b std Z+20, r24 ; 0x14 128a6: 95 8b std Z+21, r25 ; 0x15 128a8: a6 8b std Z+22, r26 ; 0x16 128aa: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 128ac: f7 01 movw r30, r14 128ae: 61 91 ld r22, Z+ 128b0: 71 91 ld r23, Z+ 128b2: 81 91 ld r24, Z+ 128b4: 91 91 ld r25, Z+ 128b6: 7f 01 movw r14, r30 128b8: 20 e0 ldi r18, 0x00 ; 0 128ba: 30 e0 ldi r19, 0x00 ; 0 128bc: 48 ec ldi r20, 0xC8 ; 200 128be: 52 e4 ldi r21, 0x42 ; 66 128c0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 128c4: 18 16 cp r1, r24 128c6: 54 f4 brge .+20 ; 0x128dc cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 128c8: 80 e0 ldi r24, 0x00 ; 0 128ca: 90 e0 ldi r25, 0x00 ; 0 128cc: a8 ec ldi r26, 0xC8 ; 200 128ce: b2 e4 ldi r27, 0x42 ; 66 128d0: f7 01 movw r30, r14 128d2: 34 97 sbiw r30, 0x04 ; 4 128d4: 80 83 st Z, r24 128d6: 91 83 std Z+1, r25 ; 0x01 128d8: a2 83 std Z+2, r26 ; 0x02 128da: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 128dc: f8 01 movw r30, r16 128de: 84 a1 ldd r24, Z+36 ; 0x24 128e0: 95 a1 ldd r25, Z+37 ; 0x25 128e2: a6 a1 ldd r26, Z+38 ; 0x26 128e4: b7 a1 ldd r27, Z+39 ; 0x27 128e6: 85 3c cpi r24, 0xC5 ; 197 128e8: 99 40 sbci r25, 0x09 ; 9 128ea: a1 05 cpc r26, r1 128ec: b1 05 cpc r27, r1 128ee: 28 f0 brcs .+10 ; 0x128fa cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 128f0: f8 01 movw r30, r16 128f2: 84 a2 std Z+36, r8 ; 0x24 128f4: 95 a2 std Z+37, r9 ; 0x25 128f6: a6 a2 std Z+38, r10 ; 0x26 128f8: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 128fa: f7 01 movw r30, r14 128fc: 84 85 ldd r24, Z+12 ; 0x0c 128fe: 95 85 ldd r25, Z+13 ; 0x0d 12900: a6 85 ldd r26, Z+14 ; 0x0e 12902: b7 85 ldd r27, Z+15 ; 0x0f 12904: 81 3c cpi r24, 0xC1 ; 193 12906: 93 40 sbci r25, 0x03 ; 3 12908: a1 05 cpc r26, r1 1290a: b1 05 cpc r27, r1 1290c: 28 f0 brcs .+10 ; 0x12918 cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 1290e: f7 01 movw r30, r14 12910: 44 86 std Z+12, r4 ; 0x0c 12912: 55 86 std Z+13, r5 ; 0x0d 12914: 66 86 std Z+14, r6 ; 0x0e 12916: 77 86 std Z+15, r7 ; 0x0f 12918: 0c 5f subi r16, 0xFC ; 252 1291a: 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++) 1291c: fd e0 ldi r31, 0x0D ; 13 1291e: 06 3c cpi r16, 0xC6 ; 198 12920: 1f 07 cpc r17, r31 12922: 09 f0 breq .+2 ; 0x12926 12924: ad cf rjmp .-166 ; 0x12880 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]); 12926: 60 91 7a 0e lds r22, 0x0E7A ; 0x800e7a 1292a: 70 e0 ldi r23, 0x00 ; 0 1292c: 80 e0 ldi r24, 0x00 ; 0 1292e: 0f 94 01 25 call 0x24a02 ; 0x24a02 tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12932: 60 91 7b 0e lds r22, 0x0E7B ; 0x800e7b 12936: 70 e0 ldi r23, 0x00 ; 0 12938: 81 e0 ldi r24, 0x01 ; 1 1293a: 0f 94 01 25 call 0x24a02 ; 0x24a02 tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 1293e: 60 91 7c 0e lds r22, 0x0E7C ; 0x800e7c 12942: 70 e0 ldi r23, 0x00 ; 0 12944: 82 e0 ldi r24, 0x02 ; 2 12946: 0f 94 01 25 call 0x24a02 ; 0x24a02 tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 1294a: 60 91 7d 0e lds r22, 0x0E7D ; 0x800e7d 1294e: 70 e0 ldi r23, 0x00 ; 0 12950: 83 e0 ldi r24, 0x03 ; 3 12952: 0f 94 01 25 call 0x24a02 ; 0x24a02 #endif //TMC2130 reset_acceleration_rates(); 12956: 0f 94 66 63 call 0x2c6cc ; 0x2c6cc // Call updatePID (similar to when we have processed M301) updatePID(); 1295a: 0f 94 da 3a call 0x275b4 ; 0x275b4 } 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; 1295e: ce 01 movw r24, r28 12960: 01 96 adiw r24, 0x01 ; 1 12962: 0f 94 a1 31 call 0x26342 ; 0x26342 // 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)); 12966: 44 e3 ldi r20, 0x34 ; 52 12968: 50 e8 ldi r21, 0x80 ; 128 1296a: 67 eb ldi r22, 0xB7 ; 183 1296c: 7a eb ldi r23, 0xBA ; 186 1296e: 82 ea ldi r24, 0xA2 ; 162 12970: 9c e0 ldi r25, 0x0C ; 12 12972: 0e 94 2e 64 call 0xc85c ; 0xc85c eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12976: 46 e6 ldi r20, 0x66 ; 102 12978: 56 e6 ldi r21, 0x66 ; 102 1297a: 66 e8 ldi r22, 0x86 ; 134 1297c: 7f e3 ldi r23, 0x3F ; 63 1297e: 8e e9 ldi r24, 0x9E ; 158 12980: 9c e0 ldi r25, 0x0C ; 12 12982: 0e 94 2e 64 call 0xc85c ; 0xc85c eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12986: 4a e9 ldi r20, 0x9A ; 154 12988: 59 e9 ldi r21, 0x99 ; 153 1298a: 69 e1 ldi r22, 0x19 ; 25 1298c: 7e e3 ldi r23, 0x3E ; 62 1298e: 8a e9 ldi r24, 0x9A ; 154 12990: 9c e0 ldi r25, 0x0C ; 12 12992: 0e 94 2e 64 call 0xc85c ; 0xc85c eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12996: 6e e0 ldi r22, 0x0E ; 14 12998: 71 e0 ldi r23, 0x01 ; 1 1299a: 88 e9 ldi r24, 0x98 ; 152 1299c: 9c e0 ldi r25, 0x0C ; 12 1299e: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 129a2: 61 e0 ldi r22, 0x01 ; 1 129a4: 87 e9 ldi r24, 0x97 ; 151 129a6: 9c e0 ldi r25, 0x0C ; 12 129a8: 0e 94 10 76 call 0xec20 ; 0xec20 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 129ac: 82 e0 ldi r24, 0x02 ; 2 129ae: 9d e0 ldi r25, 0x0D ; 13 129b0: 0f 94 23 dc call 0x3b846 ; 0x3b846 129b4: 91 e0 ldi r25, 0x01 ; 1 129b6: 81 11 cpse r24, r1 129b8: 01 c0 rjmp .+2 ; 0x129bc 129ba: 90 e0 ldi r25, 0x00 ; 0 129bc: 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); 129c0: 8e ef ldi r24, 0xFE ; 254 129c2: 9c e0 ldi r25, 0x0C ; 12 129c4: 0f 94 2b dc call 0x3b856 ; 0x3b856 129c8: 60 93 da 12 sts 0x12DA, r22 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 129cc: 70 93 db 12 sts 0x12DB, r23 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 129d0: 80 93 dc 12 sts 0x12DC, r24 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 129d4: 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); 129d8: 82 ea ldi r24, 0xA2 ; 162 129da: 9c e0 ldi r25, 0x0C ; 12 129dc: 0f 94 2b dc call 0x3b856 ; 0x3b856 129e0: 60 93 de 12 sts 0x12DE, r22 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 129e4: 70 93 df 12 sts 0x12DF, r23 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 129e8: 80 93 e0 12 sts 0x12E0, r24 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 129ec: 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); 129f0: 8e e9 ldi r24, 0x9E ; 158 129f2: 9c e0 ldi r25, 0x0C ; 12 129f4: 0f 94 2b dc call 0x3b856 ; 0x3b856 129f8: 60 93 e2 12 sts 0x12E2, r22 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 129fc: 70 93 e3 12 sts 0x12E3, r23 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 12a00: 80 93 e4 12 sts 0x12E4, r24 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 12a04: 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); 12a08: 8a ef ldi r24, 0xFA ; 250 12a0a: 9c e0 ldi r25, 0x0C ; 12 12a0c: 0f 94 2b dc call 0x3b856 ; 0x3b856 12a10: 60 93 e6 12 sts 0x12E6, r22 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 12a14: 70 93 e7 12 sts 0x12E7, r23 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 12a18: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 12a1c: 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); 12a20: 8a e9 ldi r24, 0x9A ; 154 12a22: 9c e0 ldi r25, 0x0C ; 12 12a24: 0f 94 2b dc call 0x3b856 ; 0x3b856 12a28: 60 93 ea 12 sts 0x12EA, r22 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 12a2c: 70 93 eb 12 sts 0x12EB, r23 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 12a30: 80 93 ec 12 sts 0x12EC, r24 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 12a34: 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)); 12a38: 88 e9 ldi r24, 0x98 ; 152 12a3a: 9c e0 ldi r25, 0x0C ; 12 12a3c: 0f 94 31 dc call 0x3b862 ; 0x3b862 12a40: 0f 94 89 2e call 0x25d12 ; 0x25d12 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12a44: 40 e4 ldi r20, 0x40 ; 64 12a46: 50 e0 ldi r21, 0x00 ; 0 12a48: 6a eb ldi r22, 0xBA ; 186 12a4a: 7c e0 ldi r23, 0x0C ; 12 12a4c: 80 ef ldi r24, 0xF0 ; 240 12a4e: 92 e1 ldi r25, 0x12 ; 18 12a50: 0f 94 13 dc call 0x3b826 ; 0x3b826 thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12a54: 86 eb ldi r24, 0xB6 ; 182 12a56: 9c e0 ldi r25, 0x0C ; 12 12a58: 0f 94 2b dc call 0x3b856 ; 0x3b856 12a5c: 60 93 30 13 sts 0x1330, r22 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 12a60: 70 93 31 13 sts 0x1331, r23 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 12a64: 80 93 32 13 sts 0x1332, r24 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 12a68: 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); 12a6c: 82 eb ldi r24, 0xB2 ; 178 12a6e: 9c e0 ldi r25, 0x0C ; 12 12a70: 0f 94 2b dc call 0x3b856 ; 0x3b856 12a74: 60 93 34 13 sts 0x1334, r22 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 12a78: 70 93 35 13 sts 0x1335, r23 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 12a7c: 80 93 36 13 sts 0x1336, r24 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 12a80: 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); 12a84: 8e ea ldi r24, 0xAE ; 174 12a86: 9c e0 ldi r25, 0x0C ; 12 12a88: 0f 94 2b dc call 0x3b856 ; 0x3b856 12a8c: 60 93 38 13 sts 0x1338, r22 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 12a90: 70 93 39 13 sts 0x1339, r23 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 12a94: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 12a98: 90 93 3b 13 sts 0x133B, r25 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> if(!thermal_model::calibrated()) { 12a9c: 0f 94 a8 2e call 0x25d50 ; 0x25d50 12aa0: 81 11 cpse r24, r1 12aa2: 06 c0 rjmp .+12 ; 0x12ab0 SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12aa4: 8d eb ldi r24, 0xBD ; 189 12aa6: 97 e7 ldi r25, 0x77 ; 119 12aa8: 0e 94 82 79 call 0xf304 ; 0xf304 thermal_model_reset_settings(); 12aac: 0f 94 af 31 call 0x2635e ; 0x2635e } thermal_model::setup(); 12ab0: 0f 94 10 2f call 0x25e20 ; 0x25e20 } 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; 12ab4: ce 01 movw r24, r28 12ab6: 01 96 adiw r24, 0x01 ; 1 12ab8: 0f 94 94 31 call 0x26328 ; 0x26328 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12abc: 80 ed ldi r24, 0xD0 ; 208 12abe: 9b ea ldi r25, 0xAB ; 171 12ac0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("Stored settings retrieved"); 12ac4: 87 ee ldi r24, 0xE7 ; 231 12ac6: 97 e7 ldi r25, 0x77 ; 119 12ac8: 0e 94 82 79 call 0xf304 ; 0xf304 12acc: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12ace: 0f 90 pop r0 12ad0: df 91 pop r29 12ad2: cf 91 pop r28 12ad4: 1f 91 pop r17 12ad6: 0f 91 pop r16 12ad8: ff 90 pop r15 12ada: ef 90 pop r14 12adc: bf 90 pop r11 12ade: af 90 pop r10 12ae0: 9f 90 pop r9 12ae2: 8f 90 pop r8 12ae4: 7f 90 pop r7 12ae6: 6f 90 pop r6 12ae8: 5f 90 pop r5 12aea: 4f 90 pop r4 12aec: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12aee: 0e 94 93 82 call 0x10526 ; 0x10526 //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))) { 12af2: 64 e0 ldi r22, 0x04 ; 4 12af4: 70 e0 ldi r23, 0x00 ; 0 12af6: 84 e1 ldi r24, 0x14 ; 20 12af8: 90 e0 ldi r25, 0x00 ; 0 12afa: 0e 94 c2 5b call 0xb784 ; 0xb784 12afe: 91 e0 ldi r25, 0x01 ; 1 12b00: 89 27 eor r24, r25 12b02: e5 cf rjmp .-54 ; 0x12ace 00012b04 : 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() 12b04: 2f 92 push r2 12b06: 3f 92 push r3 12b08: 4f 92 push r4 12b0a: 5f 92 push r5 12b0c: 6f 92 push r6 12b0e: 7f 92 push r7 12b10: 8f 92 push r8 12b12: 9f 92 push r9 12b14: af 92 push r10 12b16: bf 92 push r11 12b18: cf 92 push r12 12b1a: df 92 push r13 12b1c: ef 92 push r14 12b1e: ff 92 push r15 12b20: 0f 93 push r16 12b22: 1f 93 push r17 12b24: cf 93 push r28 12b26: df 93 push r29 12b28: cd b7 in r28, 0x3d ; 61 12b2a: de b7 in r29, 0x3e ; 62 12b2c: cf 58 subi r28, 0x8F ; 143 12b2e: d1 09 sbc r29, r1 12b30: 0f b6 in r0, 0x3f ; 63 12b32: f8 94 cli 12b34: de bf out 0x3e, r29 ; 62 12b36: 0f be out 0x3f, r0 ; 63 12b38: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12b3a: 82 e0 ldi r24, 0x02 ; 2 12b3c: 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) 12b40: a0 90 92 12 lds r10, 0x1292 ; 0x801292 12b44: b0 90 93 12 lds r11, 0x1293 ; 0x801293 12b48: 85 01 movw r16, r10 12b4a: 08 55 subi r16, 0x58 ; 88 12b4c: 1f 4e sbci r17, 0xEF ; 239 12b4e: 46 e0 ldi r20, 0x06 ; 6 12b50: 50 e0 ldi r21, 0x00 ; 0 12b52: 61 ea ldi r22, 0xA1 ; 161 12b54: 78 e8 ldi r23, 0x88 ; 136 12b56: c8 01 movw r24, r16 12b58: 0f 94 02 da call 0x3b404 ; 0x3b404 12b5c: 89 2b or r24, r25 12b5e: 09 f0 breq .+2 ; 0x12b62 12b60: b8 c0 rjmp .+368 ; 0x12cd2 { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12b62: 82 e9 ldi r24, 0x92 ; 146 12b64: 98 e8 ldi r25, 0x88 ; 136 12b66: 0e 94 2d 68 call 0xd05a ; 0xd05a 12b6a: 88 23 and r24, r24 12b6c: 09 f4 brne .+2 ; 0x12b70 12b6e: 91 c0 rjmp .+290 ; 0x12c92 { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12b70: 88 e5 ldi r24, 0x58 ; 88 12b72: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 12b76: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12b78: 89 e5 ldi r24, 0x59 ; 89 12b7a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 12b7e: 81 11 cpse r24, r1 12b80: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12b82: 0f 94 ef 42 call 0x285de ; 0x285de static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12b86: 1a 82 std Y+2, r1 ; 0x02 12b88: 19 82 std Y+1, r1 ; 0x01 12b8a: fe 01 movw r30, r28 12b8c: 33 96 adiw r30, 0x03 ; 3 12b8e: 83 e1 ldi r24, 0x13 ; 19 12b90: df 01 movw r26, r30 12b92: 1d 92 st X+, r1 12b94: 8a 95 dec r24 12b96: e9 f7 brne .-6 ; 0x12b92 if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12b98: 48 ec ldi r20, 0xC8 ; 200 12b9a: 5f ea ldi r21, 0xAF ; 175 12b9c: 60 e0 ldi r22, 0x00 ; 0 12b9e: 70 e0 ldi r23, 0x00 ; 0 12ba0: 85 e7 ldi r24, 0x75 ; 117 12ba2: 93 e0 ldi r25, 0x03 ; 3 12ba4: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 12ba8: 81 11 cpse r24, r1 crashDet_counter = 0; 12baa: 10 92 74 03 sts 0x0374, r1 ; 0x800374 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12bae: 00 91 74 03 lds r16, 0x0374 ; 0x800374 12bb2: 0f 5f subi r16, 0xFF ; 255 12bb4: 00 93 74 03 sts 0x0374, r16 ; 0x800374 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12bb8: 85 e7 ldi r24, 0x75 ; 117 12bba: 93 e0 ldi r25, 0x03 ; 3 12bbc: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> crashDet_axes |= mask; 12bc0: 80 91 73 03 lds r24, 0x0373 ; 0x800373 12bc4: 81 2b or r24, r17 12bc6: 80 93 73 03 sts 0x0373, r24 ; 0x800373 if (mask & X_AXIS_MASK) { 12bca: 10 ff sbrs r17, 0 12bcc: 08 c0 rjmp .+16 ; 0x12bde eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12bce: 86 e6 ldi r24, 0x66 ; 102 12bd0: 9f e0 ldi r25, 0x0F ; 15 12bd2: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12bd6: 85 e0 ldi r24, 0x05 ; 5 12bd8: 9f e0 ldi r25, 0x0F ; 15 12bda: 0e 94 22 76 call 0xec44 ; 0xec44 } if (mask & Y_AXIS_MASK) { 12bde: 11 ff sbrs r17, 1 12be0: 08 c0 rjmp .+16 ; 0x12bf2 eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12be2: 88 e6 ldi r24, 0x68 ; 104 12be4: 9f e0 ldi r25, 0x0F ; 15 12be6: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12bea: 83 e0 ldi r24, 0x03 ; 3 12bec: 9f e0 ldi r25, 0x0F ; 15 12bee: 0e 94 22 76 call 0xec44 ; 0xec44 } lcd_update_enable(true); 12bf2: 81 e0 ldi r24, 0x01 ; 1 12bf4: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_update(2); 12bf8: 82 e0 ldi r24, 0x02 ; 2 12bfa: 0e 94 ae 6e call 0xdd5c ; 0xdd5c // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12bfe: 61 2f mov r22, r17 12c00: ce 01 movw r24, r28 12c02: 01 96 adiw r24, 0x01 ; 1 12c04: 0e 94 10 74 call 0xe820 ; 0xe820 lcd_setstatus(msg); 12c08: ce 01 movw r24, r28 12c0a: 01 96 adiw r24, 0x01 ; 1 12c0c: 0e 94 90 f4 call 0x1e920 ; 0x1e920 gcode_G28(true, true, false); //home X and Y 12c10: 40 e0 ldi r20, 0x00 ; 0 12c12: 61 e0 ldi r22, 0x01 ; 1 12c14: 81 e0 ldi r24, 0x01 ; 1 12c16: 0e 94 0c 7f call 0xfe18 ; 0xfe18 if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12c1a: 61 e0 ldi r22, 0x01 ; 1 12c1c: 83 e2 ldi r24, 0x23 ; 35 12c1e: 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) { 12c20: 03 30 cpi r16, 0x03 ; 3 12c22: 60 f1 brcs .+88 ; 0x12c7c 12c24: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 12c28: 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); 12c2c: 80 e0 ldi r24, 0x00 ; 0 12c2e: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 12c32: 0e 94 1a 6f call 0xde34 ; 0xde34 crashdet_fmt_error(msg, crashDet_axes); 12c36: 60 91 73 03 lds r22, 0x0373 ; 0x800373 12c3a: ce 01 movw r24, r28 12c3c: 01 96 adiw r24, 0x01 ; 1 12c3e: 0e 94 10 74 call 0xe820 ; 0xe820 crashDet_axes = 0; 12c42: 10 92 73 03 sts 0x0373, r1 ; 0x800373 lcd_print(msg); 12c46: ce 01 movw r24, r28 12c48: 01 96 adiw r24, 0x01 ; 1 12c4a: 0e 94 ee 70 call 0xe1dc ; 0xe1dc // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12c4e: 80 e0 ldi r24, 0x00 ; 0 12c50: 97 e4 ldi r25, 0x47 ; 71 12c52: 0e 94 b3 72 call 0xe566 ; 0xe566 12c56: ac 01 movw r20, r24 12c58: 61 e0 ldi r22, 0x01 ; 1 12c5a: 80 e0 ldi r24, 0x00 ; 0 12c5c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc('?'); 12c60: 8f e3 ldi r24, 0x3F ; 63 12c62: 0e 94 d6 6e call 0xddac ; 0xddac //! @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); 12c66: 40 e0 ldi r20, 0x00 ; 0 12c68: 60 e0 ldi r22, 0x00 ; 0 12c6a: 90 e0 ldi r25, 0x00 ; 0 12c6c: 80 e0 ldi r24, 0x00 ; 0 12c6e: 0f 94 47 4f call 0x29e8e ; 0x29e8e 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")); 12c72: 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) 12c74: 81 11 cpse r24, r1 12c76: 0a c0 rjmp .+20 ; 0x12c8c { enquecommand_P(PSTR("CRASH_RECOVER")); 12c78: 85 e1 ldi r24, 0x15 ; 21 12c7a: 95 e8 ldi r25, 0x85 ; 133 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12c7c: 0e 94 27 88 call 0x1104e ; 0x1104e SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12c80: 81 e0 ldi r24, 0x01 ; 1 12c82: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be ClearToSend(); 12c86: 0e 94 31 7f call 0xfe62 ; 0xfe62 12c8a: 5e c3 rjmp .+1724 ; 0x13348 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12c8c: 88 e0 ldi r24, 0x08 ; 8 12c8e: 95 e8 ldi r25, 0x85 ; 133 12c90: f5 cf rjmp .-22 ; 0x12c7c crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12c92: 84 e8 ldi r24, 0x84 ; 132 12c94: 98 e8 ldi r25, 0x88 ; 136 12c96: 0e 94 2d 68 call 0xd05a ; 0xd05a 12c9a: 88 23 and r24, r24 12c9c: 69 f0 breq .+26 ; 0x12cb8 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 12c9e: 0e 94 8c 67 call 0xcf18 ; 0xcf18 12ca2: 81 11 cpse r24, r1 12ca4: 06 c0 rjmp .+12 ; 0x12cb2 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 12ca6: 60 e0 ldi r22, 0x00 ; 0 12ca8: 70 e0 ldi r23, 0x00 ; 0 12caa: 80 e8 ldi r24, 0x80 ; 128 12cac: 9f e3 ldi r25, 0x3F ; 63 12cae: 0e 94 4b 68 call 0xd096 ; 0xd096 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 12cb2: 0f 94 5c 26 call 0x24cb8 ; 0x24cb8 12cb6: e4 cf rjmp .-56 ; 0x12c80 else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 12cb8: 87 e7 ldi r24, 0x77 ; 119 12cba: 98 e8 ldi r25, 0x88 ; 136 12cbc: 0e 94 2d 68 call 0xd05a ; 0xd05a 12cc0: 88 23 and r24, r24 12cc2: f1 f2 breq .-68 ; 0x12c80 } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 12cc4: 0f 94 5c 26 call 0x24cb8 ; 0x24cb8 // Abort the print print_stop(); 12cc8: 60 e0 ldi r22, 0x00 ; 0 12cca: 80 e0 ldi r24, 0x00 ; 0 12ccc: 0e 94 a1 f4 call 0x1e942 ; 0x1e942 12cd0: d7 cf rjmp .-82 ; 0x12c80 // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 12cd2: 44 e0 ldi r20, 0x04 ; 4 12cd4: 50 e0 ldi r21, 0x00 ; 0 12cd6: 62 e7 ldi r22, 0x72 ; 114 12cd8: 78 e8 ldi r23, 0x88 ; 136 12cda: c8 01 movw r24, r16 12cdc: 0f 94 02 da call 0x3b404 ; 0x3b404 12ce0: 89 2b or r24, r25 12ce2: 09 f0 breq .+2 ; 0x12ce6 12ce4: fc c0 rjmp .+504 ; 0x12ede { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 12ce6: 85 01 movw r16, r10 12ce8: 04 55 subi r16, 0x54 ; 84 12cea: 1f 4e sbci r17, 0xEF ; 239 12cec: 49 e0 ldi r20, 0x09 ; 9 12cee: 50 e0 ldi r21, 0x00 ; 0 12cf0: 68 e6 ldi r22, 0x68 ; 104 12cf2: 78 e8 ldi r23, 0x88 ; 136 12cf4: c8 01 movw r24, r16 12cf6: 0f 94 02 da call 0x3b404 ; 0x3b404 12cfa: 89 2b or r24, r25 12cfc: c9 f4 brne .+50 ; 0x12d30 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12cfe: f5 01 movw r30, r10 12d00: eb 54 subi r30, 0x4B ; 75 12d02: ff 4e sbci r31, 0xEF ; 239 12d04: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12d06: 15 34 cpi r17, 0x45 ; 69 12d08: 89 f0 breq .+34 ; 0x12d2c 12d0a: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12d0c: 14 30 cpi r17, 0x04 ; 4 12d0e: 08 f0 brcs .+2 ; 0x12d12 12d10: b7 cf rjmp .-146 ; 0x12c80 { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12d12: 4a e0 ldi r20, 0x0A ; 10 12d14: 50 e0 ldi r21, 0x00 ; 0 12d16: 70 e0 ldi r23, 0x00 ; 0 12d18: 60 e0 ldi r22, 0x00 ; 0 12d1a: c5 01 movw r24, r10 12d1c: 8a 54 subi r24, 0x4A ; 74 12d1e: 9f 4e sbci r25, 0xEF ; 239 12d20: 0f 94 ae d7 call 0x3af5c ; 0x3af5c tmc2130_set_wave(axis, 247, fac); 12d24: 81 2f mov r24, r17 12d26: 0f 94 93 88 call 0x31126 ; 0x31126 12d2a: aa cf rjmp .-172 ; 0x12c80 // ### 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'); 12d2c: 13 e0 ldi r17, 0x03 ; 3 12d2e: f1 cf rjmp .-30 ; 0x12d12 } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 12d30: 49 e0 ldi r20, 0x09 ; 9 12d32: 50 e0 ldi r21, 0x00 ; 0 12d34: 6e e5 ldi r22, 0x5E ; 94 12d36: 78 e8 ldi r23, 0x88 ; 136 12d38: c8 01 movw r24, r16 12d3a: 0f 94 02 da call 0x3b404 ; 0x3b404 12d3e: 89 2b or r24, r25 12d40: 51 f5 brne .+84 ; 0x12d96 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12d42: f5 01 movw r30, r10 12d44: eb 54 subi r30, 0x4B ; 75 12d46: ff 4e sbci r31, 0xEF ; 239 12d48: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 12d4a: 15 34 cpi r17, 0x45 ; 69 12d4c: 11 f1 breq .+68 ; 0x12d92 12d4e: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 12d50: 14 30 cpi r17, 0x04 ; 4 12d52: 08 f0 brcs .+2 ; 0x12d56 12d54: 95 cf rjmp .-214 ; 0x12c80 { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 12d56: 4a e0 ldi r20, 0x0A ; 10 12d58: 50 e0 ldi r21, 0x00 ; 0 12d5a: 70 e0 ldi r23, 0x00 ; 0 12d5c: 60 e0 ldi r22, 0x00 ; 0 12d5e: c5 01 movw r24, r10 12d60: 8a 54 subi r24, 0x4A ; 74 12d62: 9f 4e sbci r25, 0xEF ; 239 12d64: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 12d68: e1 2f mov r30, r17 12d6a: f0 e0 ldi r31, 0x00 ; 0 12d6c: eb 50 subi r30, 0x0B ; 11 12d6e: fb 4f sbci r31, 0xFB ; 251 12d70: 80 81 ld r24, Z 12d72: 40 e0 ldi r20, 0x00 ; 0 12d74: 51 e0 ldi r21, 0x01 ; 1 12d76: 02 c0 rjmp .+4 ; 0x12d7c 12d78: 56 95 lsr r21 12d7a: 47 95 ror r20 12d7c: 8a 95 dec r24 12d7e: e2 f7 brpl .-8 ; 0x12d78 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 12d80: 84 2f mov r24, r20 12d82: 88 0f add r24, r24 12d84: 88 0f add r24, r24 12d86: 81 50 subi r24, 0x01 ; 1 12d88: 68 23 and r22, r24 12d8a: 81 2f mov r24, r17 12d8c: 0f 94 aa 8b call 0x31754 ; 0x31754 12d90: 77 cf rjmp .-274 ; 0x12c80 // ### 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'); 12d92: 13 e0 ldi r17, 0x03 ; 3 12d94: e0 cf rjmp .-64 ; 0x12d56 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 12d96: 49 e0 ldi r20, 0x09 ; 9 12d98: 50 e0 ldi r21, 0x00 ; 0 12d9a: 64 e5 ldi r22, 0x54 ; 84 12d9c: 78 e8 ldi r23, 0x88 ; 136 12d9e: c8 01 movw r24, r16 12da0: 0f 94 02 da call 0x3b404 ; 0x3b404 12da4: 89 2b or r24, r25 12da6: 09 f0 breq .+2 ; 0x12daa 12da8: 6b cf rjmp .-298 ; 0x12c80 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 12daa: f5 01 movw r30, r10 12dac: eb 54 subi r30, 0x4B ; 75 12dae: ff 4e sbci r31, 0xEF ; 239 12db0: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 12db2: 85 34 cpi r24, 0x45 ; 69 12db4: 09 f4 brne .+2 ; 0x12db8 12db6: 90 c0 rjmp .+288 ; 0x12ed8 12db8: 98 ea ldi r25, 0xA8 ; 168 12dba: c9 2e mov r12, r25 12dbc: c8 0e add r12, r24 if (axis < 4) 12dbe: b3 e0 ldi r27, 0x03 ; 3 12dc0: bc 15 cp r27, r12 12dc2: 08 f4 brcc .+2 ; 0x12dc6 12dc4: 5d cf rjmp .-326 ; 0x12c80 { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 12dc6: ec 2c mov r14, r12 12dc8: f1 2c mov r15, r1 12dca: 47 01 movw r8, r14 12dcc: 88 0c add r8, r8 12dce: 99 1c adc r9, r9 12dd0: f4 01 movw r30, r8 12dd2: eb 55 subi r30, 0x5B ; 91 12dd4: fd 4f sbci r31, 0xFD ; 253 12dd6: 00 81 ld r16, Z 12dd8: 20 2f mov r18, r16 12dda: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 12ddc: 10 2f mov r17, r16 12dde: 12 95 swap r17 12de0: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 12de2: 00 1f adc r16, r16 12de4: 00 27 eor r16, r16 12de6: 00 1f adc r16, r16 12de8: 61 81 ldd r22, Z+1 ; 0x01 12dea: 67 70 andi r22, 0x07 ; 7 12dec: 66 0f add r22, r22 12dee: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 12df0: f4 01 movw r30, r8 12df2: ea 55 subi r30, 0x5A ; 90 12df4: fd 4f sbci r31, 0xFD ; 253 12df6: d0 80 ld r13, Z 12df8: d6 94 lsr r13 12dfa: d6 94 lsr r13 12dfc: d6 94 lsr r13 12dfe: ed 2d mov r30, r13 12e00: e3 70 andi r30, 0x03 ; 3 12e02: de 2e mov r13, r30 char* str_end = 0; 12e04: 1a 82 std Y+2, r1 ; 0x02 12e06: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 12e08: c5 01 movw r24, r10 12e0a: 8a 54 subi r24, 0x4A ; 74 12e0c: 9f 4e sbci r25, 0xEF ; 239 12e0e: dc 01 movw r26, r24 12e10: 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; 12e12: 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]) 12e14: 33 23 and r19, r19 12e16: e1 f1 breq .+120 ; 0x12e90 { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 12e18: 4a e0 ldi r20, 0x0A ; 10 12e1a: 50 e0 ldi r21, 0x00 ; 0 12e1c: be 01 movw r22, r28 12e1e: 6f 5f subi r22, 0xFF ; 255 12e20: 7f 4f sbci r23, 0xFF ; 255 12e22: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 12e26: 6f 70 andi r22, 0x0F ; 15 12e28: b6 2e mov r11, r22 if (str_end && *str_end) 12e2a: 89 81 ldd r24, Y+1 ; 0x01 12e2c: 9a 81 ldd r25, Y+2 ; 0x02 12e2e: 00 97 sbiw r24, 0x00 ; 0 12e30: 79 f1 breq .+94 ; 0x12e90 12e32: fc 01 movw r30, r24 12e34: 20 81 ld r18, Z 12e36: 22 23 and r18, r18 12e38: 59 f1 breq .+86 ; 0x12e90 { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 12e3a: 4a e0 ldi r20, 0x0A ; 10 12e3c: 50 e0 ldi r21, 0x00 ; 0 12e3e: be 01 movw r22, r28 12e40: 6f 5f subi r22, 0xFF ; 255 12e42: 7f 4f sbci r23, 0xFF ; 255 12e44: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 12e48: 16 2f mov r17, r22 12e4a: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 12e4c: 89 81 ldd r24, Y+1 ; 0x01 12e4e: 9a 81 ldd r25, Y+2 ; 0x02 12e50: 00 97 sbiw r24, 0x00 ; 0 12e52: f1 f0 breq .+60 ; 0x12e90 12e54: dc 01 movw r26, r24 12e56: 2c 91 ld r18, X 12e58: 22 23 and r18, r18 12e5a: d1 f0 breq .+52 ; 0x12e90 { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 12e5c: 4a e0 ldi r20, 0x0A ; 10 12e5e: 50 e0 ldi r21, 0x00 ; 0 12e60: be 01 movw r22, r28 12e62: 6f 5f subi r22, 0xFF ; 255 12e64: 7f 4f sbci r23, 0xFF ; 255 12e66: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 12e6a: 06 2f mov r16, r22 12e6c: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 12e6e: 89 81 ldd r24, Y+1 ; 0x01 12e70: 9a 81 ldd r25, Y+2 ; 0x02 12e72: 00 97 sbiw r24, 0x00 ; 0 12e74: 69 f0 breq .+26 ; 0x12e90 12e76: fc 01 movw r30, r24 12e78: 20 81 ld r18, Z 12e7a: 22 23 and r18, r18 12e7c: 49 f0 breq .+18 ; 0x12e90 chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 12e7e: 4a e0 ldi r20, 0x0A ; 10 12e80: 50 e0 ldi r21, 0x00 ; 0 12e82: be 01 movw r22, r28 12e84: 6f 5f subi r22, 0xFF ; 255 12e86: 7f 4f sbci r23, 0xFF ; 255 12e88: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 12e8c: 63 70 andi r22, 0x03 ; 3 12e8e: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 12e90: f4 01 movw r30, r8 12e92: eb 55 subi r30, 0x5B ; 91 12e94: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 12e96: 17 70 andi r17, 0x07 ; 7 12e98: 12 95 swap r17 12e9a: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 12e9c: 60 2f mov r22, r16 12e9e: 67 95 ror r22 12ea0: 66 27 eor r22, r22 12ea2: 67 95 ror r22 12ea4: 1b 29 or r17, r11 12ea6: 16 2b or r17, r22 12ea8: 10 83 st Z, r17 12eaa: 60 2f mov r22, r16 12eac: 66 95 lsr r22 12eae: 01 81 ldd r16, Z+1 ; 0x01 12eb0: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 12eb2: 2d 2d mov r18, r13 12eb4: 23 70 andi r18, 0x03 ; 3 12eb6: d2 2e mov r13, r18 12eb8: dd 0c add r13, r13 12eba: dd 0c add r13, r13 12ebc: dd 0c add r13, r13 12ebe: 06 2b or r16, r22 12ec0: d0 2a or r13, r16 12ec2: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 12ec4: f7 01 movw r30, r14 12ec6: eb 50 subi r30, 0x0B ; 11 12ec8: fb 4f sbci r31, 0xFB ; 251 12eca: 50 e0 ldi r21, 0x00 ; 0 12ecc: 40 e0 ldi r20, 0x00 ; 0 12ece: 60 81 ld r22, Z 12ed0: 8c 2d mov r24, r12 12ed2: 0f 94 96 24 call 0x2492c ; 0x2492c 12ed6: d4 ce rjmp .-600 ; 0x12c80 // ### 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'); 12ed8: 03 e0 ldi r16, 0x03 ; 3 12eda: c0 2e mov r12, r16 12edc: 74 cf rjmp .-280 ; 0x12dc6 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) { 12ede: 45 e0 ldi r20, 0x05 ; 5 12ee0: 50 e0 ldi r21, 0x00 ; 0 12ee2: 6e e4 ldi r22, 0x4E ; 78 12ee4: 78 e8 ldi r23, 0x88 ; 136 12ee6: c8 01 movw r24, r16 12ee8: 0f 94 02 da call 0x3b404 ; 0x3b404 12eec: 89 2b or r24, r25 12eee: 09 f0 breq .+2 ; 0x12ef2 12ef0: 64 c1 rjmp .+712 ; 0x131ba - `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"))) { 12ef2: 84 e4 ldi r24, 0x44 ; 68 12ef4: 98 e8 ldi r25, 0x88 ; 136 12ef6: 0e 94 2d 68 call 0xd05a ; 0xd05a 12efa: 88 23 and r24, r24 12efc: 09 f4 brne .+2 ; 0x12f00 12efe: 3c c0 rjmp .+120 ; 0x12f78 //! 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 12f00: 10 92 6f 06 sts 0x066F, r1 ; 0x80066f 12f04: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 12f06: c1 2c mov r12, r1 12f08: d1 2c mov r13, r1 12f0a: 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); 12f0c: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 12f0e: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 12f10: 64 e1 ldi r22, 0x14 ; 20 12f12: 70 e0 ldi r23, 0x00 ; 0 12f14: 80 e0 ldi r24, 0x00 ; 0 12f16: 90 e0 ldi r25, 0x00 ; 0 12f18: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 unsigned long tachMeasure = _micros(); 12f1c: 0f 94 34 27 call 0x24e68 ; 0x24e68 12f20: 4b 01 movw r8, r22 12f22: 5c 01 movw r10, r24 cli(); 12f24: f8 94 cli SET_INPUT(TACH_1); 12f26: 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 ) ; 12f28: 67 9b sbis 0x0c, 7 ; 12 12f2a: fe cf rjmp .-4 ; 0x12f28 sei(); 12f2c: 78 94 sei tachMeasure = _micros() - tachMeasure; 12f2e: 0f 94 34 27 call 0x24e68 ; 0x24e68 12f32: dc 01 movw r26, r24 12f34: cb 01 movw r24, r22 12f36: 88 19 sub r24, r8 12f38: 99 09 sbc r25, r9 12f3a: aa 09 sbc r26, r10 12f3c: bb 09 sbc r27, r11 12f3e: c8 16 cp r12, r24 12f40: d9 06 cpc r13, r25 12f42: ea 06 cpc r14, r26 12f44: fb 06 cpc r15, r27 12f46: 10 f4 brcc .+4 ; 0x12f4c 12f48: 6c 01 movw r12, r24 12f4a: 7d 01 movw r14, r26 12f4c: 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){ 12f4e: f1 f6 brne .-68 ; 0x12f0c 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 "); 12f50: 8d ef ldi r24, 0xFD ; 253 12f52: 94 e8 ldi r25, 0x84 ; 132 12f54: 0e 94 57 77 call 0xeeae ; 0xeeae if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 12f58: 89 ef ldi r24, 0xF9 ; 249 12f5a: 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 ){ 12f5c: 35 ef ldi r19, 0xF5 ; 245 12f5e: c3 16 cp r12, r19 12f60: 31 e0 ldi r19, 0x01 ; 1 12f62: d3 06 cpc r13, r19 12f64: e1 04 cpc r14, r1 12f66: f1 04 cpc r15, r1 12f68: 10 f4 brcc .+4 ; 0x12f6e // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 12f6a: 86 ef ldi r24, 0xF6 ; 246 12f6c: 94 e8 ldi r25, 0x84 ; 132 12f6e: 0e 94 82 79 call 0xf304 ; 0xf304 } // cleanup after the test function SET_INPUT(TACH_1); 12f72: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 12f74: 77 9a sbi 0x0e, 7 ; 14 12f76: 84 ce rjmp .-760 ; 0x12c80 */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 12f78: 80 e4 ldi r24, 0x40 ; 64 12f7a: 98 e8 ldi r25, 0x88 ; 136 12f7c: 0e 94 2d 68 call 0xd05a ; 0xd05a 12f80: 88 23 and r24, r24 12f82: 21 f1 breq .+72 ; 0x12fcc printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 12f84: 40 91 cb 03 lds r20, 0x03CB ; 0x8003cb 12f88: 50 91 cc 03 lds r21, 0x03CC ; 0x8003cc 12f8c: 2c e3 ldi r18, 0x3C ; 60 12f8e: 24 9f mul r18, r20 12f90: c0 01 movw r24, r0 12f92: 25 9f mul r18, r21 12f94: 90 0d add r25, r0 12f96: 11 24 eor r1, r1 12f98: 9f 93 push r25 12f9a: 8f 93 push r24 12f9c: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 12fa0: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca 12fa4: 24 9f mul r18, r20 12fa6: c0 01 movw r24, r0 12fa8: 25 9f mul r18, r21 12faa: 90 0d add r25, r0 12fac: 11 24 eor r1, r1 12fae: 9f 93 push r25 12fb0: 8f 93 push r24 12fb2: 80 e3 ldi r24, 0x30 ; 48 12fb4: 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); 12fb6: 9f 93 push r25 12fb8: 8f 93 push r24 12fba: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 12fbe: 0f 90 pop r0 12fc0: 0f 90 pop r0 12fc2: 0f 90 pop r0 12fc4: 0f 90 pop r0 12fc6: 0f 90 pop r0 12fc8: 0f 90 pop r0 12fca: 5a ce rjmp .-844 ; 0x12c80 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 12fcc: 8b e3 ldi r24, 0x3B ; 59 12fce: 98 e8 ldi r25, 0x88 ; 136 12fd0: 0e 94 2d 68 call 0xd05a ; 0xd05a 12fd4: 88 23 and r24, r24 12fd6: 11 f1 breq .+68 ; 0x1301c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 12fd8: 8c e8 ldi r24, 0x8C ; 140 12fda: 9f e0 ldi r25, 0x0F ; 15 12fdc: 0f 94 23 dc call 0x3b846 ; 0x3b846 12fe0: 81 11 cpse r24, r1 12fe2: 10 c0 rjmp .+32 ; 0x13004 // M24 - Start SD print enquecommand_P(MSG_M24); 12fe4: 61 e0 ldi r22, 0x01 ; 1 12fe6: 81 ef ldi r24, 0xF1 ; 241 12fe8: 90 e7 ldi r25, 0x70 ; 112 12fea: 0e 94 27 88 call 0x1104e ; 0x1104e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 12fee: 60 e0 ldi r22, 0x00 ; 0 12ff0: 85 ea ldi r24, 0xA5 ; 165 12ff2: 9f e0 ldi r25, 0x0F ; 15 12ff4: 0f 94 47 dc call 0x3b88e ; 0x3b88e 12ff8: 60 e0 ldi r22, 0x00 ; 0 12ffa: 8f e7 ldi r24, 0x7F ; 127 12ffc: 9c e0 ldi r25, 0x0C ; 12 12ffe: 0f 94 47 dc call 0x3b88e ; 0x3b88e 13002: 3e ce rjmp .-900 ; 0x12c80 // 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) { 13004: 81 30 cpi r24, 0x01 ; 1 13006: 09 f0 breq .+2 ; 0x1300a 13008: 3b ce rjmp .-906 ; 0x12c80 // 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(); 1300a: 0f 94 94 42 call 0x28528 ; 0x28528 usb_timer.start(); 1300e: 8e e0 ldi r24, 0x0E ; 14 13010: 95 e0 ldi r25, 0x05 ; 5 13012: 0f 94 b4 29 call 0x25368 ; 0x25368 ::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(); 13016: 0f 94 5f 29 call 0x252be ; 0x252be 1301a: 32 ce rjmp .-924 ; 0x12c80 } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 1301c: 84 e3 ldi r24, 0x34 ; 52 1301e: 98 e8 ldi r25, 0x88 ; 136 13020: 0e 94 2d 68 call 0xd05a ; 0xd05a 13024: 88 23 and r24, r24 13026: 21 f0 breq .+8 ; 0x13030 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13028: 80 e0 ldi r24, 0x00 ; 0 1302a: 0f 94 83 0f call 0x21f06 ; 0x21f06 1302e: 28 ce rjmp .-944 ; 0x12c80 MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 13030: 8e e2 ldi r24, 0x2E ; 46 13032: 98 e8 ldi r25, 0x88 ; 136 13034: 0e 94 2d 68 call 0xd05a ; 0xd05a 13038: 88 23 and r24, r24 1303a: 51 f0 breq .+20 ; 0x13050 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 1303c: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 13040: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 13044: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 13048: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7df> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 1304c: 0e 94 53 67 call 0xcea6 ; 0xcea6 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 13050: 8b e2 ldi r24, 0x2B ; 43 13052: 98 e8 ldi r25, 0x88 ; 136 13054: 0e 94 2d 68 call 0xd05a ; 0xd05a 13058: 88 23 and r24, r24 1305a: a9 f0 breq .+42 ; 0x13086 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 1305c: 44 e1 ldi r20, 0x14 ; 20 1305e: 50 e0 ldi r21, 0x00 ; 0 13060: 65 e1 ldi r22, 0x15 ; 21 13062: 7d e0 ldi r23, 0x0D ; 13 13064: ce 01 movw r24, r28 13066: 01 96 adiw r24, 0x01 ; 1 13068: 0f 94 13 dc call 0x3b826 ; 0x3b826 if (SN[19]) 1306c: 8c 89 ldd r24, Y+20 ; 0x14 1306e: 88 23 and r24, r24 13070: 29 f0 breq .+10 ; 0x1307c puts_P(PSTR("SN invalid")); 13072: 80 e2 ldi r24, 0x20 ; 32 13074: 98 e8 ldi r25, 0x88 ; 136 13076: 0f 94 0c db call 0x3b618 ; 0x3b618 1307a: 02 ce rjmp .-1020 ; 0x12c80 else puts(SN); 1307c: ce 01 movw r24, r28 1307e: 01 96 adiw r24, 0x01 ; 1 13080: 0f 94 b2 e2 call 0x3c564 ; 0x3c564 13084: fd cd rjmp .-1030 ; 0x12c80 } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 13086: 8c e1 ldi r24, 0x1C ; 28 13088: 98 e8 ldi r25, 0x88 ; 136 1308a: 0e 94 2d 68 call 0xd05a ; 0xd05a 1308e: 88 23 and r24, r24 13090: 29 f0 breq .+10 ; 0x1309c SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 13092: 80 e1 ldi r24, 0x10 ; 16 13094: 98 e8 ldi r25, 0x88 ; 136 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 13096: 0e 94 82 79 call 0xf304 ; 0xf304 1309a: f2 cd rjmp .-1052 ; 0x12c80 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 1309c: 8c e0 ldi r24, 0x0C ; 12 1309e: 98 e8 ldi r25, 0x88 ; 136 130a0: 0e 94 2d 68 call 0xd05a ; 0xd05a 130a4: 88 23 and r24, r24 130a6: 19 f0 breq .+6 ; 0x130ae SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 130a8: 88 ee ldi r24, 0xE8 ; 232 130aa: 97 e8 ldi r25, 0x87 ; 135 130ac: f4 cf rjmp .-24 ; 0x13096 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 130ae: 83 ee ldi r24, 0xE3 ; 227 130b0: 97 e8 ldi r25, 0x87 ; 135 130b2: 0e 94 2d 68 call 0xd05a ; 0xd05a 130b6: 88 23 and r24, r24 130b8: 19 f0 breq .+6 ; 0x130c0 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 130ba: 0e 94 33 71 call 0xe266 ; 0xe266 130be: e0 cd rjmp .-1088 ; 0x12c80 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 130c0: 80 ee ldi r24, 0xE0 ; 224 130c2: 97 e8 ldi r25, 0x87 ; 135 130c4: 0e 94 2d 68 call 0xd05a ; 0xd05a 130c8: 88 23 and r24, r24 130ca: 79 f0 breq .+30 ; 0x130ea eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 130cc: 81 ea ldi r24, 0xA1 ; 161 130ce: 9d e0 ldi r25, 0x0D ; 13 130d0: 0f 94 23 dc call 0x3b846 ; 0x3b846 130d4: 4b e0 ldi r20, 0x0B ; 11 130d6: 84 9f mul r24, r20 130d8: c0 01 movw r24, r0 130da: 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); 130dc: 70 e0 ldi r23, 0x00 ; 0 130de: 60 e0 ldi r22, 0x00 ; 0 130e0: 80 5b subi r24, 0xB0 ; 176 130e2: 92 4f sbci r25, 0xF2 ; 242 130e4: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 130e8: cb cd rjmp .-1130 ; 0x12c80 } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 130ea: 8d ed ldi r24, 0xDD ; 221 130ec: 97 e8 ldi r25, 0x87 ; 135 130ee: 0e 94 2d 68 call 0xd05a ; 0xd05a 130f2: 88 23 and r24, r24 130f4: 51 f0 breq .+20 ; 0x1310a // 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(); 130f6: 0e 94 1a 6f call 0xde34 ; 0xde34 Sound_MakeCustom(100,0,false); 130fa: 40 e0 ldi r20, 0x00 ; 0 130fc: 70 e0 ldi r23, 0x00 ; 0 130fe: 60 e0 ldi r22, 0x00 ; 0 13100: 84 e6 ldi r24, 0x64 ; 100 13102: 90 e0 ldi r25, 0x00 ; 0 13104: 0f 94 4d 51 call 0x2a29a ; 0x2a29a 13108: d8 cf rjmp .-80 ; 0x130ba 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 1310a: 89 ed ldi r24, 0xD9 ; 217 1310c: 97 e8 ldi r25, 0x87 ; 135 1310e: 0e 94 2d 68 call 0xd05a ; 0xd05a 13112: 88 23 and r24, r24 13114: e1 f0 breq .+56 ; 0x1314e // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13116: 86 e5 ldi r24, 0x56 ; 86 13118: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1311c: 88 23 and r24, r24 1311e: 09 f4 brne .+2 ; 0x13122 13120: af cd rjmp .-1186 ; 0x12c80 bool value = code_value_short(); 13122: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 13126: 11 e0 ldi r17, 0x01 ; 1 13128: 89 2b or r24, r25 1312a: 09 f4 brne .+2 ; 0x1312e 1312c: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1312e: 0f 94 ef 42 call 0x285de ; 0x285de if(value != mbl.active) { 13132: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 13136: 90 e0 ldi r25, 0x00 ; 0 13138: 18 17 cp r17, r24 1313a: 19 06 cpc r1, r25 1313c: 09 f4 brne .+2 ; 0x13140 1313e: a0 cd rjmp .-1216 ; 0x12c80 mbl.active = value; 13140: 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]); 13144: 8a e9 ldi r24, 0x9A ; 154 13146: 96 e0 ldi r25, 0x06 ; 6 13148: 0f 94 f8 63 call 0x2c7f0 ; 0x2c7f0 1314c: 99 cd rjmp .-1230 ; 0x12c80 } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 1314e: 82 ed ldi r24, 0xD2 ; 210 13150: 97 e8 ldi r25, 0x87 ; 135 13152: 0e 94 2d 68 call 0xd05a ; 0xd05a 13156: 88 23 and r24, r24 13158: 09 f4 brne .+2 ; 0x1315c 1315a: 92 cd rjmp .-1244 ; 0x12c80 uint16_t nDiameter; if(code_seen('D')) { 1315c: 84 e4 ldi r24, 0x44 ; 68 1315e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 13162: 88 23 and r24, r24 13164: a1 f0 breq .+40 ; 0x1318e nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 13166: 0e 94 a4 60 call 0xc148 ; 0xc148 1316a: 20 e0 ldi r18, 0x00 ; 0 1316c: 30 e0 ldi r19, 0x00 ; 0 1316e: 4a e7 ldi r20, 0x7A ; 122 13170: 54 e4 ldi r21, 0x44 ; 68 13172: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13176: 20 e0 ldi r18, 0x00 ; 0 13178: 30 e0 ldi r19, 0x00 ; 0 1317a: 40 e0 ldi r20, 0x00 ; 0 1317c: 5f e3 ldi r21, 0x3F ; 63 1317e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13182: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> nozzle_diameter_check(nDiameter); 13186: cb 01 movw r24, r22 13188: 0e 94 37 f5 call 0x1ea6e ; 0x1ea6e 1318c: 79 cd rjmp .-1294 ; 0x12c80 } else if(code_seen_P(PSTR("set")) && farm_mode) { 1318e: 8e ec ldi r24, 0xCE ; 206 13190: 97 e8 ldi r25, 0x87 ; 135 13192: 0e 94 2d 68 call 0xd05a ; 0xd05a 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); 13196: 85 ea ldi r24, 0xA5 ; 165 13198: 9d e0 ldi r25, 0x0D ; 13 1319a: 0f 94 31 dc call 0x3b862 ; 0x3b862 1319e: bc 01 movw r22, r24 131a0: 90 e0 ldi r25, 0x00 ; 0 131a2: 80 e0 ldi r24, 0x00 ; 0 131a4: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 131a8: 20 e0 ldi r18, 0x00 ; 0 131aa: 30 e0 ldi r19, 0x00 ; 0 131ac: 4a e7 ldi r20, 0x7A ; 122 131ae: 54 e4 ldi r21, 0x44 ; 68 131b0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 131b4: 0f 94 bb 74 call 0x2e976 ; 0x2e976 131b8: 63 cd rjmp .-1338 ; 0x12c80 } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 131ba: d8 01 movw r26, r16 131bc: 8c 91 ld r24, X 131be: 87 34 cpi r24, 0x47 ; 71 131c0: 11 f0 breq .+4 ; 0x131c6 131c2: 0c 94 78 a4 jmp 0x148f0 ; 0x148f0 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 131c6: 10 93 96 03 sts 0x0396, r17 ; 0x800396 131ca: 00 93 95 03 sts 0x0395, r16 ; 0x800395 gcode_in_progress = code_value_short(); 131ce: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 131d2: 90 93 94 03 sts 0x0394, r25 ; 0x800394 131d6: 80 93 93 03 sts 0x0393, r24 ; 0x800393 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 131da: 8e 31 cpi r24, 0x1E ; 30 131dc: 91 05 cpc r25, r1 131de: 09 f4 brne .+2 ; 0x131e2 131e0: da c6 rjmp .+3508 ; 0x13f96 131e2: 0c f0 brlt .+2 ; 0x131e6 131e4: 45 c1 rjmp .+650 ; 0x13470 131e6: 84 30 cpi r24, 0x04 ; 4 131e8: 91 05 cpc r25, r1 131ea: 09 f4 brne .+2 ; 0x131ee 131ec: 7e c6 rjmp .+3324 ; 0x13eea 131ee: 0c f0 brlt .+2 ; 0x131f2 131f0: c5 c0 rjmp .+394 ; 0x1337c 131f2: 97 fd sbrc r25, 7 131f4: cb c0 rjmp .+406 ; 0x1338c 131f6: 02 97 sbiw r24, 0x02 ; 2 131f8: 0c f0 brlt .+2 ; 0x131fc 131fa: fc c1 rjmp .+1016 ; 0x135f4 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 131fc: 0e 94 7a 5a call 0xb4f4 ; 0xb4f4 13200: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 13202: 0e 94 cb 61 call 0xc396 ; 0xc396 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13206: 60 91 65 06 lds r22, 0x0665 ; 0x800665 1320a: 70 91 66 06 lds r23, 0x0666 ; 0x800666 1320e: 80 91 67 06 lds r24, 0x0667 ; 0x800667 13212: 90 91 68 06 lds r25, 0x0668 ; 0x800668 13216: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 1321a: 6b 01 movw r12, r22 1321c: 7c 01 movw r14, r24 1321e: 40 90 9e 06 lds r4, 0x069E ; 0x80069e 13222: 50 90 9f 06 lds r5, 0x069F ; 0x80069f 13226: 60 90 a0 06 lds r6, 0x06A0 ; 0x8006a0 1322a: 70 90 a1 06 lds r7, 0x06A1 ; 0x8006a1 1322e: 80 90 80 06 lds r8, 0x0680 ; 0x800680 13232: 90 90 81 06 lds r9, 0x0681 ; 0x800681 13236: a0 90 82 06 lds r10, 0x0682 ; 0x800682 1323a: b0 90 83 06 lds r11, 0x0683 ; 0x800683 1323e: a5 01 movw r20, r10 13240: 94 01 movw r18, r8 13242: c3 01 movw r24, r6 13244: b2 01 movw r22, r4 13246: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1324a: 20 e0 ldi r18, 0x00 ; 0 1324c: 30 e0 ldi r19, 0x00 ; 0 1324e: 48 ec ldi r20, 0xC8 ; 200 13250: 52 e4 ldi r21, 0x42 ; 66 13252: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13256: 9b 01 movw r18, r22 13258: ac 01 movw r20, r24 1325a: c7 01 movw r24, r14 1325c: b6 01 movw r22, r12 1325e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 13262: 18 16 cp r1, r24 13264: d4 f4 brge .+52 ; 0x1329a total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 13266: a3 01 movw r20, r6 13268: 92 01 movw r18, r4 1326a: c5 01 movw r24, r10 1326c: b4 01 movw r22, r8 1326e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13272: 20 e0 ldi r18, 0x00 ; 0 13274: 30 e0 ldi r19, 0x00 ; 0 13276: 48 ec ldi r20, 0xC8 ; 200 13278: 52 e4 ldi r21, 0x42 ; 66 1327a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1327e: a7 01 movw r20, r14 13280: 96 01 movw r18, r12 13282: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13286: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 1328a: 60 93 65 06 sts 0x0665, r22 ; 0x800665 1328e: 70 93 66 06 sts 0x0666, r23 ; 0x800666 13292: 80 93 67 06 sts 0x0667, r24 ; 0x800667 13296: 90 93 68 06 sts 0x0668, r25 ; 0x800668 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 1329a: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 1329e: 88 23 and r24, r24 132a0: 09 f4 brne .+2 ; 0x132a4 132a2: a4 c1 rjmp .+840 ; 0x135ec if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 132a4: 88 e5 ldi r24, 0x58 ; 88 132a6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 132aa: 81 11 cpse r24, r1 132ac: 9f c1 rjmp .+830 ; 0x135ec 132ae: 89 e5 ldi r24, 0x59 ; 89 132b0: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 132b4: 81 11 cpse r24, r1 132b6: 9a c1 rjmp .+820 ; 0x135ec 132b8: 8a e5 ldi r24, 0x5A ; 90 132ba: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 132be: 81 11 cpse r24, r1 132c0: 95 c1 rjmp .+810 ; 0x135ec 132c2: 85 e4 ldi r24, 0x45 ; 69 132c4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 132c8: 88 23 and r24, r24 132ca: 09 f4 brne .+2 ; 0x132ce 132cc: 8f c1 rjmp .+798 ; 0x135ec float echange=destination[E_AXIS]-current_position[E_AXIS]; 132ce: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 132d2: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 132d6: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 132da: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 132de: 60 91 80 06 lds r22, 0x0680 ; 0x800680 132e2: 70 91 81 06 lds r23, 0x0681 ; 0x800681 132e6: 80 91 82 06 lds r24, 0x0682 ; 0x800682 132ea: 90 91 83 06 lds r25, 0x0683 ; 0x800683 132ee: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 132f2: 6b 01 movw r12, r22 132f4: 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 132f6: 2d ec ldi r18, 0xCD ; 205 132f8: 3c ec ldi r19, 0xCC ; 204 132fa: 4c ec ldi r20, 0xCC ; 204 132fc: 5d eb ldi r21, 0xBD ; 189 132fe: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 13302: 87 ff sbrs r24, 7 13304: 65 c1 rjmp .+714 ; 0x135d0 13306: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 1330a: 81 11 cpse r24, r1 1330c: 0c 94 35 cc jmp 0x1986a ; 0x1986a st_synchronize(); 13310: 0f 94 ef 42 call 0x285de ; 0x285de current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13314: 80 91 80 06 lds r24, 0x0680 ; 0x800680 13318: 90 91 81 06 lds r25, 0x0681 ; 0x800681 1331c: a0 91 82 06 lds r26, 0x0682 ; 0x800682 13320: b0 91 83 06 lds r27, 0x0683 ; 0x800683 13324: 80 93 9e 06 sts 0x069E, r24 ; 0x80069e 13328: 90 93 9f 06 sts 0x069F, r25 ; 0x80069f 1332c: a0 93 a0 06 sts 0x06A0, r26 ; 0x8006a0 13330: b0 93 a1 06 sts 0x06A1, r27 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13334: 8e e9 ldi r24, 0x9E ; 158 13336: 96 e0 ldi r25, 0x06 ; 6 13338: 0f 94 c5 63 call 0x2c78a ; 0x2c78a retract(!retracted[active_extruder]); 1333c: 90 91 8e 06 lds r25, 0x068E ; 0x80068e 13340: 81 e0 ldi r24, 0x01 ; 1 13342: 89 27 eor r24, r25 13344: 0f 94 2f 8a call 0x3145e ; 0x3145e SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 13348: c1 57 subi r28, 0x71 ; 113 1334a: df 4f sbci r29, 0xFF ; 255 1334c: 0f b6 in r0, 0x3f ; 63 1334e: f8 94 cli 13350: de bf out 0x3e, r29 ; 62 13352: 0f be out 0x3f, r0 ; 63 13354: cd bf out 0x3d, r28 ; 61 13356: df 91 pop r29 13358: cf 91 pop r28 1335a: 1f 91 pop r17 1335c: 0f 91 pop r16 1335e: ff 90 pop r15 13360: ef 90 pop r14 13362: df 90 pop r13 13364: cf 90 pop r12 13366: bf 90 pop r11 13368: af 90 pop r10 1336a: 9f 90 pop r9 1336c: 8f 90 pop r8 1336e: 7f 90 pop r7 13370: 6f 90 pop r6 13372: 5f 90 pop r5 13374: 4f 90 pop r4 13376: 3f 90 pop r3 13378: 2f 90 pop r2 1337a: 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) 1337c: 8b 30 cpi r24, 0x0B ; 11 1337e: 91 05 cpc r25, r1 13380: 09 f4 brne .+2 ; 0x13384 13382: 00 c6 rjmp .+3072 ; 0x13f84 13384: dc f4 brge .+54 ; 0x133bc 13386: 0a 97 sbiw r24, 0x0a ; 10 13388: 09 f4 brne .+2 ; 0x1338c 1338a: f8 c5 rjmp .+3056 ; 0x13f7c case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 1338c: 80 91 92 12 lds r24, 0x1292 ; 0x801292 13390: 90 91 93 12 lds r25, 0x1293 ; 0x801293 13394: 88 55 subi r24, 0x58 ; 88 13396: 9f 4e sbci r25, 0xEF ; 239 13398: 9f 93 push r25 1339a: 8f 93 push r24 1339c: 1f 92 push r1 1339e: 87 e4 ldi r24, 0x47 ; 71 133a0: 8f 93 push r24 133a2: 82 e5 ldi r24, 0x52 ; 82 133a4: 99 e6 ldi r25, 0x69 ; 105 133a6: 9f 93 push r25 133a8: 8f 93 push r24 133aa: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 133ae: 0f 90 pop r0 133b0: 0f 90 pop r0 133b2: 0f 90 pop r0 133b4: 0f 90 pop r0 133b6: 0f 90 pop r0 133b8: 0f 90 pop r0 133ba: a5 c0 rjmp .+330 ; 0x13506 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) 133bc: 85 31 cpi r24, 0x15 ; 21 133be: 91 05 cpc r25, r1 133c0: 09 f4 brne .+2 ; 0x133c4 133c2: a1 c0 rjmp .+322 ; 0x13506 133c4: 4c 97 sbiw r24, 0x1c ; 28 133c6: 11 f7 brne .-60 ; 0x1338c { 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]); 133c8: 88 e5 ldi r24, 0x58 ; 88 133ca: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 133ce: 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; 133d0: 41 2c mov r4, r1 133d2: 51 2c mov r5, r1 133d4: 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(); 133d6: 88 23 and r24, r24 133d8: 21 f0 breq .+8 ; 0x133e2 133da: 0e 94 89 5b call 0xb712 ; 0xb712 133de: 2b 01 movw r4, r22 133e0: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 133e2: 89 e5 ldi r24, 0x59 ; 89 133e4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 133e8: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 133ea: 88 23 and r24, r24 133ec: 09 f4 brne .+2 ; 0x133f0 133ee: cc c5 rjmp .+2968 ; 0x13f88 133f0: 0e 94 89 5b call 0xb712 ; 0xb712 133f4: 6e 96 adiw r28, 0x1e ; 30 133f6: 6c af std Y+60, r22 ; 0x3c 133f8: 7d af std Y+61, r23 ; 0x3d 133fa: 8e af std Y+62, r24 ; 0x3e 133fc: 9f af std Y+63, r25 ; 0x3f 133fe: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 13400: 8a e5 ldi r24, 0x5A ; 90 13402: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 13406: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13408: 81 2c mov r8, r1 1340a: 91 2c mov r9, r1 1340c: 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(); 1340e: 88 23 and r24, r24 13410: 21 f0 breq .+8 ; 0x1341a 13412: 0e 94 89 5b call 0xb712 ; 0xb712 13416: 4b 01 movw r8, r22 13418: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 1341a: 87 e5 ldi r24, 0x57 ; 87 1341c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 13420: 67 96 adiw r28, 0x17 ; 23 13422: 8f af std Y+63, r24 ; 0x3f 13424: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13426: 83 e4 ldi r24, 0x43 ; 67 13428: 0e 94 dd 5b call 0xb7ba ; 0xb7ba gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 1342c: 67 96 adiw r28, 0x17 ; 23 1342e: ff ad ldd r31, Y+63 ; 0x3f 13430: 67 97 sbiw r28, 0x17 ; 23 13432: ff 93 push r31 13434: 8f 93 push r24 13436: cd 2c mov r12, r13 13438: 6e 96 adiw r28, 0x1e ; 30 1343a: ec ac ldd r14, Y+60 ; 0x3c 1343c: fd ac ldd r15, Y+61 ; 0x3d 1343e: 0e ad ldd r16, Y+62 ; 0x3e 13440: 1f ad ldd r17, Y+63 ; 0x3f 13442: 6e 97 sbiw r28, 0x1e ; 30 13444: 22 2d mov r18, r2 13446: b3 01 movw r22, r6 13448: a2 01 movw r20, r4 1344a: 83 2d mov r24, r3 1344c: 0e 94 2e 7d call 0xfa5c ; 0xfa5c #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) { 13450: 0f 90 pop r0 13452: 0f 90 pop r0 13454: 31 10 cpse r3, r1 13456: 57 c0 rjmp .+174 ; 0x13506 13458: 21 10 cpse r2, r1 1345a: 55 c0 rjmp .+170 ; 0x13506 1345c: 67 96 adiw r28, 0x17 ; 23 1345e: 2f ad ldd r18, Y+63 ; 0x3f 13460: 67 97 sbiw r28, 0x17 ; 23 13462: 21 11 cpse r18, r1 13464: 50 c0 rjmp .+160 ; 0x13506 13466: d1 10 cpse r13, r1 13468: 4e c0 rjmp .+156 ; 0x13506 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 1346a: 0e 94 fb 8d call 0x11bf6 ; 0x11bf6 1346e: 4b c0 rjmp .+150 ; 0x13506 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) 13470: 86 35 cpi r24, 0x56 ; 86 13472: 91 05 cpc r25, r1 13474: 11 f4 brne .+4 ; 0x1347a 13476: 0c 94 27 a4 jmp 0x1484e ; 0x1484e 1347a: b4 f5 brge .+108 ; 0x134e8 1347c: 8c 34 cpi r24, 0x4C ; 76 1347e: 91 05 cpc r25, r1 13480: 09 f4 brne .+2 ; 0x13484 13482: df c5 rjmp .+3006 ; 0x14042 13484: 3c f5 brge .+78 ; 0x134d4 13486: 08 e2 ldi r16, 0x28 ; 40 13488: 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)); 1348a: f2 e0 ldi r31, 0x02 ; 2 1348c: ef 2e mov r14, r31 1348e: fa e6 ldi r31, 0x6A ; 106 13490: 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) 13492: 8b 34 cpi r24, 0x4B ; 75 13494: 91 05 cpc r25, r1 13496: 09 f0 breq .+2 ; 0x1349a 13498: 79 cf rjmp .-270 ; 0x1338c 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)); 1349a: 60 2f mov r22, r16 1349c: 70 e0 ldi r23, 0x00 ; 0 1349e: 90 e0 ldi r25, 0x00 ; 0 134a0: 80 e0 ldi r24, 0x00 ; 0 134a2: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 134a6: 0e 94 91 5c call 0xb922 ; 0xb922 134aa: 9f 93 push r25 134ac: 8f 93 push r24 134ae: 7f 93 push r23 134b0: 6f 93 push r22 134b2: 1f 93 push r17 134b4: 0f 93 push r16 134b6: ff 92 push r15 134b8: ef 92 push r14 134ba: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 134be: 0f 5f subi r16, 0xFF ; 255 134c0: 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++) 134c2: 0f b6 in r0, 0x3f ; 63 134c4: f8 94 cli 134c6: de bf out 0x3e, r29 ; 62 134c8: 0f be out 0x3f, r0 ; 63 134ca: cd bf out 0x3d, r28 ; 61 134cc: 0f 36 cpi r16, 0x6F ; 111 134ce: 11 05 cpc r17, r1 134d0: 21 f7 brne .-56 ; 0x1349a 134d2: 19 c0 rjmp .+50 ; 0x13506 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) 134d4: 80 35 cpi r24, 0x50 ; 80 134d6: 91 05 cpc r25, r1 134d8: 41 f2 breq .-112 ; 0x1346a 134da: 81 35 cpi r24, 0x51 ; 81 134dc: 91 05 cpc r25, r1 134de: 09 f0 breq .+2 ; 0x134e2 134e0: 55 cf rjmp .-342 ; 0x1338c /*! ### 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(); 134e2: 0e 94 62 7f call 0xfec4 ; 0xfec4 134e6: 0f c0 rjmp .+30 ; 0x13506 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) 134e8: 8a 35 cpi r24, 0x5A ; 90 134ea: 91 05 cpc r25, r1 134ec: 11 f4 brne .+4 ; 0x134f2 134ee: 0c 94 31 a4 jmp 0x14862 ; 0x14862 134f2: 74 f4 brge .+28 ; 0x13510 134f4: 87 35 cpi r24, 0x57 ; 87 134f6: 91 05 cpc r25, r1 134f8: 11 f4 brne .+4 ; 0x134fe 134fa: 0c 94 2c a4 jmp 0x14858 ; 0x14858 134fe: 88 35 cpi r24, 0x58 ; 88 13500: 91 05 cpc r25, r1 13502: 09 f0 breq .+2 ; 0x13506 13504: 43 cf rjmp .-378 ; 0x1338c #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; 13506: 10 92 94 03 sts 0x0394, r1 ; 0x800394 1350a: 10 92 93 03 sts 0x0393, r1 ; 0x800393 1350e: b8 cb rjmp .-2192 ; 0x12c80 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) 13510: 8b 35 cpi r24, 0x5B ; 91 13512: 91 05 cpc r25, r1 13514: 11 f4 brne .+4 ; 0x1351a 13516: 0c 94 38 a4 jmp 0x14870 ; 0x14870 1351a: 8c 35 cpi r24, 0x5C ; 92 1351c: 91 05 cpc r25, r1 1351e: 09 f0 breq .+2 ; 0x13522 13520: 35 cf rjmp .-406 ; 0x1338c 13522: 1d ed ldi r17, 0xDD ; 221 13524: c1 2e mov r12, r17 13526: 12 e0 ldi r17, 0x02 ; 2 13528: d1 2e mov r13, r17 1352a: 8e 01 movw r16, r28 1352c: 0f 5b subi r16, 0xBF ; 191 1352e: 1f 4f sbci r17, 0xFF ; 255 13530: 9e 01 movw r18, r28 13532: 2f 5f subi r18, 0xFF ; 255 13534: 3f 4f sbci r19, 0xFF ; 255 13536: 79 01 movw r14, r18 13538: 81 ee ldi r24, 0xE1 ; 225 1353a: 88 2e mov r8, r24 1353c: 82 e0 ldi r24, 0x02 ; 2 1353e: 98 2e mov r9, r24 13540: 58 01 movw r10, r16 13542: 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]); 13544: d6 01 movw r26, r12 13546: 8d 91 ld r24, X+ 13548: 6d 01 movw r12, r26 1354a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1354e: f5 01 movw r30, r10 13550: 81 93 st Z+, r24 13552: 5f 01 movw r10, r30 if(codes[i]) 13554: 88 23 and r24, r24 13556: 41 f0 breq .+16 ; 0x13568 values[i] = code_value(); 13558: 0e 94 a4 60 call 0xc148 ; 0xc148 1355c: d7 01 movw r26, r14 1355e: 6d 93 st X+, r22 13560: 7d 93 st X+, r23 13562: 8d 93 st X+, r24 13564: 9c 93 st X, r25 13566: 13 97 sbiw r26, 0x03 ; 3 13568: b4 e0 ldi r27, 0x04 ; 4 1356a: eb 0e add r14, r27 1356c: 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) 1356e: 8c 14 cp r8, r12 13570: 9d 04 cpc r9, r13 13572: 41 f7 brne .-48 ; 0x13544 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 13574: f8 01 movw r30, r16 13576: d3 80 ldd r13, Z+3 ; 0x03 13578: dd 20 and r13, r13 1357a: 11 f4 brne .+4 ; 0x13580 1357c: 0c 94 3c a4 jmp 0x14878 ; 0x14878 13580: 20 e0 ldi r18, 0x00 ; 0 13582: 30 e0 ldi r19, 0x00 ; 0 13584: a9 01 movw r20, r18 13586: 6d 85 ldd r22, Y+13 ; 0x0d 13588: 7e 85 ldd r23, Y+14 ; 0x0e 1358a: 8f 85 ldd r24, Y+15 ; 0x0f 1358c: 98 89 ldd r25, Y+16 ; 0x10 1358e: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 13592: 81 11 cpse r24, r1 13594: 0c 94 3c a4 jmp 0x14878 ; 0x14878 13598: d8 01 movw r26, r16 1359a: 8c 91 ld r24, X 1359c: 81 11 cpse r24, r1 1359e: 0c 94 3c a4 jmp 0x14878 ; 0x14878 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 135a2: 11 96 adiw r26, 0x01 ; 1 135a4: 8c 91 ld r24, X 135a6: 11 97 sbiw r26, 0x01 ; 1 135a8: 81 11 cpse r24, r1 135aa: 0c 94 3c a4 jmp 0x14878 ; 0x14878 135ae: 12 96 adiw r26, 0x02 ; 2 135b0: 8c 91 ld r24, X 135b2: 81 11 cpse r24, r1 135b4: 0c 94 3c a4 jmp 0x14878 ; 0x14878 { // 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; 135b8: 10 92 9e 06 sts 0x069E, r1 ; 0x80069e 135bc: 10 92 9f 06 sts 0x069F, r1 ; 0x80069f 135c0: 10 92 a0 06 sts 0x06A0, r1 ; 0x8006a0 135c4: 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; 135c8: 81 e0 ldi r24, 0x01 ; 1 135ca: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> 135ce: 9b cf rjmp .-202 ; 0x13506 #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 135d0: 2d ec ldi r18, 0xCD ; 205 135d2: 3c ec ldi r19, 0xCC ; 204 135d4: 4c ec ldi r20, 0xCC ; 204 135d6: 5d e3 ldi r21, 0x3D ; 61 135d8: c7 01 movw r24, r14 135da: b6 01 movw r22, r12 135dc: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 135e0: 18 16 cp r1, r24 135e2: 24 f4 brge .+8 ; 0x135ec 135e4: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 135e8: 81 11 cpse r24, r1 135ea: 92 ce rjmp .-732 ; 0x13310 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 135ec: c8 01 movw r24, r16 135ee: 0e 94 0f 6c call 0xd81e ; 0xd81e 135f2: 89 cf rjmp .-238 ; 0x13506 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 135f4: 0e 94 7a 5a call 0xb4f4 ; 0xb4f4 135f8: e0 96 adiw r28, 0x30 ; 48 135fa: 9f af std Y+63, r25 ; 0x3f 135fc: 8e af std Y+62, r24 ; 0x3e 135fe: 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 13600: 0e 94 cb 61 call 0xc396 ; 0xc396 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13604: 89 e4 ldi r24, 0x49 ; 73 13606: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1360a: 88 23 and r24, r24 1360c: 09 f4 brne .+2 ; 0x13610 1360e: 00 c4 rjmp .+2048 ; 0x13e10 13610: 0e 94 a4 60 call 0xc148 ; 0xc148 13614: 60 93 8b 03 sts 0x038B, r22 ; 0x80038b 13618: 70 93 8c 03 sts 0x038C, r23 ; 0x80038c 1361c: 80 93 8d 03 sts 0x038D, r24 ; 0x80038d 13620: 90 93 8e 03 sts 0x038E, r25 ; 0x80038e offset[1] = code_seen('J') ? code_value() : 0.f; 13624: 8a e4 ldi r24, 0x4A ; 74 13626: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1362a: c1 2c mov r12, r1 1362c: d1 2c mov r13, r1 1362e: 76 01 movw r14, r12 13630: 88 23 and r24, r24 13632: 21 f0 breq .+8 ; 0x1363c 13634: 0e 94 a4 60 call 0xc148 ; 0xc148 13638: 6b 01 movw r12, r22 1363a: 7c 01 movw r14, r24 1363c: c0 92 8f 03 sts 0x038F, r12 ; 0x80038f 13640: d0 92 90 03 sts 0x0390, r13 ; 0x800390 13644: e0 92 91 03 sts 0x0391, r14 ; 0x800391 13648: f0 92 92 03 sts 0x0392, r15 ; 0x800392 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1364c: e0 91 93 03 lds r30, 0x0393 ; 0x800393 13650: f0 91 94 03 lds r31, 0x0394 ; 0x800394 13654: c2 57 subi r28, 0x72 ; 114 13656: df 4f sbci r29, 0xFF ; 255 13658: f9 83 std Y+1, r31 ; 0x01 1365a: e8 83 st Y, r30 1365c: ce 58 subi r28, 0x8E ; 142 1365e: 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 13660: 80 90 8b 03 lds r8, 0x038B ; 0x80038b 13664: 90 90 8c 03 lds r9, 0x038C ; 0x80038c 13668: a0 90 8d 03 lds r10, 0x038D ; 0x80038d 1366c: b0 90 8e 03 lds r11, 0x038E ; 0x80038e 13670: a7 01 movw r20, r14 13672: 96 01 movw r18, r12 13674: c5 01 movw r24, r10 13676: b4 01 movw r22, r8 13678: 0f 94 e7 df call 0x3bfce ; 0x3bfce 1367c: ae 96 adiw r28, 0x2e ; 46 1367e: 6c af std Y+60, r22 ; 0x3c 13680: 7d af std Y+61, r23 ; 0x3d 13682: 8e af std Y+62, r24 ; 0x3e 13684: 9f af std Y+63, r25 ; 0x3f 13686: 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); 13688: 60 91 39 02 lds r22, 0x0239 ; 0x800239 1368c: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 13690: 07 2e mov r0, r23 13692: 00 0c add r0, r0 13694: 88 0b sbc r24, r24 13696: 99 0b sbc r25, r25 13698: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1369c: 20 91 b8 02 lds r18, 0x02B8 ; 0x8002b8 136a0: 30 91 b9 02 lds r19, 0x02B9 ; 0x8002b9 136a4: 40 91 ba 02 lds r20, 0x02BA ; 0x8002ba 136a8: 50 91 bb 02 lds r21, 0x02BB ; 0x8002bb 136ac: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 136b0: 2e e3 ldi r18, 0x3E ; 62 136b2: 33 ec ldi r19, 0xC3 ; 195 136b4: 4e e2 ldi r20, 0x2E ; 46 136b6: 59 e3 ldi r21, 0x39 ; 57 136b8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 136bc: aa 96 adiw r28, 0x2a ; 42 136be: 6c af std Y+60, r22 ; 0x3c 136c0: 7d af std Y+61, r23 ; 0x3d 136c2: 8e af std Y+62, r24 ; 0x3e 136c4: 9f af std Y+63, r25 ; 0x3f 136c6: 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)); 136c8: 80 e1 ldi r24, 0x10 ; 16 136ca: e2 e9 ldi r30, 0x92 ; 146 136cc: f6 e0 ldi r31, 0x06 ; 6 136ce: de 01 movw r26, r28 136d0: 11 96 adiw r26, 0x01 ; 1 136d2: 01 90 ld r0, Z+ 136d4: 0d 92 st X+, r0 136d6: 8a 95 dec r24 136d8: e1 f7 brne .-8 ; 0x136d2 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 136da: a5 01 movw r20, r10 136dc: 94 01 movw r18, r8 136de: 50 58 subi r21, 0x80 ; 128 136e0: 6e 96 adiw r28, 0x1e ; 30 136e2: 2c af std Y+60, r18 ; 0x3c 136e4: 3d af std Y+61, r19 ; 0x3d 136e6: 4e af std Y+62, r20 ; 0x3e 136e8: 5f af std Y+63, r21 ; 0x3f 136ea: 6e 97 sbiw r28, 0x1e ; 30 float r_axis_y = -offset[Y_AXIS]; 136ec: d7 01 movw r26, r14 136ee: c6 01 movw r24, r12 136f0: b0 58 subi r27, 0x80 ; 128 136f2: 6a 96 adiw r28, 0x1a ; 26 136f4: 8c af std Y+60, r24 ; 0x3c 136f6: 9d af std Y+61, r25 ; 0x3d 136f8: ae af std Y+62, r26 ; 0x3e 136fa: bf af std Y+63, r27 ; 0x3f 136fc: 6a 97 sbiw r28, 0x1a ; 26 float center_axis_x = start_position[X_AXIS] - r_axis_x; 136fe: 29 81 ldd r18, Y+1 ; 0x01 13700: 3a 81 ldd r19, Y+2 ; 0x02 13702: 4b 81 ldd r20, Y+3 ; 0x03 13704: 5c 81 ldd r21, Y+4 ; 0x04 13706: e6 96 adiw r28, 0x36 ; 54 13708: 2c af std Y+60, r18 ; 0x3c 1370a: 3d af std Y+61, r19 ; 0x3d 1370c: 4e af std Y+62, r20 ; 0x3e 1370e: 5f af std Y+63, r21 ; 0x3f 13710: e6 97 sbiw r28, 0x36 ; 54 13712: c5 01 movw r24, r10 13714: b4 01 movw r22, r8 13716: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1371a: ea 96 adiw r28, 0x3a ; 58 1371c: 6c af std Y+60, r22 ; 0x3c 1371e: 7d af std Y+61, r23 ; 0x3d 13720: 8e af std Y+62, r24 ; 0x3e 13722: 9f af std Y+63, r25 ; 0x3f 13724: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13726: 8d 81 ldd r24, Y+5 ; 0x05 13728: 9e 81 ldd r25, Y+6 ; 0x06 1372a: af 81 ldd r26, Y+7 ; 0x07 1372c: b8 85 ldd r27, Y+8 ; 0x08 1372e: ee 96 adiw r28, 0x3e ; 62 13730: 8c af std Y+60, r24 ; 0x3c 13732: 9d af std Y+61, r25 ; 0x3d 13734: ae af std Y+62, r26 ; 0x3e 13736: bf af std Y+63, r27 ; 0x3f 13738: ee 97 sbiw r28, 0x3e ; 62 1373a: 9c 01 movw r18, r24 1373c: ad 01 movw r20, r26 1373e: c7 01 movw r24, r14 13740: b6 01 movw r22, r12 13742: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13746: ce 57 subi r28, 0x7E ; 126 13748: df 4f sbci r29, 0xFF ; 255 1374a: 68 83 st Y, r22 1374c: 79 83 std Y+1, r23 ; 0x01 1374e: 8a 83 std Y+2, r24 ; 0x02 13750: 9b 83 std Y+3, r25 ; 0x03 13752: c2 58 subi r28, 0x82 ; 130 13754: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13756: 29 85 ldd r18, Y+9 ; 0x09 13758: 3a 85 ldd r19, Y+10 ; 0x0a 1375a: 4b 85 ldd r20, Y+11 ; 0x0b 1375c: 5c 85 ldd r21, Y+12 ; 0x0c 1375e: 60 91 7c 06 lds r22, 0x067C ; 0x80067c 13762: 70 91 7d 06 lds r23, 0x067D ; 0x80067d 13766: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 1376a: 90 91 7f 06 lds r25, 0x067F ; 0x80067f 1376e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13772: c2 58 subi r28, 0x82 ; 130 13774: df 4f sbci r29, 0xFF ; 255 13776: 68 83 st Y, r22 13778: 79 83 std Y+1, r23 ; 0x01 1377a: 8a 83 std Y+2, r24 ; 0x02 1377c: 9b 83 std Y+3, r25 ; 0x03 1377e: ce 57 subi r28, 0x7E ; 126 13780: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13782: 20 91 74 06 lds r18, 0x0674 ; 0x800674 13786: 30 91 75 06 lds r19, 0x0675 ; 0x800675 1378a: 40 91 76 06 lds r20, 0x0676 ; 0x800676 1378e: 50 91 77 06 lds r21, 0x0677 ; 0x800677 13792: ca 57 subi r28, 0x7A ; 122 13794: df 4f sbci r29, 0xFF ; 255 13796: 28 83 st Y, r18 13798: 39 83 std Y+1, r19 ; 0x01 1379a: 4a 83 std Y+2, r20 ; 0x02 1379c: 5b 83 std Y+3, r21 ; 0x03 1379e: c6 58 subi r28, 0x86 ; 134 137a0: d0 40 sbci r29, 0x00 ; 0 137a2: ea 96 adiw r28, 0x3a ; 58 137a4: 2c ad ldd r18, Y+60 ; 0x3c 137a6: 3d ad ldd r19, Y+61 ; 0x3d 137a8: 4e ad ldd r20, Y+62 ; 0x3e 137aa: 5f ad ldd r21, Y+63 ; 0x3f 137ac: ea 97 sbiw r28, 0x3a ; 58 137ae: ca 57 subi r28, 0x7A ; 122 137b0: df 4f sbci r29, 0xFF ; 255 137b2: 68 81 ld r22, Y 137b4: 79 81 ldd r23, Y+1 ; 0x01 137b6: 8a 81 ldd r24, Y+2 ; 0x02 137b8: 9b 81 ldd r25, Y+3 ; 0x03 137ba: c6 58 subi r28, 0x86 ; 134 137bc: d0 40 sbci r29, 0x00 ; 0 137be: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 137c2: 6b 01 movw r12, r22 137c4: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 137c6: 80 91 78 06 lds r24, 0x0678 ; 0x800678 137ca: 90 91 79 06 lds r25, 0x0679 ; 0x800679 137ce: a0 91 7a 06 lds r26, 0x067A ; 0x80067a 137d2: b0 91 7b 06 lds r27, 0x067B ; 0x80067b 137d6: c6 57 subi r28, 0x76 ; 118 137d8: df 4f sbci r29, 0xFF ; 255 137da: 88 83 st Y, r24 137dc: 99 83 std Y+1, r25 ; 0x01 137de: aa 83 std Y+2, r26 ; 0x02 137e0: bb 83 std Y+3, r27 ; 0x03 137e2: ca 58 subi r28, 0x8A ; 138 137e4: d0 40 sbci r29, 0x00 ; 0 137e6: ce 57 subi r28, 0x7E ; 126 137e8: df 4f sbci r29, 0xFF ; 255 137ea: 28 81 ld r18, Y 137ec: 39 81 ldd r19, Y+1 ; 0x01 137ee: 4a 81 ldd r20, Y+2 ; 0x02 137f0: 5b 81 ldd r21, Y+3 ; 0x03 137f2: c2 58 subi r28, 0x82 ; 130 137f4: d0 40 sbci r29, 0x00 ; 0 137f6: bc 01 movw r22, r24 137f8: cd 01 movw r24, r26 137fa: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 137fe: 4b 01 movw r8, r22 13800: 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; 13802: 30 90 82 0e lds r3, 0x0E82 ; 0x800e82 13806: 20 90 83 0e lds r2, 0x0E83 ; 0x800e83 1380a: 90 91 84 0e lds r25, 0x0E84 ; 0x800e84 1380e: 6f 96 adiw r28, 0x1f ; 31 13810: 9f af std Y+63, r25 ; 0x3f 13812: 6f 97 sbiw r28, 0x1f ; 31 13814: a0 91 85 0e lds r26, 0x0E85 ; 0x800e85 13818: a3 96 adiw r28, 0x23 ; 35 1381a: af af std Y+63, r26 ; 0x3f 1381c: 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); 1381e: a7 01 movw r20, r14 13820: 96 01 movw r18, r12 13822: 6e 96 adiw r28, 0x1e ; 30 13824: 6c ad ldd r22, Y+60 ; 0x3c 13826: 7d ad ldd r23, Y+61 ; 0x3d 13828: 8e ad ldd r24, Y+62 ; 0x3e 1382a: 9f ad ldd r25, Y+63 ; 0x3f 1382c: 6e 97 sbiw r28, 0x1e ; 30 1382e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13832: 2b 01 movw r4, r22 13834: 3c 01 movw r6, r24 13836: a5 01 movw r20, r10 13838: 94 01 movw r18, r8 1383a: 6a 96 adiw r28, 0x1a ; 26 1383c: 6c ad ldd r22, Y+60 ; 0x3c 1383e: 7d ad ldd r23, Y+61 ; 0x3d 13840: 8e ad ldd r24, Y+62 ; 0x3e 13842: 9f ad ldd r25, Y+63 ; 0x3f 13844: 6a 97 sbiw r28, 0x1a ; 26 13846: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1384a: 9b 01 movw r18, r22 1384c: ac 01 movw r20, r24 1384e: c3 01 movw r24, r6 13850: b2 01 movw r22, r4 13852: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13856: 2b 01 movw r4, r22 13858: 3c 01 movw r6, r24 1385a: a5 01 movw r20, r10 1385c: 94 01 movw r18, r8 1385e: 6e 96 adiw r28, 0x1e ; 30 13860: 6c ad ldd r22, Y+60 ; 0x3c 13862: 7d ad ldd r23, Y+61 ; 0x3d 13864: 8e ad ldd r24, Y+62 ; 0x3e 13866: 9f ad ldd r25, Y+63 ; 0x3f 13868: 6e 97 sbiw r28, 0x1e ; 30 1386a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1386e: 4b 01 movw r8, r22 13870: 5c 01 movw r10, r24 13872: a7 01 movw r20, r14 13874: 96 01 movw r18, r12 13876: 6a 96 adiw r28, 0x1a ; 26 13878: 6c ad ldd r22, Y+60 ; 0x3c 1387a: 7d ad ldd r23, Y+61 ; 0x3d 1387c: 8e ad ldd r24, Y+62 ; 0x3e 1387e: 9f ad ldd r25, Y+63 ; 0x3f 13880: 6a 97 sbiw r28, 0x1a ; 26 13882: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13886: 9b 01 movw r18, r22 13888: ac 01 movw r20, r24 1388a: c5 01 movw r24, r10 1388c: b4 01 movw r22, r8 1388e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13892: a3 01 movw r20, r6 13894: 92 01 movw r18, r4 13896: 0f 94 ca dd call 0x3bb94 ; 0x3bb94 1389a: 6b 01 movw r12, r22 1389c: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 1389e: 20 e0 ldi r18, 0x00 ; 0 138a0: 30 e0 ldi r19, 0x00 ; 0 138a2: a9 01 movw r20, r18 138a4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 138a8: 87 ff sbrs r24, 7 138aa: 0a c0 rjmp .+20 ; 0x138c0 138ac: 2b ed ldi r18, 0xDB ; 219 138ae: 3f e0 ldi r19, 0x0F ; 15 138b0: 49 ec ldi r20, 0xC9 ; 201 138b2: 50 e4 ldi r21, 0x40 ; 64 138b4: c7 01 movw r24, r14 138b6: b6 01 movw r22, r12 138b8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 138bc: 6b 01 movw r12, r22 138be: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 138c0: 60 91 8b 0e lds r22, 0x0E8B ; 0x800e8b 138c4: 70 91 8c 0e lds r23, 0x0E8C ; 0x800e8c 138c8: 61 15 cp r22, r1 138ca: 71 05 cpc r23, r1 138cc: 09 f4 brne .+2 ; 0x138d0 138ce: a4 c2 rjmp .+1352 ; 0x13e18 { // 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); 138d0: 90 e0 ldi r25, 0x00 ; 0 138d2: 80 e0 ldi r24, 0x00 ; 0 138d4: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 138d8: 9b 01 movw r18, r22 138da: ac 01 movw r20, r24 138dc: 6b ed ldi r22, 0xDB ; 219 138de: 7f e0 ldi r23, 0x0F ; 15 138e0: 89 ec ldi r24, 0xC9 ; 201 138e2: 90 e4 ldi r25, 0x40 ; 64 138e4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 138e8: ae 96 adiw r28, 0x2e ; 46 138ea: 2c ad ldd r18, Y+60 ; 0x3c 138ec: 3d ad ldd r19, Y+61 ; 0x3d 138ee: 4e ad ldd r20, Y+62 ; 0x3e 138f0: 5f ad ldd r21, Y+63 ; 0x3f 138f2: ae 97 sbiw r28, 0x2e ; 46 138f4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 138f8: 5b 01 movw r10, r22 138fa: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 138fc: 60 91 8d 0e lds r22, 0x0E8D ; 0x800e8d 13900: 70 91 8e 0e lds r23, 0x0E8E ; 0x800e8e 13904: 61 15 cp r22, r1 13906: 71 05 cpc r23, r1 13908: f1 f0 breq .+60 ; 0x13946 { // 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)); 1390a: 90 e0 ldi r25, 0x00 ; 0 1390c: 80 e0 ldi r24, 0x00 ; 0 1390e: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 13912: 20 e0 ldi r18, 0x00 ; 0 13914: 30 e0 ldi r19, 0x00 ; 0 13916: 40 e7 ldi r20, 0x70 ; 112 13918: 52 e4 ldi r21, 0x42 ; 66 1391a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1391e: 9b 01 movw r18, r22 13920: ac 01 movw r20, r24 13922: aa 96 adiw r28, 0x2a ; 42 13924: 6c ad ldd r22, Y+60 ; 0x3c 13926: 7d ad ldd r23, Y+61 ; 0x3d 13928: 8e ad ldd r24, Y+62 ; 0x3e 1392a: 9f ad ldd r25, Y+63 ; 0x3f 1392c: aa 97 sbiw r28, 0x2a ; 42 1392e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 13932: 3b 01 movw r6, r22 13934: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13936: 95 01 movw r18, r10 13938: a8 01 movw r20, r16 1393a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1393e: 87 ff sbrs r24, 7 13940: 02 c0 rjmp .+4 ; 0x13946 mm_per_arc_segment = mm_per_arc_segment_sec; 13942: 53 01 movw r10, r6 13944: 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) 13946: 40 90 86 0e lds r4, 0x0E86 ; 0x800e86 1394a: 50 90 87 0e lds r5, 0x0E87 ; 0x800e87 1394e: 60 90 88 0e lds r6, 0x0E88 ; 0x800e88 13952: 70 90 89 0e lds r7, 0x0E89 ; 0x800e89 13956: 95 01 movw r18, r10 13958: a8 01 movw r20, r16 1395a: b2 01 movw r22, r4 1395c: c3 01 movw r24, r6 1395e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 13962: 18 16 cp r1, r24 13964: c4 f0 brlt .+48 ; 0x13996 { // 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) { 13966: 95 01 movw r18, r10 13968: a8 01 movw r20, r16 1396a: 63 2d mov r22, r3 1396c: 72 2d mov r23, r2 1396e: 6f 96 adiw r28, 0x1f ; 31 13970: 8f ad ldd r24, Y+63 ; 0x3f 13972: 6f 97 sbiw r28, 0x1f ; 31 13974: a3 96 adiw r28, 0x23 ; 35 13976: 9f ad ldd r25, Y+63 ; 0x3f 13978: a3 97 sbiw r28, 0x23 ; 35 1397a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1397e: 25 01 movw r4, r10 13980: 38 01 movw r6, r16 13982: 87 ff sbrs r24, 7 13984: 08 c0 rjmp .+16 ; 0x13996 // 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; 13986: 43 2c mov r4, r3 13988: 52 2c mov r5, r2 1398a: 6f 96 adiw r28, 0x1f ; 31 1398c: 6f ac ldd r6, Y+63 ; 0x3f 1398e: 6f 97 sbiw r28, 0x1f ; 31 13990: a3 96 adiw r28, 0x23 ; 35 13992: 7f ac ldd r7, Y+63 ; 0x3f 13994: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13996: c2 57 subi r28, 0x72 ; 114 13998: df 4f sbci r29, 0xFF ; 255 1399a: e8 81 ld r30, Y 1399c: f9 81 ldd r31, Y+1 ; 0x01 1399e: ce 58 subi r28, 0x8E ; 142 139a0: d0 40 sbci r29, 0x00 ; 0 139a2: 32 97 sbiw r30, 0x02 ; 2 139a4: 51 f4 brne .+20 ; 0x139ba 139a6: 2b ed ldi r18, 0xDB ; 219 139a8: 3f e0 ldi r19, 0x0F ; 15 139aa: 49 ec ldi r20, 0xC9 ; 201 139ac: 50 e4 ldi r21, 0x40 ; 64 139ae: c7 01 movw r24, r14 139b0: b6 01 movw r22, r12 139b2: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 139b6: 6b 01 movw r12, r22 139b8: 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) 139ba: ca 57 subi r28, 0x7A ; 122 139bc: df 4f sbci r29, 0xFF ; 255 139be: 28 81 ld r18, Y 139c0: 39 81 ldd r19, Y+1 ; 0x01 139c2: 4a 81 ldd r20, Y+2 ; 0x02 139c4: 5b 81 ldd r21, Y+3 ; 0x03 139c6: c6 58 subi r28, 0x86 ; 134 139c8: d0 40 sbci r29, 0x00 ; 0 139ca: e6 96 adiw r28, 0x36 ; 54 139cc: 6c ad ldd r22, Y+60 ; 0x3c 139ce: 7d ad ldd r23, Y+61 ; 0x3d 139d0: 8e ad ldd r24, Y+62 ; 0x3e 139d2: 9f ad ldd r25, Y+63 ; 0x3f 139d4: e6 97 sbiw r28, 0x36 ; 54 139d6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 139da: 81 11 cpse r24, r1 139dc: 25 c0 rjmp .+74 ; 0x13a28 139de: c6 57 subi r28, 0x76 ; 118 139e0: df 4f sbci r29, 0xFF ; 255 139e2: 28 81 ld r18, Y 139e4: 39 81 ldd r19, Y+1 ; 0x01 139e6: 4a 81 ldd r20, Y+2 ; 0x02 139e8: 5b 81 ldd r21, Y+3 ; 0x03 139ea: ca 58 subi r28, 0x8A ; 138 139ec: d0 40 sbci r29, 0x00 ; 0 139ee: ee 96 adiw r28, 0x3e ; 62 139f0: 6c ad ldd r22, Y+60 ; 0x3c 139f2: 7d ad ldd r23, Y+61 ; 0x3d 139f4: 8e ad ldd r24, Y+62 ; 0x3e 139f6: 9f ad ldd r25, Y+63 ; 0x3f 139f8: ee 97 sbiw r28, 0x3e ; 62 139fa: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 139fe: 81 11 cpse r24, r1 13a00: 13 c0 rjmp .+38 ; 0x13a28 13a02: 20 e0 ldi r18, 0x00 ; 0 13a04: 30 e0 ldi r19, 0x00 ; 0 13a06: a9 01 movw r20, r18 13a08: c7 01 movw r24, r14 13a0a: b6 01 movw r22, r12 13a0c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 13a10: 81 11 cpse r24, r1 13a12: 0a c0 rjmp .+20 ; 0x13a28 { angular_travel_total += 2 * M_PI; 13a14: 2b ed ldi r18, 0xDB ; 219 13a16: 3f e0 ldi r19, 0x0F ; 15 13a18: 49 ec ldi r20, 0xC9 ; 201 13a1a: 50 e4 ldi r21, 0x40 ; 64 13a1c: c7 01 movw r24, r14 13a1e: b6 01 movw r22, r12 13a20: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13a24: 6b 01 movw r12, r22 13a26: 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)); 13a28: a7 01 movw r20, r14 13a2a: 96 01 movw r18, r12 13a2c: ae 96 adiw r28, 0x2e ; 46 13a2e: 6c ad ldd r22, Y+60 ; 0x3c 13a30: 7d ad ldd r23, Y+61 ; 0x3d 13a32: 8e ad ldd r24, Y+62 ; 0x3e 13a34: 9f ad ldd r25, Y+63 ; 0x3f 13a36: ae 97 sbiw r28, 0x2e ; 46 13a38: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13a3c: c2 58 subi r28, 0x82 ; 130 13a3e: df 4f sbci r29, 0xFF ; 255 13a40: 28 81 ld r18, Y 13a42: 39 81 ldd r19, Y+1 ; 0x01 13a44: 4a 81 ldd r20, Y+2 ; 0x02 13a46: 5b 81 ldd r21, Y+3 ; 0x03 13a48: ce 57 subi r28, 0x7E ; 126 13a4a: d0 40 sbci r29, 0x00 ; 0 13a4c: 0f 94 e7 df call 0x3bfce ; 0x3bfce 13a50: 4b 01 movw r8, r22 13a52: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13a54: 2f e6 ldi r18, 0x6F ; 111 13a56: 32 e1 ldi r19, 0x12 ; 18 13a58: 43 e8 ldi r20, 0x83 ; 131 13a5a: 5a e3 ldi r21, 0x3A ; 58 13a5c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 13a60: 87 fd sbrc r24, 7 13a62: cf c1 rjmp .+926 ; 0x13e02 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13a64: 92 01 movw r18, r4 13a66: a3 01 movw r20, r6 13a68: c5 01 movw r24, r10 13a6a: b4 01 movw r22, r8 13a6c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 13a70: 0f 94 29 de call 0x3bc52 ; 0x3bc52 13a74: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 13a78: a4 96 adiw r28, 0x24 ; 36 13a7a: 7f af std Y+63, r23 ; 0x3f 13a7c: 6e af std Y+62, r22 ; 0x3e 13a7e: 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) 13a80: 62 30 cpi r22, 0x02 ; 2 13a82: 71 05 cpc r23, r1 13a84: 08 f4 brcc .+2 ; 0x13a88 13a86: 8b c1 rjmp .+790 ; 0x13d9e 13a88: e0 96 adiw r28, 0x30 ; 48 13a8a: 4e ad ldd r20, Y+62 ; 0x3e 13a8c: 5f ad ldd r21, Y+63 ; 0x3f 13a8e: e0 97 sbiw r28, 0x30 ; 48 13a90: 45 2b or r20, r21 13a92: 09 f4 brne .+2 ; 0x13a96 13a94: 84 c1 rjmp .+776 ; 0x13d9e 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; 13a96: 50 91 8a 0e lds r21, 0x0E8A ; 0x800e8a 13a9a: 6f 96 adiw r28, 0x1f ; 31 13a9c: 5f af std Y+63, r21 ; 0x3f 13a9e: 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, 13aa0: 90 e0 ldi r25, 0x00 ; 0 13aa2: 80 e0 ldi r24, 0x00 ; 0 13aa4: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 13aa8: 4b 01 movw r8, r22 13aaa: 5c 01 movw r10, r24 13aac: ac 01 movw r20, r24 13aae: 9b 01 movw r18, r22 13ab0: c7 01 movw r24, r14 13ab2: b6 01 movw r22, r12 13ab4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 13ab8: 2b 01 movw r4, r22 13aba: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13abc: a5 01 movw r20, r10 13abe: 94 01 movw r18, r8 13ac0: c2 58 subi r28, 0x82 ; 130 13ac2: df 4f sbci r29, 0xFF ; 255 13ac4: 68 81 ld r22, Y 13ac6: 79 81 ldd r23, Y+1 ; 0x01 13ac8: 8a 81 ldd r24, Y+2 ; 0x02 13aca: 9b 81 ldd r25, Y+3 ; 0x03 13acc: ce 57 subi r28, 0x7E ; 126 13ace: d0 40 sbci r29, 0x00 ; 0 13ad0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 13ad4: ee 96 adiw r28, 0x3e ; 62 13ad6: 6c af std Y+60, r22 ; 0x3c 13ad8: 7d af std Y+61, r23 ; 0x3d 13ada: 8e af std Y+62, r24 ; 0x3e 13adc: 9f af std Y+63, r25 ; 0x3f 13ade: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13ae0: 2d 85 ldd r18, Y+13 ; 0x0d 13ae2: 3e 85 ldd r19, Y+14 ; 0x0e 13ae4: 4f 85 ldd r20, Y+15 ; 0x0f 13ae6: 58 89 ldd r21, Y+16 ; 0x10 13ae8: 60 91 80 06 lds r22, 0x0680 ; 0x800680 13aec: 70 91 81 06 lds r23, 0x0681 ; 0x800681 13af0: 80 91 82 06 lds r24, 0x0682 ; 0x800682 13af4: 90 91 83 06 lds r25, 0x0683 ; 0x800683 13af8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13afc: a5 01 movw r20, r10 13afe: 94 01 movw r18, r8 13b00: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 13b04: c2 58 subi r28, 0x82 ; 130 13b06: df 4f sbci r29, 0xFF ; 255 13b08: 68 83 st Y, r22 13b0a: 79 83 std Y+1, r23 ; 0x01 13b0c: 8a 83 std Y+2, r24 ; 0x02 13b0e: 9b 83 std Y+3, r25 ; 0x03 13b10: ce 57 subi r28, 0x7E ; 126 13b12: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13b14: a3 01 movw r20, r6 13b16: 92 01 movw r18, r4 13b18: c3 01 movw r24, r6 13b1a: b2 01 movw r22, r4 13b1c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13b20: 6b 01 movw r12, r22 13b22: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13b24: ac 01 movw r20, r24 13b26: 9b 01 movw r18, r22 13b28: c3 01 movw r24, r6 13b2a: b2 01 movw r22, r4 13b2c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13b30: 20 e0 ldi r18, 0x00 ; 0 13b32: 30 e0 ldi r19, 0x00 ; 0 13b34: 40 ec ldi r20, 0xC0 ; 192 13b36: 50 e4 ldi r21, 0x40 ; 64 13b38: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 13b3c: 9b 01 movw r18, r22 13b3e: ac 01 movw r20, r24 13b40: c3 01 movw r24, r6 13b42: b2 01 movw r22, r4 13b44: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13b48: ae 96 adiw r28, 0x2e ; 46 13b4a: 6c af std Y+60, r22 ; 0x3c 13b4c: 7d af std Y+61, r23 ; 0x3d 13b4e: 8e af std Y+62, r24 ; 0x3e 13b50: 9f af std Y+63, r25 ; 0x3f 13b52: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13b54: 20 e0 ldi r18, 0x00 ; 0 13b56: 30 e0 ldi r19, 0x00 ; 0 13b58: 40 e0 ldi r20, 0x00 ; 0 13b5a: 5f e3 ldi r21, 0x3F ; 63 13b5c: c7 01 movw r24, r14 13b5e: b6 01 movw r22, r12 13b60: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13b64: 9b 01 movw r18, r22 13b66: ac 01 movw r20, r24 13b68: 60 e0 ldi r22, 0x00 ; 0 13b6a: 70 e0 ldi r23, 0x00 ; 0 13b6c: 80 e8 ldi r24, 0x80 ; 128 13b6e: 9f e3 ldi r25, 0x3F ; 63 13b70: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13b74: e6 96 adiw r28, 0x36 ; 54 13b76: 6c af std Y+60, r22 ; 0x3c 13b78: 7d af std Y+61, r23 ; 0x3d 13b7a: 8e af std Y+62, r24 ; 0x3e 13b7c: 9f af std Y+63, r25 ; 0x3f 13b7e: 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++) { 13b80: 22 24 eor r2, r2 13b82: 23 94 inc r2 13b84: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13b86: 6f 96 adiw r28, 0x1f ; 31 13b88: 8f ad ldd r24, Y+63 ; 0x3f 13b8a: 6f 97 sbiw r28, 0x1f ; 31 13b8c: 81 11 cpse r24, r1 13b8e: 4d c1 rjmp .+666 ; 0x13e2a // 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); 13b90: b1 01 movw r22, r2 13b92: 90 e0 ldi r25, 0x00 ; 0 13b94: 80 e0 ldi r24, 0x00 ; 0 13b96: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 13b9a: a3 01 movw r20, r6 13b9c: 92 01 movw r18, r4 13b9e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13ba2: 6b 01 movw r12, r22 13ba4: 7c 01 movw r14, r24 13ba6: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 13baa: 6a 96 adiw r28, 0x1a ; 26 13bac: 6c af std Y+60, r22 ; 0x3c 13bae: 7d af std Y+61, r23 ; 0x3d 13bb0: 8e af std Y+62, r24 ; 0x3e 13bb2: 9f af std Y+63, r25 ; 0x3f 13bb4: 6a 97 sbiw r28, 0x1a ; 26 13bb6: c7 01 movw r24, r14 13bb8: b6 01 movw r22, r12 13bba: 0f 94 0b e1 call 0x3c216 ; 0x3c216 13bbe: 4b 01 movw r8, r22 13bc0: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13bc2: c0 90 8b 03 lds r12, 0x038B ; 0x80038b 13bc6: d0 90 8c 03 lds r13, 0x038C ; 0x80038c 13bca: e0 90 8d 03 lds r14, 0x038D ; 0x80038d 13bce: f0 90 8e 03 lds r15, 0x038E ; 0x80038e 13bd2: f7 fa bst r15, 7 13bd4: f0 94 com r15 13bd6: f7 f8 bld r15, 7 13bd8: f0 94 com r15 13bda: 20 91 8f 03 lds r18, 0x038F ; 0x80038f 13bde: 30 91 90 03 lds r19, 0x0390 ; 0x800390 13be2: 40 91 91 03 lds r20, 0x0391 ; 0x800391 13be6: 50 91 92 03 lds r21, 0x0392 ; 0x800392 13bea: a2 96 adiw r28, 0x22 ; 34 13bec: 2c af std Y+60, r18 ; 0x3c 13bee: 3d af std Y+61, r19 ; 0x3d 13bf0: 4e af std Y+62, r20 ; 0x3e 13bf2: 5f af std Y+63, r21 ; 0x3f 13bf4: a2 97 sbiw r28, 0x22 ; 34 13bf6: a7 01 movw r20, r14 13bf8: 96 01 movw r18, r12 13bfa: 6a 96 adiw r28, 0x1a ; 26 13bfc: 6c ad ldd r22, Y+60 ; 0x3c 13bfe: 7d ad ldd r23, Y+61 ; 0x3d 13c00: 8e ad ldd r24, Y+62 ; 0x3e 13c02: 9f ad ldd r25, Y+63 ; 0x3f 13c04: 6a 97 sbiw r28, 0x1a ; 26 13c06: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13c0a: 6e 96 adiw r28, 0x1e ; 30 13c0c: 6c af std Y+60, r22 ; 0x3c 13c0e: 7d af std Y+61, r23 ; 0x3d 13c10: 8e af std Y+62, r24 ; 0x3e 13c12: 9f af std Y+63, r25 ; 0x3f 13c14: 6e 97 sbiw r28, 0x1e ; 30 13c16: a2 96 adiw r28, 0x22 ; 34 13c18: 2c ad ldd r18, Y+60 ; 0x3c 13c1a: 3d ad ldd r19, Y+61 ; 0x3d 13c1c: 4e ad ldd r20, Y+62 ; 0x3e 13c1e: 5f ad ldd r21, Y+63 ; 0x3f 13c20: a2 97 sbiw r28, 0x22 ; 34 13c22: c5 01 movw r24, r10 13c24: b4 01 movw r22, r8 13c26: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13c2a: 9b 01 movw r18, r22 13c2c: ac 01 movw r20, r24 13c2e: 6e 96 adiw r28, 0x1e ; 30 13c30: 6c ad ldd r22, Y+60 ; 0x3c 13c32: 7d ad ldd r23, Y+61 ; 0x3d 13c34: 8e ad ldd r24, Y+62 ; 0x3e 13c36: 9f ad ldd r25, Y+63 ; 0x3f 13c38: 6e 97 sbiw r28, 0x1e ; 30 13c3a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13c3e: 6e 96 adiw r28, 0x1e ; 30 13c40: 6c af std Y+60, r22 ; 0x3c 13c42: 7d af std Y+61, r23 ; 0x3d 13c44: 8e af std Y+62, r24 ; 0x3e 13c46: 9f af std Y+63, r25 ; 0x3f 13c48: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13c4a: a7 01 movw r20, r14 13c4c: 96 01 movw r18, r12 13c4e: c5 01 movw r24, r10 13c50: b4 01 movw r22, r8 13c52: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13c56: 6b 01 movw r12, r22 13c58: 7c 01 movw r14, r24 13c5a: a2 96 adiw r28, 0x22 ; 34 13c5c: 2c ad ldd r18, Y+60 ; 0x3c 13c5e: 3d ad ldd r19, Y+61 ; 0x3d 13c60: 4e ad ldd r20, Y+62 ; 0x3e 13c62: 5f ad ldd r21, Y+63 ; 0x3f 13c64: a2 97 sbiw r28, 0x22 ; 34 13c66: 6a 96 adiw r28, 0x1a ; 26 13c68: 6c ad ldd r22, Y+60 ; 0x3c 13c6a: 7d ad ldd r23, Y+61 ; 0x3d 13c6c: 8e ad ldd r24, Y+62 ; 0x3e 13c6e: 9f ad ldd r25, Y+63 ; 0x3f 13c70: 6a 97 sbiw r28, 0x1a ; 26 13c72: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13c76: 9b 01 movw r18, r22 13c78: ac 01 movw r20, r24 13c7a: c7 01 movw r24, r14 13c7c: b6 01 movw r22, r12 13c7e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13c82: 6a 96 adiw r28, 0x1a ; 26 13c84: 6c af std Y+60, r22 ; 0x3c 13c86: 7d af std Y+61, r23 ; 0x3d 13c88: 8e af std Y+62, r24 ; 0x3e 13c8a: 9f af std Y+63, r25 ; 0x3f 13c8c: 6a 97 sbiw r28, 0x1a ; 26 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13c8e: 30 91 8a 0e lds r19, 0x0E8A ; 0x800e8a 13c92: 6f 96 adiw r28, 0x1f ; 31 13c94: 3f af std Y+63, r19 ; 0x3f 13c96: 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; 13c98: 6e 96 adiw r28, 0x1e ; 30 13c9a: 2c ad ldd r18, Y+60 ; 0x3c 13c9c: 3d ad ldd r19, Y+61 ; 0x3d 13c9e: 4e ad ldd r20, Y+62 ; 0x3e 13ca0: 5f ad ldd r21, Y+63 ; 0x3f 13ca2: 6e 97 sbiw r28, 0x1e ; 30 13ca4: ea 96 adiw r28, 0x3a ; 58 13ca6: 6c ad ldd r22, Y+60 ; 0x3c 13ca8: 7d ad ldd r23, Y+61 ; 0x3d 13caa: 8e ad ldd r24, Y+62 ; 0x3e 13cac: 9f ad ldd r25, Y+63 ; 0x3f 13cae: ea 97 sbiw r28, 0x3a ; 58 13cb0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13cb4: 69 83 std Y+1, r22 ; 0x01 13cb6: 7a 83 std Y+2, r23 ; 0x02 13cb8: 8b 83 std Y+3, r24 ; 0x03 13cba: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 13cbc: 6a 96 adiw r28, 0x1a ; 26 13cbe: 2c ad ldd r18, Y+60 ; 0x3c 13cc0: 3d ad ldd r19, Y+61 ; 0x3d 13cc2: 4e ad ldd r20, Y+62 ; 0x3e 13cc4: 5f ad ldd r21, Y+63 ; 0x3f 13cc6: 6a 97 sbiw r28, 0x1a ; 26 13cc8: ce 57 subi r28, 0x7E ; 126 13cca: df 4f sbci r29, 0xFF ; 255 13ccc: 68 81 ld r22, Y 13cce: 79 81 ldd r23, Y+1 ; 0x01 13cd0: 8a 81 ldd r24, Y+2 ; 0x02 13cd2: 9b 81 ldd r25, Y+3 ; 0x03 13cd4: c2 58 subi r28, 0x82 ; 130 13cd6: d0 40 sbci r29, 0x00 ; 0 13cd8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13cdc: 6d 83 std Y+5, r22 ; 0x05 13cde: 7e 83 std Y+6, r23 ; 0x06 13ce0: 8f 83 std Y+7, r24 ; 0x07 13ce2: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 13ce4: ee 96 adiw r28, 0x3e ; 62 13ce6: 2c ad ldd r18, Y+60 ; 0x3c 13ce8: 3d ad ldd r19, Y+61 ; 0x3d 13cea: 4e ad ldd r20, Y+62 ; 0x3e 13cec: 5f ad ldd r21, Y+63 ; 0x3f 13cee: ee 97 sbiw r28, 0x3e ; 62 13cf0: 69 85 ldd r22, Y+9 ; 0x09 13cf2: 7a 85 ldd r23, Y+10 ; 0x0a 13cf4: 8b 85 ldd r24, Y+11 ; 0x0b 13cf6: 9c 85 ldd r25, Y+12 ; 0x0c 13cf8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13cfc: 69 87 std Y+9, r22 ; 0x09 13cfe: 7a 87 std Y+10, r23 ; 0x0a 13d00: 8b 87 std Y+11, r24 ; 0x0b 13d02: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 13d04: c2 58 subi r28, 0x82 ; 130 13d06: df 4f sbci r29, 0xFF ; 255 13d08: 28 81 ld r18, Y 13d0a: 39 81 ldd r19, Y+1 ; 0x01 13d0c: 4a 81 ldd r20, Y+2 ; 0x02 13d0e: 5b 81 ldd r21, Y+3 ; 0x03 13d10: ce 57 subi r28, 0x7E ; 126 13d12: d0 40 sbci r29, 0x00 ; 0 13d14: 6d 85 ldd r22, Y+13 ; 0x0d 13d16: 7e 85 ldd r23, Y+14 ; 0x0e 13d18: 8f 85 ldd r24, Y+15 ; 0x0f 13d1a: 98 89 ldd r25, Y+16 ; 0x10 13d1c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13d20: 6d 87 std Y+13, r22 ; 0x0d 13d22: 7e 87 std Y+14, r23 ; 0x0e 13d24: 8f 87 std Y+15, r24 ; 0x0f 13d26: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 13d28: ce 01 movw r24, r28 13d2a: 01 96 adiw r24, 0x01 ; 1 13d2c: 0e 94 d0 6b call 0xd7a0 ; 0xd7a0 // Insert the segment into the buffer if (i >= start_segment_idx) 13d30: e0 96 adiw r28, 0x30 ; 48 13d32: 8e ad ldd r24, Y+62 ; 0x3e 13d34: 9f ad ldd r25, Y+63 ; 0x3f 13d36: e0 97 sbiw r28, 0x30 ; 48 13d38: 28 16 cp r2, r24 13d3a: 39 06 cpc r3, r25 13d3c: 08 f1 brcs .+66 ; 0x13d80 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 13d3e: e9 84 ldd r14, Y+9 ; 0x09 13d40: fa 84 ldd r15, Y+10 ; 0x0a 13d42: 0b 85 ldd r16, Y+11 ; 0x0b 13d44: 1c 85 ldd r17, Y+12 ; 0x0c 13d46: 2d 81 ldd r18, Y+5 ; 0x05 13d48: 3e 81 ldd r19, Y+6 ; 0x06 13d4a: 4f 81 ldd r20, Y+7 ; 0x07 13d4c: 58 85 ldd r21, Y+8 ; 0x08 13d4e: 69 81 ldd r22, Y+1 ; 0x01 13d50: 7a 81 ldd r23, Y+2 ; 0x02 13d52: 8b 81 ldd r24, Y+3 ; 0x03 13d54: 9c 81 ldd r25, Y+4 ; 0x04 13d56: 3f 92 push r3 13d58: 2f 92 push r2 13d5a: a2 e9 ldi r26, 0x92 ; 146 13d5c: b6 e0 ldi r27, 0x06 ; 6 13d5e: bf 93 push r27 13d60: af 93 push r26 13d62: aa 96 adiw r28, 0x2a ; 42 13d64: 8c ac ldd r8, Y+60 ; 0x3c 13d66: 9d ac ldd r9, Y+61 ; 0x3d 13d68: ae ac ldd r10, Y+62 ; 0x3e 13d6a: bf ac ldd r11, Y+63 ; 0x3f 13d6c: aa 97 sbiw r28, 0x2a ; 42 13d6e: de 01 movw r26, r28 13d70: 1d 96 adiw r26, 0x0d ; 13 13d72: 6d 01 movw r12, r26 13d74: 0f 94 fb b0 call 0x361f6 ; 0x361f6 13d78: 0f 90 pop r0 13d7a: 0f 90 pop r0 13d7c: 0f 90 pop r0 13d7e: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 13d80: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 13d84: 81 11 cpse r24, r1 13d86: 3d c0 rjmp .+122 ; 0x13e02 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++) { 13d88: bf ef ldi r27, 0xFF ; 255 13d8a: 2b 1a sub r2, r27 13d8c: 3b 0a sbc r3, r27 13d8e: a4 96 adiw r28, 0x24 ; 36 13d90: ee ad ldd r30, Y+62 ; 0x3e 13d92: ff ad ldd r31, Y+63 ; 0x3f 13d94: a4 97 sbiw r28, 0x24 ; 36 13d96: e2 15 cp r30, r2 13d98: f3 05 cpc r31, r3 13d9a: 09 f0 breq .+2 ; 0x13d9e 13d9c: f4 ce rjmp .-536 ; 0x13b86 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 13d9e: 84 e7 ldi r24, 0x74 ; 116 13da0: 96 e0 ldi r25, 0x06 ; 6 13da2: 0e 94 d0 6b call 0xd7a0 ; 0xd7a0 // 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); 13da6: e0 90 7c 06 lds r14, 0x067C ; 0x80067c 13daa: f0 90 7d 06 lds r15, 0x067D ; 0x80067d 13dae: 00 91 7e 06 lds r16, 0x067E ; 0x80067e 13db2: 10 91 7f 06 lds r17, 0x067F ; 0x80067f 13db6: 20 91 78 06 lds r18, 0x0678 ; 0x800678 13dba: 30 91 79 06 lds r19, 0x0679 ; 0x800679 13dbe: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 13dc2: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 13dc6: 60 91 74 06 lds r22, 0x0674 ; 0x800674 13dca: 70 91 75 06 lds r23, 0x0675 ; 0x800675 13dce: 80 91 76 06 lds r24, 0x0676 ; 0x800676 13dd2: 90 91 77 06 lds r25, 0x0677 ; 0x800677 13dd6: 1f 92 push r1 13dd8: 1f 92 push r1 13dda: e2 e9 ldi r30, 0x92 ; 146 13ddc: f6 e0 ldi r31, 0x06 ; 6 13dde: ff 93 push r31 13de0: ef 93 push r30 13de2: aa 96 adiw r28, 0x2a ; 42 13de4: 8c ac ldd r8, Y+60 ; 0x3c 13de6: 9d ac ldd r9, Y+61 ; 0x3d 13de8: ae ac ldd r10, Y+62 ; 0x3e 13dea: bf ac ldd r11, Y+63 ; 0x3f 13dec: aa 97 sbiw r28, 0x2a ; 42 13dee: a0 e8 ldi r26, 0x80 ; 128 13df0: ca 2e mov r12, r26 13df2: a6 e0 ldi r26, 0x06 ; 6 13df4: da 2e mov r13, r26 13df6: 0f 94 fb b0 call 0x361f6 ; 0x361f6 13dfa: 0f 90 pop r0 13dfc: 0f 90 pop r0 13dfe: 0f 90 pop r0 13e00: 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(); 13e02: 0e 94 06 5b call 0xb60c ; 0xb60c previous_millis_cmd.start(); 13e06: 86 e8 ldi r24, 0x86 ; 134 13e08: 93 e0 ldi r25, 0x03 ; 3 13e0a: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> 13e0e: 7b cb rjmp .-2314 ; 0x13506 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; 13e10: 60 e0 ldi r22, 0x00 ; 0 13e12: 70 e0 ldi r23, 0x00 ; 0 13e14: cb 01 movw r24, r22 13e16: fe cb rjmp .-2052 ; 0x13614 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; 13e18: a3 2c mov r10, r3 13e1a: b2 2c mov r11, r2 13e1c: 6f 96 adiw r28, 0x1f ; 31 13e1e: 0f ad ldd r16, Y+63 ; 0x3f 13e20: 6f 97 sbiw r28, 0x1f ; 31 13e22: a3 96 adiw r28, 0x23 ; 35 13e24: 1f ad ldd r17, Y+63 ; 0x3f 13e26: a3 97 sbiw r28, 0x23 ; 35 13e28: 69 cd rjmp .-1326 ; 0x138fc 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) { 13e2a: 6f 96 adiw r28, 0x1f ; 31 13e2c: 4f ad ldd r20, Y+63 ; 0x3f 13e2e: 6f 97 sbiw r28, 0x1f ; 31 13e30: 41 50 subi r20, 0x01 ; 1 13e32: 6f 96 adiw r28, 0x1f ; 31 13e34: 4f af std Y+63, r20 ; 0x3f 13e36: 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; 13e38: ae 96 adiw r28, 0x2e ; 46 13e3a: 2c ad ldd r18, Y+60 ; 0x3c 13e3c: 3d ad ldd r19, Y+61 ; 0x3d 13e3e: 4e ad ldd r20, Y+62 ; 0x3e 13e40: 5f ad ldd r21, Y+63 ; 0x3f 13e42: ae 97 sbiw r28, 0x2e ; 46 13e44: 6e 96 adiw r28, 0x1e ; 30 13e46: 6c ad ldd r22, Y+60 ; 0x3c 13e48: 7d ad ldd r23, Y+61 ; 0x3d 13e4a: 8e ad ldd r24, Y+62 ; 0x3e 13e4c: 9f ad ldd r25, Y+63 ; 0x3f 13e4e: 6e 97 sbiw r28, 0x1e ; 30 13e50: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13e54: 6b 01 movw r12, r22 13e56: 7c 01 movw r14, r24 13e58: e6 96 adiw r28, 0x36 ; 54 13e5a: 2c ad ldd r18, Y+60 ; 0x3c 13e5c: 3d ad ldd r19, Y+61 ; 0x3d 13e5e: 4e ad ldd r20, Y+62 ; 0x3e 13e60: 5f ad ldd r21, Y+63 ; 0x3f 13e62: e6 97 sbiw r28, 0x36 ; 54 13e64: 6a 96 adiw r28, 0x1a ; 26 13e66: 6c ad ldd r22, Y+60 ; 0x3c 13e68: 7d ad ldd r23, Y+61 ; 0x3d 13e6a: 8e ad ldd r24, Y+62 ; 0x3e 13e6c: 9f ad ldd r25, Y+63 ; 0x3f 13e6e: 6a 97 sbiw r28, 0x1a ; 26 13e70: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13e74: 9b 01 movw r18, r22 13e76: ac 01 movw r20, r24 13e78: c7 01 movw r24, r14 13e7a: b6 01 movw r22, r12 13e7c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 13e80: 7b 01 movw r14, r22 13e82: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 13e84: e6 96 adiw r28, 0x36 ; 54 13e86: 2c ad ldd r18, Y+60 ; 0x3c 13e88: 3d ad ldd r19, Y+61 ; 0x3d 13e8a: 4e ad ldd r20, Y+62 ; 0x3e 13e8c: 5f ad ldd r21, Y+63 ; 0x3f 13e8e: e6 97 sbiw r28, 0x36 ; 54 13e90: 6e 96 adiw r28, 0x1e ; 30 13e92: 6c ad ldd r22, Y+60 ; 0x3c 13e94: 7d ad ldd r23, Y+61 ; 0x3d 13e96: 8e ad ldd r24, Y+62 ; 0x3e 13e98: 9f ad ldd r25, Y+63 ; 0x3f 13e9a: 6e 97 sbiw r28, 0x1e ; 30 13e9c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13ea0: 4b 01 movw r8, r22 13ea2: 5c 01 movw r10, r24 13ea4: ae 96 adiw r28, 0x2e ; 46 13ea6: 2c ad ldd r18, Y+60 ; 0x3c 13ea8: 3d ad ldd r19, Y+61 ; 0x3d 13eaa: 4e ad ldd r20, Y+62 ; 0x3e 13eac: 5f ad ldd r21, Y+63 ; 0x3f 13eae: ae 97 sbiw r28, 0x2e ; 46 13eb0: 6a 96 adiw r28, 0x1a ; 26 13eb2: 6c ad ldd r22, Y+60 ; 0x3c 13eb4: 7d ad ldd r23, Y+61 ; 0x3d 13eb6: 8e ad ldd r24, Y+62 ; 0x3e 13eb8: 9f ad ldd r25, Y+63 ; 0x3f 13eba: 6a 97 sbiw r28, 0x1a ; 26 13ebc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13ec0: 9b 01 movw r18, r22 13ec2: ac 01 movw r20, r24 13ec4: c5 01 movw r24, r10 13ec6: b4 01 movw r22, r8 13ec8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 13ecc: 6e 96 adiw r28, 0x1e ; 30 13ece: 6c af std Y+60, r22 ; 0x3c 13ed0: 7d af std Y+61, r23 ; 0x3d 13ed2: 8e af std Y+62, r24 ; 0x3e 13ed4: 9f af std Y+63, r25 ; 0x3f 13ed6: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = r_axisi; 13ed8: c7 01 movw r24, r14 13eda: d8 01 movw r26, r16 13edc: 6a 96 adiw r28, 0x1a ; 26 13ede: 8c af std Y+60, r24 ; 0x3c 13ee0: 9d af std Y+61, r25 ; 0x3d 13ee2: ae af std Y+62, r26 ; 0x3e 13ee4: bf af std Y+63, r27 ; 0x3f 13ee6: 6a 97 sbiw r28, 0x1a ; 26 13ee8: d7 ce rjmp .-594 ; 0x13c98 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13eea: 80 e5 ldi r24, 0x50 ; 80 13eec: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 13ef0: c1 2c mov r12, r1 13ef2: d1 2c mov r13, r1 13ef4: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 13ef6: 88 23 and r24, r24 13ef8: 31 f0 breq .+12 ; 0x13f06 13efa: 0e 94 a4 60 call 0xc148 ; 0xc148 13efe: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 13f02: 6b 01 movw r12, r22 13f04: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 13f06: 83 e5 ldi r24, 0x53 ; 83 13f08: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 13f0c: 88 23 and r24, r24 13f0e: 61 f0 breq .+24 ; 0x13f28 13f10: 0e 94 a4 60 call 0xc148 ; 0xc148 13f14: 20 e0 ldi r18, 0x00 ; 0 13f16: 30 e0 ldi r19, 0x00 ; 0 13f18: 4a e7 ldi r20, 0x7A ; 122 13f1a: 54 e4 ldi r21, 0x44 ; 68 13f1c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 13f20: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 13f24: 6b 01 movw r12, r22 13f26: 7c 01 movw r14, r24 if(codenum != 0) 13f28: c1 14 cp r12, r1 13f2a: d1 04 cpc r13, r1 13f2c: e1 04 cpc r14, r1 13f2e: f1 04 cpc r15, r1 13f30: 41 f0 breq .+16 ; 0x13f42 { if(custom_message_type != CustomMsg::M117) 13f32: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 13f36: 87 30 cpi r24, 0x07 ; 7 13f38: 21 f0 breq .+8 ; 0x13f42 { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 13f3a: 87 e2 ldi r24, 0x27 ; 39 13f3c: 9a e6 ldi r25, 0x6A ; 106 13f3e: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 } } st_synchronize(); 13f42: 0f 94 ef 42 call 0x285de ; 0x285de codenum += _millis(); // keep track of when we started waiting 13f46: 0f 94 53 29 call 0x252a6 ; 0x252a6 13f4a: c6 0e add r12, r22 13f4c: d7 1e adc r13, r23 13f4e: e8 1e adc r14, r24 13f50: f9 1e adc r15, r25 previous_millis_cmd.start(); 13f52: 86 e8 ldi r24, 0x86 ; 134 13f54: 93 e0 ldi r25, 0x03 ; 3 13f56: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> while(_millis() < codenum) { 13f5a: 0f 94 53 29 call 0x252a6 ; 0x252a6 13f5e: 6c 15 cp r22, r12 13f60: 7d 05 cpc r23, r13 13f62: 8e 05 cpc r24, r14 13f64: 9f 05 cpc r25, r15 13f66: 08 f0 brcs .+2 ; 0x13f6a 13f68: ce ca rjmp .-2660 ; 0x13506 manage_heater(); 13f6a: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(); 13f6e: 80 e0 ldi r24, 0x00 ; 0 13f70: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 13f74: 80 e0 ldi r24, 0x00 ; 0 13f76: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 13f7a: ef cf rjmp .-34 ; 0x13f5a 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); 13f7c: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 13f7e: 0f 94 2f 8a call 0x3145e ; 0x3145e 13f82: c1 ca rjmp .-2686 ; 0x13506 13f84: 80 e0 ldi r24, 0x00 ; 0 13f86: fb cf rjmp .-10 ; 0x13f7e - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 13f88: 6e 96 adiw r28, 0x1e ; 30 13f8a: 1c ae std Y+60, r1 ; 0x3c 13f8c: 1d ae std Y+61, r1 ; 0x3d 13f8e: 1e ae std Y+62, r1 ; 0x3e 13f90: 1f ae std Y+63, r1 ; 0x3f 13f92: 6e 97 sbiw r28, 0x1e ; 30 13f94: 35 ca rjmp .-2966 ; 0x13400 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 13f96: 0f 94 ef 42 call 0x285de ; 0x285de homing_flag = true; 13f9a: 81 e0 ldi r24, 0x01 ; 1 13f9c: 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(); 13fa0: 0e 94 ef 66 call 0xcdde ; 0xcdde 13fa4: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 13fa6: 80 e0 ldi r24, 0x00 ; 0 13fa8: 90 e0 ldi r25, 0x00 ; 0 13faa: a8 e4 ldi r26, 0x48 ; 72 13fac: b4 e4 ldi r27, 0x44 ; 68 13fae: 80 93 b8 02 sts 0x02B8, r24 ; 0x8002b8 13fb2: 90 93 b9 02 sts 0x02B9, r25 ; 0x8002b9 13fb6: a0 93 ba 02 sts 0x02BA, r26 ; 0x8002ba 13fba: b0 93 bb 02 sts 0x02BB, r27 ; 0x8002bb find_bed_induction_sensor_point_z(-10.f, 3); 13fbe: 43 e0 ldi r20, 0x03 ; 3 13fc0: 60 e0 ldi r22, 0x00 ; 0 13fc2: 70 e0 ldi r23, 0x00 ; 0 13fc4: 80 e2 ldi r24, 0x20 ; 32 13fc6: 91 ec ldi r25, 0xC1 ; 193 13fc8: 0f 94 5e 8c call 0x318bc ; 0x318bc printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 13fcc: 70 90 9a 06 lds r7, 0x069A ; 0x80069a 13fd0: 60 90 9b 06 lds r6, 0x069B ; 0x80069b 13fd4: 50 90 9c 06 lds r5, 0x069C ; 0x80069c 13fd8: 40 90 9d 06 lds r4, 0x069D ; 0x80069d 13fdc: b0 90 96 06 lds r11, 0x0696 ; 0x800696 13fe0: a0 90 97 06 lds r10, 0x0697 ; 0x800697 13fe4: 90 90 98 06 lds r9, 0x0698 ; 0x800698 13fe8: 80 90 99 06 lds r8, 0x0699 ; 0x800699 13fec: f0 90 92 06 lds r15, 0x0692 ; 0x800692 13ff0: e0 90 93 06 lds r14, 0x0693 ; 0x800693 13ff4: d0 90 94 06 lds r13, 0x0694 ; 0x800694 13ff8: c0 90 95 06 lds r12, 0x0695 ; 0x800695 13ffc: 85 ef ldi r24, 0xF5 ; 245 13ffe: 93 e4 ldi r25, 0x43 ; 67 14000: 0e 94 b3 72 call 0xe566 ; 0xe566 14004: 4f 92 push r4 14006: 5f 92 push r5 14008: 6f 92 push r6 1400a: 7f 92 push r7 1400c: 8f 92 push r8 1400e: 9f 92 push r9 14010: af 92 push r10 14012: bf 92 push r11 14014: cf 92 push r12 14016: df 92 push r13 14018: ef 92 push r14 1401a: ff 92 push r15 1401c: 9f 93 push r25 1401e: 8f 93 push r24 14020: 8b e0 ldi r24, 0x0B ; 11 14022: 9a e6 ldi r25, 0x6A ; 106 14024: 9f 93 push r25 14026: 8f 93 push r24 14028: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca clean_up_after_endstop_move(l_feedmultiply); 1402c: c8 01 movw r24, r16 1402e: 0e 94 d5 66 call 0xcdaa ; 0xcdaa homing_flag = false; 14032: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 14036: 0f b6 in r0, 0x3f ; 63 14038: f8 94 cli 1403a: de bf out 0x3e, r29 ; 62 1403c: 0f be out 0x3f, r0 ; 63 1403e: cd bf out 0x3d, r28 ; 61 14040: 62 ca rjmp .-2876 ; 0x13506 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 14042: 20 e0 ldi r18, 0x00 ; 0 14044: 30 e0 ldi r19, 0x00 ; 0 14046: 40 e2 ldi r20, 0x20 ; 32 14048: 51 e4 ldi r21, 0x41 ; 65 1404a: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1404e: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14052: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14056: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1405a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1405e: 87 ff sbrs r24, 7 14060: 05 c0 rjmp .+10 ; 0x1406c { SERIAL_ECHOLNPGM("No PINDA thermistor"); 14062: 8a eb ldi r24, 0xBA ; 186 14064: 97 e8 ldi r25, 0x87 ; 135 14066: 0e 94 82 79 call 0xf304 ; 0xf304 1406a: 4d ca rjmp .-2918 ; 0x13506 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1406c: 82 e0 ldi r24, 0x02 ; 2 1406e: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 14072: 81 11 cpse r24, r1 14074: 07 c0 rjmp .+14 ; 0x14084 //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)); 14076: 8f e5 ldi r24, 0x5F ; 95 14078: 9a e3 ldi r25, 0x3A ; 58 1407a: 0e 94 b3 72 call 0xe566 ; 0xe566 1407e: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 14082: 41 ca rjmp .-2942 ; 0x13506 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 14084: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 14088: 88 23 and r24, r24 1408a: 41 f0 breq .+16 ; 0x1409c 1408c: 80 91 90 06 lds r24, 0x0690 ; 0x800690 14090: 88 23 and r24, r24 14092: 21 f0 breq .+8 ; 0x1409c 14094: 10 91 91 06 lds r17, 0x0691 ; 0x800691 14098: 11 11 cpse r17, r1 1409a: 08 c0 rjmp .+16 ; 0x140ac 1409c: 81 e0 ldi r24, 0x01 ; 1 1409e: 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); 140a2: 84 ee ldi r24, 0xE4 ; 228 140a4: 9b e6 ldi r25, 0x6B ; 107 140a6: 0f 94 04 75 call 0x2ea08 ; 0x2ea08 140aa: 2d ca rjmp .-2982 ; 0x13506 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 140ac: 86 e1 ldi r24, 0x16 ; 22 140ae: 9a e3 ldi r25, 0x3A ; 58 140b0: 0e 94 b3 72 call 0xe566 ; 0xe566 140b4: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 140b8: 8f eb ldi r24, 0xBF ; 191 140ba: 9e e3 ldi r25, 0x3E ; 62 140bc: 0e 94 b3 72 call 0xe566 ; 0xe566 140c0: 41 e0 ldi r20, 0x01 ; 1 140c2: 60 e0 ldi r22, 0x00 ; 0 140c4: 0f 94 47 4f call 0x29e8e ; 0x29e8e if (result == LCD_LEFT_BUTTON_CHOICE) 140c8: 81 11 cpse r24, r1 140ca: 61 c0 rjmp .+194 ; 0x1418e { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 140cc: 80 e0 ldi r24, 0x00 ; 0 140ce: 90 e0 ldi r25, 0x00 ; 0 140d0: a0 ea ldi r26, 0xA0 ; 160 140d2: b0 e4 ldi r27, 0x40 ; 64 140d4: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 140d8: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 140dc: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 140e0: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 140e4: 60 e0 ldi r22, 0x00 ; 0 140e6: 70 e0 ldi r23, 0x00 ; 0 140e8: 88 e4 ldi r24, 0x48 ; 72 140ea: 92 e4 ldi r25, 0x42 ; 66 140ec: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[Z_AXIS] = 50; 140f0: 80 e0 ldi r24, 0x00 ; 0 140f2: 90 e0 ldi r25, 0x00 ; 0 140f4: a8 e4 ldi r26, 0x48 ; 72 140f6: b2 e4 ldi r27, 0x42 ; 66 140f8: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 140fc: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 14100: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14104: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d current_position[Y_AXIS] = 180; 14108: 80 e0 ldi r24, 0x00 ; 0 1410a: 90 e0 ldi r25, 0x00 ; 0 1410c: a4 e3 ldi r26, 0x34 ; 52 1410e: b3 e4 ldi r27, 0x43 ; 67 14110: 80 93 96 06 sts 0x0696, r24 ; 0x800696 14114: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14118: a0 93 98 06 sts 0x0698, r26 ; 0x800698 1411c: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 14120: 60 e0 ldi r22, 0x00 ; 0 14122: 70 e0 ldi r23, 0x00 ; 0 14124: 88 e4 ldi r24, 0x48 ; 72 14126: 92 e4 ldi r25, 0x42 ; 66 14128: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1412c: 0f 94 ef 42 call 0x285de ; 0x285de lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 14130: 85 e9 ldi r24, 0x95 ; 149 14132: 9e e3 ldi r25, 0x3E ; 62 14134: 0e 94 b3 72 call 0xe566 ; 0xe566 14138: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1413c: ec ee ldi r30, 0xEC ; 236 1413e: f5 ea ldi r31, 0xA5 ; 165 14140: 85 91 lpm r24, Z+ 14142: 95 91 lpm r25, Z+ 14144: a5 91 lpm r26, Z+ 14146: b4 91 lpm r27, Z 14148: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1414c: 90 93 97 06 sts 0x0697, r25 ; 0x800697 14150: a0 93 98 06 sts 0x0698, r26 ; 0x800698 14154: b0 93 99 06 sts 0x0699, r27 ; 0x800699 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14158: e8 ee ldi r30, 0xE8 ; 232 1415a: f5 ea ldi r31, 0xA5 ; 165 1415c: 85 91 lpm r24, Z+ 1415e: 95 91 lpm r25, Z+ 14160: a5 91 lpm r26, Z+ 14162: b4 91 lpm r27, Z 14164: 80 93 92 06 sts 0x0692, r24 ; 0x800692 14168: 90 93 93 06 sts 0x0693, r25 ; 0x800693 1416c: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14170: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(3000 / 60); 14174: 60 e0 ldi r22, 0x00 ; 0 14176: 70 e0 ldi r23, 0x00 ; 0 14178: 88 e4 ldi r24, 0x48 ; 72 1417a: 92 e4 ldi r25, 0x42 ; 66 1417c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 14180: 0f 94 ef 42 call 0x285de ; 0x285de gcode_G28(false, false, true); 14184: 41 e0 ldi r20, 0x01 ; 1 14186: 60 e0 ldi r22, 0x00 ; 0 14188: 80 e0 ldi r24, 0x00 ; 0 1418a: 0e 94 0c 7f call 0xfe18 ; 0xfe18 } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 1418e: 20 e0 ldi r18, 0x00 ; 0 14190: 30 e0 ldi r19, 0x00 ; 0 14192: 4c e0 ldi r20, 0x0C ; 12 14194: 52 e4 ldi r21, 0x42 ; 66 14196: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1419a: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1419e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 141a2: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 141a6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 141aa: 18 16 cp r1, r24 141ac: 0c f0 brlt .+2 ; 0x141b0 141ae: 73 c0 rjmp .+230 ; 0x14296 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 141b0: 80 e0 ldi r24, 0x00 ; 0 141b2: 90 e0 ldi r25, 0x00 ; 0 141b4: a8 ec ldi r26, 0xC8 ; 200 141b6: b2 e4 ldi r27, 0x42 ; 66 141b8: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 141bc: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 141c0: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 141c4: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 141c8: 60 e0 ldi r22, 0x00 ; 0 141ca: 70 e0 ldi r23, 0x00 ; 0 141cc: 88 e4 ldi r24, 0x48 ; 72 141ce: 92 e4 ldi r25, 0x42 ; 66 141d0: 0f 94 50 c0 call 0x380a0 ; 0x380a0 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 141d4: 0f 94 1f 2f call 0x25e3e ; 0x25e3e LongTimer pinda_timeout; 141d8: 19 82 std Y+1, r1 ; 0x01 141da: 1a 82 std Y+2, r1 ; 0x02 141dc: 1b 82 std Y+3, r1 ; 0x03 141de: 1c 82 std Y+4, r1 ; 0x04 141e0: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 141e2: ce 01 movw r24, r28 141e4: 01 96 adiw r24, 0x01 ; 1 141e6: 0f 94 f6 2b call 0x257ec ; 0x257ec ::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); 141ea: 03 e2 ldi r16, 0x23 ; 35 141ec: ee ee ldi r30, 0xEE ; 238 141ee: ee 2e mov r14, r30 141f0: e4 e8 ldi r30, 0x84 ; 132 141f2: fe 2e mov r15, r30 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 141f4: 20 e0 ldi r18, 0x00 ; 0 141f6: 30 e0 ldi r19, 0x00 ; 0 141f8: 4c e0 ldi r20, 0x0C ; 12 141fa: 52 e4 ldi r21, 0x42 ; 66 141fc: 60 91 99 03 lds r22, 0x0399 ; 0x800399 14200: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14204: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14208: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1420c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 14210: 18 16 cp r1, r24 14212: c4 f5 brge .+112 ; 0x14284 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14214: 88 ec ldi r24, 0xC8 ; 200 14216: 99 e3 ldi r25, 0x39 ; 57 14218: 0e 94 b3 72 call 0xe566 ; 0xe566 1421c: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 14220: 42 e8 ldi r20, 0x82 ; 130 14222: 64 e0 ldi r22, 0x04 ; 4 14224: 80 e0 ldi r24, 0x00 ; 0 14226: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 1422a: 1f 92 push r1 1422c: 0f 93 push r16 1422e: 60 91 99 03 lds r22, 0x0399 ; 0x800399 14232: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14236: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1423a: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1423e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 14242: 7f 93 push r23 14244: 6f 93 push r22 14246: ff 92 push r15 14248: ef 92 push r14 1424a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 lcd_putc(LCD_STR_DEGREE[0]); 1424e: 81 e8 ldi r24, 0x81 ; 129 14250: 0e 94 d6 6e call 0xddac ; 0xddac delay_keep_alive(1000); 14254: 88 ee ldi r24, 0xE8 ; 232 14256: 93 e0 ldi r25, 0x03 ; 3 14258: 0e 94 eb 8c call 0x119d6 ; 0x119d6 serialecho_temperatures(); 1425c: 0e 94 65 77 call 0xeeca ; 0xeeca if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 14260: 40 e0 ldi r20, 0x00 ; 0 14262: 53 e5 ldi r21, 0x53 ; 83 14264: 67 e0 ldi r22, 0x07 ; 7 14266: 70 e0 ldi r23, 0x00 ; 0 14268: ce 01 movw r24, r28 1426a: 01 96 adiw r24, 0x01 ; 1 1426c: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 14270: 0f 90 pop r0 14272: 0f 90 pop r0 14274: 0f 90 pop r0 14276: 0f 90 pop r0 14278: 0f 90 pop r0 1427a: 0f 90 pop r0 1427c: 88 23 and r24, r24 1427e: 09 f4 brne .+2 ; 0x14282 14280: b9 cf rjmp .-142 ; 0x141f4 target_temp_reached = false; 14282: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 14284: 81 e0 ldi r24, 0x01 ; 1 14286: 0e 94 2c 6f call 0xde58 ; 0xde58 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 1428a: 11 11 cpse r17, r1 1428c: 04 c0 rjmp .+8 ; 0x14296 lcd_temp_cal_show_result(false); 1428e: 80 e0 ldi r24, 0x00 ; 0 14290: 0f 94 43 20 call 0x24086 ; 0x24086 14294: 38 c9 rjmp .-3472 ; 0x13506 break; } } st_synchronize(); 14296: 0f 94 ef 42 call 0x285de ; 0x285de homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 1429a: 81 e0 ldi r24, 0x01 ; 1 1429c: 80 93 a7 0d sts 0x0DA7, r24 ; 0x800da7 lcd_update_enable(true); 142a0: 0e 94 2c 6f call 0xde58 ; 0xde58 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 142a4: 8c e9 ldi r24, 0x9C ; 156 142a6: 97 e8 ldi r25, 0x87 ; 135 142a8: 0e 94 82 79 call 0xf304 ; 0xf304 float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 142ac: 80 90 99 03 lds r8, 0x0399 ; 0x800399 142b0: 90 90 9a 03 lds r9, 0x039A ; 0x80039a 142b4: a0 90 9b 03 lds r10, 0x039B ; 0x80039b 142b8: b0 90 9c 03 lds r11, 0x039C ; 0x80039c 142bc: 20 e0 ldi r18, 0x00 ; 0 142be: 30 e0 ldi r19, 0x00 ; 0 142c0: 40 ea ldi r20, 0xA0 ; 160 142c2: 50 e4 ldi r21, 0x40 ; 64 142c4: c5 01 movw r24, r10 142c6: b4 01 movw r22, r8 142c8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 142cc: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 142d0: 25 e0 ldi r18, 0x05 ; 5 142d2: 26 9f mul r18, r22 142d4: a0 01 movw r20, r0 142d6: 27 9f mul r18, r23 142d8: 50 0d add r21, r0 142da: 11 24 eor r1, r1 142dc: ba 01 movw r22, r20 142de: 55 0f add r21, r21 142e0: 88 0b sbc r24, r24 142e2: 99 0b sbc r25, r25 142e4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 142e8: 1b 01 movw r2, r22 142ea: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 142ec: 20 e0 ldi r18, 0x00 ; 0 142ee: 30 e0 ldi r19, 0x00 ; 0 142f0: 4c e0 ldi r20, 0x0C ; 12 142f2: 52 e4 ldi r21, 0x42 ; 66 142f4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 142f8: 87 ff sbrs r24, 7 142fa: 06 c0 rjmp .+12 ; 0x14308 142fc: 21 2c mov r2, r1 142fe: 31 2c mov r3, r1 14300: 6c e0 ldi r22, 0x0C ; 12 14302: e6 2e mov r14, r22 14304: 72 e4 ldi r23, 0x42 ; 66 14306: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 14308: 22 2d mov r18, r2 1430a: 33 2d mov r19, r3 1430c: 4e 2d mov r20, r14 1430e: 5f 2d mov r21, r15 14310: c5 01 movw r24, r10 14312: b4 01 movw r22, r8 14314: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 14318: 18 16 cp r1, r24 1431a: 64 f4 brge .+24 ; 0x14334 1431c: 20 e0 ldi r18, 0x00 ; 0 1431e: 30 e0 ldi r19, 0x00 ; 0 14320: 40 ea ldi r20, 0xA0 ; 160 14322: 50 e4 ldi r21, 0x40 ; 64 14324: 62 2d mov r22, r2 14326: 73 2d mov r23, r3 14328: 8e 2d mov r24, r14 1432a: 9f 2d mov r25, r15 1432c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 14330: 1b 01 movw r2, r22 14332: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14334: ff 92 push r15 14336: ef 92 push r14 14338: 3f 92 push r3 1433a: 2f 92 push r2 1433c: 89 ee ldi r24, 0xE9 ; 233 1433e: 99 e6 ldi r25, 0x69 ; 105 14340: 9f 93 push r25 14342: 8f 93 push r24 14344: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca setTargetBed(70 + (start_temp - 30)); 14348: 20 e0 ldi r18, 0x00 ; 0 1434a: 30 e0 ldi r19, 0x00 ; 0 1434c: 40 ef ldi r20, 0xF0 ; 240 1434e: 51 e4 ldi r21, 0x41 ; 65 14350: 62 2d mov r22, r2 14352: 73 2d mov r23, r3 14354: 8e 2d mov r24, r14 14356: 9f 2d mov r25, r15 14358: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1435c: 20 e0 ldi r18, 0x00 ; 0 1435e: 30 e0 ldi r19, 0x00 ; 0 14360: 4c e8 ldi r20, 0x8C ; 140 14362: 52 e4 ldi r21, 0x42 ; 66 14364: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14368: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1436c: 70 93 73 06 sts 0x0673, r23 ; 0x800673 14370: 60 93 72 06 sts 0x0672, r22 ; 0x800672 custom_message_type = CustomMsg::TempCal; 14374: 84 e0 ldi r24, 0x04 ; 4 14376: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = 1; 1437a: 81 e0 ldi r24, 0x01 ; 1 1437c: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 14380: 81 e1 ldi r24, 0x11 ; 17 14382: 95 e4 ldi r25, 0x45 ; 69 14384: 0e 94 b3 72 call 0xe566 ; 0xe566 14388: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1438c: 80 e0 ldi r24, 0x00 ; 0 1438e: 90 e0 ldi r25, 0x00 ; 0 14390: a0 ea ldi r26, 0xA0 ; 160 14392: b0 e4 ldi r27, 0x40 ; 64 14394: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14398: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1439c: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 143a0: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 143a4: 60 e0 ldi r22, 0x00 ; 0 143a6: 70 e0 ldi r23, 0x00 ; 0 143a8: 88 e4 ldi r24, 0x48 ; 72 143aa: 92 e4 ldi r25, 0x42 ; 66 143ac: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[X_AXIS] = PINDA_PREHEAT_X; 143b0: 80 e0 ldi r24, 0x00 ; 0 143b2: 90 e0 ldi r25, 0x00 ; 0 143b4: a0 ea ldi r26, 0xA0 ; 160 143b6: b1 e4 ldi r27, 0x41 ; 65 143b8: 80 93 92 06 sts 0x0692, r24 ; 0x800692 143bc: 90 93 93 06 sts 0x0693, r25 ; 0x800693 143c0: a0 93 94 06 sts 0x0694, r26 ; 0x800694 143c4: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 143c8: 80 e0 ldi r24, 0x00 ; 0 143ca: 90 e0 ldi r25, 0x00 ; 0 143cc: a0 e7 ldi r26, 0x70 ; 112 143ce: b2 e4 ldi r27, 0x42 ; 66 143d0: 80 93 96 06 sts 0x0696, r24 ; 0x800696 143d4: 90 93 97 06 sts 0x0697, r25 ; 0x800697 143d8: a0 93 98 06 sts 0x0698, r26 ; 0x800698 143dc: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 143e0: 60 e0 ldi r22, 0x00 ; 0 143e2: 70 e0 ldi r23, 0x00 ; 0 143e4: 88 e4 ldi r24, 0x48 ; 72 143e6: 92 e4 ldi r25, 0x42 ; 66 143e8: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 143ec: 8a e9 ldi r24, 0x9A ; 154 143ee: 99 e9 ldi r25, 0x99 ; 153 143f0: a9 e1 ldi r26, 0x19 ; 25 143f2: be e3 ldi r27, 0x3E ; 62 143f4: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 143f8: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 143fc: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 14400: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14404: 60 e0 ldi r22, 0x00 ; 0 14406: 70 e0 ldi r23, 0x00 ; 0 14408: 88 e4 ldi r24, 0x48 ; 72 1440a: 92 e4 ldi r25, 0x42 ; 66 1440c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 14410: 0f 94 ef 42 call 0x285de ; 0x285de 14414: 0f 90 pop r0 14416: 0f 90 pop r0 14418: 0f 90 pop r0 1441a: 0f 90 pop r0 1441c: 0f 90 pop r0 1441e: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 14420: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14424: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 14428: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 1442c: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 14430: 62 2d mov r22, r2 14432: 73 2d mov r23, r3 14434: 8e 2d mov r24, r14 14436: 9f 2d mov r25, r15 14438: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1443c: 18 16 cp r1, r24 1443e: 3c f4 brge .+14 ; 0x1444e { delay_keep_alive(1000); 14440: 88 ee ldi r24, 0xE8 ; 232 14442: 93 e0 ldi r25, 0x03 ; 3 14444: 0e 94 eb 8c call 0x119d6 ; 0x119d6 serialecho_temperatures(); 14448: 0e 94 65 77 call 0xeeca ; 0xeeca 1444c: e9 cf rjmp .-46 ; 0x14420 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1444e: 60 e0 ldi r22, 0x00 ; 0 14450: 86 ea ldi r24, 0xA6 ; 166 14452: 9f e0 ldi r25, 0x0F ; 15 14454: 0f 94 47 dc call 0x3b88e ; 0x3b88e } 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; 14458: 80 e0 ldi r24, 0x00 ; 0 1445a: 90 e0 ldi r25, 0x00 ; 0 1445c: a0 ea ldi r26, 0xA0 ; 160 1445e: b0 e4 ldi r27, 0x40 ; 64 14460: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14464: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 14468: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1446c: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14470: 60 e0 ldi r22, 0x00 ; 0 14472: 70 e0 ldi r23, 0x00 ; 0 14474: 88 e4 ldi r24, 0x48 ; 72 14476: 92 e4 ldi r25, 0x42 ; 66 14478: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1447c: e8 ee ldi r30, 0xE8 ; 232 1447e: f5 ea ldi r31, 0xA5 ; 165 14480: 85 91 lpm r24, Z+ 14482: 95 91 lpm r25, Z+ 14484: a5 91 lpm r26, Z+ 14486: b4 91 lpm r27, Z 14488: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1448c: 90 93 93 06 sts 0x0693, r25 ; 0x800693 14490: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14494: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14498: ec ee ldi r30, 0xEC ; 236 1449a: f5 ea ldi r31, 0xA5 ; 165 1449c: 85 91 lpm r24, Z+ 1449e: 95 91 lpm r25, Z+ 144a0: a5 91 lpm r26, Z+ 144a2: b4 91 lpm r27, Z 144a4: 80 93 96 06 sts 0x0696, r24 ; 0x800696 144a8: 90 93 97 06 sts 0x0697, r25 ; 0x800697 144ac: a0 93 98 06 sts 0x0698, r26 ; 0x800698 144b0: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 144b4: 60 e0 ldi r22, 0x00 ; 0 144b6: 70 e0 ldi r23, 0x00 ; 0 144b8: 88 e4 ldi r24, 0x48 ; 72 144ba: 92 e4 ldi r25, 0x42 ; 66 144bc: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 144c0: 0f 94 ef 42 call 0x285de ; 0x285de bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 144c4: 43 e0 ldi r20, 0x03 ; 3 144c6: 60 e0 ldi r22, 0x00 ; 0 144c8: 70 e0 ldi r23, 0x00 ; 0 144ca: 80 e8 ldi r24, 0x80 ; 128 144cc: 9f eb ldi r25, 0xBF ; 191 144ce: 0f 94 5e 8c call 0x318bc ; 0x318bc if (find_z_result == false) { 144d2: 81 11 cpse r24, r1 144d4: 06 c0 rjmp .+12 ; 0x144e2 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); 144d6: 0f 94 43 20 call 0x24086 ; 0x24086 homing_flag = false; 144da: 10 92 a7 0d sts 0x0DA7, r1 ; 0x800da7 144de: 0c 94 83 9a jmp 0x13506 ; 0x13506 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 144e2: 90 91 9a 06 lds r25, 0x069A ; 0x80069a 144e6: 67 96 adiw r28, 0x17 ; 23 144e8: 9f af std Y+63, r25 ; 0x3f 144ea: 67 97 sbiw r28, 0x17 ; 23 144ec: a0 91 9b 06 lds r26, 0x069B ; 0x80069b 144f0: 6b 96 adiw r28, 0x1b ; 27 144f2: af af std Y+63, r26 ; 0x3f 144f4: 6b 97 sbiw r28, 0x1b ; 27 144f6: b0 91 9c 06 lds r27, 0x069C ; 0x80069c 144fa: 6f 96 adiw r28, 0x1f ; 31 144fc: bf af std Y+63, r27 ; 0x3f 144fe: 6f 97 sbiw r28, 0x1f ; 31 14500: e0 91 9d 06 lds r30, 0x069D ; 0x80069d 14504: a7 96 adiw r28, 0x27 ; 39 14506: ef af std Y+63, r30 ; 0x3f 14508: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 1450a: ef 93 push r30 1450c: bf 93 push r27 1450e: af 93 push r26 14510: 9f 93 push r25 14512: 8c ed ldi r24, 0xDC ; 220 14514: 99 e6 ldi r25, 0x69 ; 105 14516: 9f 93 push r25 14518: 8f 93 push r24 1451a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 1451e: 0f 90 pop r0 14520: 0f 90 pop r0 14522: 0f 90 pop r0 14524: 0f 90 pop r0 14526: 0f 90 pop r0 14528: 0f 90 pop r0 1452a: 4e ea ldi r20, 0xAE ; 174 1452c: 84 2e mov r8, r20 1452e: 4f e0 ldi r20, 0x0F ; 15 14530: 94 2e mov r9, r20 14532: 53 e2 ldi r21, 0x23 ; 35 14534: c5 2e mov r12, r21 14536: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 14538: 0f ef ldi r16, 0xFF ; 255 1453a: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 1453c: b6 01 movw r22, r12 1453e: 0d 2c mov r0, r13 14540: 00 0c add r0, r0 14542: 88 0b sbc r24, r24 14544: 99 0b sbc r25, r25 14546: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1454a: 2b 01 movw r4, r22 1454c: 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)); 1454e: df 92 push r13 14550: cf 92 push r12 14552: c8 01 movw r24, r16 14554: 02 96 adiw r24, 0x02 ; 2 14556: 9f 93 push r25 14558: 8f 93 push r24 1455a: 20 ea ldi r18, 0xA0 ; 160 1455c: 39 e6 ldi r19, 0x69 ; 105 1455e: 3f 93 push r19 14560: 2f 93 push r18 14562: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 14566: 58 01 movw r10, r16 14568: 5f ef ldi r21, 0xFF ; 255 1456a: a5 1a sub r10, r21 1456c: b5 0a sbc r11, r21 if (i >= 0) { 1456e: 0f 90 pop r0 14570: 0f 90 pop r0 14572: 0f 90 pop r0 14574: 0f 90 pop r0 14576: 0f 90 pop r0 14578: 0f 90 pop r0 1457a: 11 f4 brne .+4 ; 0x14580 1457c: 0c 94 43 cc jmp 0x19886 ; 0x19886 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 14580: 70 e0 ldi r23, 0x00 ; 0 14582: 60 e0 ldi r22, 0x00 ; 0 14584: c4 01 movw r24, r8 14586: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 1458a: a3 01 movw r20, r6 1458c: 92 01 movw r18, r4 1458e: 62 2d mov r22, r2 14590: 73 2d mov r23, r3 14592: 8e 2d mov r24, r14 14594: 9f 2d mov r25, r15 14596: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1459a: 18 16 cp r1, r24 1459c: 44 f4 brge .+16 ; 0x145ae } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 1459e: 85 e0 ldi r24, 0x05 ; 5 145a0: a8 16 cp r10, r24 145a2: b1 04 cpc r11, r1 145a4: 11 f0 breq .+4 ; 0x145aa 145a6: 0c 94 4f cc jmp 0x1989e ; 0x1989e 145aa: 05 e0 ldi r16, 0x05 ; 5 145ac: 10 e0 ldi r17, 0x00 ; 0 145ae: 58 01 movw r10, r16 145b0: 97 e2 ldi r25, 0x27 ; 39 145b2: a9 1a sub r10, r25 145b4: 98 ef ldi r25, 0xF8 ; 248 145b6: b9 0a sbc r11, r25 145b8: aa 0c add r10, r10 145ba: bb 1c adc r11, r11 145bc: 85 e0 ldi r24, 0x05 ; 5 145be: 80 9f mul r24, r16 145c0: 10 01 movw r2, r0 145c2: 81 9f mul r24, r17 145c4: 30 0c add r3, r0 145c6: 11 24 eor r1, r1 145c8: 0d 5f subi r16, 0xFD ; 253 145ca: 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; 145cc: 2a e9 ldi r18, 0x9A ; 154 145ce: 42 2e mov r4, r18 145d0: 29 e9 ldi r18, 0x99 ; 153 145d2: 52 2e mov r5, r18 145d4: 29 e1 ldi r18, 0x19 ; 25 145d6: 62 2e mov r6, r18 145d8: 2e e3 ldi r18, 0x3E ; 62 145da: 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); 145dc: 37 e6 ldi r19, 0x67 ; 103 145de: 83 2e mov r8, r19 145e0: 39 e6 ldi r19, 0x69 ; 105 145e2: 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++) 145e4: c8 01 movw r24, r16 145e6: 02 97 sbiw r24, 0x02 ; 2 145e8: 05 97 sbiw r24, 0x05 ; 5 145ea: 0c f0 brlt .+2 ; 0x145ee 145ec: d4 c0 rjmp .+424 ; 0x14796 { float temp = (40 + i * 5); 145ee: b1 01 movw r22, r2 145f0: 63 5d subi r22, 0xD3 ; 211 145f2: 7f 4f sbci r23, 0xFF ; 255 145f4: 07 2e mov r0, r23 145f6: 00 0c add r0, r0 145f8: 88 0b sbc r24, r24 145fa: 99 0b sbc r25, r25 145fc: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 14600: 6b 01 movw r12, r22 14602: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14604: 1f 93 push r17 14606: 0f 93 push r16 14608: a3 e9 ldi r26, 0x93 ; 147 1460a: b9 e6 ldi r27, 0x69 ; 105 1460c: bf 93 push r27 1460e: af 93 push r26 14610: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca custom_message_state = i + 2; 14614: 00 93 f7 03 sts 0x03F7, r16 ; 0x8003f7 setTargetBed(50 + 10 * (temp - 30) / 5); 14618: 20 e0 ldi r18, 0x00 ; 0 1461a: 30 e0 ldi r19, 0x00 ; 0 1461c: 40 ef ldi r20, 0xF0 ; 240 1461e: 51 e4 ldi r21, 0x41 ; 65 14620: c7 01 movw r24, r14 14622: b6 01 movw r22, r12 14624: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 14628: 20 e0 ldi r18, 0x00 ; 0 1462a: 30 e0 ldi r19, 0x00 ; 0 1462c: 40 e2 ldi r20, 0x20 ; 32 1462e: 51 e4 ldi r21, 0x41 ; 65 14630: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 14634: 20 e0 ldi r18, 0x00 ; 0 14636: 30 e0 ldi r19, 0x00 ; 0 14638: 40 ea ldi r20, 0xA0 ; 160 1463a: 50 e4 ldi r21, 0x40 ; 64 1463c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 14640: 20 e0 ldi r18, 0x00 ; 0 14642: 30 e0 ldi r19, 0x00 ; 0 14644: 48 e4 ldi r20, 0x48 ; 72 14646: 52 e4 ldi r21, 0x42 ; 66 14648: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1464c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 14650: 70 93 73 06 sts 0x0673, r23 ; 0x800673 14654: 60 93 72 06 sts 0x0672, r22 ; 0x800672 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14658: 80 e0 ldi r24, 0x00 ; 0 1465a: 90 e0 ldi r25, 0x00 ; 0 1465c: a0 ea ldi r26, 0xA0 ; 160 1465e: b0 e4 ldi r27, 0x40 ; 64 14660: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14664: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 14668: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1466c: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14670: 60 e0 ldi r22, 0x00 ; 0 14672: 70 e0 ldi r23, 0x00 ; 0 14674: 88 e4 ldi r24, 0x48 ; 72 14676: 92 e4 ldi r25, 0x42 ; 66 14678: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[X_AXIS] = PINDA_PREHEAT_X; 1467c: 20 e0 ldi r18, 0x00 ; 0 1467e: 30 e0 ldi r19, 0x00 ; 0 14680: 40 ea ldi r20, 0xA0 ; 160 14682: 51 e4 ldi r21, 0x41 ; 65 14684: 20 93 92 06 sts 0x0692, r18 ; 0x800692 14688: 30 93 93 06 sts 0x0693, r19 ; 0x800693 1468c: 40 93 94 06 sts 0x0694, r20 ; 0x800694 14690: 50 93 95 06 sts 0x0695, r21 ; 0x800695 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14694: 80 e0 ldi r24, 0x00 ; 0 14696: 90 e0 ldi r25, 0x00 ; 0 14698: a0 e7 ldi r26, 0x70 ; 112 1469a: b2 e4 ldi r27, 0x42 ; 66 1469c: 80 93 96 06 sts 0x0696, r24 ; 0x800696 146a0: 90 93 97 06 sts 0x0697, r25 ; 0x800697 146a4: a0 93 98 06 sts 0x0698, r26 ; 0x800698 146a8: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 146ac: 60 e0 ldi r22, 0x00 ; 0 146ae: 70 e0 ldi r23, 0x00 ; 0 146b0: 88 e4 ldi r24, 0x48 ; 72 146b2: 92 e4 ldi r25, 0x42 ; 66 146b4: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 146b8: 40 92 9a 06 sts 0x069A, r4 ; 0x80069a 146bc: 50 92 9b 06 sts 0x069B, r5 ; 0x80069b 146c0: 60 92 9c 06 sts 0x069C, r6 ; 0x80069c 146c4: 70 92 9d 06 sts 0x069D, r7 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 146c8: 60 e0 ldi r22, 0x00 ; 0 146ca: 70 e0 ldi r23, 0x00 ; 0 146cc: 88 e4 ldi r24, 0x48 ; 72 146ce: 92 e4 ldi r25, 0x42 ; 66 146d0: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 146d4: 0f 94 ef 42 call 0x285de ; 0x285de 146d8: 0f 90 pop r0 146da: 0f 90 pop r0 146dc: 0f 90 pop r0 146de: 0f 90 pop r0 while (current_temperature_pinda < temp) 146e0: 20 91 99 03 lds r18, 0x0399 ; 0x800399 146e4: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 146e8: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 146ec: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 146f0: c7 01 movw r24, r14 146f2: b6 01 movw r22, r12 146f4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 146f8: 18 16 cp r1, r24 146fa: 3c f4 brge .+14 ; 0x1470a { delay_keep_alive(1000); 146fc: 88 ee ldi r24, 0xE8 ; 232 146fe: 93 e0 ldi r25, 0x03 ; 3 14700: 0e 94 eb 8c call 0x119d6 ; 0x119d6 serialecho_temperatures(); 14704: 0e 94 65 77 call 0xeeca ; 0xeeca 14708: eb cf rjmp .-42 ; 0x146e0 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1470a: 80 e0 ldi r24, 0x00 ; 0 1470c: 90 e0 ldi r25, 0x00 ; 0 1470e: a0 ea ldi r26, 0xA0 ; 160 14710: b0 e4 ldi r27, 0x40 ; 64 14712: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 14716: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1471a: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1471e: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(3000 / 60); 14722: 60 e0 ldi r22, 0x00 ; 0 14724: 70 e0 ldi r23, 0x00 ; 0 14726: 88 e4 ldi r24, 0x48 ; 72 14728: 92 e4 ldi r25, 0x42 ; 66 1472a: 0f 94 50 c0 call 0x380a0 ; 0x380a0 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1472e: e8 ee ldi r30, 0xE8 ; 232 14730: f5 ea ldi r31, 0xA5 ; 165 14732: 85 91 lpm r24, Z+ 14734: 95 91 lpm r25, Z+ 14736: a5 91 lpm r26, Z+ 14738: b4 91 lpm r27, Z 1473a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1473e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 14742: a0 93 94 06 sts 0x0694, r26 ; 0x800694 14746: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 1474a: ec ee ldi r30, 0xEC ; 236 1474c: f5 ea ldi r31, 0xA5 ; 165 1474e: 85 91 lpm r24, Z+ 14750: 95 91 lpm r25, Z+ 14752: a5 91 lpm r26, Z+ 14754: b4 91 lpm r27, Z 14756: 80 93 96 06 sts 0x0696, r24 ; 0x800696 1475a: 90 93 97 06 sts 0x0697, r25 ; 0x800697 1475e: a0 93 98 06 sts 0x0698, r26 ; 0x800698 14762: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(3000 / 60); 14766: 60 e0 ldi r22, 0x00 ; 0 14768: 70 e0 ldi r23, 0x00 ; 0 1476a: 88 e4 ldi r24, 0x48 ; 72 1476c: 92 e4 ldi r25, 0x42 ; 66 1476e: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 14772: 0f 94 ef 42 call 0x285de ; 0x285de find_z_result = find_bed_induction_sensor_point_z(-1.f); 14776: 43 e0 ldi r20, 0x03 ; 3 14778: 60 e0 ldi r22, 0x00 ; 0 1477a: 70 e0 ldi r23, 0x00 ; 0 1477c: 80 e8 ldi r24, 0x80 ; 128 1477e: 9f eb ldi r25, 0xBF ; 191 14780: 0f 94 5e 8c call 0x318bc ; 0x318bc 14784: 95 e0 ldi r25, 0x05 ; 5 14786: 29 0e add r2, r25 14788: 31 1c adc r3, r1 1478a: 0f 5f subi r16, 0xFF ; 255 1478c: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 1478e: 81 11 cpse r24, r1 14790: 04 c0 rjmp .+8 ; 0x1479a lcd_temp_cal_show_result(find_z_result); 14792: 0f 94 43 20 call 0x24086 ; 0x24086 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); 14796: 81 e0 ldi r24, 0x01 ; 1 14798: 9e ce rjmp .-708 ; 0x144d6 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]); 1479a: 67 96 adiw r28, 0x17 ; 23 1479c: 7f ad ldd r23, Y+63 ; 0x3f 1479e: 67 97 sbiw r28, 0x17 ; 23 147a0: 6b 96 adiw r28, 0x1b ; 27 147a2: 6f ad ldd r22, Y+63 ; 0x3f 147a4: 6b 97 sbiw r28, 0x1b ; 27 147a6: 6f 96 adiw r28, 0x1f ; 31 147a8: 9f ad ldd r25, Y+63 ; 0x3f 147aa: 6f 97 sbiw r28, 0x1f ; 31 147ac: a7 96 adiw r28, 0x27 ; 39 147ae: 8f ad ldd r24, Y+63 ; 0x3f 147b0: a7 97 sbiw r28, 0x27 ; 39 147b2: 27 2f mov r18, r23 147b4: 36 2f mov r19, r22 147b6: 49 2f mov r20, r25 147b8: 58 2f mov r21, r24 147ba: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 147be: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 147c2: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 147c6: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 147ca: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 147ce: f6 2e mov r15, r22 147d0: e7 2e mov r14, r23 147d2: d8 2e mov r13, r24 147d4: c9 2e mov r12, r25 147d6: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 147da: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 147de: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 147e2: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 147e6: d7 01 movw r26, r14 147e8: f6 01 movw r30, r12 147ea: 6b 2f mov r22, r27 147ec: 7a 2f mov r23, r26 147ee: 8f 2f mov r24, r31 147f0: 9e 2f mov r25, r30 147f2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 147f6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 147fa: a6 96 adiw r28, 0x26 ; 38 147fc: 6c af std Y+60, r22 ; 0x3c 147fe: 7d af std Y+61, r23 ; 0x3d 14800: 8e af std Y+62, r24 ; 0x3e 14802: 9f af std Y+63, r25 ; 0x3f 14804: 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); 14806: cf 92 push r12 14808: df 92 push r13 1480a: ef 92 push r14 1480c: ff 92 push r15 1480e: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 14812: 8f 93 push r24 14814: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14818: 8f 93 push r24 1481a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 1481e: 8f 93 push r24 14820: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14824: 8f 93 push r24 14826: 9f 92 push r9 14828: 8f 92 push r8 1482a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 1482e: a4 96 adiw r28, 0x24 ; 36 14830: 6e ad ldd r22, Y+62 ; 0x3e 14832: 7f ad ldd r23, Y+63 ; 0x3f 14834: a4 97 sbiw r28, 0x24 ; 36 14836: c5 01 movw r24, r10 14838: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 1483c: a2 e0 ldi r26, 0x02 ; 2 1483e: aa 0e add r10, r26 14840: b1 1c adc r11, r1 14842: 0f b6 in r0, 0x3f ; 63 14844: f8 94 cli 14846: de bf out 0x3e, r29 ; 62 14848: 0f be out 0x3f, r0 ; 63 1484a: cd bf out 0x3d, r28 ; 61 1484c: cb ce rjmp .-618 ; 0x145e4 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1484e: 80 e1 ldi r24, 0x10 ; 16 14850: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 14854: 0c 94 83 9a jmp 0x13506 ; 0x13506 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14858: 80 e1 ldi r24, 0x10 ; 16 1485a: 0e 94 99 ee call 0x1dd32 ; 0x1dd32 1485e: 0c 94 83 9a jmp 0x13506 ; 0x13506 /*! ### 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); 14862: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14866: 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; 14868: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 1486c: 0c 94 83 9a jmp 0x13506 ; 0x13506 14870: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14874: 87 60 ori r24, 0x07 ; 7 14876: f8 cf rjmp .-16 ; 0x14868 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14878: 0f 94 ef 42 call 0x285de ; 0x285de 1487c: f1 2c mov r15, r1 1487e: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14880: f8 01 movw r30, r16 14882: 81 91 ld r24, Z+ 14884: 8f 01 movw r16, r30 14886: 88 23 and r24, r24 14888: d1 f0 breq .+52 ; 0x148be current_position[i] = values[i] + cs.add_homing[i]; 1488a: 97 01 movw r18, r14 1488c: 2e 56 subi r18, 0x6E ; 110 1488e: 39 4f sbci r19, 0xF9 ; 249 14890: 59 01 movw r10, r18 14892: f3 01 movw r30, r6 14894: ee 0d add r30, r14 14896: ff 1d adc r31, r15 14898: 20 81 ld r18, Z 1489a: 31 81 ldd r19, Z+1 ; 0x01 1489c: 42 81 ldd r20, Z+2 ; 0x02 1489e: 53 81 ldd r21, Z+3 ; 0x03 148a0: f7 01 movw r30, r14 148a2: ea 5e subi r30, 0xEA ; 234 148a4: f1 4f sbci r31, 0xF1 ; 241 148a6: 60 81 ld r22, Z 148a8: 71 81 ldd r23, Z+1 ; 0x01 148aa: 82 81 ldd r24, Z+2 ; 0x02 148ac: 93 81 ldd r25, Z+3 ; 0x03 148ae: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 148b2: d5 01 movw r26, r10 148b4: 6d 93 st X+, r22 148b6: 7d 93 st X+, r23 148b8: 8d 93 st X+, r24 148ba: 9c 93 st X, r25 148bc: 13 97 sbiw r26, 0x03 ; 3 148be: b4 e0 ldi r27, 0x04 ; 4 148c0: eb 0e add r14, r27 148c2: 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) 148c4: ec e0 ldi r30, 0x0C ; 12 148c6: ee 16 cp r14, r30 148c8: f1 04 cpc r15, r1 148ca: d1 f6 brne .-76 ; 0x14880 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 148cc: dd 20 and r13, r13 148ce: 61 f0 breq .+24 ; 0x148e8 current_position[E_AXIS] = values[E_AXIS]; 148d0: 8d 85 ldd r24, Y+13 ; 0x0d 148d2: 9e 85 ldd r25, Y+14 ; 0x0e 148d4: af 85 ldd r26, Y+15 ; 0x0f 148d6: b8 89 ldd r27, Y+16 ; 0x10 148d8: 80 93 9e 06 sts 0x069E, r24 ; 0x80069e 148dc: 90 93 9f 06 sts 0x069F, r25 ; 0x80069f 148e0: a0 93 a0 06 sts 0x06A0, r26 ; 0x8006a0 148e4: b0 93 a1 06 sts 0x06A1, r27 ; 0x8006a1 // Set all at once plan_set_position_curposXYZE(); 148e8: 0f 94 10 bf call 0x37e20 ; 0x37e20 148ec: 0c 94 83 9a jmp 0x13506 ; 0x13506 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 148f0: 8d 34 cpi r24, 0x4D ; 77 148f2: 11 f0 breq .+4 ; 0x148f8 148f4: 0c 94 b4 ca jmp 0x19568 ; 0x19568 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 148f8: 10 93 96 03 sts 0x0396, r17 ; 0x800396 148fc: 00 93 95 03 sts 0x0395, r16 ; 0x800395 14900: f8 01 movw r30, r16 14902: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14904: 81 91 ld r24, Z+ 14906: 80 32 cpi r24, 0x20 ; 32 14908: e9 f3 breq .-6 ; 0x14904 1490a: 89 30 cpi r24, 0x09 ; 9 1490c: d9 f3 breq .-10 ; 0x14904 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 1490e: 80 53 subi r24, 0x30 ; 48 14910: 8a 30 cpi r24, 0x0A ; 10 14912: 70 f0 brcs .+28 ; 0x14930 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14914: 1f 93 push r17 14916: 0f 93 push r16 14918: 88 e8 ldi r24, 0x88 ; 136 1491a: 97 e8 ldi r25, 0x87 ; 135 1491c: 9f 93 push r25 1491e: 8f 93 push r24 14920: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 14924: 0f 90 pop r0 14926: 0f 90 pop r0 14928: 0f 90 pop r0 1492a: 0f 90 pop r0 1492c: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 } else { mcode_in_progress = code_value_short(); 14930: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 14934: 90 93 ab 0d sts 0x0DAB, r25 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 14938: 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) 1493c: 89 3c cpi r24, 0xC9 ; 201 1493e: 91 05 cpc r25, r1 14940: 11 f4 brne .+4 ; 0x14946 14942: 0c 94 76 b2 jmp 0x164ec ; 0x164ec 14946: 0c f0 brlt .+2 ; 0x1494a 14948: 08 c3 rjmp .+1552 ; 0x14f5a 1494a: 8e 34 cpi r24, 0x4E ; 78 1494c: 91 05 cpc r25, r1 1494e: 11 f4 brne .+4 ; 0x14954 14950: 0c 94 2c ae jmp 0x15c58 ; 0x15c58 14954: 0c f0 brlt .+2 ; 0x14958 14956: 0e c2 rjmp .+1052 ; 0x14d74 14958: 8c 31 cpi r24, 0x1C ; 28 1495a: 91 05 cpc r25, r1 1495c: 09 f4 brne .+2 ; 0x14960 1495e: de c7 rjmp .+4028 ; 0x1591c 14960: 0c f0 brlt .+2 ; 0x14964 14962: f1 c0 rjmp .+482 ; 0x14b46 14964: 85 31 cpi r24, 0x15 ; 21 14966: 91 05 cpc r25, r1 14968: 09 f4 brne .+2 ; 0x1496c 1496a: f1 c6 rjmp .+3554 ; 0x1574e 1496c: 0c f0 brlt .+2 ; 0x14970 1496e: 5a c0 rjmp .+180 ; 0x14a24 14970: 81 31 cpi r24, 0x11 ; 17 14972: 91 05 cpc r25, r1 14974: 09 f4 brne .+2 ; 0x14978 14976: e0 c6 rjmp .+3520 ; 0x15738 14978: dc f4 brge .+54 ; 0x149b0 1497a: 02 97 sbiw r24, 0x02 ; 2 1497c: 08 f4 brcc .+2 ; 0x14980 1497e: 50 c6 rjmp .+3232 ; 0x15620 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14980: 80 91 92 12 lds r24, 0x1292 ; 0x801292 14984: 90 91 93 12 lds r25, 0x1293 ; 0x801293 14988: 88 55 subi r24, 0x58 ; 88 1498a: 9f 4e sbci r25, 0xEF ; 239 1498c: 9f 93 push r25 1498e: 8f 93 push r24 14990: 1f 92 push r1 14992: 8d e4 ldi r24, 0x4D ; 77 14994: 8f 93 push r24 14996: 82 e5 ldi r24, 0x52 ; 82 14998: 99 e6 ldi r25, 0x69 ; 105 1499a: 9f 93 push r25 1499c: 8f 93 push r24 1499e: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 149a2: 0f 90 pop r0 149a4: 0f 90 pop r0 149a6: 0f 90 pop r0 149a8: 0f 90 pop r0 149aa: 0f 90 pop r0 149ac: 0f 90 pop r0 149ae: 1d c6 rjmp .+3130 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 149b0: 82 31 cpi r24, 0x12 ; 18 149b2: 91 05 cpc r25, r1 149b4: 11 f4 brne .+4 ; 0x149ba 149b6: 0c 94 8f af jmp 0x15f1e ; 0x15f1e 149ba: 44 97 sbiw r24, 0x14 ; 20 149bc: 09 f7 brne .-62 ; 0x14980 #### 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() 149be: 81 e0 ldi r24, 0x01 ; 1 149c0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 149c4: 82 e4 ldi r24, 0x42 ; 66 149c6: 99 e6 ldi r25, 0x69 ; 105 149c8: 0e 94 82 79 call 0xf304 ; 0xf304 card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 149cc: 84 e5 ldi r24, 0x54 ; 84 149ce: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 149d2: 18 2f mov r17, r24 149d4: 8c e4 ldi r24, 0x4C ; 76 149d6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 149da: 00 e0 ldi r16, 0x00 ; 0 149dc: 80 fb bst r24, 0 149de: 00 f9 bld r16, 0 149e0: 10 fb bst r17, 0 149e2: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 149e4: 86 e1 ldi r24, 0x16 ; 22 149e6: 95 e1 ldi r25, 0x15 ; 21 149e8: 0e 94 33 77 call 0xee66 ; 0xee66 lsDive("",root, NULL, LS_SerialPrint, params); 149ec: 83 e2 ldi r24, 0x23 ; 35 149ee: e6 e1 ldi r30, 0x16 ; 22 149f0: f5 e1 ldi r31, 0x15 ; 21 149f2: de 01 movw r26, r28 149f4: 11 96 adiw r26, 0x01 ; 1 149f6: 01 90 ld r0, Z+ 149f8: 0d 92 st X+, r0 149fa: 8a 95 dec r24 149fc: e1 f7 brne .-8 ; 0x149f6 149fe: 20 e0 ldi r18, 0x00 ; 0 14a00: 50 e0 ldi r21, 0x00 ; 0 14a02: 40 e0 ldi r20, 0x00 ; 0 14a04: be 01 movw r22, r28 14a06: 6f 5f subi r22, 0xFF ; 255 14a08: 7f 4f sbci r23, 0xFF ; 255 14a0a: 89 ef ldi r24, 0xF9 ; 249 14a0c: 92 e0 ldi r25, 0x02 ; 2 14a0e: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 14a12: ce 01 movw r24, r28 14a14: 01 96 adiw r24, 0x01 ; 1 14a16: 0e 94 38 77 call 0xee70 ; 0xee70 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14a1a: 84 e3 ldi r24, 0x34 ; 52 14a1c: 99 e6 ldi r25, 0x69 ; 105 14a1e: 0e 94 82 79 call 0xf304 ; 0xf304 14a22: e3 c5 rjmp .+3014 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a24: 88 31 cpi r24, 0x18 ; 24 14a26: 91 05 cpc r25, r1 14a28: 09 f4 brne .+2 ; 0x14a2c 14a2a: a2 c6 rjmp .+3396 ; 0x15770 14a2c: 84 f4 brge .+32 ; 0x14a4e 14a2e: 86 31 cpi r24, 0x16 ; 22 14a30: 91 05 cpc r25, r1 14a32: 09 f4 brne .+2 ; 0x14a36 14a34: 90 c6 rjmp .+3360 ; 0x15756 14a36: 47 97 sbiw r24, 0x17 ; 23 14a38: 09 f0 breq .+2 ; 0x14a3c 14a3a: a2 cf rjmp .-188 ; 0x14980 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14a3c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14a40: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14a44: 61 e0 ldi r22, 0x01 ; 1 14a46: 04 96 adiw r24, 0x04 ; 4 14a48: 0f 94 52 7f call 0x2fea4 ; 0x2fea4 14a4c: ce c5 rjmp .+2972 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14a4e: 8a 31 cpi r24, 0x1A ; 26 14a50: 91 05 cpc r25, r1 14a52: 09 f4 brne .+2 ; 0x14a56 14a54: d3 c6 rjmp .+3494 ; 0x157fc 14a56: 0c f0 brlt .+2 ; 0x14a5a 14a58: f3 c6 rjmp .+3558 ; 0x15840 14a5a: 0d ed ldi r16, 0xDD ; 221 14a5c: 12 e0 ldi r17, 0x02 ; 2 14a5e: ff e3 ldi r31, 0x3F ; 63 14a60: af 2e mov r10, r31 14a62: f2 e0 ldi r31, 0x02 ; 2 14a64: bf 2e mov r11, r31 14a66: a1 e2 ldi r26, 0x21 ; 33 14a68: ca 2e mov r12, r26 14a6a: a2 e0 ldi r26, 0x02 ; 2 14a6c: da 2e mov r13, r26 14a6e: b5 e1 ldi r27, 0x15 ; 21 14a70: eb 2e mov r14, r27 14a72: b2 e0 ldi r27, 0x02 ; 2 14a74: 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])) { 14a76: f8 01 movw r30, r16 14a78: 81 91 ld r24, Z+ 14a7a: 8f 01 movw r16, r30 14a7c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14a80: 88 23 and r24, r24 14a82: 21 f1 breq .+72 ; 0x14acc //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14a84: 0e 94 a4 60 call 0xc148 ; 0xc148 14a88: d6 01 movw r26, r12 14a8a: 4d 90 ld r4, X+ 14a8c: 5d 90 ld r5, X+ 14a8e: 6d 90 ld r6, X+ 14a90: 7c 90 ld r7, X 14a92: a3 01 movw r20, r6 14a94: 92 01 movw r18, r4 14a96: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 14a9a: 87 fd sbrc r24, 7 14a9c: 11 c0 rjmp .+34 ; 0x14ac0 14a9e: 0e 94 a4 60 call 0xc148 ; 0xc148 14aa2: f7 01 movw r30, r14 14aa4: 40 80 ld r4, Z 14aa6: 51 80 ldd r5, Z+1 ; 0x01 14aa8: 62 80 ldd r6, Z+2 ; 0x02 14aaa: 73 80 ldd r7, Z+3 ; 0x03 14aac: a3 01 movw r20, r6 14aae: 92 01 movw r18, r4 14ab0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 14ab4: 18 16 cp r1, r24 14ab6: 24 f0 brlt .+8 ; 0x14ac0 14ab8: 0e 94 a4 60 call 0xc148 ; 0xc148 14abc: 2b 01 movw r4, r22 14abe: 3c 01 movw r6, r24 14ac0: d5 01 movw r26, r10 14ac2: 4d 92 st X+, r4 14ac4: 5d 92 st X+, r5 14ac6: 6d 92 st X+, r6 14ac8: 7c 92 st X, r7 14aca: 13 97 sbiw r26, 0x03 ; 3 14acc: b4 e0 ldi r27, 0x04 ; 4 14ace: ab 0e add r10, r27 14ad0: b1 1c adc r11, r1 14ad2: e4 e0 ldi r30, 0x04 ; 4 14ad4: ce 0e add r12, r30 14ad6: d1 1c adc r13, r1 14ad8: f4 e0 ldi r31, 0x04 ; 4 14ada: ef 0e add r14, r31 14adc: 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++) { 14ade: 22 e0 ldi r18, 0x02 ; 2 14ae0: 00 3e cpi r16, 0xE0 ; 224 14ae2: 12 07 cpc r17, r18 14ae4: 41 f6 brne .-112 ; 0x14a76 //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')) { 14ae6: 83 e5 ldi r24, 0x53 ; 83 14ae8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14aec: 88 23 and r24, r24 14aee: 11 f4 brne .+4 ; 0x14af4 14af0: 0c 94 32 c3 jmp 0x18664 ; 0x18664 if ( code_value_uint8() == 0 ) { 14af4: 0e 94 6f 5b call 0xb6de ; 0xb6de 14af8: 81 11 cpse r24, r1 14afa: 77 c5 rjmp .+2798 ; 0x155ea pause_position[X_AXIS] = X_PAUSE_POS; 14afc: 80 e0 ldi r24, 0x00 ; 0 14afe: 90 e0 ldi r25, 0x00 ; 0 14b00: a8 e4 ldi r26, 0x48 ; 72 14b02: b2 e4 ldi r27, 0x42 ; 66 14b04: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.481> 14b08: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.481+0x1> 14b0c: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.481+0x2> 14b10: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.481+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14b14: 80 e0 ldi r24, 0x00 ; 0 14b16: 90 e0 ldi r25, 0x00 ; 0 14b18: ae e3 ldi r26, 0x3E ; 62 14b1a: b3 e4 ldi r27, 0x43 ; 67 14b1c: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.481+0x4> 14b20: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.481+0x5> 14b24: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.481+0x6> 14b28: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.481+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14b2c: 80 e0 ldi r24, 0x00 ; 0 14b2e: 90 e0 ldi r25, 0x00 ; 0 14b30: a0 ea ldi r26, 0xA0 ; 160 14b32: b1 e4 ldi r27, 0x41 ; 65 14b34: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 14b38: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 14b3c: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 14b40: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 14b44: 52 c5 rjmp .+2724 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14b46: 8d 32 cpi r24, 0x2D ; 45 14b48: 91 05 cpc r25, r1 14b4a: 09 f4 brne .+2 ; 0x14b4e 14b4c: 89 c7 rjmp .+3858 ; 0x15a60 14b4e: 0c f0 brlt .+2 ; 0x14b52 14b50: e3 c0 rjmp .+454 ; 0x14d18 14b52: 8f 31 cpi r24, 0x1F ; 31 14b54: 91 05 cpc r25, r1 14b56: 09 f4 brne .+2 ; 0x14b5a 14b58: 10 c7 rjmp .+3616 ; 0x1597a 14b5a: 0c f0 brlt .+2 ; 0x14b5e 14b5c: 63 c0 rjmp .+198 ; 0x14c24 14b5e: 8d 31 cpi r24, 0x1D ; 29 14b60: 91 05 cpc r25, r1 14b62: 09 f4 brne .+2 ; 0x14b66 14b64: 42 c5 rjmp .+2692 ; 0x155ea 14b66: 4e 97 sbiw r24, 0x1e ; 30 14b68: 09 f0 breq .+2 ; 0x14b6c 14b6a: 0a cf rjmp .-492 ; 0x14980 M30 [filename] */ case 30: if (card.mounted){ 14b6c: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14b70: 88 23 and r24, r24 14b72: 09 f4 brne .+2 ; 0x14b76 14b74: 3a c5 rjmp .+2676 ; 0x155ea lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14b76: 80 e2 ldi r24, 0x20 ; 32 14b78: 97 e1 ldi r25, 0x17 ; 23 14b7a: 0f 94 42 58 call 0x2b084 ; 0x2b084 file.close(); 14b7e: 80 e2 ldi r24, 0x20 ; 32 14b80: 97 e1 ldi r25, 0x17 ; 23 14b82: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee saving = false; 14b86: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 14b8a: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f card.closefile(); card.removeFile(strchr_pointer + 4); 14b8e: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14b92: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14b96: 0c 5f subi r16, 0xFC ; 252 14b98: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14b9a: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14b9e: 88 23 and r24, r24 14ba0: 09 f4 brne .+2 ; 0x14ba4 14ba2: 23 c5 rjmp .+2630 ; 0x155ea file.close(); 14ba4: 80 e2 ldi r24, 0x20 ; 32 14ba6: 97 e1 ldi r25, 0x17 ; 23 14ba8: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee sdprinting = false; 14bac: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 14bb0: 23 96 adiw r28, 0x03 ; 3 14bb2: 1f af std Y+63, r17 ; 0x3f 14bb4: 0e af std Y+62, r16 ; 0x3e 14bb6: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14bb8: ce 01 movw r24, r28 14bba: 8f 5b subi r24, 0xBF ; 191 14bbc: 9f 4f sbci r25, 0xFF ; 255 14bbe: 0f 94 cd 7e call 0x2fd9a ; 0x2fd9a 14bc2: 88 23 and r24, r24 14bc4: 09 f4 brne .+2 ; 0x14bc8 14bc6: 11 c5 rjmp .+2594 ; 0x155ea return; if (file.remove(curDir, fname)) 14bc8: 23 96 adiw r28, 0x03 ; 3 14bca: 4e ad ldd r20, Y+62 ; 0x3e 14bcc: 5f ad ldd r21, Y+63 ; 0x3f 14bce: 23 97 sbiw r28, 0x03 ; 3 14bd0: 60 91 39 15 lds r22, 0x1539 ; 0x801539 14bd4: 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) {} 14bd8: 19 82 std Y+1, r1 ; 0x01 14bda: 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; 14bdc: 22 e0 ldi r18, 0x02 ; 2 14bde: ce 01 movw r24, r28 14be0: 01 96 adiw r24, 0x01 ; 1 14be2: 0f 94 1f 64 call 0x2c83e ; 0x2c83e 14be6: 81 11 cpse r24, r1 14be8: a1 c6 rjmp .+3394 ; 0x1592c return file.remove(); fail: // can't set iostate - static function return false; 14bea: 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; 14bec: ce 01 movw r24, r28 14bee: 01 96 adiw r24, 0x01 ; 1 14bf0: 0e 94 38 77 call 0xee70 ; 0xee70 14bf4: 11 23 and r17, r17 14bf6: 09 f4 brne .+2 ; 0x14bfa 14bf8: b0 c6 rjmp .+3424 ; 0x1595a { SERIAL_PROTOCOLPGM("File deleted:"); 14bfa: 84 eb ldi r24, 0xB4 ; 180 14bfc: 94 e8 ldi r25, 0x84 ; 132 14bfe: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN(fname); 14c02: 23 96 adiw r28, 0x03 ; 3 14c04: 8e ad ldd r24, Y+62 ; 0x3e 14c06: 9f ad ldd r25, Y+63 ; 0x3f 14c08: 23 97 sbiw r28, 0x03 ; 3 14c0a: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e sdpos = 0; 14c0e: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 14c12: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 14c16: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 14c1a: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 #ifdef SDCARD_SORT_ALPHA presort(); 14c1e: 0f 94 99 7c call 0x2f932 ; 0x2f932 14c22: e3 c4 rjmp .+2502 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c24: 8a 32 cpi r24, 0x2A ; 42 14c26: 91 05 cpc r25, r1 14c28: 09 f4 brne .+2 ; 0x14c2c 14c2a: ce c6 rjmp .+3484 ; 0x159c8 14c2c: 8c 32 cpi r24, 0x2C ; 44 14c2e: 91 05 cpc r25, r1 14c30: 09 f4 brne .+2 ; 0x14c34 14c32: fd c6 rjmp .+3578 ; 0x15a2e 14c34: 80 97 sbiw r24, 0x20 ; 32 14c36: 09 f0 breq .+2 ; 0x14c3a 14c38: a3 ce rjmp .-698 ; 0x14980 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14c3a: 80 91 90 14 lds r24, 0x1490 ; 0x801490 14c3e: 81 11 cpse r24, r1 st_synchronize(); 14c40: 0f 94 ef 42 call 0x285de ; 0x285de } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14c44: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14c48: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14c4c: 0c 5f subi r16, 0xFC ; 252 14c4e: 1f 4f sbci r17, 0xFF ; 255 14c50: 61 e2 ldi r22, 0x21 ; 33 14c52: 70 e0 ldi r23, 0x00 ; 0 14c54: c8 01 movw r24, r16 14c56: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 if(namestartpos==NULL) 14c5a: 00 97 sbiw r24, 0x00 ; 0 14c5c: 19 f0 breq .+6 ; 0x14c64 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14c5e: 8c 01 movw r16, r24 14c60: 0f 5f subi r16, 0xFF ; 255 14c62: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14c64: 80 e5 ldi r24, 0x50 ; 80 14c66: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14c6a: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14c6c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14c70: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14c74: 08 17 cp r16, r24 14c76: 19 07 cpc r17, r25 14c78: 08 f4 brcc .+2 ; 0x14c7c call_procedure=false; //false alert, 'P' found within filename 14c7a: f1 2c mov r15, r1 if( card.mounted ) 14c7c: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14c80: 88 23 and r24, r24 14c82: 09 f4 brne .+2 ; 0x14c86 14c84: b2 c4 rjmp .+2404 ; 0x155ea { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 14c86: 61 e0 ldi r22, 0x01 ; 1 14c88: 6f 25 eor r22, r15 14c8a: c8 01 movw r24, r16 14c8c: 0f 94 52 7f call 0x2fea4 ; 0x2fea4 if(code_seen('S')) 14c90: 83 e5 ldi r24, 0x53 ; 83 14c92: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14c96: 88 23 and r24, r24 14c98: 99 f0 breq .+38 ; 0x14cc0 if(strchr_pointer 14c9e: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14ca2: 80 17 cp r24, r16 14ca4: 91 07 cpc r25, r17 14ca6: 60 f4 brcc .+24 ; 0x14cc0 card.setIndex(code_value_long()); 14ca8: 0e 94 89 5b call 0xb712 ; 0xb712 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 14cac: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 14cb0: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 14cb4: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 14cb8: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 14cbc: 0f 94 a3 75 call 0x2eb46 ; 0x2eb46 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 14cc0: 80 91 91 14 lds r24, 0x1491 ; 0x801491 14cc4: 88 23 and r24, r24 14cc6: 31 f0 breq .+12 ; 0x14cd4 { sdprinting = true; 14cc8: 81 e0 ldi r24, 0x01 ; 1 14cca: 80 93 90 14 sts 0x1490, r24 ; 0x801490 14cce: 85 e0 ldi r24, 0x05 ; 5 14cd0: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> card.startFileprint(); if(!call_procedure) 14cd4: f1 10 cpse r15, r1 14cd6: 89 c4 rjmp .+2322 ; 0x155ea 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); }; 14cd8: 80 91 23 17 lds r24, 0x1723 ; 0x801723 14cdc: 88 23 and r24, r24 14cde: 61 f0 breq .+24 ; 0x14cf8 { if(!card.get_sdpos()) 14ce0: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 14ce4: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 14ce8: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 14cec: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 14cf0: 89 2b or r24, r25 14cf2: 8a 2b or r24, r26 14cf4: 8b 2b or r24, r27 14cf6: 69 f4 brne .+26 ; 0x14d12 { // A new print has started from scratch, reset stats failstats_reset_print(); 14cf8: 0e 94 2b 5c call 0xb856 ; 0xb856 sdpos_atomic = 0; 14cfc: 10 92 82 03 sts 0x0382, r1 ; 0x800382 14d00: 10 92 83 03 sts 0x0383, r1 ; 0x800383 14d04: 10 92 84 03 sts 0x0384, r1 ; 0x800384 14d08: 10 92 85 03 sts 0x0385, r1 ; 0x800385 14d0c: 80 e0 ldi r24, 0x00 ; 0 14d0e: 0e 94 1e 82 call 0x1043c ; 0x1043c #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 14d12: 0f 94 94 42 call 0x28528 ; 0x28528 14d16: 69 c4 rjmp .+2258 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d18: 89 34 cpi r24, 0x49 ; 73 14d1a: 91 05 cpc r25, r1 14d1c: 09 f4 brne .+2 ; 0x14d20 14d1e: e4 c6 rjmp .+3528 ; 0x15ae8 14d20: cc f4 brge .+50 ; 0x14d54 14d22: 8e 32 cpi r24, 0x2E ; 46 14d24: 91 05 cpc r25, r1 14d26: 09 f4 brne .+2 ; 0x14d2a 14d28: a1 c6 rjmp .+3394 ; 0x15a6c 14d2a: 88 34 cpi r24, 0x48 ; 72 14d2c: 91 05 cpc r25, r1 14d2e: 09 f0 breq .+2 ; 0x14d32 14d30: 27 ce rjmp .-946 ; 0x14980 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 14d32: 83 e5 ldi r24, 0x53 ; 83 14d34: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14d38: 88 23 and r24, r24 14d3a: 09 f4 brne .+2 ; 0x14d3e 14d3c: c6 c6 rjmp .+3468 ; 0x15aca switch (code_value_uint8()){ 14d3e: 0e 94 6f 5b call 0xb6de ; 0xb6de 14d42: 88 23 and r24, r24 14d44: 09 f4 brne .+2 ; 0x14d48 14d46: be c6 rjmp .+3452 ; 0x15ac4 14d48: 81 30 cpi r24, 0x01 ; 1 14d4a: 09 f0 breq .+2 ; 0x14d4e 14d4c: 4e c4 rjmp .+2204 ; 0x155ea 14d4e: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 14d52: 4b c4 rjmp .+2198 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d54: 8c 34 cpi r24, 0x4C ; 76 14d56: 91 05 cpc r25, r1 14d58: 09 f4 brne .+2 ; 0x14d5c 14d5a: 66 c7 rjmp .+3788 ; 0x15c28 14d5c: 0c f0 brlt .+2 ; 0x14d60 14d5e: 77 c7 rjmp .+3822 ; 0x15c4e 14d60: 8b 34 cpi r24, 0x4B ; 75 14d62: 91 05 cpc r25, r1 14d64: 09 f0 breq .+2 ; 0x14d68 14d66: 0c ce rjmp .-1000 ; 0x14980 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 14d68: 0e 94 09 f5 call 0x1ea12 ; 0x1ea12 14d6c: 88 23 and r24, r24 14d6e: 09 f4 brne .+2 ; 0x14d72 14d70: 3c c4 rjmp .+2168 ; 0x155ea 14d72: cf cf rjmp .-98 ; 0x14d12 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d74: 8e 36 cpi r24, 0x6E ; 110 14d76: 91 05 cpc r25, r1 14d78: 11 f4 brne .+4 ; 0x14d7e 14d7a: 0c 94 86 b0 jmp 0x1610c ; 0x1610c 14d7e: 0c f0 brlt .+2 ; 0x14d82 14d80: 7d c0 rjmp .+250 ; 0x14e7c 14d82: 86 35 cpi r24, 0x56 ; 86 14d84: 91 05 cpc r25, r1 14d86: 11 f4 brne .+4 ; 0x14d8c 14d88: 0c 94 df af jmp 0x15fbe ; 0x15fbe 14d8c: b4 f5 brge .+108 ; 0x14dfa 14d8e: 83 35 cpi r24, 0x53 ; 83 14d90: 91 05 cpc r25, r1 14d92: 11 f4 brne .+4 ; 0x14d98 14d94: 0c 94 89 af jmp 0x15f12 ; 0x15f12 14d98: 74 f4 brge .+28 ; 0x14db6 14d9a: 8f 34 cpi r24, 0x4F ; 79 14d9c: 91 05 cpc r25, r1 14d9e: 09 f4 brne .+2 ; 0x14da2 14da0: 76 c7 rjmp .+3820 ; 0x15c8e 14da2: 82 35 cpi r24, 0x52 ; 82 14da4: 91 05 cpc r25, r1 14da6: 09 f0 breq .+2 ; 0x14daa 14da8: eb cd rjmp .-1066 ; 0x14980 /*! ### 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; 14daa: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 14dae: 87 7f andi r24, 0xF7 ; 247 14db0: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 14db4: 1a c4 rjmp .+2100 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14db6: 84 35 cpi r24, 0x54 ; 84 14db8: 91 05 cpc r25, r1 14dba: 11 f4 brne .+4 ; 0x14dc0 14dbc: 0c 94 8f af jmp 0x15f1e ; 0x15f1e 14dc0: 85 35 cpi r24, 0x55 ; 85 14dc2: 91 05 cpc r25, r1 14dc4: 09 f0 breq .+2 ; 0x14dc8 14dc6: dc cd rjmp .-1096 ; 0x14980 #### 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')) { 14dc8: 83 e5 ldi r24, 0x53 ; 83 14dca: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14dce: 88 23 and r24, r24 14dd0: 09 f4 brne .+2 ; 0x14dd4 14dd2: 0b c4 rjmp .+2070 ; 0x155ea max_inactive_time = code_value() * 1000; 14dd4: 0e 94 a4 60 call 0xc148 ; 0xc148 14dd8: 20 e0 ldi r18, 0x00 ; 0 14dda: 30 e0 ldi r19, 0x00 ; 0 14ddc: 4a e7 ldi r20, 0x7A ; 122 14dde: 54 e4 ldi r21, 0x44 ; 68 14de0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 14de4: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 14de8: 60 93 7e 03 sts 0x037E, r22 ; 0x80037e 14dec: 70 93 7f 03 sts 0x037F, r23 ; 0x80037f 14df0: 80 93 80 03 sts 0x0380, r24 ; 0x800380 14df4: 90 93 81 03 sts 0x0381, r25 ; 0x800381 14df8: f8 c3 rjmp .+2032 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dfa: 89 36 cpi r24, 0x69 ; 105 14dfc: 91 05 cpc r25, r1 14dfe: 09 f4 brne .+2 ; 0x14e02 14e00: a2 c7 rjmp .+3908 ; 0x15d46 14e02: c4 f4 brge .+48 ; 0x14e34 14e04: 8c 35 cpi r24, 0x5C ; 92 14e06: 91 05 cpc r25, r1 14e08: 11 f4 brne .+4 ; 0x14e0e 14e0a: 0c 94 fc af jmp 0x15ff8 ; 0x15ff8 14e0e: 88 36 cpi r24, 0x68 ; 104 14e10: 91 05 cpc r25, r1 14e12: 09 f0 breq .+2 ; 0x14e16 14e14: b5 cd rjmp .-1174 ; 0x14980 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 14e16: 83 e5 ldi r24, 0x53 ; 83 14e18: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14e1c: 88 23 and r24, r24 14e1e: 09 f4 brne .+2 ; 0x14e22 14e20: e4 c3 rjmp .+1992 ; 0x155ea { setTargetHotend(code_value()); 14e22: 0e 94 a4 60 call 0xc148 ; 0xc148 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 14e26: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 14e2a: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 14e2e: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 14e32: db c3 rjmp .+1974 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e34: 8b 36 cpi r24, 0x6B ; 107 14e36: 91 05 cpc r25, r1 14e38: 11 f4 brne .+4 ; 0x14e3e 14e3a: 0c 94 86 af jmp 0x15f0c ; 0x15f0c 14e3e: 14 f4 brge .+4 ; 0x14e44 14e40: 0c 94 78 af jmp 0x15ef0 ; 0x15ef0 14e44: 8d 36 cpi r24, 0x6D ; 109 14e46: 91 05 cpc r25, r1 14e48: 09 f0 breq .+2 ; 0x14e4c 14e4a: 9a cd rjmp .-1228 ; 0x14980 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)); 14e4c: 8d e2 ldi r24, 0x2D ; 45 14e4e: 9e e4 ldi r25, 0x4E ; 78 14e50: 0e 94 b3 72 call 0xe566 ; 0xe566 14e54: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 heating_status = HeatingStatus::EXTRUDER_HEATING; 14e58: 81 e0 ldi r24, 0x01 ; 1 14e5a: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14e5e: 83 e5 ldi r24, 0x53 ; 83 14e60: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14e64: 88 23 and r24, r24 14e66: 09 f4 brne .+2 ; 0x14e6a 14e68: 81 c7 rjmp .+3842 ; 0x15d6c setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14e6a: 0e 94 a4 60 call 0xc148 ; 0xc148 14e6e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 14e72: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 14e76: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 14e7a: 7d c7 rjmp .+3834 ; 0x15d76 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e7c: 87 37 cpi r24, 0x77 ; 119 14e7e: 91 05 cpc r25, r1 14e80: 11 f4 brne .+4 ; 0x14e86 14e82: 0c 94 cb b1 jmp 0x16396 ; 0x16396 14e86: 94 f5 brge .+100 ; 0x14eec 14e88: 82 37 cpi r24, 0x72 ; 114 14e8a: 91 05 cpc r25, r1 14e8c: 11 f4 brne .+4 ; 0x14e92 14e8e: 0c 94 80 b1 jmp 0x16300 ; 0x16300 14e92: a4 f4 brge .+40 ; 0x14ebc 14e94: 80 37 cpi r24, 0x70 ; 112 14e96: 91 05 cpc r25, r1 14e98: 09 f4 brne .+2 ; 0x14e9c 14e9a: 42 c7 rjmp .+3716 ; 0x15d20 14e9c: 81 37 cpi r24, 0x71 ; 113 14e9e: 91 05 cpc r25, r1 14ea0: 09 f0 breq .+2 ; 0x14ea4 14ea2: 6e cd rjmp .-1316 ; 0x14980 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14ea4: 83 e5 ldi r24, 0x53 ; 83 14ea6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14eaa: 88 23 and r24, r24 14eac: 11 f4 brne .+4 ; 0x14eb2 14eae: 0c 94 97 b0 jmp 0x1612e ; 0x1612e host_keepalive_interval = code_value_uint8(); 14eb2: 0e 94 6f 5b call 0xb6de ; 0xb6de 14eb6: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 14eba: 97 c3 rjmp .+1838 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ebc: 85 37 cpi r24, 0x75 ; 117 14ebe: 91 05 cpc r25, r1 14ec0: 11 f4 brne .+4 ; 0x14ec6 14ec2: 0c 94 83 b1 jmp 0x16306 ; 0x16306 14ec6: 14 f0 brlt .+4 ; 0x14ecc 14ec8: 0c 94 93 b1 jmp 0x16326 ; 0x16326 14ecc: 83 37 cpi r24, 0x73 ; 115 14ece: 91 05 cpc r25, r1 14ed0: 09 f0 breq .+2 ; 0x14ed4 14ed2: 56 cd rjmp .-1364 ; 0x14980 #### 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')) { 14ed4: 86 e5 ldi r24, 0x56 ; 86 14ed6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14eda: 88 23 and r24, r24 14edc: 11 f4 brne .+4 ; 0x14ee2 14ede: 0c 94 ac b0 jmp 0x16158 ; 0x16158 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 14ee2: 85 e9 ldi r24, 0x95 ; 149 14ee4: 94 e8 ldi r25, 0x84 ; 132 14ee6: 0e 94 82 79 call 0xf304 ; 0xf304 14eea: 7f c3 rjmp .+1790 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14eec: 8c 38 cpi r24, 0x8C ; 140 14eee: 91 05 cpc r25, r1 14ef0: 09 f4 brne .+2 ; 0x14ef4 14ef2: 1a c7 rjmp .+3636 ; 0x15d28 14ef4: 54 f4 brge .+20 ; 0x14f0a 14ef6: 8b 37 cpi r24, 0x7B ; 123 14ef8: 91 05 cpc r25, r1 14efa: 11 f4 brne .+4 ; 0x14f00 14efc: 0c 94 30 b2 jmp 0x16460 ; 0x16460 14f00: 8d 37 cpi r24, 0x7D ; 125 14f02: 91 05 cpc r25, r1 14f04: 09 f4 brne .+2 ; 0x14f08 14f06: a9 cd rjmp .-1198 ; 0x14a5a 14f08: 3b cd rjmp .-1418 ; 0x14980 14f0a: 8e 3b cpi r24, 0xBE ; 190 14f0c: 91 05 cpc r25, r1 14f0e: 09 f4 brne .+2 ; 0x14f12 14f10: 62 c7 rjmp .+3780 ; 0x15dd6 14f12: 88 3c cpi r24, 0xC8 ; 200 14f14: 91 05 cpc r25, r1 14f16: 11 f4 brne .+4 ; 0x14f1c 14f18: 0c 94 33 b2 jmp 0x16466 ; 0x16466 14f1c: 8b 39 cpi r24, 0x9B ; 155 14f1e: 91 05 cpc r25, r1 14f20: 09 f0 breq .+2 ; 0x14f24 14f22: 2e cd rjmp .-1444 ; 0x14980 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14f24: 83 e5 ldi r24, 0x53 ; 83 14f26: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14f2a: 88 23 and r24, r24 14f2c: 59 f0 breq .+22 ; 0x14f44 autoReportFeatures.SetPeriod( code_value_uint8() ); 14f2e: 0e 94 6f 5b call 0xb6de ; 0xb6de 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; 14f32: 80 93 88 14 sts 0x1488, r24 ; 0x801488 if (auto_report_period != 0){ 14f36: 88 23 and r24, r24 14f38: 09 f4 brne .+2 ; 0x14f3c 14f3a: 11 c7 rjmp .+3618 ; 0x15d5e auto_report_timer.start(); 14f3c: 89 e8 ldi r24, 0x89 ; 137 14f3e: 94 e1 ldi r25, 0x14 ; 20 14f40: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14f44: 83 e4 ldi r24, 0x43 ; 67 14f46: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14f4a: 88 23 and r24, r24 14f4c: 09 f4 brne .+2 ; 0x14f50 14f4e: 0a c7 rjmp .+3604 ; 0x15d64 autoReportFeatures.SetMask(code_value_uint8()); 14f50: 0e 94 6f 5b call 0xb6de ; 0xb6de 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; } 14f54: 80 93 87 14 sts 0x1487, r24 ; 0x801487 14f58: 48 c3 rjmp .+1680 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f5a: 86 3f cpi r24, 0xF6 ; 246 14f5c: f1 e0 ldi r31, 0x01 ; 1 14f5e: 9f 07 cpc r25, r31 14f60: 11 f4 brne .+4 ; 0x14f66 14f62: 0c 94 ea bb jmp 0x177d4 ; 0x177d4 14f66: 0c f0 brlt .+2 ; 0x14f6a 14f68: f7 c1 rjmp .+1006 ; 0x15358 14f6a: 8c 32 cpi r24, 0x2C ; 44 14f6c: 31 e0 ldi r19, 0x01 ; 1 14f6e: 93 07 cpc r25, r19 14f70: 11 f4 brne .+4 ; 0x14f76 14f72: 0c 94 f6 b4 jmp 0x169ec ; 0x169ec 14f76: 0c f0 brlt .+2 ; 0x14f7a 14f78: 1b c1 rjmp .+566 ; 0x151b0 14f7a: 80 3d cpi r24, 0xD0 ; 208 14f7c: 91 05 cpc r25, r1 14f7e: 11 f4 brne .+4 ; 0x14f84 14f80: 0c 94 e5 b3 jmp 0x167ca ; 0x167ca 14f84: 0c f0 brlt .+2 ; 0x14f88 14f86: 73 c0 rjmp .+230 ; 0x1506e 14f88: 8d 3c cpi r24, 0xCD ; 205 14f8a: 91 05 cpc r25, r1 14f8c: 11 f4 brne .+4 ; 0x14f92 14f8e: 0c 94 4c b3 jmp 0x16698 ; 0x16698 14f92: 9c f5 brge .+102 ; 0x14ffa 14f94: 8b 3c cpi r24, 0xCB ; 203 14f96: 91 05 cpc r25, r1 14f98: 11 f4 brne .+4 ; 0x14f9e 14f9a: 0c 94 c3 b2 jmp 0x16586 ; 0x16586 14f9e: 8c 3c cpi r24, 0xCC ; 204 14fa0: 91 05 cpc r25, r1 14fa2: 09 f0 breq .+2 ; 0x14fa6 14fa4: ed cc rjmp .-1574 ; 0x14980 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 14fa6: 83 e5 ldi r24, 0x53 ; 83 14fa8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14fac: 88 23 and r24, r24 14fae: 11 f4 brne .+4 ; 0x14fb4 14fb0: 0c 94 1b b3 jmp 0x16636 ; 0x16636 // 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(); 14fb4: 0e 94 a4 60 call 0xc148 ; 0xc148 14fb8: 60 93 7e 0e sts 0x0E7E, r22 ; 0x800e7e 14fbc: 70 93 7f 0e sts 0x0E7F, r23 ; 0x800e7f 14fc0: 80 93 80 0e sts 0x0E80, r24 ; 0x800e80 14fc4: 90 93 81 0e sts 0x0E81, r25 ; 0x800e81 14fc8: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 14fcc: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 14fd0: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 14fd4: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 14fd8: 84 e5 ldi r24, 0x54 ; 84 14fda: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 14fde: 88 23 and r24, r24 14fe0: 09 f4 brne .+2 ; 0x14fe4 14fe2: 03 c3 rjmp .+1542 ; 0x155ea cs.retract_acceleration = code_value(); 14fe4: 0e 94 a4 60 call 0xc148 ; 0xc148 14fe8: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 14fec: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 14ff0: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 14ff4: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 14ff8: f8 c2 rjmp .+1520 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ffa: 8e 3c cpi r24, 0xCE ; 206 14ffc: 91 05 cpc r25, r1 14ffe: 11 f4 brne .+4 ; 0x15004 15000: 0c 94 c5 b3 jmp 0x1678a ; 0x1678a 15004: 8f 3c cpi r24, 0xCF ; 207 15006: 91 05 cpc r25, r1 15008: 09 f0 breq .+2 ; 0x1500c 1500a: ba cc rjmp .-1676 ; 0x14980 - `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')) 1500c: 83 e5 ldi r24, 0x53 ; 83 1500e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15012: 88 23 and r24, r24 15014: 51 f0 breq .+20 ; 0x1502a { cs.retract_length = code_value() ; 15016: 0e 94 a4 60 call 0xc148 ; 0xc148 1501a: 60 93 41 0e sts 0x0E41, r22 ; 0x800e41 1501e: 70 93 42 0e sts 0x0E42, r23 ; 0x800e42 15022: 80 93 43 0e sts 0x0E43, r24 ; 0x800e43 15026: 90 93 44 0e sts 0x0E44, r25 ; 0x800e44 } if(code_seen('F')) 1502a: 86 e4 ldi r24, 0x46 ; 70 1502c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15030: 88 23 and r24, r24 15032: 61 f0 breq .+24 ; 0x1504c { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 15034: 0e 94 a4 60 call 0xc148 ; 0xc148 15038: 0e 94 ce 66 call 0xcd9c ; 0xcd9c 1503c: 60 93 45 0e sts 0x0E45, r22 ; 0x800e45 15040: 70 93 46 0e sts 0x0E46, r23 ; 0x800e46 15044: 80 93 47 0e sts 0x0E47, r24 ; 0x800e47 15048: 90 93 48 0e sts 0x0E48, r25 ; 0x800e48 } if(code_seen('Z')) 1504c: 8a e5 ldi r24, 0x5A ; 90 1504e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15052: 88 23 and r24, r24 15054: 09 f4 brne .+2 ; 0x15058 15056: c9 c2 rjmp .+1426 ; 0x155ea { cs.retract_zlift = code_value() ; 15058: 0e 94 a4 60 call 0xc148 ; 0xc148 1505c: 60 93 49 0e sts 0x0E49, r22 ; 0x800e49 15060: 70 93 4a 0e sts 0x0E4A, r23 ; 0x800e4a 15064: 80 93 4b 0e sts 0x0E4B, r24 ; 0x800e4b 15068: 90 93 4c 0e sts 0x0E4C, r25 ; 0x800e4c 1506c: be c2 rjmp .+1404 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1506e: 8c 3d cpi r24, 0xDC ; 220 15070: 91 05 cpc r25, r1 15072: 11 f4 brne .+4 ; 0x15078 15074: 0c 94 4c b4 jmp 0x16898 ; 0x16898 15078: 0c f0 brlt .+2 ; 0x1507c 1507a: 7d c0 rjmp .+250 ; 0x15176 1507c: 81 3d cpi r24, 0xD1 ; 209 1507e: 91 05 cpc r25, r1 15080: 11 f4 brne .+4 ; 0x15086 15082: 0c 94 09 b4 jmp 0x16812 ; 0x16812 15086: 86 3d cpi r24, 0xD6 ; 214 15088: 91 05 cpc r25, r1 1508a: 09 f0 breq .+2 ; 0x1508e 1508c: 79 cc rjmp .-1806 ; 0x14980 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; 1508e: 80 e5 ldi r24, 0x50 ; 80 15090: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15094: 88 23 and r24, r24 15096: 11 f4 brne .+4 ; 0x1509c 15098: 0c 94 38 b4 jmp 0x16870 ; 0x16870 1509c: 0e 94 a4 60 call 0xc148 ; 0xc148 150a0: 2b 01 movw r4, r22 150a2: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 150a4: 83 e5 ldi r24, 0x53 ; 83 150a6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 150aa: 88 23 and r24, r24 150ac: 11 f4 brne .+4 ; 0x150b2 150ae: 0c 94 42 b4 jmp 0x16884 ; 0x16884 150b2: 0e 94 a4 60 call 0xc148 ; 0xc148 150b6: 4b 01 movw r8, r22 150b8: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 150ba: 8e e4 ldi r24, 0x4E ; 78 150bc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 150c0: d0 90 8a 0e lds r13, 0x0E8A ; 0x800e8a 150c4: 88 23 and r24, r24 150c6: 29 f0 breq .+10 ; 0x150d2 150c8: 0e 94 a4 60 call 0xc148 ; 0xc148 150cc: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 150d0: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 150d2: 82 e5 ldi r24, 0x52 ; 82 150d4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 150d8: e0 90 8b 0e lds r14, 0x0E8B ; 0x800e8b 150dc: f0 90 8c 0e lds r15, 0x0E8C ; 0x800e8c 150e0: 88 23 and r24, r24 150e2: 29 f0 breq .+10 ; 0x150ee 150e4: 0e 94 a4 60 call 0xc148 ; 0xc148 150e8: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 150ec: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 150ee: 86 e4 ldi r24, 0x46 ; 70 150f0: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 150f4: 00 91 8d 0e lds r16, 0x0E8D ; 0x800e8d 150f8: 10 91 8e 0e lds r17, 0x0E8E ; 0x800e8e 150fc: 88 23 and r24, r24 150fe: 29 f0 breq .+10 ; 0x1510a 15100: 0e 94 a4 60 call 0xc148 ; 0xc148 15104: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15108: 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) 1510a: 20 e0 ldi r18, 0x00 ; 0 1510c: 30 e0 ldi r19, 0x00 ; 0 1510e: a9 01 movw r20, r18 15110: c3 01 movw r24, r6 15112: b2 01 movw r22, r4 15114: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 15118: 18 16 cp r1, r24 1511a: 0c f0 brlt .+2 ; 0x1511e 1511c: 66 c2 rjmp .+1228 ; 0x155ea 1511e: 20 e0 ldi r18, 0x00 ; 0 15120: 30 e0 ldi r19, 0x00 ; 0 15122: a9 01 movw r20, r18 15124: c5 01 movw r24, r10 15126: b4 01 movw r22, r8 15128: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1512c: 87 fd sbrc r24, 7 1512e: 5d c2 rjmp .+1210 ; 0x155ea 15130: a5 01 movw r20, r10 15132: 94 01 movw r18, r8 15134: c3 01 movw r24, r6 15136: b2 01 movw r22, r4 15138: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1513c: 87 fd sbrc r24, 7 1513e: 55 c2 rjmp .+1194 ; 0x155ea { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 15140: 40 92 82 0e sts 0x0E82, r4 ; 0x800e82 15144: 50 92 83 0e sts 0x0E83, r5 ; 0x800e83 15148: 60 92 84 0e sts 0x0E84, r6 ; 0x800e84 1514c: 70 92 85 0e sts 0x0E85, r7 ; 0x800e85 cs.min_mm_per_arc_segment = s; 15150: 80 92 86 0e sts 0x0E86, r8 ; 0x800e86 15154: 90 92 87 0e sts 0x0E87, r9 ; 0x800e87 15158: a0 92 88 0e sts 0x0E88, r10 ; 0x800e88 1515c: b0 92 89 0e sts 0x0E89, r11 ; 0x800e89 cs.n_arc_correction = n; 15160: d0 92 8a 0e sts 0x0E8A, r13 ; 0x800e8a cs.min_arc_segments = r; 15164: f0 92 8c 0e sts 0x0E8C, r15 ; 0x800e8c 15168: e0 92 8b 0e sts 0x0E8B, r14 ; 0x800e8b cs.arc_segments_per_sec = f; 1516c: 10 93 8e 0e sts 0x0E8E, r17 ; 0x800e8e 15170: 00 93 8d 0e sts 0x0E8D, r16 ; 0x800e8d 15174: 3a c2 rjmp .+1140 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15176: 82 3e cpi r24, 0xE2 ; 226 15178: 91 05 cpc r25, r1 1517a: 11 f4 brne .+4 ; 0x15180 1517c: 0c 94 9d b4 jmp 0x1693a ; 0x1693a 15180: 80 3f cpi r24, 0xF0 ; 240 15182: 91 05 cpc r25, r1 15184: 09 f4 brne .+2 ; 0x15188 15186: 31 c2 rjmp .+1122 ; 0x155ea 15188: 8d 3d cpi r24, 0xDD ; 221 1518a: 91 05 cpc r25, r1 1518c: 09 f0 breq .+2 ; 0x15190 1518e: f8 cb rjmp .-2064 ; 0x14980 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 15190: 83 e5 ldi r24, 0x53 ; 83 15192: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15196: 88 23 and r24, r24 15198: 11 f4 brne .+4 ; 0x1519e 1519a: 0c 94 8b b4 jmp 0x16916 ; 0x16916 { extrudemultiply = code_value_short(); 1519e: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 151a2: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 151a6: 80 93 bc 02 sts 0x02BC, r24 ; 0x8002bc calculate_extruder_multipliers(); 151aa: 0e 94 c0 65 call 0xcb80 ; 0xcb80 151ae: 1d c2 rjmp .+1082 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151b0: 80 39 cpi r24, 0x90 ; 144 151b2: 51 e0 ldi r21, 0x01 ; 1 151b4: 95 07 cpc r25, r21 151b6: 11 f4 brne .+4 ; 0x151bc 151b8: 0c 94 bb bb jmp 0x17776 ; 0x17776 151bc: 0c f0 brlt .+2 ; 0x151c0 151be: a7 c0 rjmp .+334 ; 0x1530e 151c0: 8f 32 cpi r24, 0x2F ; 47 151c2: b1 e0 ldi r27, 0x01 ; 1 151c4: 9b 07 cpc r25, r27 151c6: 11 f4 brne .+4 ; 0x151cc 151c8: 0c 94 9a b5 jmp 0x16b34 ; 0x16b34 151cc: c4 f4 brge .+48 ; 0x151fe 151ce: 8d 32 cpi r24, 0x2D ; 45 151d0: f1 e0 ldi r31, 0x01 ; 1 151d2: 9f 07 cpc r25, r31 151d4: 11 f4 brne .+4 ; 0x151da 151d6: 0c 94 1d b5 jmp 0x16a3a ; 0x16a3a 151da: 8e 32 cpi r24, 0x2E ; 46 151dc: 91 40 sbci r25, 0x01 ; 1 151de: 09 f0 breq .+2 ; 0x151e2 151e0: cf cb rjmp .-2146 ; 0x14980 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 151e2: 83 e5 ldi r24, 0x53 ; 83 151e4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 151e8: 88 23 and r24, r24 151ea: 11 f4 brne .+4 ; 0x151f0 151ec: 0c 94 96 b5 jmp 0x16b2c ; 0x16b2c 151f0: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 151f4: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 151f8: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 151fc: f6 c1 rjmp .+1004 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151fe: 86 33 cpi r24, 0x36 ; 54 15200: 31 e0 ldi r19, 0x01 ; 1 15202: 93 07 cpc r25, r19 15204: 11 f4 brne .+4 ; 0x1520a 15206: 0c 94 cd b5 jmp 0x16b9a ; 0x16b9a 1520a: 8e 35 cpi r24, 0x5E ; 94 1520c: 41 e0 ldi r20, 0x01 ; 1 1520e: 94 07 cpc r25, r20 15210: 11 f4 brne .+4 ; 0x15216 15212: 0c 94 c6 c8 jmp 0x1918c ; 0x1918c 15216: 80 33 cpi r24, 0x30 ; 48 15218: 91 40 sbci r25, 0x01 ; 1 1521a: 09 f0 breq .+2 ; 0x1521e 1521c: b1 cb rjmp .-2206 ; 0x14980 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 1521e: 80 e5 ldi r24, 0x50 ; 80 15220: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15224: 88 23 and r24, r24 15226: 51 f0 breq .+20 ; 0x1523c 15228: 0e 94 a4 60 call 0xc148 ; 0xc148 1522c: 60 93 32 0e sts 0x0E32, r22 ; 0x800e32 15230: 70 93 33 0e sts 0x0E33, r23 ; 0x800e33 15234: 80 93 34 0e sts 0x0E34, r24 ; 0x800e34 15238: 90 93 35 0e sts 0x0E35, r25 ; 0x800e35 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 1523c: 89 e4 ldi r24, 0x49 ; 73 1523e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15242: 88 23 and r24, r24 15244: 81 f0 breq .+32 ; 0x15266 15246: 0e 94 a4 60 call 0xc148 ; 0xc148 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1524a: 2c ea ldi r18, 0xAC ; 172 1524c: 35 ec ldi r19, 0xC5 ; 197 1524e: 47 e2 ldi r20, 0x27 ; 39 15250: 5e e3 ldi r21, 0x3E ; 62 15252: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 15256: 60 93 36 0e sts 0x0E36, r22 ; 0x800e36 1525a: 70 93 37 0e sts 0x0E37, r23 ; 0x800e37 1525e: 80 93 38 0e sts 0x0E38, r24 ; 0x800e38 15262: 90 93 39 0e sts 0x0E39, r25 ; 0x800e39 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 15266: 84 e4 ldi r24, 0x44 ; 68 15268: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1526c: 88 23 and r24, r24 1526e: 81 f0 breq .+32 ; 0x15290 15270: 0e 94 a4 60 call 0xc148 ; 0xc148 } float unscalePID_i(float i) { return i/PID_dT; 15274: 2c ea ldi r18, 0xAC ; 172 15276: 35 ec ldi r19, 0xC5 ; 197 15278: 47 e2 ldi r20, 0x27 ; 39 1527a: 5e e3 ldi r21, 0x3E ; 62 1527c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 15280: 60 93 3a 0e sts 0x0E3A, r22 ; 0x800e3a 15284: 70 93 3b 0e sts 0x0E3B, r23 ; 0x800e3b 15288: 80 93 3c 0e sts 0x0E3C, r24 ; 0x800e3c 1528c: 90 93 3d 0e sts 0x0E3D, r25 ; 0x800e3d updatePID(); 15290: 0f 94 da 3a call 0x275b4 ; 0x275b4 SERIAL_PROTOCOLRPGM(MSG_OK); 15294: 8b eb ldi r24, 0xBB ; 187 15296: 9d e6 ldi r25, 0x6D ; 109 15298: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLPGM(" p:"); 1529c: 87 e4 ldi r24, 0x47 ; 71 1529e: 96 e8 ldi r25, 0x86 ; 134 152a0: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 152a4: 60 91 32 0e lds r22, 0x0E32 ; 0x800e32 152a8: 70 91 33 0e lds r23, 0x0E33 ; 0x800e33 152ac: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 152b0: 90 91 35 0e lds r25, 0x0E35 ; 0x800e35 152b4: 42 e0 ldi r20, 0x02 ; 2 152b6: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 152ba: 83 e4 ldi r24, 0x43 ; 67 152bc: 96 e8 ldi r25, 0x86 ; 134 152be: 0e 94 57 77 call 0xeeae ; 0xeeae 152c2: 2c ea ldi r18, 0xAC ; 172 152c4: 35 ec ldi r19, 0xC5 ; 197 152c6: 47 e2 ldi r20, 0x27 ; 39 152c8: 5e e3 ldi r21, 0x3E ; 62 152ca: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 152ce: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 152d2: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 152d6: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 152da: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 152de: 42 e0 ldi r20, 0x02 ; 2 152e0: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 152e4: 8f e3 ldi r24, 0x3F ; 63 152e6: 96 e8 ldi r25, 0x86 ; 134 152e8: 0e 94 57 77 call 0xeeae ; 0xeeae #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 152ec: 2c ea ldi r18, 0xAC ; 172 152ee: 35 ec ldi r19, 0xC5 ; 197 152f0: 47 e2 ldi r20, 0x27 ; 39 152f2: 5e e3 ldi r21, 0x3E ; 62 152f4: 60 91 3a 0e lds r22, 0x0E3A ; 0x800e3a 152f8: 70 91 3b 0e lds r23, 0x0E3B ; 0x800e3b 152fc: 80 91 3c 0e lds r24, 0x0E3C ; 0x800e3c 15300: 90 91 3d 0e lds r25, 0x0E3D ; 0x800e3d 15304: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 15308: 0f 94 bb 74 call 0x2e976 ; 0x2e976 1530c: 6e c1 rjmp .+732 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1530e: 86 39 cpi r24, 0x96 ; 150 15310: a1 e0 ldi r26, 0x01 ; 1 15312: 9a 07 cpc r25, r26 15314: 11 f4 brne .+4 ; 0x1531a 15316: 0c 94 dd bb jmp 0x177ba ; 0x177ba 1531a: 74 f4 brge .+28 ; 0x15338 1531c: 83 39 cpi r24, 0x93 ; 147 1531e: e1 e0 ldi r30, 0x01 ; 1 15320: 9e 07 cpc r25, r30 15322: 11 f4 brne .+4 ; 0x15328 15324: 0c 94 bf bb jmp 0x1777e ; 0x1777e 15328: 85 39 cpi r24, 0x95 ; 149 1532a: 91 40 sbci r25, 0x01 ; 1 1532c: 09 f0 breq .+2 ; 0x15330 1532e: 28 cb rjmp .-2480 ; 0x14980 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 15330: 81 e0 ldi r24, 0x01 ; 1 15332: 0e 94 d6 74 call 0xe9ac ; 0xe9ac 15336: 59 c1 rjmp .+690 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15338: 84 3f cpi r24, 0xF4 ; 244 1533a: 21 e0 ldi r18, 0x01 ; 1 1533c: 92 07 cpc r25, r18 1533e: 11 f4 brne .+4 ; 0x15344 15340: 0c 94 e2 bb jmp 0x177c4 ; 0x177c4 15344: 14 f0 brlt .+4 ; 0x1534a 15346: 0c 94 e6 bb jmp 0x177cc ; 0x177cc 1534a: 84 3a cpi r24, 0xA4 ; 164 1534c: 91 40 sbci r25, 0x01 ; 1 1534e: 09 f0 breq .+2 ; 0x15352 15350: 17 cb rjmp .-2514 ; 0x14980 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 15352: 0e 94 62 7f call 0xfec4 ; 0xfec4 15356: 49 c1 rjmp .+658 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15358: 83 3c cpi r24, 0xC3 ; 195 1535a: 52 e0 ldi r21, 0x02 ; 2 1535c: 95 07 cpc r25, r21 1535e: 11 f4 brne .+4 ; 0x15364 15360: 0c 94 4a ca jmp 0x19494 ; 0x19494 15364: 0c f0 brlt .+2 ; 0x15368 15366: 91 c0 rjmp .+290 ; 0x1548a 15368: 8a 35 cpi r24, 0x5A ; 90 1536a: b2 e0 ldi r27, 0x02 ; 2 1536c: 9b 07 cpc r25, r27 1536e: 11 f4 brne .+4 ; 0x15374 15370: 0c 94 41 c3 jmp 0x18682 ; 0x18682 15374: 3c f5 brge .+78 ; 0x153c4 15376: 88 32 cpi r24, 0x28 ; 40 15378: f2 e0 ldi r31, 0x02 ; 2 1537a: 9f 07 cpc r25, r31 1537c: 11 f4 brne .+4 ; 0x15382 1537e: 0c 94 01 bf jmp 0x17e02 ; 0x17e02 15382: ac f4 brge .+42 ; 0x153ae 15384: 87 3f cpi r24, 0xF7 ; 247 15386: 31 e0 ldi r19, 0x01 ; 1 15388: 93 07 cpc r25, r19 1538a: 11 f4 brne .+4 ; 0x15390 1538c: 0c 94 ee bb jmp 0x177dc ; 0x177dc 15390: 8d 3f cpi r24, 0xFD ; 253 15392: 91 40 sbci r25, 0x01 ; 1 15394: 09 f0 breq .+2 ; 0x15398 15396: f4 ca rjmp .-2584 ; 0x14980 M509 */ case 509: { lang_reset(); 15398: 0e 94 33 71 call 0xe266 ; 0xe266 SERIAL_ECHO_START; 1539c: 80 ed ldi r24, 0xD0 ; 208 1539e: 9b ea ldi r25, 0xAB ; 171 153a0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 153a4: 8f e2 ldi r24, 0x2F ; 47 153a6: 96 e8 ldi r25, 0x86 ; 134 153a8: 0e 94 57 77 call 0xeeae ; 0xeeae 153ac: 1e c1 rjmp .+572 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153ae: 88 35 cpi r24, 0x58 ; 88 153b0: 52 e0 ldi r21, 0x02 ; 2 153b2: 95 07 cpc r25, r21 153b4: 11 f4 brne .+4 ; 0x153ba 153b6: 0c 94 36 bf jmp 0x17e6c ; 0x17e6c 153ba: 89 35 cpi r24, 0x59 ; 89 153bc: 92 40 sbci r25, 0x02 ; 2 153be: 09 f4 brne .+2 ; 0x153c2 153c0: 4c cb rjmp .-2408 ; 0x14a5a 153c2: de ca rjmp .-2628 ; 0x14980 153c4: 8e 3b cpi r24, 0xBE ; 190 153c6: b2 e0 ldi r27, 0x02 ; 2 153c8: 9b 07 cpc r25, r27 153ca: 11 f4 brne .+4 ; 0x153d0 153cc: 0c 94 0a ca jmp 0x19414 ; 0x19414 153d0: 0c f0 brlt .+2 ; 0x153d4 153d2: 49 c0 rjmp .+146 ; 0x15466 153d4: 8b 35 cpi r24, 0x5B ; 91 153d6: f2 e0 ldi r31, 0x02 ; 2 153d8: 9f 07 cpc r25, r31 153da: 11 f4 brne .+4 ; 0x153e0 153dc: 0c 94 49 c3 jmp 0x18692 ; 0x18692 153e0: 8d 3b cpi r24, 0xBD ; 189 153e2: 92 40 sbci r25, 0x02 ; 2 153e4: 09 f0 breq .+2 ; 0x153e8 153e6: cc ca rjmp .-2664 ; 0x14980 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 153e8: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 153ec: 81 30 cpi r24, 0x01 ; 1 153ee: 11 f4 brne .+4 ; 0x153f4 153f0: 0c 94 ab c9 jmp 0x19356 ; 0x19356 - `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; 153f4: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 153f6: 8c e4 ldi r24, 0x4C ; 76 153f8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `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 153fc: c1 2c mov r12, r1 153fe: d1 2c mov r13, r1 15400: 6c e8 ldi r22, 0x8C ; 140 15402: e6 2e mov r14, r22 15404: 62 e4 ldi r22, 0x42 ; 66 15406: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15408: 88 23 and r24, r24 1540a: 21 f0 breq .+8 ; 0x15414 1540c: 0e 94 a4 60 call 0xc148 ; 0xc148 15410: 6b 01 movw r12, r22 15412: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15414: 8a e5 ldi r24, 0x5A ; 90 15416: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1541a: 88 23 and r24, r24 1541c: 11 f4 brne .+4 ; 0x15422 1541e: 0c 94 bc c9 jmp 0x19378 ; 0x19378 15422: 0e 94 a4 60 call 0xc148 ; 0xc148 15426: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15428: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 1542c: 4b 01 movw r8, r22 1542e: 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 15430: 8a e5 ldi r24, 0x5A ; 90 15432: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15436: 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; 15438: 0f 94 b5 86 call 0x30d6a ; 0x30d6a prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 1543c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 15440: 81 30 cpi r24, 0x01 ; 1 15442: 11 f0 breq .+4 ; 0x15448 15444: 0c 94 c1 c9 jmp 0x19382 ; 0x19382 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 15448: 15 30 cpi r17, 0x05 ; 5 1544a: 18 f4 brcc .+6 ; 0x15452 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 1544c: 81 2f mov r24, r17 1544e: 0f 94 b7 0e call 0x21d6e ; 0x21d6e lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 15452: 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. 15456: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 // 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); 1545a: c5 01 movw r24, r10 1545c: b4 01 movw r22, r8 1545e: 90 58 subi r25, 0x80 ; 128 15460: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 15464: c2 c0 rjmp .+388 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15466: 81 3c cpi r24, 0xC1 ; 193 15468: 32 e0 ldi r19, 0x02 ; 2 1546a: 93 07 cpc r25, r19 1546c: 11 f4 brne .+4 ; 0x15472 1546e: 0c 94 3e ca jmp 0x1947c ; 0x1947c 15472: 14 f0 brlt .+4 ; 0x15478 15474: 0c 94 44 ca jmp 0x19488 ; 0x19488 15478: 80 3c cpi r24, 0xC0 ; 192 1547a: 92 40 sbci r25, 0x02 ; 2 1547c: 09 f0 breq .+2 ; 0x15480 1547e: 80 ca rjmp .-2816 ; 0x14980 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 15480: 80 ec ldi r24, 0xC0 ; 192 15482: 92 e0 ldi r25, 0x02 ; 2 15484: 0e 94 56 60 call 0xc0ac ; 0xc0ac 15488: b0 c0 rjmp .+352 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1548a: 84 38 cpi r24, 0x84 ; 132 1548c: a3 e0 ldi r26, 0x03 ; 3 1548e: 9a 07 cpc r25, r26 15490: 11 f4 brne .+4 ; 0x15496 15492: 0c 94 f3 c6 jmp 0x18de6 ; 0x18de6 15496: 0c f0 brlt .+2 ; 0x1549a 15498: 97 c0 rjmp .+302 ; 0x155c8 1549a: 82 35 cpi r24, 0x52 ; 82 1549c: e3 e0 ldi r30, 0x03 ; 3 1549e: 9e 07 cpc r25, r30 154a0: 11 f4 brne .+4 ; 0x154a6 154a2: 0c 94 4f c3 jmp 0x1869e ; 0x1869e 154a6: 94 f5 brge .+100 ; 0x1550c 154a8: 84 3c cpi r24, 0xC4 ; 196 154aa: 22 e0 ldi r18, 0x02 ; 2 154ac: 92 07 cpc r25, r18 154ae: 11 f4 brne .+4 ; 0x154b4 154b0: 0c 94 67 ca jmp 0x194ce ; 0x194ce 154b4: 85 3c cpi r24, 0xC5 ; 197 154b6: 92 40 sbci r25, 0x02 ; 2 154b8: 09 f0 breq .+2 ; 0x154bc 154ba: 62 ca rjmp .-2876 ; 0x14980 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 154bc: 83 e5 ldi r24, 0x53 ; 83 154be: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 154c2: 88 23 and r24, r24 154c4: 51 f0 breq .+20 ; 0x154da { switch (code_value_uint8()) 154c6: 0e 94 6f 5b call 0xb6de ; 0xb6de 154ca: 88 23 and r24, r24 154cc: 11 f4 brne .+4 ; 0x154d2 154ce: 0c 94 93 ca jmp 0x19526 ; 0x19526 154d2: 81 30 cpi r24, 0x01 ; 1 154d4: 11 f4 brne .+4 ; 0x154da 154d6: 0c 94 a0 ca jmp 0x19540 ; 0x19540 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 154da: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 154de: 81 30 cpi r24, 0x01 ; 1 154e0: 91 f4 brne .+36 ; 0x15506 154e2: 88 e5 ldi r24, 0x58 ; 88 154e4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 154e8: 88 23 and r24, r24 154ea: 69 f0 breq .+26 ; 0x15506 { switch (code_value_uint8()) 154ec: 0e 94 6f 5b call 0xb6de ; 0xb6de 154f0: 81 30 cpi r24, 0x01 ; 1 154f2: 11 f4 brne .+4 ; 0x154f8 154f4: 0c 94 ae ca jmp 0x1955c ; 0x1955c 154f8: 10 f4 brcc .+4 ; 0x154fe 154fa: 0c 94 a9 ca jmp 0x19552 ; 0x19552 154fe: 8a 32 cpi r24, 0x2A ; 42 15500: 11 f4 brne .+4 ; 0x15506 15502: 0c 94 b2 ca jmp 0x19564 ; 0x19564 break; default: break; } } MMU2::mmu2.Status(); 15506: 0f 94 ea 74 call 0x2e9d4 ; 0x2e9d4 1550a: 6f c0 rjmp .+222 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1550c: 8d 35 cpi r24, 0x5D ; 93 1550e: 43 e0 ldi r20, 0x03 ; 3 15510: 94 07 cpc r25, r20 15512: 11 f4 brne .+4 ; 0x15518 15514: 0c 94 c5 c4 jmp 0x1898a ; 0x1898a 15518: 8e 35 cpi r24, 0x5E ; 94 1551a: 53 e0 ldi r21, 0x03 ; 3 1551c: 95 07 cpc r25, r21 1551e: 11 f4 brne .+4 ; 0x15524 15520: 0c 94 5d c5 jmp 0x18aba ; 0x18aba 15524: 8c 35 cpi r24, 0x5C ; 92 15526: 93 40 sbci r25, 0x03 ; 3 15528: 09 f0 breq .+2 ; 0x1552c 1552a: 2a ca rjmp .-2988 ; 0x14980 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1552c: 83 e5 ldi r24, 0x53 ; 83 1552e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15532: 88 23 and r24, r24 15534: 09 f4 brne .+2 ; 0x15538 15536: 59 c0 rjmp .+178 ; 0x155ea set_target_pinda = code_value_short(); 15538: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 1553c: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1553e: 8a ee ldi r24, 0xEA ; 234 15540: 99 e3 ldi r25, 0x39 ; 57 15542: 0e 94 b3 72 call 0xe566 ; 0xe566 15546: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 1554a: 88 ea ldi r24, 0xA8 ; 168 1554c: 95 e8 ldi r25, 0x85 ; 133 1554e: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN(set_target_pinda); 15552: c8 01 movw r24, r16 15554: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 codenum = _millis(); 15558: 0f 94 53 29 call 0x252a6 ; 0x252a6 1555c: 4b 01 movw r8, r22 1555e: 5c 01 movw r10, r24 cancel_heatup = false; 15560: 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; 15564: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 15568: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 1556c: 89 2b or r24, r25 1556e: 41 f4 brne .+16 ; 0x15580 15570: ff 24 eor r15, r15 15572: f3 94 inc r15 15574: 80 91 72 06 lds r24, 0x0672 ; 0x800672 15578: 90 91 73 06 lds r25, 0x0673 ; 0x800673 1557c: 89 2b or r24, r25 1557e: 09 f0 breq .+2 ; 0x15582 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 15580: 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)) ) { 15582: 28 01 movw r4, r16 15584: 01 2e mov r0, r17 15586: 00 0c add r0, r0 15588: 66 08 sbc r6, r6 1558a: 77 08 sbc r7, r7 1558c: f1 10 cpse r15, r1 1558e: 0c 94 85 c4 jmp 0x1890a ; 0x1890a 15592: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> 15596: 81 11 cpse r24, r1 15598: 12 c0 rjmp .+36 ; 0x155be 1559a: c3 01 movw r24, r6 1559c: b2 01 movw r22, r4 1559e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 155a2: 20 91 99 03 lds r18, 0x0399 ; 0x800399 155a6: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 155aa: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 155ae: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 155b2: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 155b6: 18 16 cp r1, r24 155b8: 14 f4 brge .+4 ; 0x155be 155ba: 0c 94 97 c4 jmp 0x1892e ; 0x1892e } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 155be: 8b eb ldi r24, 0xBB ; 187 155c0: 9d e6 ldi r25, 0x6D ; 109 155c2: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 155c6: 11 c0 rjmp .+34 ; 0x155ea } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155c8: 81 39 cpi r24, 0x91 ; 145 155ca: b3 e0 ldi r27, 0x03 ; 3 155cc: 9b 07 cpc r25, r27 155ce: 11 f4 brne .+4 ; 0x155d4 155d0: 0c 94 26 c8 jmp 0x1904c ; 0x1904c 155d4: 84 f4 brge .+32 ; 0x155f6 155d6: 8b 38 cpi r24, 0x8B ; 139 155d8: f3 e0 ldi r31, 0x03 ; 3 155da: 9f 07 cpc r25, r31 155dc: 11 f4 brne .+4 ; 0x155e2 155de: 0c 94 a2 c7 jmp 0x18f44 ; 0x18f44 155e2: 8c 38 cpi r24, 0x8C ; 140 155e4: 93 40 sbci r25, 0x03 ; 3 155e6: 09 f0 breq .+2 ; 0x155ea 155e8: cb c9 rjmp .-3178 ; 0x14980 */ 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; 155ea: 10 92 ab 0d sts 0x0DAB, r1 ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 155ee: 10 92 aa 0d sts 0x0DAA, r1 ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> 155f2: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155f6: 84 39 cpi r24, 0x94 ; 148 155f8: 33 e0 ldi r19, 0x03 ; 3 155fa: 93 07 cpc r25, r19 155fc: 14 f4 brge .+4 ; 0x15602 155fe: 0c 94 75 c8 jmp 0x190ea ; 0x190ea 15602: 80 3a cpi r24, 0xA0 ; 160 15604: 93 40 sbci r25, 0x03 ; 3 15606: 09 f0 breq .+2 ; 0x1560a 15608: bb c9 rjmp .-3210 ; 0x14980 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1560a: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1560e: 90 91 96 03 lds r25, 0x0396 ; 0x800396 } } void CardReader::openLogFile(const char* name) { logging = true; 15612: 21 e0 ldi r18, 0x01 ; 1 15614: 20 93 8f 14 sts 0x148F, r18 ; 0x80148f openFileWrite(name); 15618: 05 96 adiw r24, 0x05 ; 5 1561a: 0f 94 6d 85 call 0x30ada ; 0x30ada 1561e: e5 cf rjmp .-54 ; 0x155ea - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 15620: 00 91 95 03 lds r16, 0x0395 ; 0x800395 15624: 10 91 96 03 lds r17, 0x0396 ; 0x800396 15628: 0e 5f subi r16, 0xFE ; 254 1562a: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1562c: 80 e5 ldi r24, 0x50 ; 80 1562e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 15632: c1 2c mov r12, r1 15634: d1 2c mov r13, r1 15636: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 15638: 88 23 and r24, r24 1563a: 21 f0 breq .+8 ; 0x15644 1563c: 0e 94 89 5b call 0xb712 ; 0xb712 15640: 6b 01 movw r12, r22 15642: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 15644: 83 e5 ldi r24, 0x53 ; 83 15646: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1564a: 88 23 and r24, r24 1564c: 51 f0 breq .+20 ; 0x15662 1564e: 0e 94 89 5b call 0xb712 ; 0xb712 15652: 9b 01 movw r18, r22 15654: ac 01 movw r20, r24 15656: a8 ee ldi r26, 0xE8 ; 232 15658: b3 e0 ldi r27, 0x03 ; 3 1565a: 0f 94 b8 dc call 0x3b970 ; 0x3b970 <__muluhisi3> 1565e: 6b 01 movw r12, r22 15660: 7c 01 movw r14, r24 15662: c8 01 movw r24, r16 15664: 0f 5f subi r16, 0xFF ; 255 15666: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 15668: dc 01 movw r26, r24 1566a: 4c 91 ld r20, X 1566c: 40 32 cpi r20, 0x20 ; 32 1566e: c9 f3 breq .-14 ; 0x15662 custom_message_type = CustomMsg::M0Wait; 15670: 26 e0 ldi r18, 0x06 ; 6 15672: 20 93 c4 06 sts 0x06C4, r18 ; 0x8006c4 if (!expiration_time_set && *src != '\0') { 15676: c1 14 cp r12, r1 15678: d1 04 cpc r13, r1 1567a: e1 04 cpc r14, r1 1567c: f1 04 cpc r15, r1 1567e: a1 f5 brne .+104 ; 0x156e8 15680: 2c 91 ld r18, X 15682: 22 23 and r18, r18 15684: 89 f1 breq .+98 ; 0x156e8 lcd_setstatus(src); 15686: 0e 94 90 f4 call 0x1e920 ; 0x1e920 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(); 1568a: 0f 94 ef 42 call 0x285de ; 0x285de menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 1568e: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 15692: 84 60 ori r24, 0x04 ; 4 15694: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 previous_millis_cmd.start(); 15698: 86 e8 ldi r24, 0x86 ; 134 1569a: 93 e0 ldi r25, 0x03 ; 3 1569c: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> if (expiration_time_set) { 156a0: c1 14 cp r12, r1 156a2: d1 04 cpc r13, r1 156a4: e1 04 cpc r14, r1 156a6: f1 04 cpc r15, r1 156a8: 79 f1 breq .+94 ; 0x15708 codenum += _millis(); // keep track of when we started waiting 156aa: 0f 94 53 29 call 0x252a6 ; 0x252a6 156ae: c6 0e add r12, r22 156b0: d7 1e adc r13, r23 156b2: e8 1e adc r14, r24 156b4: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 156b6: 84 e0 ldi r24, 0x04 ; 4 156b8: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(_millis() < codenum && !lcd_clicked()) { 156bc: 0f 94 53 29 call 0x252a6 ; 0x252a6 156c0: 6c 15 cp r22, r12 156c2: 7d 05 cpc r23, r13 156c4: 8e 05 cpc r24, r14 156c6: 9f 05 cpc r25, r15 156c8: b0 f0 brcs .+44 ; 0x156f6 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 156ca: 82 e0 ldi r24, 0x02 ; 2 156cc: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 156d0: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 156d4: 8b 7f andi r24, 0xFB ; 251 156d6: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 if (IS_SD_PRINTING) 156da: 80 91 90 14 lds r24, 0x1490 ; 0x801490 156de: 88 23 and r24, r24 156e0: 31 f1 breq .+76 ; 0x1572e custom_message_type = CustomMsg::Status; 156e2: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 156e6: 81 cf rjmp .-254 ; 0x155ea } 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)); 156e8: 83 e0 ldi r24, 0x03 ; 3 156ea: 9a e3 ldi r25, 0x3A ; 58 156ec: 0e 94 b3 72 call 0xe566 ; 0xe566 156f0: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 156f4: ca cf rjmp .-108 ; 0x1568a 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()) { 156f6: 0e 94 04 71 call 0xe208 ; 0xe208 156fa: 81 11 cpse r24, r1 156fc: e6 cf rjmp .-52 ; 0x156ca delay_keep_alive(0); 156fe: 90 e0 ldi r25, 0x00 ; 0 15700: 80 e0 ldi r24, 0x00 ; 0 15702: 0e 94 eb 8c call 0x119d6 ; 0x119d6 15706: da cf rjmp .-76 ; 0x156bc //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 15708: 10 91 be 02 lds r17, 0x02BE ; 0x8002be KEEPALIVE_STATE(PAUSED_FOR_USER); 1570c: 84 e0 ldi r24, 0x04 ; 4 1570e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 15712: 0e 94 ff 70 call 0xe1fe ; 0xe1fe while(!lcd_clicked()) 15716: 0e 94 04 71 call 0xe208 ; 0xe208 1571a: 81 11 cpse r24, r1 1571c: 05 c0 rjmp .+10 ; 0x15728 { delay_keep_alive(0); 1571e: 90 e0 ldi r25, 0x00 ; 0 15720: 80 e0 ldi r24, 0x00 ; 0 15722: 0e 94 eb 8c call 0x119d6 ; 0x119d6 15726: f7 cf rjmp .-18 ; 0x15716 } KEEPALIVE_STATE(busy_state_backup); 15728: 10 93 be 02 sts 0x02BE, r17 ; 0x8002be 1572c: d1 cf rjmp .-94 ; 0x156d0 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 1572e: 83 e7 ldi r24, 0x73 ; 115 15730: 90 e7 ldi r25, 0x70 ; 112 15732: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 15736: 59 cf rjmp .-334 ; 0x155ea /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 15738: 88 ef ldi r24, 0xF8 ; 248 1573a: 99 e3 ldi r25, 0x39 ; 57 1573c: 0e 94 b3 72 call 0xe566 ; 0xe566 15740: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 enable_x(); 15744: 17 98 cbi 0x02, 7 ; 2 enable_y(); 15746: 16 98 cbi 0x02, 6 ; 2 enable_z(); 15748: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1574a: 14 98 cbi 0x02, 4 ; 2 1574c: 4e cf rjmp .-356 ; 0x155ea /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 1574e: 81 e0 ldi r24, 0x01 ; 1 15750: 0f 94 c9 80 call 0x30192 ; 0x30192 15754: 4a cf rjmp .-364 ; 0x155ea presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 15756: 10 92 90 14 sts 0x1490, r1 ; 0x801490 mounted = false; 1575a: 10 92 91 14 sts 0x1491, r1 ; 0x801491 SERIAL_ECHO_START; 1575e: 80 ed ldi r24, 0xD0 ; 208 15760: 9b ea ldi r25, 0xAB ; 171 15762: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 15766: 88 e9 ldi r24, 0x98 ; 152 15768: 9b e6 ldi r25, 0x6B ; 107 1576a: 0e 94 82 79 call 0xf304 ; 0xf304 1576e: 3d cf rjmp .-390 ; 0x155ea /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 15770: 0e 94 8c 67 call 0xcf18 ; 0xcf18 15774: 88 23 and r24, r24 15776: 19 f0 breq .+6 ; 0x1577e lcd_resume_print(); 15778: 0e 94 1e f8 call 0x1f03c ; 0x1f03c 1577c: 36 cf rjmp .-404 ; 0x155ea else { if (!filament_presence_check()) { 1577e: 0e 94 09 f5 call 0x1ea12 ; 0x1ea12 15782: 88 23 and r24, r24 15784: 09 f4 brne .+2 ; 0x15788 15786: 31 cf rjmp .-414 ; 0x155ea 15788: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1578c: 88 23 and r24, r24 1578e: 61 f0 breq .+24 ; 0x157a8 // Print was aborted break; } if (!card.get_sdpos()) 15790: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 15794: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 15798: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 1579c: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 157a0: 89 2b or r24, r25 157a2: 8a 2b or r24, r26 157a4: 8b 2b or r24, r27 157a6: 69 f4 brne .+26 ; 0x157c2 { // A new print has started from scratch, reset stats failstats_reset_print(); 157a8: 0e 94 2b 5c call 0xb856 ; 0xb856 sdpos_atomic = 0; 157ac: 10 92 82 03 sts 0x0382, r1 ; 0x800382 157b0: 10 92 83 03 sts 0x0383, r1 ; 0x800383 157b4: 10 92 84 03 sts 0x0384, r1 ; 0x800384 157b8: 10 92 85 03 sts 0x0385, r1 ; 0x800385 157bc: 80 e0 ldi r24, 0x00 ; 0 157be: 0e 94 1e 82 call 0x1043c ; 0x1043c } void CardReader::startFileprint() { if(mounted) 157c2: 80 91 91 14 lds r24, 0x1491 ; 0x801491 157c6: 88 23 and r24, r24 157c8: 31 f0 breq .+12 ; 0x157d6 { sdprinting = true; 157ca: 81 e0 ldi r24, 0x01 ; 1 157cc: 80 93 90 14 sts 0x1490, r24 ; 0x801490 157d0: 85 e0 ldi r24, 0x05 ; 5 157d2: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 157d6: 0f 94 94 42 call 0x28528 ; 0x28528 if (MMU2::mmu2.Enabled()) 157da: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 157de: 81 30 cpi r24, 0x01 ; 1 157e0: 09 f0 breq .+2 ; 0x157e4 157e2: 03 cf rjmp .-506 ; 0x155ea { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 157e4: 80 91 90 13 lds r24, 0x1390 ; 0x801390 157e8: 88 23 and r24, r24 157ea: 09 f4 brne .+2 ; 0x157ee 157ec: fe ce rjmp .-516 ; 0x155ea 157ee: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 157f2: 81 11 cpse r24, r1 157f4: fa ce rjmp .-524 ; 0x155ea { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 157f6: 0f 94 44 ad call 0x35a88 ; 0x35a88 157fa: f7 ce rjmp .-530 ; 0x155ea #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 157fc: 80 91 91 14 lds r24, 0x1491 ; 0x801491 15800: 88 23 and r24, r24 15802: 09 f4 brne .+2 ; 0x15806 15804: f2 ce rjmp .-540 ; 0x155ea 15806: 83 e5 ldi r24, 0x53 ; 83 15808: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1580c: 88 23 and r24, r24 1580e: 09 f4 brne .+2 ; 0x15812 15810: ec ce rjmp .-552 ; 0x155ea long index = code_value_long(); 15812: 0e 94 89 5b call 0xb712 ; 0xb712 15816: 6b 01 movw r12, r22 15818: 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);}; 1581a: c0 92 a4 17 sts 0x17A4, r12 ; 0x8017a4 1581e: d0 92 a5 17 sts 0x17A5, r13 ; 0x8017a5 15822: e0 92 a6 17 sts 0x17A6, r14 ; 0x8017a6 15826: f0 92 a7 17 sts 0x17A7, r15 ; 0x8017a7 1582a: 0f 94 a3 75 call 0x2eb46 ; 0x2eb46 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; 1582e: c0 92 82 03 sts 0x0382, r12 ; 0x800382 15832: d0 92 83 03 sts 0x0383, r13 ; 0x800383 15836: e0 92 84 03 sts 0x0384, r14 ; 0x800384 1583a: f0 92 85 03 sts 0x0385, r15 ; 0x800385 1583e: d5 ce rjmp .-598 ; 0x155ea #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 15840: 80 e5 ldi r24, 0x50 ; 80 15842: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15846: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 15848: 0e 94 8c 67 call 0xcf18 ; 0xcf18 1584c: 88 23 and r24, r24 1584e: 91 f0 breq .+36 ; 0x15874 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 15850: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 15854: 88 23 and r24, r24 15856: 49 f0 breq .+18 ; 0x1586a 15858: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1585c: 81 11 cpse r24, r1 1585e: 05 c0 rjmp .+10 ; 0x1586a SERIAL_PROTOCOLLNPGM("SD print paused"); 15860: 8e ed ldi r24, 0xDE ; 222 15862: 94 e8 ldi r25, 0x84 ; 132 15864: 0e 94 82 79 call 0xf304 ; 0xf304 15868: c0 ce rjmp .-640 ; 0x155ea else SERIAL_PROTOCOLLNPGM("Print saved"); 1586a: 82 ed ldi r24, 0xD2 ; 210 1586c: 94 e8 ldi r25, 0x84 ; 132 1586e: 0e 94 82 79 call 0xf304 ; 0xf304 15872: bb ce rjmp .-650 ; 0x155ea } else if (sdprinting) 15874: 80 91 90 14 lds r24, 0x1490 ; 0x801490 15878: 88 23 and r24, r24 1587a: 09 f4 brne .+2 ; 0x1587e 1587c: 4a c0 rjmp .+148 ; 0x15912 { if (arg_P) 1587e: 11 23 and r17, r17 15880: e1 f1 breq .+120 ; 0x158fa { printAbsFilenameFast(); 15882: 0f 94 28 7a call 0x2f450 ; 0x2f450 SERIAL_PROTOCOLLN(); 15886: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 1588a: 81 ed ldi r24, 0xD1 ; 209 1588c: 97 e6 ldi r25, 0x67 ; 103 1588e: 0e 94 57 77 call 0xeeae ; 0xeeae } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15892: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 15896: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 1589a: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 1589e: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 158a2: 4a e0 ldi r20, 0x0A ; 10 158a4: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 158a8: 8f e2 ldi r24, 0x2F ; 47 158aa: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 158ae: 60 91 9d 17 lds r22, 0x179D ; 0x80179d 158b2: 70 91 9e 17 lds r23, 0x179E ; 0x80179e 158b6: 80 91 9f 17 lds r24, 0x179F ; 0x80179f 158ba: 90 91 a0 17 lds r25, 0x17A0 ; 0x8017a0 158be: 4a e0 ldi r20, 0x0A ; 10 158c0: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 158c4: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 158c8: 0f 94 aa 3e call 0x27d54 ; 0x27d54 158cc: 2c e3 ldi r18, 0x3C ; 60 158ce: 30 e0 ldi r19, 0x00 ; 0 158d0: 40 e0 ldi r20, 0x00 ; 0 158d2: 50 e0 ldi r21, 0x00 ; 0 158d4: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 158d8: c9 01 movw r24, r18 158da: 6c e3 ldi r22, 0x3C ; 60 158dc: 70 e0 ldi r23, 0x00 ; 0 158de: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 158e2: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 158e4: 90 e0 ldi r25, 0x00 ; 0 158e6: 80 e0 ldi r24, 0x00 ; 0 158e8: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 158ec: 8a e3 ldi r24, 0x3A ; 58 158ee: 0e 94 3e 77 call 0xee7c ; 0xee7c SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 158f2: c8 01 movw r24, r16 158f4: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 158f8: 78 ce rjmp .-784 ; 0x155ea { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 158fa: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 158fe: 88 23 and r24, r24 15900: 29 f0 breq .+10 ; 0x1590c 15902: 87 ea ldi r24, 0xA7 ; 167 15904: 94 e1 ldi r25, 0x14 ; 20 15906: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 1590a: bf cf rjmp .-130 ; 0x1588a 1590c: 82 e9 ldi r24, 0x92 ; 146 1590e: 94 e1 ldi r25, 0x14 ; 20 15910: fa cf rjmp .-12 ; 0x15906 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 15912: 82 ec ldi r24, 0xC2 ; 194 15914: 94 e8 ldi r25, 0x84 ; 132 15916: 0e 94 82 79 call 0xf304 ; 0xf304 1591a: 67 ce rjmp .-818 ; 0x155ea /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1591c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 15920: 90 91 96 03 lds r25, 0x0396 ; 0x800396 15924: 04 96 adiw r24, 0x04 ; 4 15926: 0f 94 6d 85 call 0x30ada ; 0x30ada 1592a: 5f ce rjmp .-834 ; 0x155ea * 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; 1592c: ce 01 movw r24, r28 1592e: 01 96 adiw r24, 0x01 ; 1 15930: 0f 94 84 76 call 0x2ed08 ; 0x2ed08 15934: 88 23 and r24, r24 15936: 09 f4 brne .+2 ; 0x1593a 15938: 58 c9 rjmp .-3408 ; 0x14bea // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1593a: 61 e0 ldi r22, 0x01 ; 1 1593c: ce 01 movw r24, r28 1593e: 01 96 adiw r24, 0x01 ; 1 15940: 0f 94 28 58 call 0x2b050 ; 0x2b050 if (!d) goto fail; 15944: 00 97 sbiw r24, 0x00 ; 0 15946: 09 f4 brne .+2 ; 0x1594a 15948: 50 c9 rjmp .-3424 ; 0x14bea // mark entry deleted d->name[0] = DIR_NAME_DELETED; 1594a: 25 ee ldi r18, 0xE5 ; 229 1594c: fc 01 movw r30, r24 1594e: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 15950: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 15952: 0f 94 1c 53 call 0x2a638 ; 0x2a638 15956: 18 2f mov r17, r24 15958: 49 c9 rjmp .-3438 ; 0x14bec presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 1595a: 8c e9 ldi r24, 0x9C ; 156 1595c: 94 e8 ldi r25, 0x84 ; 132 1595e: 0e 94 57 77 call 0xeeae ; 0xeeae 15962: 23 96 adiw r28, 0x03 ; 3 15964: 8e ad ldd r24, Y+62 ; 0x3e 15966: 9f ad ldd r25, Y+63 ; 0x3f 15968: 23 97 sbiw r28, 0x03 ; 3 1596a: 0e 94 1b 88 call 0x11036 ; 0x11036 1596e: 8e e2 ldi r24, 0x2E ; 46 15970: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::println(char c, int base) { print(c, base); println(); 15974: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 15978: 38 ce rjmp .-912 ; 0x155ea ### 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(); 1597a: 0f 94 aa 3e call 0x27d54 ; 0x27d54 int16_t sec, min; min = t / 60; sec = t % 60; 1597e: 2c e3 ldi r18, 0x3C ; 60 15980: 30 e0 ldi r19, 0x00 ; 0 15982: 40 e0 ldi r20, 0x00 ; 0 15984: 50 e0 ldi r21, 0x00 ; 0 15986: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 1598a: 7f 93 push r23 1598c: 6f 93 push r22 1598e: 3f 93 push r19 15990: 2f 93 push r18 15992: 89 e7 ldi r24, 0x79 ; 121 15994: 97 e8 ldi r25, 0x87 ; 135 15996: 9f 93 push r25 15998: 8f 93 push r24 1599a: 8e 01 movw r16, r28 1599c: 0f 5f subi r16, 0xFF ; 255 1599e: 1f 4f sbci r17, 0xFF ; 255 159a0: 1f 93 push r17 159a2: 0f 93 push r16 159a4: 0f 94 3a db call 0x3b674 ; 0x3b674 SERIAL_ECHO_START; 159a8: 80 ed ldi r24, 0xD0 ; 208 159aa: 9b ea ldi r25, 0xAB ; 171 159ac: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(time); 159b0: c8 01 movw r24, r16 159b2: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e lcd_setstatus(time); 159b6: c8 01 movw r24, r16 159b8: 0e 94 90 f4 call 0x1e920 ; 0x1e920 autotempShutdown(); 159bc: 0f b6 in r0, 0x3f ; 63 159be: f8 94 cli 159c0: de bf out 0x3e, r29 ; 62 159c2: 0f be out 0x3f, r0 ; 63 159c4: cd bf out 0x3d, r28 ; 61 159c6: 11 ce rjmp .-990 ; 0x155ea #### 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')) 159c8: 83 e5 ldi r24, 0x53 ; 83 159ca: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 159ce: 88 23 and r24, r24 159d0: 09 f4 brne .+2 ; 0x159d4 159d2: 0b ce rjmp .-1002 ; 0x155ea { uint8_t pin_status = code_value_uint8(); 159d4: 0e 94 6f 5b call 0xb6de ; 0xb6de 159d8: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 159da: 80 e5 ldi r24, 0x50 ; 80 159dc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 159e0: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 159e2: 88 23 and r24, r24 159e4: 19 f0 breq .+6 ; 0x159ec pin_number = code_value_uint8(); 159e6: 0e 94 6f 5b call 0xb6de ; 0xb6de 159ea: 18 2f mov r17, r24 159ec: ed e5 ldi r30, 0x5D ; 93 159ee: f7 e8 ldi r31, 0x87 ; 135 159f0: 89 e7 ldi r24, 0x79 ; 121 159f2: 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) 159f4: 24 91 lpm r18, Z 159f6: 21 17 cp r18, r17 159f8: 09 f4 brne .+2 ; 0x159fc 159fa: f7 cd rjmp .-1042 ; 0x155ea 159fc: 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++) 159fe: 8e 17 cp r24, r30 15a00: 9f 07 cpc r25, r31 15a02: c1 f7 brne .-16 ; 0x159f4 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 15a04: 16 30 cpi r17, 0x06 ; 6 15a06: 81 f4 brne .+32 ; 0x15a28 fanSpeed = pin_status; 15a08: 00 93 e7 03 sts 0x03E7, r16 ; 0x8003e7 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 15a0c: 61 e0 ldi r22, 0x01 ; 1 15a0e: 81 2f mov r24, r17 15a10: 0e 94 ec e8 call 0x1d1d8 ; 0x1d1d8 digitalWrite(pin_number, pin_status); 15a14: 60 2f mov r22, r16 15a16: 81 2f mov r24, r17 15a18: 0e 94 be e8 call 0x1d17c ; 0x1d17c analogWrite(pin_number, pin_status); 15a1c: 60 2f mov r22, r16 15a1e: 70 e0 ldi r23, 0x00 ; 0 15a20: 81 2f mov r24, r17 15a22: 0e 94 1d e9 call 0x1d23a ; 0x1d23a 15a26: e1 cd rjmp .-1086 ; 0x155ea } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 15a28: 17 fd sbrc r17, 7 15a2a: df cd rjmp .-1090 ; 0x155ea 15a2c: ef cf rjmp .-34 ; 0x15a0c ### 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); 15a2e: 80 e1 ldi r24, 0x10 ; 16 15a30: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 15a34: 81 ea ldi r24, 0xA1 ; 161 15a36: 9d e0 ldi r25, 0x0D ; 13 15a38: 0f 94 23 dc call 0x3b846 ; 0x3b846 15a3c: 3b e0 ldi r19, 0x0B ; 11 15a3e: 83 9f mul r24, r19 15a40: c0 01 movw r24, r0 15a42: 11 24 eor r1, r1 15a44: 70 e0 ldi r23, 0x00 ; 0 15a46: 60 e0 ldi r22, 0x00 ; 0 15a48: 80 5b subi r24, 0xB0 ; 176 15a4a: 92 4f sbci r25, 0xF2 ; 242 15a4c: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 15a50: 82 e0 ldi r24, 0x02 ; 2 15a52: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 reset_bed_offset_and_skew(); 15a56: 0f 94 5c ce call 0x39cb8 ; 0x39cb8 // 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(); 15a5a: 0f 94 3d ce call 0x39c7a ; 0x39c7a 15a5e: c5 cd rjmp .-1142 ; 0x155ea */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 15a60: 8a e5 ldi r24, 0x5A ; 90 15a62: 0e 94 dd 5b call 0xb7ba ; 0xb7ba // 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); 15a66: 0f 94 ac 8d call 0x31b58 ; 0x31b58 15a6a: bf cd rjmp .-1154 ; 0x155ea ### 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()) { 15a6c: 80 91 01 17 lds r24, 0x1701 ; 0x801701 15a70: 88 23 and r24, r24 15a72: 19 f1 breq .+70 ; 0x15aba uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 15a74: ce 01 movw r24, r28 15a76: 01 96 adiw r24, 0x01 ; 1 15a78: 0f 94 d5 85 call 0x30baa ; 0x30baa 15a7c: 88 23 and r24, r24 15a7e: c1 f0 breq .+48 ; 0x15ab0 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a80: 89 81 ldd r24, Y+1 ; 0x01 15a82: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15a86: 8e e2 ldi r24, 0x2E ; 46 15a88: 0e 94 3e 77 call 0xee7c ; 0xee7c } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a8c: 8a 81 ldd r24, Y+2 ; 0x02 15a8e: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15a92: 8e e2 ldi r24, 0x2E ; 46 15a94: 0e 94 3e 77 call 0xee7c ; 0xee7c } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15a98: 8b 81 ldd r24, Y+3 ; 0x03 15a9a: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15a9e: 8e e2 ldi r24, 0x2E ; 46 15aa0: 0e 94 3e 77 call 0xee7c ; 0xee7c } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15aa4: 8c 81 ldd r24, Y+4 ; 0x04 15aa6: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 15aaa: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 15aae: 9d cd rjmp .-1222 ; 0x155ea SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 15ab0: 8d e3 ldi r24, 0x3D ; 61 15ab2: 97 e8 ldi r25, 0x87 ; 135 15ab4: 0e 94 57 77 call 0xeeae ; 0xeeae 15ab8: 98 cd rjmp .-1232 ; 0x155ea } } else { SERIAL_PROTOCOLLNPGM("n/a"); 15aba: 89 e3 ldi r24, 0x39 ; 57 15abc: 97 e8 ldi r25, 0x87 ; 135 15abe: 0e 94 82 79 call 0xf304 ; 0xf304 15ac2: 93 cd rjmp .-1242 ; 0x155ea 15ac4: 10 92 b8 0d sts 0x0DB8, r1 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 15ac8: 90 cd rjmp .-1248 ; 0x155ea break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 15aca: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 15ace: 1f 92 push r1 15ad0: 8f 93 push r24 15ad2: 82 e2 ldi r24, 0x22 ; 34 15ad4: 99 e6 ldi r25, 0x69 ; 105 15ad6: 9f 93 push r25 15ad8: 8f 93 push r24 15ada: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 15ade: 0f 90 pop r0 15ae0: 0f 90 pop r0 15ae2: 0f 90 pop r0 15ae4: 0f 90 pop r0 15ae6: 81 cd rjmp .-1278 ; 0x155ea - `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(); 15ae8: 80 e5 ldi r24, 0x50 ; 80 15aea: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15aee: 88 23 and r24, r24 15af0: 21 f0 breq .+8 ; 0x15afa 15af2: 0e 94 6f 5b call 0xb6de ; 0xb6de 15af6: 80 93 ae 02 sts 0x02AE, r24 ; 0x8002ae if(code_seen('R')) print_time_remaining_normal = code_value(); 15afa: 82 e5 ldi r24, 0x52 ; 82 15afc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15b00: 88 23 and r24, r24 15b02: 41 f0 breq .+16 ; 0x15b14 15b04: 0e 94 a4 60 call 0xc148 ; 0xc148 15b08: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15b0c: 70 93 b2 02 sts 0x02B2, r23 ; 0x8002b2 15b10: 60 93 b1 02 sts 0x02B1, r22 ; 0x8002b1 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 15b14: 81 e5 ldi r24, 0x51 ; 81 15b16: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15b1a: 88 23 and r24, r24 15b1c: 21 f0 breq .+8 ; 0x15b26 15b1e: 0e 94 6f 5b call 0xb6de ; 0xb6de 15b22: 80 93 ad 02 sts 0x02AD, r24 ; 0x8002ad if(code_seen('S')) print_time_remaining_silent = code_value(); 15b26: 83 e5 ldi r24, 0x53 ; 83 15b28: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15b2c: 88 23 and r24, r24 15b2e: 41 f0 breq .+16 ; 0x15b40 15b30: 0e 94 a4 60 call 0xc148 ; 0xc148 15b34: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15b38: 70 93 b6 02 sts 0x02B6, r23 ; 0x8002b6 15b3c: 60 93 b5 02 sts 0x02B5, r22 ; 0x8002b5 if(code_seen('C')){ 15b40: 83 e4 ldi r24, 0x43 ; 67 15b42: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15b46: 88 23 and r24, r24 15b48: a9 f0 breq .+42 ; 0x15b74 float print_time_to_change_normal_f = code_value(); 15b4a: 0e 94 a4 60 call 0xc148 ; 0xc148 15b4e: 6b 01 movw r12, r22 15b50: 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; 15b52: 20 e0 ldi r18, 0x00 ; 0 15b54: 30 e0 ldi r19, 0x00 ; 0 15b56: a9 01 movw r20, r18 15b58: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 15b5c: 6f ef ldi r22, 0xFF ; 255 15b5e: 7f ef ldi r23, 0xFF ; 255 15b60: 18 16 cp r1, r24 15b62: 24 f4 brge .+8 ; 0x15b6c 15b64: c7 01 movw r24, r14 15b66: b6 01 movw r22, r12 15b68: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15b6c: 70 93 b0 02 sts 0x02B0, r23 ; 0x8002b0 15b70: 60 93 af 02 sts 0x02AF, r22 ; 0x8002af } if(code_seen('D')){ 15b74: 84 e4 ldi r24, 0x44 ; 68 15b76: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15b7a: 88 23 and r24, r24 15b7c: a9 f0 breq .+42 ; 0x15ba8 float print_time_to_change_silent_f = code_value(); 15b7e: 0e 94 a4 60 call 0xc148 ; 0xc148 15b82: 6b 01 movw r12, r22 15b84: 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; 15b86: 20 e0 ldi r18, 0x00 ; 0 15b88: 30 e0 ldi r19, 0x00 ; 0 15b8a: a9 01 movw r20, r18 15b8c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 15b90: 6f ef ldi r22, 0xFF ; 255 15b92: 7f ef ldi r23, 0xFF ; 255 15b94: 18 16 cp r1, r24 15b96: 24 f4 brge .+8 ; 0x15ba0 15b98: c7 01 movw r24, r14 15b9a: b6 01 movw r22, r12 15b9c: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15ba0: 70 93 b4 02 sts 0x02B4, r23 ; 0x8002b4 15ba4: 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); 15ba8: 80 91 b0 02 lds r24, 0x02B0 ; 0x8002b0 15bac: 8f 93 push r24 15bae: 80 91 af 02 lds r24, 0x02AF ; 0x8002af 15bb2: 8f 93 push r24 15bb4: 80 91 b2 02 lds r24, 0x02B2 ; 0x8002b2 15bb8: 8f 93 push r24 15bba: 80 91 b1 02 lds r24, 0x02B1 ; 0x8002b1 15bbe: 8f 93 push r24 15bc0: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 15bc4: 28 2f mov r18, r24 15bc6: 08 2e mov r0, r24 15bc8: 00 0c add r0, r0 15bca: 33 0b sbc r19, r19 15bcc: 3f 93 push r19 15bce: 8f 93 push r24 15bd0: 88 ec ldi r24, 0xC8 ; 200 15bd2: 98 e6 ldi r25, 0x68 ; 104 15bd4: 9f 93 push r25 15bd6: 8f 93 push r24 15bd8: 0f ec ldi r16, 0xCF ; 207 15bda: 18 e6 ldi r17, 0x68 ; 104 15bdc: 1f 93 push r17 15bde: 0f 93 push r16 15be0: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 15be4: 80 91 b4 02 lds r24, 0x02B4 ; 0x8002b4 15be8: 8f 93 push r24 15bea: 80 91 b3 02 lds r24, 0x02B3 ; 0x8002b3 15bee: 8f 93 push r24 15bf0: 80 91 b6 02 lds r24, 0x02B6 ; 0x8002b6 15bf4: 8f 93 push r24 15bf6: 80 91 b5 02 lds r24, 0x02B5 ; 0x8002b5 15bfa: 8f 93 push r24 15bfc: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 15c00: 28 2f mov r18, r24 15c02: 08 2e mov r0, r24 15c04: 00 0c add r0, r0 15c06: 33 0b sbc r19, r19 15c08: 3f 93 push r19 15c0a: 8f 93 push r24 15c0c: 81 ec ldi r24, 0xC1 ; 193 15c0e: 98 e6 ldi r25, 0x68 ; 104 15c10: 9f 93 push r25 15c12: 8f 93 push r24 15c14: 1f 93 push r17 15c16: 0f 93 push r16 15c18: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 15c1c: 0f b6 in r0, 0x3f ; 63 15c1e: f8 94 cli 15c20: de bf out 0x3e, r29 ; 62 15c22: 0f be out 0x3f, r0 ; 63 15c24: cd bf out 0x3d, r28 ; 61 15c26: e1 cc rjmp .-1598 ; 0x155ea } else return false; } bool Stopwatch::pause() { if (isRunning()) { 15c28: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 15c2c: 81 30 cpi r24, 0x01 ; 1 15c2e: 09 f0 breq .+2 ; 0x15c32 15c30: dc cc rjmp .-1608 ; 0x155ea state = PAUSED; 15c32: 82 e0 ldi r24, 0x02 ; 2 15c34: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 15c38: 0f 94 53 29 call 0x252a6 ; 0x252a6 15c3c: 60 93 52 06 sts 0x0652, r22 ; 0x800652 15c40: 70 93 53 06 sts 0x0653, r23 ; 0x800653 15c44: 80 93 54 06 sts 0x0654, r24 ; 0x800654 15c48: 90 93 55 06 sts 0x0655, r25 ; 0x800655 15c4c: ce cc rjmp .-1636 ; 0x155ea /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 15c4e: 0f 94 b8 42 call 0x28570 ; 0x28570 save_statistics(); 15c52: 0e 94 26 66 call 0xcc4c ; 0xcc4c 15c56: c9 cc rjmp .-1646 ; 0x155ea ### 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 "); 15c58: 82 e3 ldi r24, 0x32 ; 50 15c5a: 97 e8 ldi r25, 0x87 ; 135 15c5c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 15c60: 8d ee ldi r24, 0xED ; 237 15c62: 9f e0 ldi r25, 0x0F ; 15 15c64: 0f 94 2b dc call 0x3b856 ; 0x3b856 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15c68: 4a e0 ldi r20, 0x0A ; 10 15c6a: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a SERIAL_ECHOPGM(" min "); 15c6e: 8c e2 ldi r24, 0x2C ; 44 15c70: 97 e8 ldi r25, 0x87 ; 135 15c72: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 15c76: 81 ef ldi r24, 0xF1 ; 241 15c78: 9f e0 ldi r25, 0x0F ; 15 15c7a: 0f 94 2b dc call 0x3b856 ; 0x3b856 15c7e: 4a e0 ldi r20, 0x0A ; 10 15c80: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a SERIAL_ECHOLNPGM(" cm."); 15c84: 87 e2 ldi r24, 0x27 ; 39 15c86: 97 e8 ldi r25, 0x87 ; 135 15c88: 0e 94 82 79 call 0xf304 ; 0xf304 15c8c: ae cc rjmp .-1700 ; 0x155ea void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 15c8e: 8e e9 ldi r24, 0x9E ; 158 15c90: 93 e0 ldi r25, 0x03 ; 3 15c92: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 15c96: 83 e5 ldi r24, 0x53 ; 83 15c98: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15c9c: 88 23 and r24, r24 15c9e: 09 f1 breq .+66 ; 0x15ce2 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 15ca0: 62 e2 ldi r22, 0x22 ; 34 15ca2: 70 e0 ldi r23, 0x00 ; 0 15ca4: 80 91 95 03 lds r24, 0x0395 ; 0x800395 15ca8: 90 91 96 03 lds r25, 0x0396 ; 0x800396 15cac: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 15cb0: 8c 01 movw r16, r24 if (!this->ptr) { 15cb2: 89 2b or r24, r25 15cb4: b1 f0 breq .+44 ; 0x15ce2 // First quote not found return; } // Skip the leading quote this->ptr++; 15cb6: 0f 5f subi r16, 0xFF ; 255 15cb8: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 15cba: 62 e2 ldi r22, 0x22 ; 34 15cbc: 70 e0 ldi r23, 0x00 ; 0 15cbe: c8 01 movw r24, r16 15cc0: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 if(!pStrEnd) { 15cc4: 89 2b or r24, r25 15cc6: 69 f0 breq .+26 ; 0x15ce2 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 15cc8: ec e4 ldi r30, 0x4C ; 76 15cca: f6 e0 ldi r31, 0x06 ; 6 15ccc: 83 e0 ldi r24, 0x03 ; 3 15cce: df 01 movw r26, r30 15cd0: 1d 92 st X+, r1 15cd2: 8a 95 dec r24 15cd4: e9 f7 brne .-6 ; 0x15cd0 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 15cd6: 42 e0 ldi r20, 0x02 ; 2 15cd8: 50 e0 ldi r21, 0x00 ; 0 15cda: b8 01 movw r22, r16 15cdc: cf 01 movw r24, r30 15cde: 0f 94 a3 e2 call 0x3c546 ; 0x3c546 } #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 15ce2: 8c e8 ldi r24, 0x8C ; 140 15ce4: 9f e0 ldi r25, 0x0F ; 15 15ce6: 0f 94 23 dc call 0x3b846 ; 0x3b846 && printer_recovering() && printingIsPaused()) { 15cea: 81 30 cpi r24, 0x01 ; 1 15cec: 09 f0 breq .+2 ; 0x15cf0 15cee: 7d cc rjmp .-1798 ; 0x155ea #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() 15cf0: 0e 94 82 67 call 0xcf04 ; 0xcf04 15cf4: 88 23 and r24, r24 15cf6: 09 f4 brne .+2 ; 0x15cfa 15cf8: 78 cc rjmp .-1808 ; 0x155ea && printingIsPaused()) { 15cfa: 0e 94 8c 67 call 0xcf18 ; 0xcf18 15cfe: 88 23 and r24, r24 15d00: 09 f4 brne .+2 ; 0x15d04 15d02: 73 cc rjmp .-1818 ; 0x155ea // 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) { 15d04: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.531> 15d08: 88 23 and r24, r24 15d0a: 29 f0 breq .+10 ; 0x15d16 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 15d0c: 8f e9 ldi r24, 0x9F ; 159 15d0e: 98 e6 ldi r25, 0x68 ; 104 15d10: 0e 94 82 79 call 0xf304 ; 0xf304 15d14: 6a cc rjmp .-1836 ; 0x155ea } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 15d16: 82 e8 ldi r24, 0x82 ; 130 15d18: 98 e6 ldi r25, 0x68 ; 104 15d1a: 0e 94 82 79 call 0xf304 ; 0xf304 15d1e: 65 cc rjmp .-1846 ; 0x155ea /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 15d20: 85 e6 ldi r24, 0x65 ; 101 15d22: 98 e6 ldi r25, 0x68 ; 104 15d24: 0e 94 11 7a call 0xf422 ; 0xf422 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 15d28: 83 e5 ldi r24, 0x53 ; 83 15d2a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15d2e: 88 23 and r24, r24 15d30: 09 f4 brne .+2 ; 0x15d34 15d32: 5b cc rjmp .-1866 ; 0x155ea 15d34: 0e 94 a4 60 call 0xc148 ; 0xc148 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 15d38: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 15d3c: 70 93 73 06 sts 0x0673, r23 ; 0x800673 15d40: 60 93 72 06 sts 0x0672, r22 ; 0x800672 15d44: 52 cc rjmp .-1884 ; 0x155ea 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 "); 15d46: 83 e2 ldi r24, 0x23 ; 35 15d48: 97 e8 ldi r25, 0x87 ; 135 15d4a: 0e 94 57 77 call 0xeeae ; 0xeeae gcode_M105(); 15d4e: 0e 94 c9 78 call 0xf192 ; 0xf192 cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 15d52: 0e 94 c3 76 call 0xed86 ; 0xed86 cmdbuffer_front_already_processed = true; 15d56: 81 e0 ldi r24, 0x01 ; 1 15d58: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 15d5c: 46 cc rjmp .-1908 ; 0x155ea 15d5e: 10 92 89 14 sts 0x1489, r1 ; 0x801489 15d62: f0 c8 rjmp .-3616 ; 0x14f44 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; } 15d64: 81 e0 ldi r24, 0x01 ; 1 15d66: 80 93 87 14 sts 0x1487, r24 ; 0x801487 15d6a: 3f cc rjmp .-1922 ; 0x155ea #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 15d6c: 82 e5 ldi r24, 0x52 ; 82 15d6e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15d72: 81 11 cpse r24, r1 15d74: 7a c8 rjmp .-3852 ; 0x14e6a autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 15d76: 0f 94 53 29 call 0x252a6 ; 0x252a6 15d7a: 6b 01 movw r12, r22 15d7c: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 15d7e: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 15d82: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 15d86: 07 2e mov r0, r23 15d88: 00 0c add r0, r0 15d8a: 88 0b sbc r24, r24 15d8c: 99 0b sbc r25, r25 15d8e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 15d92: 11 e0 ldi r17, 0x01 ; 1 15d94: 20 91 b0 0d lds r18, 0x0DB0 ; 0x800db0 15d98: 30 91 b1 0d lds r19, 0x0DB1 ; 0x800db1 15d9c: 40 91 b2 0d lds r20, 0x0DB2 ; 0x800db2 15da0: 50 91 b3 0d lds r21, 0x0DB3 ; 0x800db3 15da4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 15da8: 18 16 cp r1, r24 15daa: 0c f0 brlt .+2 ; 0x15dae 15dac: 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 15dae: 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 15db2: c7 01 movw r24, r14 15db4: b6 01 movw r22, r12 15db6: 0f 94 e8 81 call 0x303d0 ; 0x303d0 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 15dba: 8d e1 ldi r24, 0x1D ; 29 15dbc: 9e e4 ldi r25, 0x4E ; 78 15dbe: 0e 94 b3 72 call 0xe566 ; 0xe566 15dc2: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 15dc6: 82 e0 ldi r24, 0x02 ; 2 15dc8: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(2); previous_millis_cmd.start(); 15dcc: 86 e8 ldi r24, 0x86 ; 134 15dce: 93 e0 ldi r25, 0x03 ; 3 15dd0: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> 15dd4: 0a cc rjmp .-2028 ; 0x155ea */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 15dd6: 8f e0 ldi r24, 0x0F ; 15 15dd8: 9e e4 ldi r25, 0x4E ; 78 15dda: 0e 94 b3 72 call 0xe566 ; 0xe566 15dde: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 heating_status = HeatingStatus::BED_HEATING; 15de2: 83 e0 ldi r24, 0x03 ; 3 15de4: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 prusa_statistics(1); if (code_seen('S')) 15de8: 83 e5 ldi r24, 0x53 ; 83 15dea: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15dee: 18 2f mov r17, r24 15df0: 88 23 and r24, r24 15df2: 49 f0 breq .+18 ; 0x15e06 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 15df4: 0e 94 a4 60 call 0xc148 ; 0xc148 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 15df8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 15dfc: 70 93 73 06 sts 0x0673, r23 ; 0x800673 15e00: 60 93 72 06 sts 0x0672, r22 ; 0x800672 15e04: 05 c0 rjmp .+10 ; 0x15e10 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 15e06: 82 e5 ldi r24, 0x52 ; 82 15e08: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15e0c: 81 11 cpse r24, r1 15e0e: f2 cf rjmp .-28 ; 0x15df4 { setTargetBed(code_value()); } codenum = _millis(); 15e10: 0f 94 53 29 call 0x252a6 ; 0x252a6 15e14: 6b 01 movw r12, r22 15e16: 7c 01 movw r14, r24 cancel_heatup = false; 15e18: 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; 15e1c: 60 91 72 06 lds r22, 0x0672 ; 0x800672 15e20: 70 91 73 06 lds r23, 0x0673 ; 0x800673 15e24: 07 2e mov r0, r23 15e26: 00 0c add r0, r0 15e28: 88 0b sbc r24, r24 15e2a: 99 0b sbc r25, r25 15e2c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 15e30: 01 e0 ldi r16, 0x01 ; 1 15e32: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 15e36: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 15e3a: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 15e3e: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 15e42: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 15e46: 18 16 cp r1, r24 15e48: 0c f0 brlt .+2 ; 0x15e4c 15e4a: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 15e4c: 00 93 af 0d sts 0x0DAF, r16 ; 0x800daf <_ZL16target_direction.lto_priv.532> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 15e50: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> 15e54: 81 11 cpse r24, r1 15e56: 1a c0 rjmp .+52 ; 0x15e8c 15e58: 60 91 72 06 lds r22, 0x0672 ; 0x800672 15e5c: 70 91 73 06 lds r23, 0x0673 ; 0x800673 15e60: 07 2e mov r0, r23 15e62: 00 0c add r0, r0 15e64: 88 0b sbc r24, r24 15e66: 99 0b sbc r25, r25 15e68: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 15e6c: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 15e70: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 15e74: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 15e78: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 15e7c: e0 91 af 0d lds r30, 0x0DAF ; 0x800daf <_ZL16target_direction.lto_priv.532> 15e80: ee 23 and r30, r30 15e82: 91 f0 breq .+36 ; 0x15ea8 15e84: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 15e88: 18 16 cp r1, r24 15e8a: a4 f0 brlt .+40 ; 0x15eb4 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 15e8c: 84 e0 ldi r24, 0x04 ; 4 15e8e: 9e e4 ldi r25, 0x4E ; 78 15e90: 0e 94 b3 72 call 0xe566 ; 0xe566 15e94: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 15e98: 84 e0 ldi r24, 0x04 ; 4 15e9a: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 previous_millis_cmd.start(); 15e9e: 86 e8 ldi r24, 0x86 ; 134 15ea0: 93 e0 ldi r25, 0x03 ; 3 15ea2: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> 15ea6: a1 cb rjmp .-2238 ; 0x155ea codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 15ea8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 15eac: 87 ff sbrs r24, 7 15eae: ee cf rjmp .-36 ; 0x15e8c 15eb0: 11 11 cpse r17, r1 15eb2: ec cf rjmp .-40 ; 0x15e8c { if (lcd_commands_type == LcdCommands::LongPause) { 15eb4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 15eb8: 82 30 cpi r24, 0x02 ; 2 15eba: 41 f3 breq .-48 ; 0x15e8c // 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. 15ebc: 0f 94 53 29 call 0x252a6 ; 0x252a6 15ec0: 6c 19 sub r22, r12 15ec2: 7d 09 sbc r23, r13 15ec4: 8e 09 sbc r24, r14 15ec6: 9f 09 sbc r25, r15 15ec8: 69 3e cpi r22, 0xE9 ; 233 15eca: 73 40 sbci r23, 0x03 ; 3 15ecc: 81 05 cpc r24, r1 15ece: 91 05 cpc r25, r1 15ed0: 30 f0 brcs .+12 ; 0x15ede { if (!farm_mode) { serialecho_temperatures(); 15ed2: 0e 94 65 77 call 0xeeca ; 0xeeca } codenum = _millis(); 15ed6: 0f 94 53 29 call 0x252a6 ; 0x252a6 15eda: 6b 01 movw r12, r22 15edc: 7c 01 movw r14, r24 } manage_heater(); 15ede: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(); 15ee2: 80 e0 ldi r24, 0x00 ; 0 15ee4: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 15ee8: 80 e0 ldi r24, 0x00 ; 0 15eea: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 15eee: b0 cf rjmp .-160 ; 0x15e50 #### 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')){ 15ef0: 83 e5 ldi r24, 0x53 ; 83 15ef2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15ef6: 88 23 and r24, r24 15ef8: 29 f0 breq .+10 ; 0x15f04 fanSpeed = code_value_uint8(); 15efa: 0e 94 6f 5b call 0xb6de ; 0xb6de 15efe: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 15f02: 73 cb rjmp .-2330 ; 0x155ea } else { fanSpeed = 255; 15f04: 8f ef ldi r24, 0xFF ; 255 15f06: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 15f0a: 6f cb rjmp .-2338 ; 0x155ea /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 15f0c: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 15f10: 6c cb rjmp .-2344 ; 0x155ea /*! ### 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; 15f12: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 15f16: 88 60 ori r24, 0x08 ; 8 15f18: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 15f1c: 66 cb rjmp .-2356 ; 0x155ea ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 15f1e: 83 e5 ldi r24, 0x53 ; 83 15f20: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f24: 88 23 and r24, r24 15f26: 99 f0 breq .+38 ; 0x15f4e stepper_inactive_time = code_value() * 1000; 15f28: 0e 94 a4 60 call 0xc148 ; 0xc148 15f2c: 20 e0 ldi r18, 0x00 ; 0 15f2e: 30 e0 ldi r19, 0x00 ; 0 15f30: 4a e7 ldi r20, 0x7A ; 122 15f32: 54 e4 ldi r21, 0x44 ; 68 15f34: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 15f38: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15f3c: 60 93 34 02 sts 0x0234, r22 ; 0x800234 15f40: 70 93 35 02 sts 0x0235, r23 ; 0x800235 15f44: 80 93 36 02 sts 0x0236, r24 ; 0x800236 15f48: 90 93 37 02 sts 0x0237, r25 ; 0x800237 15f4c: 4e cb rjmp .-2404 ; 0x155ea } 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]))); 15f4e: 88 e5 ldi r24, 0x58 ; 88 15f50: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f54: 88 23 and r24, r24 15f56: d1 f0 breq .+52 ; 0x15f8c disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 15f58: 0f 94 ef 42 call 0x285de ; 0x285de if (code_seen('X')) disable_x(); 15f5c: 88 e5 ldi r24, 0x58 ; 88 15f5e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f62: 81 11 cpse r24, r1 15f64: 28 c0 rjmp .+80 ; 0x15fb6 if (code_seen('Y')) disable_y(); 15f66: 89 e5 ldi r24, 0x59 ; 89 15f68: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f6c: 88 23 and r24, r24 15f6e: 19 f0 breq .+6 ; 0x15f76 15f70: 16 9a sbi 0x02, 6 ; 2 15f72: 10 92 90 06 sts 0x0690, r1 ; 0x800690 if (code_seen('Z')) disable_z(); 15f76: 8a e5 ldi r24, 0x5A ; 90 15f78: 0e 94 dd 5b call 0xb7ba ; 0xb7ba #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 15f7c: 85 e4 ldi r24, 0x45 ; 69 15f7e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f82: 88 23 and r24, r24 15f84: 09 f4 brne .+2 ; 0x15f88 15f86: 31 cb rjmp .-2462 ; 0x155ea 15f88: 14 9a sbi 0x02, 4 ; 2 15f8a: 2f cb rjmp .-2466 ; 0x155ea 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]))); 15f8c: 89 e5 ldi r24, 0x59 ; 89 15f8e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f92: 81 11 cpse r24, r1 15f94: e1 cf rjmp .-62 ; 0x15f58 15f96: 8a e5 ldi r24, 0x5A ; 90 15f98: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15f9c: 81 11 cpse r24, r1 15f9e: dc cf rjmp .-72 ; 0x15f58 15fa0: 85 e4 ldi r24, 0x45 ; 69 15fa2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15fa6: 81 11 cpse r24, r1 15fa8: d7 cf rjmp .-82 ; 0x15f58 if(all_axis) { st_synchronize(); 15faa: 0f 94 ef 42 call 0x285de ; 0x285de disable_e0(); 15fae: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 15fb0: 0e 94 6f 82 call 0x104de ; 0x104de 15fb4: 1a cb rjmp .-2508 ; 0x155ea } else { st_synchronize(); if (code_seen('X')) disable_x(); 15fb6: 17 9a sbi 0x02, 7 ; 2 15fb8: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f 15fbc: d4 cf rjmp .-88 ; 0x15f66 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 15fbe: 83 e5 ldi r24, 0x53 ; 83 15fc0: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 15fc4: 88 23 and r24, r24 15fc6: 09 f4 brne .+2 ; 0x15fca 15fc8: 10 cb rjmp .-2528 ; 0x155ea safetytimer_inactive_time = code_value() * 1000; 15fca: 0e 94 a4 60 call 0xc148 ; 0xc148 15fce: 20 e0 ldi r18, 0x00 ; 0 15fd0: 30 e0 ldi r19, 0x00 ; 0 15fd2: 4a e7 ldi r20, 0x7A ; 122 15fd4: 54 e4 ldi r21, 0x44 ; 68 15fd6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 15fda: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 15fde: 60 93 30 02 sts 0x0230, r22 ; 0x800230 15fe2: 70 93 31 02 sts 0x0231, r23 ; 0x800231 15fe6: 80 93 32 02 sts 0x0232, r24 ; 0x800232 15fea: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 15fee: 8a ed ldi r24, 0xDA ; 218 15ff0: 95 e0 ldi r25, 0x05 ; 5 15ff2: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> 15ff6: f9 ca rjmp .-2574 ; 0x155ea 15ff8: ad ed ldi r26, 0xDD ; 221 15ffa: ca 2e mov r12, r26 15ffc: a2 e0 ldi r26, 0x02 ; 2 15ffe: da 2e mov r13, r26 16000: be eb ldi r27, 0xBE ; 190 16002: eb 2e mov r14, r27 16004: bd e0 ldi r27, 0x0D ; 13 16006: 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++) 16008: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 1600a: f6 01 movw r30, r12 1600c: 81 91 ld r24, Z+ 1600e: 6f 01 movw r12, r30 16010: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16014: 88 23 and r24, r24 16016: 09 f4 brne .+2 ; 0x1601a 16018: 67 c0 rjmp .+206 ; 0x160e8 { float value = code_value(); 1601a: 0e 94 a4 60 call 0xc148 ; 0xc148 1601e: 2b 01 movw r4, r22 16020: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16022: 13 30 cpi r17, 0x03 ; 3 16024: 09 f0 breq .+2 ; 0x16028 16026: 6a c0 rjmp .+212 ; 0x160fc if(value < 20.0) { 16028: 20 e0 ldi r18, 0x00 ; 0 1602a: 30 e0 ldi r19, 0x00 ; 0 1602c: 40 ea ldi r20, 0xA0 ; 160 1602e: 51 e4 ldi r21, 0x41 ; 65 16030: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 16034: 87 ff sbrs r24, 7 16036: 4e c0 rjmp .+156 ; 0x160d4 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 16038: a3 01 movw r20, r6 1603a: 92 01 movw r18, r4 1603c: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 16040: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 16044: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 16048: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 1604c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 16050: 4b 01 movw r8, r22 16052: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 16054: ac 01 movw r20, r24 16056: 9b 01 movw r18, r22 16058: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 1605c: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 16060: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 16064: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 16068: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1606c: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 16070: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 16074: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 16078: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 max_feedrate[E_AXIS] *= factor; 1607c: 20 90 71 02 lds r2, 0x0271 ; 0x800271 16080: 30 90 72 02 lds r3, 0x0272 ; 0x800272 16084: a5 01 movw r20, r10 16086: 94 01 movw r18, r8 16088: d1 01 movw r26, r2 1608a: 1c 96 adiw r26, 0x0c ; 12 1608c: 6d 91 ld r22, X+ 1608e: 7d 91 ld r23, X+ 16090: 8d 91 ld r24, X+ 16092: 9c 91 ld r25, X 16094: 1f 97 sbiw r26, 0x0f ; 15 16096: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1609a: f1 01 movw r30, r2 1609c: 64 87 std Z+12, r22 ; 0x0c 1609e: 75 87 std Z+13, r23 ; 0x0d 160a0: 86 87 std Z+14, r24 ; 0x0e 160a2: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 160a4: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 160a8: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 160ac: 80 91 5c 05 lds r24, 0x055C ; 0x80055c 160b0: 90 91 5d 05 lds r25, 0x055D ; 0x80055d 160b4: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 160b8: a5 01 movw r20, r10 160ba: 94 01 movw r18, r8 160bc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 160c0: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 160c4: 60 93 5a 05 sts 0x055A, r22 ; 0x80055a 160c8: 70 93 5b 05 sts 0x055B, r23 ; 0x80055b 160cc: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 160d0: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d } cs.axis_steps_per_mm[E_AXIS] = value; 160d4: 40 92 ce 0d sts 0x0DCE, r4 ; 0x800dce 160d8: 50 92 cf 0d sts 0x0DCF, r5 ; 0x800dcf 160dc: 60 92 d0 0d sts 0x0DD0, r6 ; 0x800dd0 160e0: 70 92 d1 0d sts 0x0DD1, r7 ; 0x800dd1 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 160e4: 0f 94 40 7b call 0x2f680 ; 0x2f680 160e8: b4 e0 ldi r27, 0x04 ; 4 160ea: eb 0e add r14, r27 160ec: f1 1c adc r15, r1 160ee: 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++) 160f0: 14 30 cpi r17, 0x04 ; 4 160f2: 09 f0 breq .+2 ; 0x160f6 160f4: 8a cf rjmp .-236 ; 0x1600a } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 160f6: 0f 94 66 63 call 0x2c6cc ; 0x2c6cc 160fa: 77 ca rjmp .-2834 ; 0x155ea 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; 160fc: d7 01 movw r26, r14 160fe: 14 96 adiw r26, 0x04 ; 4 16100: 4d 92 st X+, r4 16102: 5d 92 st X+, r5 16104: 6d 92 st X+, r6 16106: 7c 92 st X, r7 16108: 17 97 sbiw r26, 0x07 ; 7 1610a: ee cf rjmp .-36 ; 0x160e8 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 1610c: 8e e4 ldi r24, 0x4E ; 78 1610e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16112: 88 23 and r24, r24 16114: 09 f4 brne .+2 ; 0x16118 16116: 69 ca rjmp .-2862 ; 0x155ea gcode_LastN = code_value_long(); 16118: 0e 94 89 5b call 0xb712 ; 0xb712 1611c: 60 93 7a 03 sts 0x037A, r22 ; 0x80037a 16120: 70 93 7b 03 sts 0x037B, r23 ; 0x80037b 16124: 80 93 7c 03 sts 0x037C, r24 ; 0x80037c 16128: 90 93 7d 03 sts 0x037D, r25 ; 0x80037d 1612c: 5e ca rjmp .-2884 ; 0x155ea case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 1612e: 80 ed ldi r24, 0xD0 ; 208 16130: 9b ea ldi r25, 0xAB ; 171 16132: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 16136: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 1613a: d1 2c mov r13, r1 1613c: f1 2c mov r15, r1 1613e: 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); } 16140: 8c e1 ldi r24, 0x1C ; 28 16142: 97 e8 ldi r25, 0x87 ; 135 16144: 0e 94 57 77 call 0xeeae ; 0xeeae 16148: 4a e0 ldi r20, 0x0A ; 10 1614a: c7 01 movw r24, r14 1614c: b6 01 movw r22, r12 1614e: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 16152: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 16156: 49 ca rjmp .-2926 ; 0x155ea */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 16158: 85 e5 ldi r24, 0x55 ; 85 1615a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1615e: 88 23 and r24, r24 16160: 09 f4 brne .+2 ; 0x16164 16162: 5a c0 rjmp .+180 ; 0x16218 // 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); 16164: 00 91 95 03 lds r16, 0x0395 ; 0x800395 16168: 10 91 96 03 lds r17, 0x0396 ; 0x800396 1616c: 0f 5f subi r16, 0xFF ; 255 1616e: 1f 4f sbci r17, 0xFF ; 255 16170: 10 93 96 03 sts 0x0396, r17 ; 0x800396 16174: 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) 16178: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 1617c: 88 23 and r24, r24 1617e: 09 f4 brne .+2 ; 0x16182 16180: 34 ca rjmp .-2968 ; 0x155ea // 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)) 16182: be 01 movw r22, r28 16184: 6f 5f subi r22, 0xFF ; 255 16186: 7f 4f sbci r23, 0xFF ; 255 16188: c8 01 movw r24, r16 1618a: 0e 94 78 ef call 0x1def0 ; 0x1def0 1618e: 88 23 and r24, r24 16190: 09 f4 brne .+2 ; 0x16194 16192: 2b ca rjmp .-2986 ; 0x155ea 16194: 8e e1 ldi r24, 0x1E ; 30 16196: 9e e8 ldi r25, 0x8E ; 142 16198: de 01 movw r26, r28 1619a: 11 96 adiw r26, 0x01 ; 1 1619c: be 01 movw r22, r28 1619e: 67 5f subi r22, 0xF7 ; 247 161a0: 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]); 161a2: fc 01 movw r30, r24 161a4: 45 91 lpm r20, Z+ 161a6: 54 91 lpm r21, Z if (ver_gcode[i] > v) 161a8: 2d 91 ld r18, X+ 161aa: 3d 91 ld r19, X+ 161ac: 42 17 cp r20, r18 161ae: 53 07 cpc r21, r19 161b0: 10 f4 brcc .+4 ; 0x161b6 161b2: 0c 94 65 cc jmp 0x198ca ; 0x198ca return 1; else if (ver_gcode[i] < v) 161b6: 24 17 cp r18, r20 161b8: 35 07 cpc r19, r21 161ba: 08 f4 brcc .+2 ; 0x161be 161bc: 16 ca rjmp .-3028 ; 0x155ea 161be: 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) 161c0: a6 17 cp r26, r22 161c2: b7 07 cpc r27, r23 161c4: 71 f7 brne .-36 ; 0x161a2 161c6: 11 ca rjmp .-3038 ; 0x155ea 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)); 161c8: 84 e9 ldi r24, 0x94 ; 148 161ca: 99 e3 ldi r25, 0x39 ; 57 161cc: 0e 94 b3 72 call 0xe566 ; 0xe566 161d0: ac 01 movw r20, r24 161d2: 63 e0 ldi r22, 0x03 ; 3 161d4: 80 e0 ldi r24, 0x00 ; 0 161d6: 0e 94 fb 6e call 0xddf6 ; 0xddf6 Sound_MakeCustom(50,1000,false); 161da: 40 e0 ldi r20, 0x00 ; 0 161dc: 68 ee ldi r22, 0xE8 ; 232 161de: 73 e0 ldi r23, 0x03 ; 3 161e0: 82 e3 ldi r24, 0x32 ; 50 161e2: 90 e0 ldi r25, 0x00 ; 0 161e4: 0f 94 4d 51 call 0x2a29a ; 0x2a29a delay_keep_alive(500); 161e8: 84 ef ldi r24, 0xF4 ; 244 161ea: 91 e0 ldi r25, 0x01 ; 1 161ec: 0e 94 eb 8c call 0x119d6 ; 0x119d6 Sound_MakeCustom(50,1000,false); 161f0: 40 e0 ldi r20, 0x00 ; 0 161f2: 68 ee ldi r22, 0xE8 ; 232 161f4: 73 e0 ldi r23, 0x03 ; 3 161f6: 82 e3 ldi r24, 0x32 ; 50 161f8: 90 e0 ldi r25, 0x00 ; 0 161fa: 0f 94 4d 51 call 0x2a29a ; 0x2a29a lcd_wait_for_click_delay(30); 161fe: 8e e1 ldi r24, 0x1E ; 30 16200: 90 e0 ldi r25, 0x00 ; 0 16202: 0f 94 36 3a call 0x2746c ; 0x2746c lcd_update_enable(true); 16206: 81 e0 ldi r24, 0x01 ; 1 16208: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 1620c: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_update(0); 16210: 80 e0 ldi r24, 0x00 ; 0 16212: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 16216: e9 c9 rjmp .-3118 ; 0x155ea } 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); 16218: 41 e1 ldi r20, 0x11 ; 17 1621a: 50 e0 ldi r21, 0x00 ; 0 1621c: 60 e8 ldi r22, 0x80 ; 128 1621e: 7c e0 ldi r23, 0x0C ; 12 16220: ce 01 movw r24, r28 16222: 01 96 adiw r24, 0x01 ; 1 16224: 0f 94 13 dc call 0x3b826 ; 0x3b826 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 16228: 8e ef ldi r24, 0xFE ; 254 1622a: 96 e8 ldi r25, 0x86 ; 134 1622c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(FW_VERSION_STR_P()); 16230: 85 e9 ldi r24, 0x95 ; 149 16232: 94 e8 ldi r25, 0x84 ; 132 16234: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM("+"); 16238: 8c ef ldi r24, 0xFC ; 252 1623a: 96 e8 ldi r25, 0x86 ; 134 1623c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(STR(FW_COMMITNR)); 16240: 87 ef ldi r24, 0xF7 ; 247 16242: 96 e8 ldi r25, 0x86 ; 134 16244: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM("_"); 16248: 85 ef ldi r24, 0xF5 ; 245 1624a: 96 e8 ldi r25, 0x86 ; 134 1624c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(FW_COMMIT_HASH); 16250: 8b ee ldi r24, 0xEB ; 235 16252: 96 e8 ldi r25, 0x86 ; 134 16254: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 16258: 81 e9 ldi r24, 0x91 ; 145 1625a: 96 e8 ldi r25, 0x86 ; 134 1625c: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(PROTOCOL_VERSION); 16260: 8d e8 ldi r24, 0x8D ; 141 16262: 96 e8 ldi r25, 0x86 ; 134 16264: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(" MACHINE_TYPE:"); 16268: 8e e7 ldi r24, 0x7E ; 126 1626a: 96 e8 ldi r25, 0x86 ; 134 1626c: 0e 94 57 77 call 0xeeae ; 0xeeae 16270: ce 01 movw r24, r28 16272: 01 96 adiw r24, 0x01 ; 1 16274: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 16278: 8c e6 ldi r24, 0x6C ; 108 1627a: 96 e8 ldi r25, 0x86 ; 134 1627c: 0e 94 57 77 call 0xeeae ; 0xeeae #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 16280: 8b e6 ldi r24, 0x6B ; 107 16282: 96 e8 ldi r25, 0x86 ; 134 16284: 0e 94 82 79 call 0xf304 ; 0xf304 } #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'); 16288: 1f 92 push r1 1628a: f1 e3 ldi r31, 0x31 ; 49 1628c: ff 2e mov r15, r31 1628e: ff 92 push r15 16290: 84 e8 ldi r24, 0x84 ; 132 16292: 94 e8 ldi r25, 0x84 ; 132 16294: 9f 93 push r25 16296: 8f 93 push r24 16298: 0d e3 ldi r16, 0x3D ; 61 1629a: 14 e8 ldi r17, 0x84 ; 132 1629c: 1f 93 push r17 1629e: 0f 93 push r16 162a0: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 162a4: 1f 92 push r1 162a6: ff 92 push r15 162a8: 84 e7 ldi r24, 0x74 ; 116 162aa: 94 e8 ldi r25, 0x84 ; 132 162ac: 9f 93 push r25 162ae: 8f 93 push r24 162b0: 1f 93 push r17 162b2: 0f 93 push r16 162b4: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 162b8: 1f 92 push r1 162ba: ff 92 push r15 162bc: 80 e6 ldi r24, 0x60 ; 96 162be: 94 e8 ldi r25, 0x84 ; 132 162c0: 9f 93 push r25 162c2: 8f 93 push r24 162c4: 1f 93 push r17 162c6: 0f 93 push r16 162c8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 162cc: 1f 92 push r1 162ce: ff 92 push r15 162d0: 83 e5 ldi r24, 0x53 ; 83 162d2: 94 e8 ldi r25, 0x84 ; 132 162d4: 9f 93 push r25 162d6: 8f 93 push r24 162d8: 1f 93 push r17 162da: 0f 93 push r16 162dc: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 162e0: 1f 92 push r1 162e2: ff 92 push r15 162e4: 88 e4 ldi r24, 0x48 ; 72 162e6: 94 e8 ldi r25, 0x84 ; 132 162e8: 9f 93 push r25 162ea: 8f 93 push r24 162ec: 1f 93 push r17 162ee: 0f 93 push r16 162f0: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 162f4: 0f b6 in r0, 0x3f ; 63 162f6: f8 94 cli 162f8: de bf out 0x3e, r29 ; 62 162fa: 0f be out 0x3f, r0 ; 63 162fc: cd bf out 0x3d, r28 ; 61 162fe: 75 c9 rjmp .-3350 ; 0x155ea /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 16300: 0e 94 4e 78 call 0xf09c ; 0xf09c 16304: 72 c9 rjmp .-3356 ; 0x155ea /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 16306: e0 91 95 03 lds r30, 0x0395 ; 0x800395 1630a: f0 91 96 03 lds r31, 0x0396 ; 0x800396 1630e: cf 01 movw r24, r30 16310: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 16312: 24 81 ldd r18, Z+4 ; 0x04 16314: 20 32 cpi r18, 0x20 ; 32 16316: 09 f4 brne .+2 ; 0x1631a 16318: 01 96 adiw r24, 0x01 ; 1 1631a: 0e 94 90 f4 call 0x1e920 ; 0x1e920 custom_message_type = CustomMsg::M117; 1631e: 87 e0 ldi r24, 0x07 ; 7 16320: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 16324: 62 c9 rjmp .-3388 ; 0x155ea - `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; 16326: 00 91 95 03 lds r16, 0x0395 ; 0x800395 1632a: 10 91 96 03 lds r17, 0x0396 ; 0x800396 1632e: 0b 5f subi r16, 0xFB ; 251 16330: 1f 4f sbci r17, 0xFF ; 255 16332: 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; 16334: f1 2c mov r15, r1 16336: 40 e0 ldi r20, 0x00 ; 0 16338: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1633a: e9 f0 breq .+58 ; 0x16376 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 1633c: d8 01 movw r26, r16 1633e: 9c 91 ld r25, X 16340: 29 2f mov r18, r25 16342: 2b 7f andi r18, 0xFB ; 251 16344: 21 34 cpi r18, 0x41 ; 65 16346: b9 f4 brne .+46 ; 0x16376 16348: 11 96 adiw r26, 0x01 ; 1 1634a: 2c 91 ld r18, X 1634c: 21 33 cpi r18, 0x31 ; 49 1634e: 99 f4 brne .+38 ; 0x16376 switch (p[0]) { 16350: 91 34 cpi r25, 0x41 ; 65 16352: 71 f0 breq .+28 ; 0x16370 16354: 95 34 cpi r25, 0x45 ; 69 16356: 09 f4 brne .+2 ; 0x1635a case 'A': hasA = true; break; case 'E': hasE = true; break; 16358: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 1635a: 98 01 movw r18, r16 1635c: 2e 5f subi r18, 0xFE ; 254 1635e: 3f 4f sbci r19, 0xFF ; 255 16360: 89 01 movw r16, r18 16362: 2f 5f subi r18, 0xFF ; 255 16364: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 16366: f8 01 movw r30, r16 16368: 90 81 ld r25, Z 1636a: 90 32 cpi r25, 0x20 ; 32 1636c: c9 f3 breq .-14 ; 0x16360 1636e: e4 cf rjmp .-56 ; 0x16338 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; 16370: ff 24 eor r15, r15 16372: f3 94 inc r15 16374: f2 cf rjmp .-28 ; 0x1635a } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 16376: 44 23 and r20, r20 16378: 21 f0 breq .+8 ; 0x16382 1637a: 80 ed ldi r24, 0xD0 ; 208 1637c: 9b ea ldi r25, 0xAB ; 171 1637e: 0e 94 57 77 call 0xeeae ; 0xeeae if (hasA) SERIAL_ECHOPGM("//"); 16382: ff 20 and r15, r15 16384: 21 f0 breq .+8 ; 0x1638e 16386: 88 e6 ldi r24, 0x68 ; 104 16388: 96 e8 ldi r25, 0x86 ; 134 1638a: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(p); 1638e: c8 01 movw r24, r16 16390: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 16394: 2a c9 rjmp .-3500 ; 0x155ea /*! ### 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 16396: 8c e4 ldi r24, 0x4C ; 76 16398: 98 e6 ldi r25, 0x68 ; 104 1639a: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN(); 1639e: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 163a2: 84 e4 ldi r24, 0x44 ; 68 163a4: 98 e6 ldi r25, 0x68 ; 104 163a6: 0e 94 57 77 call 0xeeae ; 0xeeae if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 163aa: 1e 99 sbic 0x03, 6 ; 3 163ac: 47 c0 rjmp .+142 ; 0x1643c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163ae: 8f e3 ldi r24, 0x3F ; 63 163b0: 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); 163b2: 0e 94 57 77 call 0xeeae ; 0xeeae }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163b6: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 163ba: 8d e2 ldi r24, 0x2D ; 45 163bc: 98 e6 ldi r25, 0x68 ; 104 163be: 0e 94 57 77 call 0xeeae ; 0xeeae if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 163c2: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 163c6: 82 fd sbrc r24, 2 163c8: 3c c0 rjmp .+120 ; 0x16442 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163ca: 8f e3 ldi r24, 0x3F ; 63 163cc: 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); 163ce: 0e 94 57 77 call 0xeeae ; 0xeeae }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163d2: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 163d6: 85 e2 ldi r24, 0x25 ; 37 163d8: 98 e6 ldi r25, 0x68 ; 104 163da: 0e 94 57 77 call 0xeeae ; 0xeeae if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 163de: 1d 99 sbic 0x03, 5 ; 3 163e0: 33 c0 rjmp .+102 ; 0x16448 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163e2: 8f e3 ldi r24, 0x3F ; 63 163e4: 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); 163e6: 0e 94 57 77 call 0xeeae ; 0xeeae }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 163ea: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 163ee: 8d e1 ldi r24, 0x1D ; 29 163f0: 98 e6 ldi r25, 0x68 ; 104 163f2: 0e 94 57 77 call 0xeeae ; 0xeeae if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 163f6: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 163fa: 87 fd sbrc r24, 7 163fc: 28 c0 rjmp .+80 ; 0x1644e SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 163fe: 8f e3 ldi r24, 0x3F ; 63 16400: 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); 16402: 0e 94 57 77 call 0xeeae ; 0xeeae }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16406: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 1640a: 85 e1 ldi r24, 0x15 ; 21 1640c: 98 e6 ldi r25, 0x68 ; 104 1640e: 0e 94 57 77 call 0xeeae ; 0xeeae if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 16412: 1c 99 sbic 0x03, 4 ; 3 16414: 1f c0 rjmp .+62 ; 0x16454 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16416: 8f e3 ldi r24, 0x3F ; 63 16418: 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); 1641a: 0e 94 57 77 call 0xeeae ; 0xeeae }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1641e: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 16422: 8d e0 ldi r24, 0x0D ; 13 16424: 98 e6 ldi r25, 0x68 ; 104 16426: 0e 94 57 77 call 0xeeae ; 0xeeae if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 1642a: 01 9b sbis 0x00, 1 ; 0 1642c: 16 c0 rjmp .+44 ; 0x1645a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1642e: 8f e3 ldi r24, 0x3F ; 63 16430: 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); 16432: 0e 94 57 77 call 0xeeae ; 0xeeae }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16436: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 1643a: d7 c8 rjmp .-3666 ; 0x155ea 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); 1643c: 85 e3 ldi r24, 0x35 ; 53 1643e: 98 e6 ldi r25, 0x68 ; 104 16440: b8 cf rjmp .-144 ; 0x163b2 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); 16442: 85 e3 ldi r24, 0x35 ; 53 16444: 98 e6 ldi r25, 0x68 ; 104 16446: c3 cf rjmp .-122 ; 0x163ce 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); 16448: 85 e3 ldi r24, 0x35 ; 53 1644a: 98 e6 ldi r25, 0x68 ; 104 1644c: cc cf rjmp .-104 ; 0x163e6 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); 1644e: 85 e3 ldi r24, 0x35 ; 53 16450: 98 e6 ldi r25, 0x68 ; 104 16452: d7 cf rjmp .-82 ; 0x16402 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); 16454: 85 e3 ldi r24, 0x35 ; 53 16456: 98 e6 ldi r25, 0x68 ; 104 16458: e0 cf rjmp .-64 ; 0x1641a 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); 1645a: 85 e3 ldi r24, 0x35 ; 53 1645c: 98 e6 ldi r25, 0x68 ; 104 1645e: e9 cf rjmp .-46 ; 0x16432 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 16460: 0e 94 8b 66 call 0xcd16 ; 0xcd16 16464: c2 c8 rjmp .-3708 ; 0x155ea */ 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')) { 16466: 84 e5 ldi r24, 0x54 ; 84 16468: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1646c: 88 23 and r24, r24 1646e: 69 f0 breq .+26 ; 0x1648a extruder = code_value_uint8(); 16470: 0e 94 6f 5b call 0xb6de ; 0xb6de if(extruder >= EXTRUDERS) { 16474: 88 23 and r24, r24 16476: 49 f0 breq .+18 ; 0x1648a SERIAL_ECHO_START; 16478: 80 ed ldi r24, 0xD0 ; 208 1647a: 9b ea ldi r25, 0xAB ; 171 1647c: 0e 94 57 77 call 0xeeae ; 0xeeae 16480: 86 ef ldi r24, 0xF6 ; 246 16482: 97 e6 ldi r25, 0x67 ; 103 16484: 0e 94 1b 88 call 0x11036 ; 0x11036 16488: b0 c8 rjmp .-3744 ; 0x155ea SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 1648a: 84 e4 ldi r24, 0x44 ; 68 1648c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16490: 88 23 and r24, r24 16492: 09 f4 brne .+2 ; 0x16496 16494: aa c8 rjmp .-3756 ; 0x155ea float diameter = code_value(); 16496: 0e 94 a4 60 call 0xc148 ; 0xc148 if (diameter == 0.0) { 1649a: 20 e0 ldi r18, 0x00 ; 0 1649c: 30 e0 ldi r19, 0x00 ; 0 1649e: a9 01 movw r20, r18 164a0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 164a4: 81 11 cpse r24, r1 164a6: 05 c0 rjmp .+10 ; 0x164b2 // 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; 164a8: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 164ac: 0e 94 c0 65 call 0xcb80 ; 0xcb80 164b0: 9c c8 rjmp .-3784 ; 0x155ea // 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(); 164b2: 0e 94 a4 60 call 0xc148 ; 0xc148 164b6: 6b 01 movw r12, r22 164b8: 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]); 164ba: 20 e0 ldi r18, 0x00 ; 0 164bc: 30 e0 ldi r19, 0x00 ; 0 164be: a9 01 movw r20, r18 164c0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 164c4: 81 11 cpse r24, r1 164c6: 06 c0 rjmp .+12 ; 0x164d4 164c8: c1 2c mov r12, r1 164ca: d1 2c mov r13, r1 164cc: e0 ee ldi r30, 0xE0 ; 224 164ce: ee 2e mov r14, r30 164d0: ef e3 ldi r30, 0x3F ; 63 164d2: fe 2e mov r15, r30 164d4: c0 92 56 0e sts 0x0E56, r12 ; 0x800e56 164d8: d0 92 57 0e sts 0x0E57, r13 ; 0x800e57 164dc: e0 92 58 0e sts 0x0E58, r14 ; 0x800e58 164e0: 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; 164e4: 81 e0 ldi r24, 0x01 ; 1 164e6: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 164ea: e0 cf rjmp .-64 ; 0x164ac 164ec: 6d ed ldi r22, 0xDD ; 221 164ee: c6 2e mov r12, r22 164f0: 62 e0 ldi r22, 0x02 ; 2 164f2: d6 2e mov r13, r22 164f4: 7e eb ldi r23, 0xBE ; 190 164f6: e7 2e mov r14, r23 164f8: 7d e0 ldi r23, 0x0D ; 13 164fa: 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++) 164fc: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 164fe: d6 01 movw r26, r12 16500: 8d 91 ld r24, X+ 16502: 6d 01 movw r12, r26 16504: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16508: 88 23 and r24, r24 1650a: 41 f1 breq .+80 ; 0x1655c { unsigned long val = code_value(); 1650c: 0e 94 a4 60 call 0xc148 ; 0xc148 16510: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 16514: 12 30 cpi r17, 0x02 ; 2 16516: 4c f5 brge .+82 ; 0x1656a { if (val > NORMAL_MAX_ACCEL_XY) 16518: 65 3c cpi r22, 0xC5 ; 197 1651a: b9 e0 ldi r27, 0x09 ; 9 1651c: 7b 07 cpc r23, r27 1651e: 81 05 cpc r24, r1 16520: 91 05 cpc r25, r1 16522: 40 f5 brcc .+80 ; 0x16574 16524: 56 2f mov r21, r22 16526: 47 2f mov r20, r23 16528: 38 2f mov r19, r24 1652a: 29 2f mov r18, r25 1652c: 61 3c cpi r22, 0xC1 ; 193 1652e: e3 e0 ldi r30, 0x03 ; 3 16530: 7e 07 cpc r23, r30 16532: 81 05 cpc r24, r1 16534: 91 05 cpc r25, r1 16536: 20 f0 brcs .+8 ; 0x16540 16538: 50 ec ldi r21, 0xC0 ; 192 1653a: 43 e0 ldi r20, 0x03 ; 3 1653c: 30 e0 ldi r19, 0x00 ; 0 1653e: 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; 16540: d7 01 movw r26, r14 16542: 94 96 adiw r26, 0x24 ; 36 16544: 6d 93 st X+, r22 16546: 7d 93 st X+, r23 16548: 8d 93 st X+, r24 1654a: 9c 93 st X, r25 1654c: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 1654e: f7 01 movw r30, r14 16550: e4 55 subi r30, 0x54 ; 84 16552: ff 4f sbci r31, 0xFF ; 255 16554: 50 83 st Z, r21 16556: 41 83 std Z+1, r20 ; 0x01 16558: 32 83 std Z+2, r19 ; 0x02 1655a: 23 83 std Z+3, r18 ; 0x03 1655c: b4 e0 ldi r27, 0x04 ; 4 1655e: eb 0e add r14, r27 16560: f1 1c adc r15, r1 16562: 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++) 16564: 14 30 cpi r17, 0x04 ; 4 16566: 59 f6 brne .-106 ; 0x164fe 16568: c6 cd rjmp .-1140 ; 0x160f6 { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 1656a: 56 2f mov r21, r22 1656c: 47 2f mov r20, r23 1656e: 38 2f mov r19, r24 16570: 29 2f mov r18, r25 16572: e6 cf rjmp .-52 ; 0x16540 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; 16574: 50 ec ldi r21, 0xC0 ; 192 16576: 43 e0 ldi r20, 0x03 ; 3 16578: 30 e0 ldi r19, 0x00 ; 0 1657a: 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; 1657c: 64 ec ldi r22, 0xC4 ; 196 1657e: 79 e0 ldi r23, 0x09 ; 9 16580: 80 e0 ldi r24, 0x00 ; 0 16582: 90 e0 ldi r25, 0x00 ; 0 16584: dd cf rjmp .-70 ; 0x16540 16586: 4d ed ldi r20, 0xDD ; 221 16588: a4 2e mov r10, r20 1658a: 42 e0 ldi r20, 0x02 ; 2 1658c: b4 2e mov r11, r20 1658e: 5e eb ldi r21, 0xBE ; 190 16590: c5 2e mov r12, r21 16592: 5d e0 ldi r21, 0x0D ; 13 16594: 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++) 16596: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 16598: f5 01 movw r30, r10 1659a: 81 91 ld r24, Z+ 1659c: 5f 01 movw r10, r30 1659e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 165a2: 88 23 and r24, r24 165a4: 71 f1 breq .+92 ; 0x16602 { float val = code_value(); 165a6: 0e 94 a4 60 call 0xc148 ; 0xc148 165aa: 7b 01 movw r14, r22 165ac: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 165ae: f1 e0 ldi r31, 0x01 ; 1 165b0: f9 15 cp r31, r9 165b2: b8 f1 brcs .+110 ; 0x16622 { if (val > NORMAL_MAX_FEEDRATE_XY) 165b4: 20 e0 ldi r18, 0x00 ; 0 165b6: 30 e0 ldi r19, 0x00 ; 0 165b8: 48 e4 ldi r20, 0x48 ; 72 165ba: 53 e4 ldi r21, 0x43 ; 67 165bc: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 165c0: 18 16 cp r1, r24 165c2: 44 f1 brlt .+80 ; 0x16614 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(); 165c4: 5e 2c mov r5, r14 165c6: 6f 2c mov r6, r15 165c8: 70 2e mov r7, r16 165ca: 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) 165cc: 20 e0 ldi r18, 0x00 ; 0 165ce: 30 e0 ldi r19, 0x00 ; 0 165d0: 48 ec ldi r20, 0xC8 ; 200 165d2: 52 e4 ldi r21, 0x42 ; 66 165d4: b7 01 movw r22, r14 165d6: c8 01 movw r24, r16 165d8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 165dc: 18 16 cp r1, r24 165de: 34 f1 brlt .+76 ; 0x1662c val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 165e0: 85 2d mov r24, r5 165e2: 96 2d mov r25, r6 165e4: a7 2d mov r26, r7 165e6: b8 2d mov r27, r8 165e8: f6 01 movw r30, r12 165ea: 84 8b std Z+20, r24 ; 0x14 165ec: 95 8b std Z+21, r25 ; 0x15 165ee: a6 8b std Z+22, r26 ; 0x16 165f0: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 165f2: c7 01 movw r24, r14 165f4: d8 01 movw r26, r16 165f6: e4 56 subi r30, 0x64 ; 100 165f8: ff 4f sbci r31, 0xFF ; 255 165fa: 80 83 st Z, r24 165fc: 91 83 std Z+1, r25 ; 0x01 165fe: a2 83 std Z+2, r26 ; 0x02 16600: 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++) 16602: 93 94 inc r9 16604: f4 e0 ldi r31, 0x04 ; 4 16606: cf 0e add r12, r31 16608: d1 1c adc r13, r1 1660a: 24 e0 ldi r18, 0x04 ; 4 1660c: 92 12 cpse r9, r18 1660e: c4 cf rjmp .-120 ; 0x16598 16610: 0c 94 f5 aa jmp 0x155ea ; 0x155ea #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 16614: 51 2c mov r5, r1 16616: 61 2c mov r6, r1 16618: 28 e4 ldi r18, 0x48 ; 72 1661a: 72 2e mov r7, r18 1661c: 33 e4 ldi r19, 0x43 ; 67 1661e: 83 2e mov r8, r19 16620: d5 cf rjmp .-86 ; 0x165cc 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(); 16622: 56 2e mov r5, r22 16624: 6f 2c mov r6, r15 16626: 78 2e mov r7, r24 16628: 81 2e mov r8, r17 1662a: da cf rjmp .-76 ; 0x165e0 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; 1662c: e1 2c mov r14, r1 1662e: f1 2c mov r15, r1 16630: 08 ec ldi r16, 0xC8 ; 200 16632: 12 e4 ldi r17, 0x42 ; 66 16634: d5 cf rjmp .-86 ; 0x165e0 // 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')) 16636: 80 e5 ldi r24, 0x50 ; 80 16638: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1663c: 88 23 and r24, r24 1663e: 51 f0 breq .+20 ; 0x16654 cs.acceleration = code_value(); 16640: 0e 94 a4 60 call 0xc148 ; 0xc148 16644: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 16648: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 1664c: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 16650: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 if(code_seen('R')) 16654: 82 e5 ldi r24, 0x52 ; 82 16656: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1665a: 88 23 and r24, r24 1665c: 51 f0 breq .+20 ; 0x16672 cs.retract_acceleration = code_value(); 1665e: 0e 94 a4 60 call 0xc148 ; 0xc148 16662: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 16666: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 1666a: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 1666e: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 if(code_seen('T')) 16672: 84 e5 ldi r24, 0x54 ; 84 16674: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16678: 88 23 and r24, r24 1667a: 11 f4 brne .+4 ; 0x16680 1667c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea cs.travel_acceleration = code_value(); 16680: 0e 94 a4 60 call 0xc148 ; 0xc148 16684: 60 93 7e 0e sts 0x0E7E, r22 ; 0x800e7e 16688: 70 93 7f 0e sts 0x0E7F, r23 ; 0x800e7f 1668c: 80 93 80 0e sts 0x0E80, r24 ; 0x800e80 16690: 90 93 81 0e sts 0x0E81, r25 ; 0x800e81 16694: 0c 94 f5 aa jmp 0x155ea ; 0x155ea - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 16698: 83 e5 ldi r24, 0x53 ; 83 1669a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1669e: 88 23 and r24, r24 166a0: 51 f0 breq .+20 ; 0x166b6 166a2: 0e 94 a4 60 call 0xc148 ; 0xc148 166a6: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 166aa: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 166ae: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 166b2: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd if(code_seen('T')) cs.mintravelfeedrate = code_value(); 166b6: 84 e5 ldi r24, 0x54 ; 84 166b8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 166bc: 88 23 and r24, r24 166be: 51 f0 breq .+20 ; 0x166d4 166c0: 0e 94 a4 60 call 0xc148 ; 0xc148 166c4: 60 93 fe 0d sts 0x0DFE, r22 ; 0x800dfe 166c8: 70 93 ff 0d sts 0x0DFF, r23 ; 0x800dff 166cc: 80 93 00 0e sts 0x0E00, r24 ; 0x800e00 166d0: 90 93 01 0e sts 0x0E01, r25 ; 0x800e01 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 166d4: 82 e4 ldi r24, 0x42 ; 66 166d6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 166da: 88 23 and r24, r24 166dc: 61 f0 breq .+24 ; 0x166f6 166de: 0e 94 a4 60 call 0xc148 ; 0xc148 166e2: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 166e6: 60 93 02 0e sts 0x0E02, r22 ; 0x800e02 166ea: 70 93 03 0e sts 0x0E03, r23 ; 0x800e03 166ee: 80 93 04 0e sts 0x0E04, r24 ; 0x800e04 166f2: 90 93 05 0e sts 0x0E05, r25 ; 0x800e05 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 166f6: 88 e5 ldi r24, 0x58 ; 88 166f8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 166fc: 88 23 and r24, r24 166fe: 91 f0 breq .+36 ; 0x16724 16700: 0e 94 a4 60 call 0xc148 ; 0xc148 16704: 60 93 0a 0e sts 0x0E0A, r22 ; 0x800e0a 16708: 70 93 0b 0e sts 0x0E0B, r23 ; 0x800e0b 1670c: 80 93 0c 0e sts 0x0E0C, r24 ; 0x800e0c 16710: 90 93 0d 0e sts 0x0E0D, r25 ; 0x800e0d 16714: 60 93 06 0e sts 0x0E06, r22 ; 0x800e06 16718: 70 93 07 0e sts 0x0E07, r23 ; 0x800e07 1671c: 80 93 08 0e sts 0x0E08, r24 ; 0x800e08 16720: 90 93 09 0e sts 0x0E09, r25 ; 0x800e09 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 16724: 89 e5 ldi r24, 0x59 ; 89 16726: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1672a: 88 23 and r24, r24 1672c: 51 f0 breq .+20 ; 0x16742 1672e: 0e 94 a4 60 call 0xc148 ; 0xc148 16732: 60 93 0a 0e sts 0x0E0A, r22 ; 0x800e0a 16736: 70 93 0b 0e sts 0x0E0B, r23 ; 0x800e0b 1673a: 80 93 0c 0e sts 0x0E0C, r24 ; 0x800e0c 1673e: 90 93 0d 0e sts 0x0E0D, r25 ; 0x800e0d if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 16742: 8a e5 ldi r24, 0x5A ; 90 16744: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16748: 88 23 and r24, r24 1674a: 51 f0 breq .+20 ; 0x16760 1674c: 0e 94 a4 60 call 0xc148 ; 0xc148 16750: 60 93 0e 0e sts 0x0E0E, r22 ; 0x800e0e 16754: 70 93 0f 0e sts 0x0E0F, r23 ; 0x800e0f 16758: 80 93 10 0e sts 0x0E10, r24 ; 0x800e10 1675c: 90 93 11 0e sts 0x0E11, r25 ; 0x800e11 if(code_seen('E')) 16760: 85 e4 ldi r24, 0x45 ; 69 16762: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16766: 88 23 and r24, r24 16768: 11 f4 brne .+4 ; 0x1676e 1676a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { float e = code_value(); 1676e: 0e 94 a4 60 call 0xc148 ; 0xc148 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 16772: 0e 94 b9 81 call 0x10372 ; 0x10372 #endif cs.max_jerk[E_AXIS] = e; 16776: 60 93 12 0e sts 0x0E12, r22 ; 0x800e12 1677a: 70 93 13 0e sts 0x0E13, r23 ; 0x800e13 1677e: 80 93 14 0e sts 0x0E14, r24 ; 0x800e14 16782: 90 93 15 0e sts 0x0E15, r25 ; 0x800e15 16786: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 1678a: 0d ed ldi r16, 0xDD ; 221 1678c: 12 e0 ldi r17, 0x02 ; 2 1678e: 86 e1 ldi r24, 0x16 ; 22 16790: e8 2e mov r14, r24 16792: 8e e0 ldi r24, 0x0E ; 14 16794: f8 2e mov r15, r24 16796: 90 ee ldi r25, 0xE0 ; 224 16798: c9 2e mov r12, r25 1679a: 92 e0 ldi r25, 0x02 ; 2 1679c: 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(); 1679e: d8 01 movw r26, r16 167a0: 8d 91 ld r24, X+ 167a2: 8d 01 movw r16, r26 167a4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 167a8: 88 23 and r24, r24 167aa: 39 f0 breq .+14 ; 0x167ba 167ac: 0e 94 a4 60 call 0xc148 ; 0xc148 167b0: f7 01 movw r30, r14 167b2: 60 83 st Z, r22 167b4: 71 83 std Z+1, r23 ; 0x01 167b6: 82 83 std Z+2, r24 ; 0x02 167b8: 93 83 std Z+3, r25 ; 0x03 167ba: f4 e0 ldi r31, 0x04 ; 4 167bc: ef 0e add r14, r31 167be: 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++) 167c0: c0 16 cp r12, r16 167c2: d1 06 cpc r13, r17 167c4: 61 f7 brne .-40 ; 0x1679e 167c6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea - `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')) 167ca: 83 e5 ldi r24, 0x53 ; 83 167cc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 167d0: 88 23 and r24, r24 167d2: 51 f0 breq .+20 ; 0x167e8 { cs.retract_recover_length = code_value() ; 167d4: 0e 94 a4 60 call 0xc148 ; 0xc148 167d8: 60 93 4d 0e sts 0x0E4D, r22 ; 0x800e4d 167dc: 70 93 4e 0e sts 0x0E4E, r23 ; 0x800e4e 167e0: 80 93 4f 0e sts 0x0E4F, r24 ; 0x800e4f 167e4: 90 93 50 0e sts 0x0E50, r25 ; 0x800e50 } if(code_seen('F')) 167e8: 86 e4 ldi r24, 0x46 ; 70 167ea: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 167ee: 88 23 and r24, r24 167f0: 11 f4 brne .+4 ; 0x167f6 167f2: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 167f6: 0e 94 a4 60 call 0xc148 ; 0xc148 167fa: 0e 94 ce 66 call 0xcd9c ; 0xcd9c 167fe: 60 93 51 0e sts 0x0E51, r22 ; 0x800e51 16802: 70 93 52 0e sts 0x0E52, r23 ; 0x800e52 16806: 80 93 53 0e sts 0x0E53, r24 ; 0x800e53 1680a: 90 93 54 0e sts 0x0E54, r25 ; 0x800e54 1680e: 0c 94 f5 aa jmp 0x155ea ; 0x155ea #### 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')) 16812: 83 e5 ldi r24, 0x53 ; 83 16814: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16818: 88 23 and r24, r24 1681a: 11 f4 brne .+4 ; 0x16820 1681c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { switch(code_value_uint8()) 16820: 0e 94 6f 5b call 0xb6de ; 0xb6de 16824: 88 23 and r24, r24 16826: c1 f0 breq .+48 ; 0x16858 16828: 81 30 cpi r24, 0x01 ; 1 1682a: e1 f0 breq .+56 ; 0x16864 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1682c: 80 ed ldi r24, 0xD0 ; 208 1682e: 9b ea ldi r25, 0xAB ; 171 16830: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16834: 83 ee ldi r24, 0xE3 ; 227 16836: 97 e6 ldi r25, 0x67 ; 103 16838: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1683c: 80 91 92 12 lds r24, 0x1292 ; 0x801292 16840: 90 91 93 12 lds r25, 0x1293 ; 0x801293 16844: 88 55 subi r24, 0x58 ; 88 16846: 9f 4e sbci r25, 0xEF ; 239 16848: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_ECHOLNPGM("\"(1)"); 1684c: 83 e6 ldi r24, 0x63 ; 99 1684e: 96 e8 ldi r25, 0x86 ; 134 16850: 0e 94 82 79 call 0xf304 ; 0xf304 16854: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 16858: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 retracted[0]=false; 1685c: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 16860: 0c 94 f5 aa jmp 0x155ea ; 0x155ea retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 16864: 80 93 40 0e sts 0x0E40, r24 ; 0x800e40 retracted[0]=false; 16868: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e 1686c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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; 16870: 40 90 82 0e lds r4, 0x0E82 ; 0x800e82 16874: 50 90 83 0e lds r5, 0x0E83 ; 0x800e83 16878: 60 90 84 0e lds r6, 0x0E84 ; 0x800e84 1687c: 70 90 85 0e lds r7, 0x0E85 ; 0x800e85 16880: 0c 94 52 a8 jmp 0x150a4 ; 0x150a4 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 16884: 80 90 86 0e lds r8, 0x0E86 ; 0x800e86 16888: 90 90 87 0e lds r9, 0x0E87 ; 0x800e87 1688c: a0 90 88 0e lds r10, 0x0E88 ; 0x800e88 16890: b0 90 89 0e lds r11, 0x0E89 ; 0x800e89 16894: 0c 94 5d a8 jmp 0x150ba ; 0x150ba - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 16898: 82 e4 ldi r24, 0x42 ; 66 1689a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1689e: 18 2f mov r17, r24 168a0: 88 23 and r24, r24 168a2: 41 f0 breq .+16 ; 0x168b4 { saved_feedmultiply_mm = feedmultiply; 168a4: 80 91 39 02 lds r24, 0x0239 ; 0x800239 168a8: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 168ac: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 168b0: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 168b4: 83 e5 ldi r24, 0x53 ; 83 168b6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 168ba: 08 2f mov r16, r24 168bc: 88 23 and r24, r24 168be: 39 f0 breq .+14 ; 0x168ce { feedmultiply = code_value_short(); 168c0: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 168c4: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 168c8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 168cc: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 168ce: 82 e5 ldi r24, 0x52 ; 82 168d0: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 168d4: 88 23 and r24, r24 168d6: 51 f0 breq .+20 ; 0x168ec { feedmultiply = saved_feedmultiply_mm; 168d8: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 168dc: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 168e0: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 168e4: 80 93 39 02 sts 0x0239, r24 ; 0x800239 168e8: 0c 94 f5 aa jmp 0x155ea ; 0x155ea codesWereSeen = true; } if (!codesWereSeen) 168ec: 11 11 cpse r17, r1 168ee: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { printf_P(PSTR("%i%%\n"), feedmultiply); 168f2: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 168f6: 8f 93 push r24 168f8: 80 91 39 02 lds r24, 0x0239 ; 0x800239 168fc: 8f 93 push r24 168fe: 8d e5 ldi r24, 0x5D ; 93 16900: 96 e8 ldi r25, 0x86 ; 134 16902: 9f 93 push r25 16904: 8f 93 push r24 16906: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 1690a: 0f 90 pop r0 1690c: 0f 90 pop r0 1690e: 0f 90 pop r0 16910: 0f 90 pop r0 16912: 0c 94 f5 aa jmp 0x155ea ; 0x155ea extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 16916: 80 91 bd 02 lds r24, 0x02BD ; 0x8002bd 1691a: 8f 93 push r24 1691c: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 16920: 8f 93 push r24 16922: 87 e5 ldi r24, 0x57 ; 87 16924: 96 e8 ldi r25, 0x86 ; 134 16926: 9f 93 push r25 16928: 8f 93 push r24 1692a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 1692e: 0f 90 pop r0 16930: 0f 90 pop r0 16932: 0f 90 pop r0 16934: 0f 90 pop r0 16936: 0c 94 f5 aa jmp 0x155ea ; 0x155ea - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1693a: 80 e5 ldi r24, 0x50 ; 80 1693c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16940: 88 23 and r24, r24 16942: 11 f4 brne .+4 ; 0x16948 16944: 0c 94 f5 aa jmp 0x155ea ; 0x155ea int pin_number = code_value_short(); // pin number 16948: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 1694c: 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 1694e: 83 e5 ldi r24, 0x53 ; 83 16950: 0e 94 dd 5b call 0xb7ba ; 0xb7ba */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 16954: 0f ef ldi r16, 0xFF ; 255 16956: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 16958: 88 23 and r24, r24 1695a: 19 f0 breq .+6 ; 0x16962 1695c: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16960: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 16962: c8 01 movw r24, r16 16964: 01 96 adiw r24, 0x01 ; 1 16966: 03 97 sbiw r24, 0x03 ; 3 16968: 10 f0 brcs .+4 ; 0x1696e 1696a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 1696e: ed e5 ldi r30, 0x5D ; 93 16970: 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)) 16972: 84 91 lpm r24, Z 16974: 08 2e mov r0, r24 16976: 00 0c add r0, r0 16978: 99 0b sbc r25, r25 1697a: e8 16 cp r14, r24 1697c: f9 06 cpc r15, r25 1697e: 11 f4 brne .+4 ; 0x16984 16980: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 16984: 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++) 16986: 27 e8 ldi r18, 0x87 ; 135 16988: e9 37 cpi r30, 0x79 ; 121 1698a: f2 07 cpc r31, r18 1698c: 91 f7 brne .-28 ; 0x16972 pin_number = -1; break; } } if (pin_number > -1) 1698e: f7 fe sbrs r15, 7 16990: 02 c0 rjmp .+4 ; 0x16996 16992: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { int target = LOW; st_synchronize(); 16996: 0f 94 ef 42 call 0x285de ; 0x285de pinMode(pin_number, INPUT); 1699a: de 2c mov r13, r14 1699c: 60 e0 ldi r22, 0x00 ; 0 1699e: 8e 2d mov r24, r14 169a0: 0e 94 ec e8 call 0x1d1d8 ; 0x1d1d8 switch(pin_state){ 169a4: 0f 3f cpi r16, 0xFF ; 255 169a6: 10 07 cpc r17, r16 169a8: b1 f0 breq .+44 ; 0x169d6 169aa: 01 30 cpi r16, 0x01 ; 1 169ac: 11 05 cpc r17, r1 169ae: 11 f0 breq .+4 ; 0x169b4 } } if (pin_number > -1) { int target = LOW; 169b0: 10 e0 ldi r17, 0x00 ; 0 169b2: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 169b4: 8d 2d mov r24, r13 169b6: 0e 94 95 e8 call 0x1d12a ; 0x1d12a 169ba: 80 17 cp r24, r16 169bc: 91 07 cpc r25, r17 169be: 11 f4 brne .+4 ; 0x169c4 169c0: 0c 94 f5 aa jmp 0x155ea ; 0x155ea manage_heater(); 169c4: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(); 169c8: 80 e0 ldi r24, 0x00 ; 0 169ca: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 169ce: 80 e0 ldi r24, 0x00 ; 0 169d0: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 169d4: ef cf rjmp .-34 ; 0x169b4 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 169d6: 8e 2d mov r24, r14 169d8: 0e 94 95 e8 call 0x1d12a ; 0x1d12a 169dc: 31 e0 ldi r19, 0x01 ; 1 169de: 20 e0 ldi r18, 0x00 ; 0 169e0: 89 2b or r24, r25 169e2: 09 f0 breq .+2 ; 0x169e6 169e4: 30 e0 ldi r19, 0x00 ; 0 169e6: 03 2f mov r16, r19 169e8: 12 2f mov r17, r18 169ea: e4 cf rjmp .-56 ; 0x169b4 - `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; 169ec: 80 e5 ldi r24, 0x50 ; 80 169ee: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 169f2: 08 ee ldi r16, 0xE8 ; 232 169f4: 13 e0 ldi r17, 0x03 ; 3 169f6: 88 23 and r24, r24 169f8: 29 f0 breq .+10 ; 0x16a04 169fa: 0e 94 a4 60 call 0xc148 ; 0xc148 169fe: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 16a02: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 16a04: 83 e5 ldi r24, 0x53 ; 83 16a06: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16a0a: 88 23 and r24, r24 16a0c: 71 f0 breq .+28 ; 0x16a2a beepS = 0; else { beepS = code_value(); 16a0e: 0e 94 a4 60 call 0xc148 ; 0xc148 16a12: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> if (!beepS) { 16a16: 61 15 cp r22, r1 16a18: 71 05 cpc r23, r1 16a1a: 49 f4 brne .+18 ; 0x16a2e // handle S0 as a pause _delay(beepP); 16a1c: b8 01 movw r22, r16 16a1e: 90 e0 ldi r25, 0x00 ; 0 16a20: 80 e0 ldi r24, 0x00 ; 0 16a22: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 16a26: 0c 94 f5 aa jmp 0x155ea ; 0x155ea case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 16a2a: 70 e0 ldi r23, 0x00 ; 0 16a2c: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 16a2e: 40 e0 ldi r20, 0x00 ; 0 16a30: c8 01 movw r24, r16 16a32: 0f 94 4d 51 call 0x2a29a ; 0x2a29a 16a36: 0c 94 f5 aa jmp 0x155ea ; 0x155ea - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 16a3a: 80 e5 ldi r24, 0x50 ; 80 16a3c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16a40: 88 23 and r24, r24 16a42: 51 f0 breq .+20 ; 0x16a58 16a44: 0e 94 a4 60 call 0xc148 ; 0xc148 16a48: 60 93 26 0e sts 0x0E26, r22 ; 0x800e26 16a4c: 70 93 27 0e sts 0x0E27, r23 ; 0x800e27 16a50: 80 93 28 0e sts 0x0E28, r24 ; 0x800e28 16a54: 90 93 29 0e sts 0x0E29, r25 ; 0x800e29 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 16a58: 89 e4 ldi r24, 0x49 ; 73 16a5a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16a5e: 88 23 and r24, r24 16a60: 81 f0 breq .+32 ; 0x16a82 16a62: 0e 94 a4 60 call 0xc148 ; 0xc148 16a66: 2c ea ldi r18, 0xAC ; 172 16a68: 35 ec ldi r19, 0xC5 ; 197 16a6a: 47 e2 ldi r20, 0x27 ; 39 16a6c: 5e e3 ldi r21, 0x3E ; 62 16a6e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 16a72: 60 93 2a 0e sts 0x0E2A, r22 ; 0x800e2a 16a76: 70 93 2b 0e sts 0x0E2B, r23 ; 0x800e2b 16a7a: 80 93 2c 0e sts 0x0E2C, r24 ; 0x800e2c 16a7e: 90 93 2d 0e sts 0x0E2D, r25 ; 0x800e2d if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 16a82: 84 e4 ldi r24, 0x44 ; 68 16a84: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16a88: 88 23 and r24, r24 16a8a: 81 f0 breq .+32 ; 0x16aac 16a8c: 0e 94 a4 60 call 0xc148 ; 0xc148 } float unscalePID_i(float i) { return i/PID_dT; 16a90: 2c ea ldi r18, 0xAC ; 172 16a92: 35 ec ldi r19, 0xC5 ; 197 16a94: 47 e2 ldi r20, 0x27 ; 39 16a96: 5e e3 ldi r21, 0x3E ; 62 16a98: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 16a9c: 60 93 2e 0e sts 0x0E2E, r22 ; 0x800e2e 16aa0: 70 93 2f 0e sts 0x0E2F, r23 ; 0x800e2f 16aa4: 80 93 30 0e sts 0x0E30, r24 ; 0x800e30 16aa8: 90 93 31 0e sts 0x0E31, r25 ; 0x800e31 updatePID(); 16aac: 0f 94 da 3a call 0x275b4 ; 0x275b4 SERIAL_PROTOCOLRPGM(MSG_OK); 16ab0: 8b eb ldi r24, 0xBB ; 187 16ab2: 9d e6 ldi r25, 0x6D ; 109 16ab4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLPGM(" p:"); 16ab8: 83 e5 ldi r24, 0x53 ; 83 16aba: 96 e8 ldi r25, 0x86 ; 134 16abc: 0e 94 57 77 call 0xeeae ; 0xeeae } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16ac0: 60 91 26 0e lds r22, 0x0E26 ; 0x800e26 16ac4: 70 91 27 0e lds r23, 0x0E27 ; 0x800e27 16ac8: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 16acc: 90 91 29 0e lds r25, 0x0E29 ; 0x800e29 16ad0: 42 e0 ldi r20, 0x02 ; 2 16ad2: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 16ad6: 8f e4 ldi r24, 0x4F ; 79 16ad8: 96 e8 ldi r25, 0x86 ; 134 16ada: 0e 94 57 77 call 0xeeae ; 0xeeae 16ade: 2c ea ldi r18, 0xAC ; 172 16ae0: 35 ec ldi r19, 0xC5 ; 197 16ae2: 47 e2 ldi r20, 0x27 ; 39 16ae4: 5e e3 ldi r21, 0x3E ; 62 16ae6: 60 91 2a 0e lds r22, 0x0E2A ; 0x800e2a 16aea: 70 91 2b 0e lds r23, 0x0E2B ; 0x800e2b 16aee: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 16af2: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 16af6: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 16afa: 42 e0 ldi r20, 0x02 ; 2 16afc: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 16b00: 8b e4 ldi r24, 0x4B ; 75 16b02: 96 e8 ldi r25, 0x86 ; 134 16b04: 0e 94 57 77 call 0xeeae ; 0xeeae #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16b08: 2c ea ldi r18, 0xAC ; 172 16b0a: 35 ec ldi r19, 0xC5 ; 197 16b0c: 47 e2 ldi r20, 0x27 ; 39 16b0e: 5e e3 ldi r21, 0x3E ; 62 16b10: 60 91 2e 0e lds r22, 0x0E2E ; 0x800e2e 16b14: 70 91 2f 0e lds r23, 0x0E2F ; 0x800e2f 16b18: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 16b1c: 90 91 31 0e lds r25, 0x0E31 ; 0x800e31 16b20: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 16b24: 0f 94 bb 74 call 0x2e976 ; 0x2e976 16b28: 0c 94 f5 aa jmp 0x155ea ; 0x155ea #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 16b2c: 90 e0 ldi r25, 0x00 ; 0 16b2e: 80 e0 ldi r24, 0x00 ; 0 16b30: 0c 94 fa a8 jmp 0x151f4 ; 0x151f4 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 16b34: 85 e4 ldi r24, 0x45 ; 69 16b36: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 16b3a: 10 e0 ldi r17, 0x00 ; 0 16b3c: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 16b3e: 88 23 and r24, r24 16b40: 59 f0 breq .+22 ; 0x16b58 16b42: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16b46: 8c 01 movw r16, r24 if (e < 0) temp = 70; 16b48: c1 2c mov r12, r1 16b4a: d1 2c mov r13, r1 16b4c: ac e8 ldi r26, 0x8C ; 140 16b4e: ea 2e mov r14, r26 16b50: a2 e4 ldi r26, 0x42 ; 66 16b52: 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) 16b54: 97 fd sbrc r25, 7 16b56: 06 c0 rjmp .+12 ; 0x16b64 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 16b58: c1 2c mov r12, r1 16b5a: d1 2c mov r13, r1 16b5c: b6 e1 ldi r27, 0x16 ; 22 16b5e: eb 2e mov r14, r27 16b60: b3 e4 ldi r27, 0x43 ; 67 16b62: 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(); 16b64: 83 e5 ldi r24, 0x53 ; 83 16b66: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16b6a: 88 23 and r24, r24 16b6c: 21 f0 breq .+8 ; 0x16b76 16b6e: 0e 94 a4 60 call 0xc148 ; 0xc148 16b72: 6b 01 movw r12, r22 16b74: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 16b76: 83 e4 ldi r24, 0x43 ; 67 16b78: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16b7c: 88 23 and r24, r24 16b7e: 51 f0 breq .+20 ; 0x16b94 16b80: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 PID_autotune(temp, e, c); 16b84: 9c 01 movw r18, r24 16b86: a8 01 movw r20, r16 16b88: c7 01 movw r24, r14 16b8a: b6 01 movw r22, r12 16b8c: 0f 94 07 3b call 0x2760e ; 0x2760e 16b90: 0c 94 f5 aa jmp 0x155ea ; 0x155ea */ case 303: { float temp = 150.0; int e = 0; int c = 5; 16b94: 85 e0 ldi r24, 0x05 ; 5 16b96: 90 e0 ldi r25, 0x00 ; 0 16b98: f5 cf rjmp .-22 ; 0x16b84 { // 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(); 16b9a: 89 e4 ldi r24, 0x49 ; 73 16b9c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16ba0: 88 23 and r24, r24 16ba2: 09 f4 brne .+2 ; 0x16ba6 16ba4: 30 c2 rjmp .+1120 ; 0x17006 16ba6: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16baa: ab 96 adiw r28, 0x2b ; 43 16bac: 8f af std Y+63, r24 ; 0x3f 16bae: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 16bb0: 82 e5 ldi r24, 0x52 ; 82 16bb2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16bb6: 88 23 and r24, r24 16bb8: 09 f4 brne .+2 ; 0x16bbc 16bba: 2a c2 rjmp .+1108 ; 0x17010 16bbc: 0e 94 a4 60 call 0xc148 ; 0xc148 16bc0: e2 96 adiw r28, 0x32 ; 50 16bc2: 6c af std Y+60, r22 ; 0x3c 16bc4: 7d af std Y+61, r23 ; 0x3d 16bc6: 8e af std Y+62, r24 ; 0x3e 16bc8: 9f af std Y+63, r25 ; 0x3f 16bca: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 16bcc: 80 e5 ldi r24, 0x50 ; 80 16bce: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `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; 16bd2: c1 2c mov r12, r1 16bd4: d1 2c mov r13, r1 16bd6: f0 ec ldi r31, 0xC0 ; 192 16bd8: ef 2e mov r14, r31 16bda: ff e7 ldi r31, 0x7F ; 127 16bdc: 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(); 16bde: 88 23 and r24, r24 16be0: 21 f0 breq .+8 ; 0x16bea 16be2: 0e 94 a4 60 call 0xc148 ; 0xc148 16be6: 6b 01 movw r12, r22 16be8: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 16bea: 85 e5 ldi r24, 0x55 ; 85 16bec: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16bf0: 88 23 and r24, r24 16bf2: 09 f4 brne .+2 ; 0x16bf6 16bf4: 18 c2 rjmp .+1072 ; 0x17026 16bf6: 0e 94 a4 60 call 0xc148 ; 0xc148 16bfa: 6e 96 adiw r28, 0x1e ; 30 16bfc: 6c af std Y+60, r22 ; 0x3c 16bfe: 7d af std Y+61, r23 ; 0x3d 16c00: 8e af std Y+62, r24 ; 0x3e 16c02: 9f af std Y+63, r25 ; 0x3f 16c04: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 16c06: 86 e5 ldi r24, 0x56 ; 86 16c08: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16c0c: 88 23 and r24, r24 16c0e: 09 f4 brne .+2 ; 0x16c12 16c10: 15 c2 rjmp .+1066 ; 0x1703c 16c12: 0e 94 a4 60 call 0xc148 ; 0xc148 16c16: a2 96 adiw r28, 0x22 ; 34 16c18: 6c af std Y+60, r22 ; 0x3c 16c1a: 7d af std Y+61, r23 ; 0x3d 16c1c: 8e af std Y+62, r24 ; 0x3e 16c1e: 9f af std Y+63, r25 ; 0x3f 16c20: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 16c22: 83 e4 ldi r24, 0x43 ; 67 16c24: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16c28: 88 23 and r24, r24 16c2a: 09 f4 brne .+2 ; 0x16c2e 16c2c: 12 c2 rjmp .+1060 ; 0x17052 16c2e: 0e 94 a4 60 call 0xc148 ; 0xc148 16c32: 6a 96 adiw r28, 0x1a ; 26 16c34: 6c af std Y+60, r22 ; 0x3c 16c36: 7d af std Y+61, r23 ; 0x3d 16c38: 8e af std Y+62, r24 ; 0x3e 16c3a: 9f af std Y+63, r25 ; 0x3f 16c3c: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 16c3e: 84 e4 ldi r24, 0x44 ; 68 16c40: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16c44: 88 23 and r24, r24 16c46: 09 f4 brne .+2 ; 0x16c4a 16c48: 0f c2 rjmp .+1054 ; 0x17068 16c4a: 0e 94 a4 60 call 0xc148 ; 0xc148 16c4e: aa 96 adiw r28, 0x2a ; 42 16c50: 6c af std Y+60, r22 ; 0x3c 16c52: 7d af std Y+61, r23 ; 0x3d 16c54: 8e af std Y+62, r24 ; 0x3e 16c56: 9f af std Y+63, r25 ; 0x3f 16c58: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 16c5a: 8c e4 ldi r24, 0x4C ; 76 16c5c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 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; 16c60: 0f ef ldi r16, 0xFF ; 255 16c62: 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(); 16c64: 88 23 and r24, r24 16c66: 19 f0 breq .+6 ; 0x16c6e 16c68: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16c6c: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 16c6e: 83 e5 ldi r24, 0x53 ; 83 16c70: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16c74: 88 23 and r24, r24 16c76: 09 f4 brne .+2 ; 0x16c7a 16c78: 02 c2 rjmp .+1028 ; 0x1707e 16c7a: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16c7e: e3 96 adiw r28, 0x33 ; 51 16c80: 8f af std Y+63, r24 ; 0x3f 16c82: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 16c84: 82 e4 ldi r24, 0x42 ; 66 16c86: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16c8a: 88 23 and r24, r24 16c8c: 09 f4 brne .+2 ; 0x16c90 16c8e: fc c1 rjmp .+1016 ; 0x17088 16c90: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16c94: e7 96 adiw r28, 0x37 ; 55 16c96: 8f af std Y+63, r24 ; 0x3f 16c98: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 16c9a: 84 e5 ldi r24, 0x54 ; 84 16c9c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16ca0: 88 23 and r24, r24 16ca2: 09 f4 brne .+2 ; 0x16ca6 16ca4: f6 c1 rjmp .+1004 ; 0x17092 16ca6: 0e 94 a4 60 call 0xc148 ; 0xc148 16caa: a6 96 adiw r28, 0x26 ; 38 16cac: 6c af std Y+60, r22 ; 0x3c 16cae: 7d af std Y+61, r23 ; 0x3d 16cb0: 8e af std Y+62, r24 ; 0x3e 16cb2: 9f af std Y+63, r25 ; 0x3f 16cb4: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 16cb6: 85 e4 ldi r24, 0x45 ; 69 16cb8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `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; 16cbc: 41 2c mov r4, r1 16cbe: 51 2c mov r5, r1 16cc0: e0 ec ldi r30, 0xC0 ; 192 16cc2: 6e 2e mov r6, r30 16cc4: ef e7 ldi r30, 0x7F ; 127 16cc6: 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(); 16cc8: 88 23 and r24, r24 16cca: 21 f0 breq .+8 ; 0x16cd4 16ccc: 0e 94 a4 60 call 0xc148 ; 0xc148 16cd0: 2b 01 movw r4, r22 16cd2: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 16cd4: 87 e5 ldi r24, 0x57 ; 87 16cd6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `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; 16cda: 81 2c mov r8, r1 16cdc: 91 2c mov r9, r1 16cde: 70 ec ldi r23, 0xC0 ; 192 16ce0: a7 2e mov r10, r23 16ce2: 7f e7 ldi r23, 0x7F ; 127 16ce4: 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(); 16ce6: 88 23 and r24, r24 16ce8: 21 f0 breq .+8 ; 0x16cf2 16cea: 0e 94 a4 60 call 0xc148 ; 0xc148 16cee: 4b 01 movw r8, r22 16cf0: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 16cf2: 81 e4 ldi r24, 0x41 ; 65 16cf4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 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; 16cf8: 22 24 eor r2, r2 16cfa: 2a 94 dec r2 16cfc: 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(); 16cfe: 88 23 and r24, r24 16d00: 19 f0 breq .+6 ; 0x16d08 16d02: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16d06: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 16d08: 86 e4 ldi r24, 0x46 ; 70 16d0a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 16d0e: 88 23 and r24, r24 16d10: 09 f4 brne .+2 ; 0x16d14 16d12: ca c1 rjmp .+916 ; 0x170a8 16d14: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 16d18: eb 96 adiw r28, 0x3b ; 59 16d1a: 8f af std Y+63, r24 ; 0x3f 16d1c: 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) 16d1e: e2 96 adiw r28, 0x32 ; 50 16d20: 2c ad ldd r18, Y+60 ; 0x3c 16d22: 3d ad ldd r19, Y+61 ; 0x3d 16d24: 4e ad ldd r20, Y+62 ; 0x3e 16d26: 5f ad ldd r21, Y+63 ; 0x3f 16d28: e2 97 sbiw r28, 0x32 ; 50 16d2a: ca 01 movw r24, r20 16d2c: b9 01 movw r22, r18 16d2e: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16d32: 88 23 and r24, r24 16d34: 09 f4 brne .+2 ; 0x16d38 16d36: c1 c1 rjmp .+898 ; 0x170ba 16d38: a7 01 movw r20, r14 16d3a: 96 01 movw r18, r12 16d3c: c7 01 movw r24, r14 16d3e: b6 01 movw r22, r12 16d40: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16d44: 88 23 and r24, r24 16d46: 09 f4 brne .+2 ; 0x16d4a 16d48: b8 c1 rjmp .+880 ; 0x170ba 16d4a: 6e 96 adiw r28, 0x1e ; 30 16d4c: 2c ad ldd r18, Y+60 ; 0x3c 16d4e: 3d ad ldd r19, Y+61 ; 0x3d 16d50: 4e ad ldd r20, Y+62 ; 0x3e 16d52: 5f ad ldd r21, Y+63 ; 0x3f 16d54: 6e 97 sbiw r28, 0x1e ; 30 16d56: ca 01 movw r24, r20 16d58: b9 01 movw r22, r18 16d5a: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16d5e: 88 23 and r24, r24 16d60: 09 f4 brne .+2 ; 0x16d64 16d62: ab c1 rjmp .+854 ; 0x170ba 16d64: a2 96 adiw r28, 0x22 ; 34 16d66: 2c ad ldd r18, Y+60 ; 0x3c 16d68: 3d ad ldd r19, Y+61 ; 0x3d 16d6a: 4e ad ldd r20, Y+62 ; 0x3e 16d6c: 5f ad ldd r21, Y+63 ; 0x3f 16d6e: a2 97 sbiw r28, 0x22 ; 34 16d70: ca 01 movw r24, r20 16d72: b9 01 movw r22, r18 16d74: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16d78: 88 23 and r24, r24 16d7a: 09 f4 brne .+2 ; 0x16d7e 16d7c: 9e c1 rjmp .+828 ; 0x170ba 16d7e: 6a 96 adiw r28, 0x1a ; 26 16d80: 2c ad ldd r18, Y+60 ; 0x3c 16d82: 3d ad ldd r19, Y+61 ; 0x3d 16d84: 4e ad ldd r20, Y+62 ; 0x3e 16d86: 5f ad ldd r21, Y+63 ; 0x3f 16d88: 6a 97 sbiw r28, 0x1a ; 26 16d8a: ca 01 movw r24, r20 16d8c: b9 01 movw r22, r18 16d8e: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16d92: 88 23 and r24, r24 16d94: 09 f4 brne .+2 ; 0x16d98 16d96: 91 c1 rjmp .+802 ; 0x170ba 16d98: aa 96 adiw r28, 0x2a ; 42 16d9a: 2c ad ldd r18, Y+60 ; 0x3c 16d9c: 3d ad ldd r19, Y+61 ; 0x3d 16d9e: 4e ad ldd r20, Y+62 ; 0x3e 16da0: 5f ad ldd r21, Y+63 ; 0x3f 16da2: aa 97 sbiw r28, 0x2a ; 42 16da4: ca 01 movw r24, r20 16da6: b9 01 movw r22, r18 16da8: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16dac: 88 23 and r24, r24 16dae: 09 f4 brne .+2 ; 0x16db2 16db0: 84 c1 rjmp .+776 ; 0x170ba 16db2: a6 96 adiw r28, 0x26 ; 38 16db4: 2c ad ldd r18, Y+60 ; 0x3c 16db6: 3d ad ldd r19, Y+61 ; 0x3d 16db8: 4e ad ldd r20, Y+62 ; 0x3e 16dba: 5f ad ldd r21, Y+63 ; 0x3f 16dbc: a6 97 sbiw r28, 0x26 ; 38 16dbe: ca 01 movw r24, r20 16dc0: b9 01 movw r22, r18 16dc2: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16dc6: 88 23 and r24, r24 16dc8: 09 f4 brne .+2 ; 0x16dcc 16dca: 77 c1 rjmp .+750 ; 0x170ba 16dcc: a5 01 movw r20, r10 16dce: 94 01 movw r18, r8 16dd0: c5 01 movw r24, r10 16dd2: b4 01 movw r22, r8 16dd4: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16dd8: 88 23 and r24, r24 16dda: 09 f4 brne .+2 ; 0x16dde 16ddc: 6e c1 rjmp .+732 ; 0x170ba 16dde: a3 01 movw r20, r6 16de0: 92 01 movw r18, r4 16de2: c3 01 movw r24, r6 16de4: b2 01 movw r22, r4 16de6: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16dea: 88 23 and r24, r24 16dec: 09 f4 brne .+2 ; 0x16df0 16dee: 65 c1 rjmp .+714 ; 0x170ba && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 16df0: ab 96 adiw r28, 0x2b ; 43 16df2: 4f ad ldd r20, Y+63 ; 0x3f 16df4: ab 97 sbiw r28, 0x2b ; 43 16df6: 47 ff sbrs r20, 7 16df8: 60 c1 rjmp .+704 ; 0x170ba 16dfa: e3 96 adiw r28, 0x33 ; 51 16dfc: 5f ad ldd r21, Y+63 ; 0x3f 16dfe: e3 97 sbiw r28, 0x33 ; 51 16e00: 57 ff sbrs r21, 7 16e02: 5b c1 rjmp .+694 ; 0x170ba 16e04: e7 96 adiw r28, 0x37 ; 55 16e06: 8f ad ldd r24, Y+63 ; 0x3f 16e08: e7 97 sbiw r28, 0x37 ; 55 16e0a: 87 ff sbrs r24, 7 16e0c: 5b c1 rjmp .+694 ; 0x170c4 16e0e: 37 fe sbrs r3, 7 16e10: 9f c1 rjmp .+830 ; 0x17150 16e12: 17 fd sbrc r17, 7 16e14: 4e c1 rjmp .+668 ; 0x170b2 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; 16e16: ce 01 movw r24, r28 16e18: 01 96 adiw r24, 0x01 ; 1 16e1a: 0f 94 a1 31 call 0x26342 ; 0x26342 if(!isnan(P) && P > 0) thermal_model::data.P = P; 16e1e: a7 01 movw r20, r14 16e20: 96 01 movw r18, r12 16e22: c7 01 movw r24, r14 16e24: b6 01 movw r22, r12 16e26: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16e2a: 88 23 and r24, r24 16e2c: 09 f4 brne .+2 ; 0x16e30 16e2e: 31 c2 rjmp .+1122 ; 0x17292 if(!isnan(U)) thermal_model::data.U = U; 16e30: 6e 96 adiw r28, 0x1e ; 30 16e32: 2c ad ldd r18, Y+60 ; 0x3c 16e34: 3d ad ldd r19, Y+61 ; 0x3d 16e36: 4e ad ldd r20, Y+62 ; 0x3e 16e38: 5f ad ldd r21, Y+63 ; 0x3f 16e3a: 6e 97 sbiw r28, 0x1e ; 30 16e3c: ca 01 movw r24, r20 16e3e: b9 01 movw r22, r18 16e40: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16e44: 81 11 cpse r24, r1 16e46: 0e c0 rjmp .+28 ; 0x16e64 16e48: 6e 96 adiw r28, 0x1e ; 30 16e4a: 2c ad ldd r18, Y+60 ; 0x3c 16e4c: 3d ad ldd r19, Y+61 ; 0x3d 16e4e: 4e ad ldd r20, Y+62 ; 0x3e 16e50: 5f ad ldd r21, Y+63 ; 0x3f 16e52: 6e 97 sbiw r28, 0x1e ; 30 16e54: 20 93 de 12 sts 0x12DE, r18 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 16e58: 30 93 df 12 sts 0x12DF, r19 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 16e5c: 40 93 e0 12 sts 0x12E0, r20 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 16e60: 50 93 e1 12 sts 0x12E1, r21 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> if(!isnan(V)) thermal_model::data.V = V; 16e64: a2 96 adiw r28, 0x22 ; 34 16e66: 2c ad ldd r18, Y+60 ; 0x3c 16e68: 3d ad ldd r19, Y+61 ; 0x3d 16e6a: 4e ad ldd r20, Y+62 ; 0x3e 16e6c: 5f ad ldd r21, Y+63 ; 0x3f 16e6e: a2 97 sbiw r28, 0x22 ; 34 16e70: ca 01 movw r24, r20 16e72: b9 01 movw r22, r18 16e74: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16e78: 81 11 cpse r24, r1 16e7a: 0e c0 rjmp .+28 ; 0x16e98 16e7c: a2 96 adiw r28, 0x22 ; 34 16e7e: 8c ad ldd r24, Y+60 ; 0x3c 16e80: 9d ad ldd r25, Y+61 ; 0x3d 16e82: ae ad ldd r26, Y+62 ; 0x3e 16e84: bf ad ldd r27, Y+63 ; 0x3f 16e86: a2 97 sbiw r28, 0x22 ; 34 16e88: 80 93 e2 12 sts 0x12E2, r24 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 16e8c: 90 93 e3 12 sts 0x12E3, r25 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 16e90: a0 93 e4 12 sts 0x12E4, r26 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 16e94: b0 93 e5 12 sts 0x12E5, r27 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 16e98: 6a 96 adiw r28, 0x1a ; 26 16e9a: 2c ad ldd r18, Y+60 ; 0x3c 16e9c: 3d ad ldd r19, Y+61 ; 0x3d 16e9e: 4e ad ldd r20, Y+62 ; 0x3e 16ea0: 5f ad ldd r21, Y+63 ; 0x3f 16ea2: 6a 97 sbiw r28, 0x1a ; 26 16ea4: ca 01 movw r24, r20 16ea6: b9 01 movw r22, r18 16ea8: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16eac: 81 11 cpse r24, r1 16eae: 1b c0 rjmp .+54 ; 0x16ee6 16eb0: 20 e0 ldi r18, 0x00 ; 0 16eb2: 30 e0 ldi r19, 0x00 ; 0 16eb4: a9 01 movw r20, r18 16eb6: 6a 96 adiw r28, 0x1a ; 26 16eb8: 6c ad ldd r22, Y+60 ; 0x3c 16eba: 7d ad ldd r23, Y+61 ; 0x3d 16ebc: 8e ad ldd r24, Y+62 ; 0x3e 16ebe: 9f ad ldd r25, Y+63 ; 0x3f 16ec0: 6a 97 sbiw r28, 0x1a ; 26 16ec2: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 16ec6: 18 16 cp r1, r24 16ec8: 74 f4 brge .+28 ; 0x16ee6 16eca: 6a 96 adiw r28, 0x1a ; 26 16ecc: 2c ad ldd r18, Y+60 ; 0x3c 16ece: 3d ad ldd r19, Y+61 ; 0x3d 16ed0: 4e ad ldd r20, Y+62 ; 0x3e 16ed2: 5f ad ldd r21, Y+63 ; 0x3f 16ed4: 6a 97 sbiw r28, 0x1a ; 26 16ed6: 20 93 e6 12 sts 0x12E6, r18 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 16eda: 30 93 e7 12 sts 0x12E7, r19 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 16ede: 40 93 e8 12 sts 0x12E8, r20 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 16ee2: 50 93 e9 12 sts 0x12E9, r21 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> if(!isnan(D)) thermal_model::data.fS = D; 16ee6: aa 96 adiw r28, 0x2a ; 42 16ee8: 2c ad ldd r18, Y+60 ; 0x3c 16eea: 3d ad ldd r19, Y+61 ; 0x3d 16eec: 4e ad ldd r20, Y+62 ; 0x3e 16eee: 5f ad ldd r21, Y+63 ; 0x3f 16ef0: aa 97 sbiw r28, 0x2a ; 42 16ef2: ca 01 movw r24, r20 16ef4: b9 01 movw r22, r18 16ef6: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16efa: 81 11 cpse r24, r1 16efc: 0e c0 rjmp .+28 ; 0x16f1a 16efe: aa 96 adiw r28, 0x2a ; 42 16f00: 8c ad ldd r24, Y+60 ; 0x3c 16f02: 9d ad ldd r25, Y+61 ; 0x3d 16f04: ae ad ldd r26, Y+62 ; 0x3e 16f06: bf ad ldd r27, Y+63 ; 0x3f 16f08: aa 97 sbiw r28, 0x2a ; 42 16f0a: 80 93 ea 12 sts 0x12EA, r24 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 16f0e: 90 93 eb 12 sts 0x12EB, r25 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 16f12: a0 93 ec 12 sts 0x12EC, r26 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 16f16: b0 93 ed 12 sts 0x12ED, r27 ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> if(L >= 0) thermal_model_set_lag(L); 16f1a: 17 fd sbrc r17, 7 16f1c: 03 c0 rjmp .+6 ; 0x16f24 16f1e: c8 01 movw r24, r16 16f20: 0f 94 89 2e call 0x25d12 ; 0x25d12 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 16f24: a6 96 adiw r28, 0x26 ; 38 16f26: 2c ad ldd r18, Y+60 ; 0x3c 16f28: 3d ad ldd r19, Y+61 ; 0x3d 16f2a: 4e ad ldd r20, Y+62 ; 0x3e 16f2c: 5f ad ldd r21, Y+63 ; 0x3f 16f2e: a6 97 sbiw r28, 0x26 ; 38 16f30: ca 01 movw r24, r20 16f32: b9 01 movw r22, r18 16f34: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16f38: 81 11 cpse r24, r1 16f3a: 0e c0 rjmp .+28 ; 0x16f58 16f3c: a6 96 adiw r28, 0x26 ; 38 16f3e: 2c ad ldd r18, Y+60 ; 0x3c 16f40: 3d ad ldd r19, Y+61 ; 0x3d 16f42: 4e ad ldd r20, Y+62 ; 0x3e 16f44: 5f ad ldd r21, Y+63 ; 0x3f 16f46: a6 97 sbiw r28, 0x26 ; 38 16f48: 20 93 30 13 sts 0x1330, r18 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 16f4c: 30 93 31 13 sts 0x1331, r19 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 16f50: 40 93 32 13 sts 0x1332, r20 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 16f54: 50 93 33 13 sts 0x1333, r21 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 16f58: a5 01 movw r20, r10 16f5a: 94 01 movw r18, r8 16f5c: c5 01 movw r24, r10 16f5e: b4 01 movw r22, r8 16f60: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16f64: 81 11 cpse r24, r1 16f66: 11 c0 rjmp .+34 ; 0x16f8a 16f68: 20 e0 ldi r18, 0x00 ; 0 16f6a: 30 e0 ldi r19, 0x00 ; 0 16f6c: a9 01 movw r20, r18 16f6e: c5 01 movw r24, r10 16f70: b4 01 movw r22, r8 16f72: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 16f76: 18 16 cp r1, r24 16f78: 44 f4 brge .+16 ; 0x16f8a 16f7a: 80 92 34 13 sts 0x1334, r8 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16f7e: 90 92 35 13 sts 0x1335, r9 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16f82: a0 92 36 13 sts 0x1336, r10 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16f86: b0 92 37 13 sts 0x1337, r11 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 16f8a: a3 01 movw r20, r6 16f8c: 92 01 movw r18, r4 16f8e: c3 01 movw r24, r6 16f90: b2 01 movw r22, r4 16f92: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 16f96: 81 11 cpse r24, r1 16f98: 11 c0 rjmp .+34 ; 0x16fbc 16f9a: 20 e0 ldi r18, 0x00 ; 0 16f9c: 30 e0 ldi r19, 0x00 ; 0 16f9e: a9 01 movw r20, r18 16fa0: c3 01 movw r24, r6 16fa2: b2 01 movw r22, r4 16fa4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 16fa8: 18 16 cp r1, r24 16faa: 44 f4 brge .+16 ; 0x16fbc 16fac: 40 92 38 13 sts 0x1338, r4 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 16fb0: 50 92 39 13 sts 0x1339, r5 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 16fb4: 60 92 3a 13 sts 0x133A, r6 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 16fb8: 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) 16fbc: c0 90 38 13 lds r12, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 16fc0: d0 90 39 13 lds r13, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 16fc4: e0 90 3a 13 lds r14, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 16fc8: f0 90 3b 13 lds r15, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 16fcc: a7 01 movw r20, r14 16fce: 96 01 movw r18, r12 16fd0: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16fd4: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16fd8: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16fdc: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 16fe0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 16fe4: 18 16 cp r1, r24 16fe6: 44 f4 brge .+16 ; 0x16ff8 thermal_model::data.warn = thermal_model::data.err; 16fe8: c0 92 34 13 sts 0x1334, r12 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 16fec: d0 92 35 13 sts 0x1335, r13 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 16ff0: e0 92 36 13 sts 0x1336, r14 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 16ff4: f0 92 37 13 sts 0x1337, r15 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::setup(); 16ff8: 0f 94 10 2f call 0x25e20 ; 0x25e20 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; 16ffc: ce 01 movw r24, r28 16ffe: 01 96 adiw r24, 0x01 ; 1 17000: 0f 94 94 31 call 0x26328 ; 0x26328 17004: c8 c0 rjmp .+400 ; 0x17196 */ 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; 17006: 4f ef ldi r20, 0xFF ; 255 17008: ab 96 adiw r28, 0x2b ; 43 1700a: 4f af std Y+63, r20 ; 0x3f 1700c: ab 97 sbiw r28, 0x2b ; 43 1700e: d0 cd rjmp .-1120 ; 0x16bb0 - `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; 17010: 80 e0 ldi r24, 0x00 ; 0 17012: 90 e0 ldi r25, 0x00 ; 0 17014: a0 ec ldi r26, 0xC0 ; 192 17016: bf e7 ldi r27, 0x7F ; 127 17018: e2 96 adiw r28, 0x32 ; 50 1701a: 8c af std Y+60, r24 ; 0x3c 1701c: 9d af std Y+61, r25 ; 0x3d 1701e: ae af std Y+62, r26 ; 0x3e 17020: bf af std Y+63, r27 ; 0x3f 17022: e2 97 sbiw r28, 0x32 ; 50 17024: d3 cd rjmp .-1114 ; 0x16bcc 17026: 20 e0 ldi r18, 0x00 ; 0 17028: 30 e0 ldi r19, 0x00 ; 0 1702a: 40 ec ldi r20, 0xC0 ; 192 1702c: 5f e7 ldi r21, 0x7F ; 127 1702e: 6e 96 adiw r28, 0x1e ; 30 17030: 2c af std Y+60, r18 ; 0x3c 17032: 3d af std Y+61, r19 ; 0x3d 17034: 4e af std Y+62, r20 ; 0x3e 17036: 5f af std Y+63, r21 ; 0x3f 17038: 6e 97 sbiw r28, 0x1e ; 30 1703a: e5 cd rjmp .-1078 ; 0x16c06 1703c: 80 e0 ldi r24, 0x00 ; 0 1703e: 90 e0 ldi r25, 0x00 ; 0 17040: a0 ec ldi r26, 0xC0 ; 192 17042: bf e7 ldi r27, 0x7F ; 127 17044: a2 96 adiw r28, 0x22 ; 34 17046: 8c af std Y+60, r24 ; 0x3c 17048: 9d af std Y+61, r25 ; 0x3d 1704a: ae af std Y+62, r26 ; 0x3e 1704c: bf af std Y+63, r27 ; 0x3f 1704e: a2 97 sbiw r28, 0x22 ; 34 17050: e8 cd rjmp .-1072 ; 0x16c22 17052: 20 e0 ldi r18, 0x00 ; 0 17054: 30 e0 ldi r19, 0x00 ; 0 17056: 40 ec ldi r20, 0xC0 ; 192 17058: 5f e7 ldi r21, 0x7F ; 127 1705a: 6a 96 adiw r28, 0x1a ; 26 1705c: 2c af std Y+60, r18 ; 0x3c 1705e: 3d af std Y+61, r19 ; 0x3d 17060: 4e af std Y+62, r20 ; 0x3e 17062: 5f af std Y+63, r21 ; 0x3f 17064: 6a 97 sbiw r28, 0x1a ; 26 17066: eb cd rjmp .-1066 ; 0x16c3e 17068: 80 e0 ldi r24, 0x00 ; 0 1706a: 90 e0 ldi r25, 0x00 ; 0 1706c: a0 ec ldi r26, 0xC0 ; 192 1706e: bf e7 ldi r27, 0x7F ; 127 17070: aa 96 adiw r28, 0x2a ; 42 17072: 8c af std Y+60, r24 ; 0x3c 17074: 9d af std Y+61, r25 ; 0x3d 17076: ae af std Y+62, r26 ; 0x3e 17078: bf af std Y+63, r27 ; 0x3f 1707a: aa 97 sbiw r28, 0x2a ; 42 1707c: ee cd rjmp .-1060 ; 0x16c5a int8_t I = -1, S = -1, B = -1, F = -1; 1707e: 9f ef ldi r25, 0xFF ; 255 17080: e3 96 adiw r28, 0x33 ; 51 17082: 9f af std Y+63, r25 ; 0x3f 17084: e3 97 sbiw r28, 0x33 ; 51 17086: fe cd rjmp .-1028 ; 0x16c84 17088: af ef ldi r26, 0xFF ; 255 1708a: e7 96 adiw r28, 0x37 ; 55 1708c: af af std Y+63, r26 ; 0x3f 1708e: e7 97 sbiw r28, 0x37 ; 55 17090: 04 ce rjmp .-1016 ; 0x16c9a - `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; 17092: 20 e0 ldi r18, 0x00 ; 0 17094: 30 e0 ldi r19, 0x00 ; 0 17096: 40 ec ldi r20, 0xC0 ; 192 17098: 5f e7 ldi r21, 0x7F ; 127 1709a: a6 96 adiw r28, 0x26 ; 38 1709c: 2c af std Y+60, r18 ; 0x3c 1709e: 3d af std Y+61, r19 ; 0x3d 170a0: 4e af std Y+62, r20 ; 0x3e 170a2: 5f af std Y+63, r21 ; 0x3f 170a4: a6 97 sbiw r28, 0x26 ; 38 170a6: 07 ce rjmp .-1010 ; 0x16cb6 int8_t I = -1, S = -1, B = -1, F = -1; 170a8: 3f ef ldi r19, 0xFF ; 255 170aa: eb 96 adiw r28, 0x3b ; 59 170ac: 3f af std Y+63, r19 ; 0x3f 170ae: eb 97 sbiw r28, 0x3b ; 59 170b0: 36 ce rjmp .-916 ; 0x16d1e 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(); 170b2: 0f 94 c8 2d call 0x25b90 ; 0x25b90 170b6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea break; } // update all parameters if(B >= 0) 170ba: e7 96 adiw r28, 0x37 ; 55 170bc: 9f ad ldd r25, Y+63 ; 0x3f 170be: e7 97 sbiw r28, 0x37 ; 55 170c0: 97 fd sbrc r25, 7 170c2: 09 c0 rjmp .+18 ; 0x170d6 thermal_model_set_warn_beep(B); 170c4: 81 e0 ldi r24, 0x01 ; 1 170c6: e7 96 adiw r28, 0x37 ; 55 170c8: af ad ldd r26, Y+63 ; 0x3f 170ca: e7 97 sbiw r28, 0x37 ; 55 170cc: a1 11 cpse r26, r1 170ce: 01 c0 rjmp .+2 ; 0x170d2 170d0: 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; 170d2: 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)) 170d6: a7 01 movw r20, r14 170d8: 96 01 movw r18, r12 170da: c7 01 movw r24, r14 170dc: b6 01 movw r22, r12 170de: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 170e2: 88 23 and r24, r24 170e4: 09 f4 brne .+2 ; 0x170e8 170e6: 97 ce rjmp .-722 ; 0x16e16 170e8: 6e 96 adiw r28, 0x1e ; 30 170ea: 2c ad ldd r18, Y+60 ; 0x3c 170ec: 3d ad ldd r19, Y+61 ; 0x3d 170ee: 4e ad ldd r20, Y+62 ; 0x3e 170f0: 5f ad ldd r21, Y+63 ; 0x3f 170f2: 6e 97 sbiw r28, 0x1e ; 30 170f4: ca 01 movw r24, r20 170f6: b9 01 movw r22, r18 170f8: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 170fc: 88 23 and r24, r24 170fe: 09 f4 brne .+2 ; 0x17102 17100: 8a ce rjmp .-748 ; 0x16e16 17102: a2 96 adiw r28, 0x22 ; 34 17104: 2c ad ldd r18, Y+60 ; 0x3c 17106: 3d ad ldd r19, Y+61 ; 0x3d 17108: 4e ad ldd r20, Y+62 ; 0x3e 1710a: 5f ad ldd r21, Y+63 ; 0x3f 1710c: a2 97 sbiw r28, 0x22 ; 34 1710e: ca 01 movw r24, r20 17110: b9 01 movw r22, r18 17112: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 17116: 88 23 and r24, r24 17118: 09 f4 brne .+2 ; 0x1711c 1711a: 7d ce rjmp .-774 ; 0x16e16 1711c: 6a 96 adiw r28, 0x1a ; 26 1711e: 2c ad ldd r18, Y+60 ; 0x3c 17120: 3d ad ldd r19, Y+61 ; 0x3d 17122: 4e ad ldd r20, Y+62 ; 0x3e 17124: 5f ad ldd r21, Y+63 ; 0x3f 17126: 6a 97 sbiw r28, 0x1a ; 26 17128: ca 01 movw r24, r20 1712a: b9 01 movw r22, r18 1712c: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 17130: 88 23 and r24, r24 17132: 09 f4 brne .+2 ; 0x17136 17134: 70 ce rjmp .-800 ; 0x16e16 17136: aa 96 adiw r28, 0x2a ; 42 17138: 2c ad ldd r18, Y+60 ; 0x3c 1713a: 3d ad ldd r19, Y+61 ; 0x3d 1713c: 4e ad ldd r20, Y+62 ; 0x3e 1713e: 5f ad ldd r21, Y+63 ; 0x3f 17140: aa 97 sbiw r28, 0x2a ; 42 17142: ca 01 movw r24, r20 17144: b9 01 movw r22, r18 17146: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1714a: 88 23 and r24, r24 1714c: 09 f4 brne .+2 ; 0x17150 1714e: 63 ce rjmp .-826 ; 0x16e16 17150: 17 fd sbrc r17, 7 17152: 02 c0 rjmp .+4 ; 0x17158 17154: 0c 94 86 cc jmp 0x1990c ; 0x1990c 17158: a6 96 adiw r28, 0x26 ; 38 1715a: 2c ad ldd r18, Y+60 ; 0x3c 1715c: 3d ad ldd r19, Y+61 ; 0x3d 1715e: 4e ad ldd r20, Y+62 ; 0x3e 17160: 5f ad ldd r21, Y+63 ; 0x3f 17162: a6 97 sbiw r28, 0x26 ; 38 17164: ca 01 movw r24, r20 17166: b9 01 movw r22, r18 17168: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1716c: 88 23 and r24, r24 1716e: 09 f4 brne .+2 ; 0x17172 17170: 52 ce rjmp .-860 ; 0x16e16 17172: a5 01 movw r20, r10 17174: 94 01 movw r18, r8 17176: c5 01 movw r24, r10 17178: b4 01 movw r22, r8 1717a: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1717e: 88 23 and r24, r24 17180: 09 f4 brne .+2 ; 0x17184 17182: 49 ce rjmp .-878 ; 0x16e16 17184: a3 01 movw r20, r6 17186: 92 01 movw r18, r4 17188: c3 01 movw r24, r6 1718a: b2 01 movw r22, r4 1718c: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 17190: 88 23 and r24, r24 17192: 09 f4 brne .+2 ; 0x17196 17194: 40 ce rjmp .-896 ; 0x16e16 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 17196: ab 96 adiw r28, 0x2b ; 43 17198: 3f ad ldd r19, Y+63 ; 0x3f 1719a: ab 97 sbiw r28, 0x2b ; 43 1719c: 37 fd sbrc r19, 7 1719e: 3b c0 rjmp .+118 ; 0x17216 171a0: e2 96 adiw r28, 0x32 ; 50 171a2: 2c ad ldd r18, Y+60 ; 0x3c 171a4: 3d ad ldd r19, Y+61 ; 0x3d 171a6: 4e ad ldd r20, Y+62 ; 0x3e 171a8: 5f ad ldd r21, Y+63 ; 0x3f 171aa: e2 97 sbiw r28, 0x32 ; 50 171ac: ca 01 movw r24, r20 171ae: b9 01 movw r22, r18 171b0: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 171b4: 81 11 cpse r24, r1 171b6: 2f c0 rjmp .+94 ; 0x17216 thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 171b8: ab 96 adiw r28, 0x2b ; 43 171ba: 4f ad ldd r20, Y+63 ; 0x3f 171bc: ab 97 sbiw r28, 0x2b ; 43 171be: 40 31 cpi r20, 0x10 ; 16 171c0: 54 f5 brge .+84 ; 0x17216 171c2: 20 e0 ldi r18, 0x00 ; 0 171c4: 30 e0 ldi r19, 0x00 ; 0 171c6: a9 01 movw r20, r18 171c8: e2 96 adiw r28, 0x32 ; 50 171ca: 6c ad ldd r22, Y+60 ; 0x3c 171cc: 7d ad ldd r23, Y+61 ; 0x3d 171ce: 8e ad ldd r24, Y+62 ; 0x3e 171d0: 9f ad ldd r25, Y+63 ; 0x3f 171d2: e2 97 sbiw r28, 0x32 ; 50 171d4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 171d8: 18 16 cp r1, r24 171da: ec f4 brge .+58 ; 0x17216 return; TempMgrGuard temp_mgr_guard; 171dc: ce 01 movw r24, r28 171de: 01 96 adiw r24, 0x01 ; 1 171e0: 0f 94 a1 31 call 0x26342 ; 0x26342 thermal_model::data.R[index] = R; 171e4: ab 96 adiw r28, 0x2b ; 43 171e6: 5f ad ldd r21, Y+63 ; 0x3f 171e8: ab 97 sbiw r28, 0x2b ; 43 171ea: 84 e0 ldi r24, 0x04 ; 4 171ec: 58 02 muls r21, r24 171ee: f0 01 movw r30, r0 171f0: 11 24 eor r1, r1 171f2: e0 51 subi r30, 0x10 ; 16 171f4: fd 4e sbci r31, 0xED ; 237 171f6: e2 96 adiw r28, 0x32 ; 50 171f8: 2c ad ldd r18, Y+60 ; 0x3c 171fa: 3d ad ldd r19, Y+61 ; 0x3d 171fc: 4e ad ldd r20, Y+62 ; 0x3e 171fe: 5f ad ldd r21, Y+63 ; 0x3f 17200: e2 97 sbiw r28, 0x32 ; 50 17202: 20 83 st Z, r18 17204: 31 83 std Z+1, r19 ; 0x01 17206: 42 83 std Z+2, r20 ; 0x02 17208: 53 83 std Z+3, r21 ; 0x03 thermal_model::setup(); 1720a: 0f 94 10 2f call 0x25e20 ; 0x25e20 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 1720e: ce 01 movw r24, r28 17210: 01 96 adiw r24, 0x01 ; 1 17212: 0f 94 94 31 call 0x26328 ; 0x26328 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17216: e3 96 adiw r28, 0x33 ; 51 17218: 3f ad ldd r19, Y+63 ; 0x3f 1721a: e3 97 sbiw r28, 0x33 ; 51 1721c: 37 fd sbrc r19, 7 1721e: 06 c0 rjmp .+12 ; 0x1722c 17220: 81 e0 ldi r24, 0x01 ; 1 17222: 31 11 cpse r19, r1 17224: 01 c0 rjmp .+2 ; 0x17228 17226: 80 e0 ldi r24, 0x00 ; 0 17228: 0f 94 44 32 call 0x26488 ; 0x26488 // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 1722c: 37 fe sbrs r3, 7 1722e: 02 c0 rjmp .+4 ; 0x17234 17230: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 17234: 11 e0 ldi r17, 0x01 ; 1 17236: eb 96 adiw r28, 0x3b ; 59 17238: 4f ad ldd r20, Y+63 ; 0x3f 1723a: eb 97 sbiw r28, 0x3b ; 59 1723c: 14 16 cp r1, r20 1723e: 0c f0 brlt .+2 ; 0x17242 17240: 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; 17242: 81 e0 ldi r24, 0x01 ; 1 17244: 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); 17248: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1724c: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 17250: 89 1b sub r24, r25 17252: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17254: 41 f4 brne .+16 ; 0x17266 17256: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1725a: 85 30 cpi r24, 0x05 ; 5 1725c: 69 f1 breq .+90 ; 0x172b8 1725e: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 17262: 88 23 and r24, r24 17264: 49 f1 breq .+82 ; 0x172b8 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17266: 8b e2 ldi r24, 0x2B ; 43 17268: 94 e8 ldi r25, 0x84 ; 132 1726a: 9f 93 push r25 1726c: 8f 93 push r24 1726e: 81 e0 ldi r24, 0x01 ; 1 17270: 90 e0 ldi r25, 0x00 ; 0 17272: 8c 0f add r24, r28 17274: 9d 1f adc r25, r29 17276: 9f 93 push r25 17278: 8f 93 push r24 1727a: 0f 94 3a db call 0x3b674 ; 0x3b674 lcd_setstatus_serial(tm_message); 1727e: ce 01 movw r24, r28 17280: 01 96 adiw r24, 0x01 ; 1 17282: 0e 94 53 f1 call 0x1e2a6 ; 0x1e2a6 return; 17286: 0f 90 pop r0 17288: 0f 90 pop r0 1728a: 0f 90 pop r0 1728c: 0f 90 pop r0 1728e: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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; 17292: 20 e0 ldi r18, 0x00 ; 0 17294: 30 e0 ldi r19, 0x00 ; 0 17296: a9 01 movw r20, r18 17298: c7 01 movw r24, r14 1729a: b6 01 movw r22, r12 1729c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 172a0: 18 16 cp r1, r24 172a2: 0c f0 brlt .+2 ; 0x172a6 172a4: c5 cd rjmp .-1142 ; 0x16e30 172a6: c0 92 da 12 sts 0x12DA, r12 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 172aa: d0 92 db 12 sts 0x12DB, r13 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 172ae: e0 92 dc 12 sts 0x12DC, r14 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 172b2: f0 92 dd 12 sts 0x12DD, r15 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 172b6: bc cd rjmp .-1160 ; 0x16e30 lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 172b8: 83 e0 ldi r24, 0x03 ; 3 172ba: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 172be: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 172c2: 82 60 ori r24, 0x02 ; 2 172c4: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 lcd_return_to_status(); 172c8: 0f 94 ad 1e call 0x23d5a ; 0x23d5a // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 172cc: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 172d0: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 172d4: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 172d8: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 172dc: 6e 96 adiw r28, 0x1e ; 30 172de: 2c af std Y+60, r18 ; 0x3c 172e0: 3d af std Y+61, r19 ; 0x3d 172e2: 4e af std Y+62, r20 ; 0x3e 172e4: 5f af std Y+63, r21 ; 0x3f 172e6: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 172e8: 80 e4 ldi r24, 0x40 ; 64 172ea: e0 ef ldi r30, 0xF0 ; 240 172ec: f2 e1 ldi r31, 0x12 ; 18 172ee: de 01 movw r26, r28 172f0: 11 96 adiw r26, 0x01 ; 1 172f2: 01 90 ld r0, Z+ 172f4: 0d 92 st X+, r0 172f6: 8a 95 dec r24 172f8: e1 f7 brne .-8 ; 0x172f2 orig_enabled = thermal_model::enabled; 172fa: 30 91 1d 05 lds r19, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 172fe: 67 96 adiw r28, 0x17 ; 23 17300: 3f af std Y+63, r19 ; 0x3f 17302: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17304: 81 2f mov r24, r17 17306: 0f 94 66 32 call 0x264cc ; 0x264cc // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 1730a: 85 e1 ldi r24, 0x15 ; 21 1730c: 94 e8 ldi r25, 0x84 ; 132 1730e: 0e 94 82 79 call 0xf304 ; 0xf304 thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17312: 21 14 cp r2, r1 17314: 31 04 cpc r3, r1 17316: 19 f4 brne .+6 ; 0x1731e 17318: 56 ee ldi r21, 0xE6 ; 230 1731a: 25 2e mov r2, r21 1731c: 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); 1731e: 80 e0 ldi r24, 0x00 ; 0 17320: 0f 94 be 2d call 0x25b7c ; 0x25b7c 17324: 32 e0 ldi r19, 0x02 ; 2 17326: 43 2e mov r4, r19 17328: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 1732a: 49 ef ldi r20, 0xF9 ; 249 1732c: 64 2e mov r6, r20 1732e: 43 e8 ldi r20, 0x83 ; 131 17330: 74 2e mov r7, r20 17332: ae 01 movw r20, r28 17334: 4f 5b subi r20, 0xBF ; 191 17336: 5f 4f sbci r21, 0xFF ; 255 17338: 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); 1733a: 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; 1733c: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 17340: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17344: 20 e0 ldi r18, 0x00 ; 0 17346: 30 e0 ldi r19, 0x00 ; 0 17348: 48 e4 ldi r20, 0x48 ; 72 1734a: 52 e4 ldi r21, 0x42 ; 66 1734c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 17350: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 17354: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 17358: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1735c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 17360: 87 fd sbrc r24, 7 17362: 58 c0 rjmp .+176 ; 0x17414 sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 17364: 1f 92 push r1 17366: 1f 93 push r17 17368: 8f ed ldi r24, 0xDF ; 223 1736a: 93 e8 ldi r25, 0x83 ; 131 1736c: 9f 93 push r25 1736e: 8f 93 push r24 17370: 9f 92 push r9 17372: 8f 92 push r8 17374: 0f 94 3a db call 0x3b674 ; 0x3b674 lcd_setstatus_serial(tm_message); 17378: c4 01 movw r24, r8 1737a: 0e 94 53 f1 call 0x1e2a6 ; 0x1e2a6 } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 1737e: 00 91 e7 03 lds r16, 0x03E7 ; 0x8003e7 set_fan_speed(255); 17382: 8f ef ldi r24, 0xFF ; 255 17384: 0f 94 be 2d call 0x25b7c ; 0x25b7c 17388: 0f 90 pop r0 1738a: 0f 90 pop r0 1738c: 0f 90 pop r0 1738e: 0f 90 pop r0 17390: 0f 90 pop r0 17392: 0f 90 pop r0 while(current_temperature[0] >= temp) { 17394: c0 90 b0 0d lds r12, 0x0DB0 ; 0x800db0 17398: d0 90 b1 0d lds r13, 0x0DB1 ; 0x800db1 1739c: e0 90 b2 0d lds r14, 0x0DB2 ; 0x800db2 173a0: f0 90 b3 0d lds r15, 0x0DB3 ; 0x800db3 173a4: 20 e0 ldi r18, 0x00 ; 0 173a6: 30 e0 ldi r19, 0x00 ; 0 173a8: 48 e4 ldi r20, 0x48 ; 72 173aa: 52 e4 ldi r21, 0x42 ; 66 173ac: c7 01 movw r24, r14 173ae: b6 01 movw r22, r12 173b0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 173b4: 87 fd sbrc r24, 7 173b6: 27 c0 rjmp .+78 ; 0x17406 if(temp_error_state.v) break; 173b8: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 173bc: 81 11 cpse r24, r1 173be: 23 c0 rjmp .+70 ; 0x17406 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 173c0: 20 91 56 06 lds r18, 0x0656 ; 0x800656 173c4: 30 91 57 06 lds r19, 0x0657 ; 0x800657 173c8: 40 91 58 06 lds r20, 0x0658 ; 0x800658 173cc: 50 91 59 06 lds r21, 0x0659 ; 0x800659 173d0: 60 91 30 13 lds r22, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 173d4: 70 91 31 13 lds r23, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 173d8: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 173dc: 90 91 33 13 lds r25, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 173e0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 173e4: 20 e0 ldi r18, 0x00 ; 0 173e6: 30 e0 ldi r19, 0x00 ; 0 173e8: 40 ea ldi r20, 0xA0 ; 160 173ea: 50 e4 ldi r21, 0x40 ; 64 173ec: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 173f0: 9b 01 movw r18, r22 173f2: ac 01 movw r20, r24 173f4: c7 01 movw r24, r14 173f6: b6 01 movw r22, r12 173f8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 173fc: 87 fd sbrc r24, 7 173fe: 03 c0 rjmp .+6 ; 0x17406 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 17400: 0f 94 8b 3a call 0x27516 ; 0x27516 17404: c7 cf rjmp .-114 ; 0x17394 } set_fan_speed(old_speed); 17406: 80 2f mov r24, r16 17408: 0f 94 be 2d call 0x25b7c ; 0x25b7c 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); 1740c: 80 e1 ldi r24, 0x10 ; 16 1740e: 97 e2 ldi r25, 0x27 ; 39 17410: 0f 94 b8 3a call 0x27570 ; 0x27570 } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 17414: 7f 92 push r7 17416: 6f 92 push r6 17418: e1 ed ldi r30, 0xD1 ; 209 1741a: f3 e8 ldi r31, 0x83 ; 131 1741c: ff 93 push r31 1741e: ef 93 push r30 17420: 9f 92 push r9 17422: 8f 92 push r8 17424: 0f 94 3a db call 0x3b674 ; 0x3b674 lcd_setstatus_serial(tm_message); 17428: c4 01 movw r24, r8 1742a: 0e 94 53 f1 call 0x1e2a6 ; 0x1e2a6 target_temperature[0] = cal_temp; 1742e: 30 92 b7 0d sts 0x0DB7, r3 ; 0x800db7 17432: 20 92 b6 0d sts 0x0DB6, r2 ; 0x800db6 samples = record(); 17436: 0f 94 d3 0f call 0x21fa6 ; 0x21fa6 1743a: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 1743c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 17440: 0f 90 pop r0 17442: 0f 90 pop r0 17444: 0f 90 pop r0 17446: 0f 90 pop r0 17448: 0f 90 pop r0 1744a: 0f 90 pop r0 1744c: 81 11 cpse r24, r1 1744e: 7a c0 rjmp .+244 ; 0x17544 17450: a1 14 cp r10, r1 17452: b1 04 cpc r11, r1 17454: 09 f4 brne .+2 ; 0x17458 17456: 76 c0 rjmp .+236 ; 0x17544 return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 17458: 60 91 f0 12 lds r22, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 1745c: 70 91 f1 12 lds r23, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17460: 80 91 f2 12 lds r24, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 17464: 90 91 f3 12 lds r25, 0x12F3 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> 17468: 9b 01 movw r18, r22 1746a: ac 01 movw r20, r24 1746c: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 17470: 88 23 and r24, r24 17472: 61 f0 breq .+24 ; 0x1748c thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 17474: 80 e0 ldi r24, 0x00 ; 0 17476: 90 e0 ldi r25, 0x00 ; 0 17478: a8 e4 ldi r26, 0x48 ; 72 1747a: b2 e4 ldi r27, 0x42 ; 66 1747c: 80 93 f0 12 sts 0x12F0, r24 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 17480: 90 93 f1 12 sts 0x12F1, r25 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17484: a0 93 f2 12 sts 0x12F2, r26 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 17488: b0 93 f3 12 sts 0x12F3, r27 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> e = estimate(samples, &thermal_model::data.C, 1748c: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17490: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17494: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17498: f0 90 59 06 lds r15, 0x0659 ; 0x800659 1749c: 00 e0 ldi r16, 0x00 ; 0 1749e: 20 e0 ldi r18, 0x00 ; 0 174a0: 30 e0 ldi r19, 0x00 ; 0 174a2: 40 ea ldi r20, 0xA0 ; 160 174a4: 51 e4 ldi r21, 0x41 ; 65 174a6: 66 ee ldi r22, 0xE6 ; 230 174a8: 72 e1 ldi r23, 0x12 ; 18 174aa: c5 01 movw r24, r10 174ac: 0e 94 be e6 call 0x1cd7c ; 0x1cd7c 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)) 174b0: 9b 01 movw r18, r22 174b2: ac 01 movw r20, r24 174b4: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 174b8: 81 11 cpse r24, r1 174ba: 44 c0 rjmp .+136 ; 0x17544 return true; wait_temp(); 174bc: 0f 94 96 3a call 0x2752c ; 0x2752c if(i) break; // we don't need to refine R 174c0: 4a 94 dec r4 174c2: 45 28 or r4, r5 174c4: 09 f4 brne .+2 ; 0x174c8 174c6: 85 c0 rjmp .+266 ; 0x175d2 wait(30000); // settle PID regulation 174c8: 80 e3 ldi r24, 0x30 ; 48 174ca: 95 e7 ldi r25, 0x75 ; 117 174cc: 0f 94 b8 3a call 0x27570 ; 0x27570 sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 174d0: 3f 92 push r3 174d2: 2f 92 push r2 174d4: 7f 92 push r7 174d6: 6f 92 push r6 174d8: 44 ec ldi r20, 0xC4 ; 196 174da: 53 e8 ldi r21, 0x83 ; 131 174dc: 5f 93 push r21 174de: 4f 93 push r20 174e0: 9f 92 push r9 174e2: 8f 92 push r8 174e4: 0f 94 3a db call 0x3b674 ; 0x3b674 lcd_setstatus_serial(tm_message); 174e8: c4 01 movw r24, r8 174ea: 0e 94 53 f1 call 0x1e2a6 ; 0x1e2a6 samples = record(); 174ee: 0f 94 d3 0f call 0x21fa6 ; 0x21fa6 if(temp_error_state.v || !samples) 174f2: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 174f6: 0f b6 in r0, 0x3f ; 63 174f8: f8 94 cli 174fa: de bf out 0x3e, r29 ; 62 174fc: 0f be out 0x3f, r0 ; 63 174fe: cd bf out 0x3d, r28 ; 61 17500: 21 11 cpse r18, r1 17502: 20 c0 rjmp .+64 ; 0x17544 17504: 00 97 sbiw r24, 0x00 ; 0 17506: f1 f0 breq .+60 ; 0x17544 return true; e = estimate(samples, &thermal_model::data.R[0], 17508: c0 90 56 06 lds r12, 0x0656 ; 0x800656 1750c: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17510: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17514: f0 90 59 06 lds r15, 0x0659 ; 0x800659 17518: 20 e0 ldi r18, 0x00 ; 0 1751a: 30 e0 ldi r19, 0x00 ; 0 1751c: 48 e4 ldi r20, 0x48 ; 72 1751e: 52 e4 ldi r21, 0x42 ; 66 17520: 60 ef ldi r22, 0xF0 ; 240 17522: 72 e1 ldi r23, 0x12 ; 18 17524: 0e 94 be e6 call 0x1cd7c ; 0x1cd7c // 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")); 17528: 02 ef ldi r16, 0xF2 ; 242 1752a: 60 2e mov r6, r16 1752c: 03 e8 ldi r16, 0x83 ; 131 1752e: 70 2e mov r7, r16 17530: 44 24 eor r4, r4 17532: 43 94 inc r4 17534: 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)) 17536: 9b 01 movw r18, r22 17538: ac 01 movw r20, r24 1753a: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1753e: 88 23 and r24, r24 17540: 09 f4 brne .+2 ; 0x17544 17542: fc ce rjmp .-520 ; 0x1733c 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; 17544: 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); 17546: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> // always reset temperature disable_heater(); 1754a: 0f 94 1f 2f call 0x25e3e ; 0x25e3e if(thermal_model_autotune_err) { 1754e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 17552: 88 23 and r24, r24 17554: 09 f4 brne .+2 ; 0x17558 17556: fd c0 rjmp .+506 ; 0x17752 sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 17558: 81 e0 ldi r24, 0x01 ; 1 1755a: 94 e8 ldi r25, 0x84 ; 132 1755c: 9f 93 push r25 1755e: 8f 93 push r24 17560: 9f 92 push r9 17562: 8f 92 push r8 17564: 0f 94 3a db call 0x3b674 ; 0x3b674 lcd_setstatus_serial(tm_message); 17568: c4 01 movw r24, r8 1756a: 0e 94 53 f1 call 0x1e2a6 ; 0x1e2a6 if(temp_error_state.v) 1756e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 17572: 0f 90 pop r0 17574: 0f 90 pop r0 17576: 0f 90 pop r0 17578: 0f 90 pop r0 1757a: 88 23 and r24, r24 1757c: 19 f0 breq .+6 ; 0x17584 thermal_model_cal::set_fan_speed(255); 1757e: 8f ef ldi r24, 0xFF ; 255 17580: 0f 94 be 2d call 0x25b7c ; 0x25b7c // show calibrated values before overwriting them thermal_model_report_settings(); 17584: 0f 94 c8 2d call 0x25b90 ; 0x25b90 // restore original state thermal_model::data.C = orig_C; 17588: 6e 96 adiw r28, 0x1e ; 30 1758a: 2c ad ldd r18, Y+60 ; 0x3c 1758c: 3d ad ldd r19, Y+61 ; 0x3d 1758e: 4e ad ldd r20, Y+62 ; 0x3e 17590: 5f ad ldd r21, Y+63 ; 0x3f 17592: 6e 97 sbiw r28, 0x1e ; 30 17594: 20 93 e6 12 sts 0x12E6, r18 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 17598: 30 93 e7 12 sts 0x12E7, r19 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 1759c: 40 93 e8 12 sts 0x12E8, r20 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 175a0: 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)); 175a4: 80 e4 ldi r24, 0x40 ; 64 175a6: fe 01 movw r30, r28 175a8: 31 96 adiw r30, 0x01 ; 1 175aa: a0 ef ldi r26, 0xF0 ; 240 175ac: b2 e1 ldi r27, 0x12 ; 18 175ae: 01 90 ld r0, Z+ 175b0: 0d 92 st X+, r0 175b2: 8a 95 dec r24 175b4: e1 f7 brne .-8 ; 0x175ae thermal_model_set_enabled(orig_enabled); 175b6: 67 96 adiw r28, 0x17 ; 23 175b8: 8f ad ldd r24, Y+63 ; 0x3f 175ba: 67 97 sbiw r28, 0x17 ; 23 175bc: 0f 94 44 32 call 0x26488 ; 0x26488 thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 175c0: 0e 94 ff 70 call 0xe1fe ; 0xe1fe menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 175c4: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 175c8: 8d 7f andi r24, 0xFD ; 253 175ca: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 175ce: 0c 94 f5 aa jmp 0x155ea ; 0x155ea // 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); 175d2: 8f ef ldi r24, 0xFF ; 255 175d4: 0f 94 be 2d call 0x25b7c ; 0x25b7c wait(30000); 175d8: 80 e3 ldi r24, 0x30 ; 48 175da: 95 e7 ldi r25, 0x75 ; 117 175dc: 0f 94 b8 3a call 0x27570 ; 0x27570 175e0: fc e2 ldi r31, 0x2C ; 44 175e2: 6f 2e mov r6, r31 175e4: f3 e1 ldi r31, 0x13 ; 19 175e6: 7f 2e mov r7, r31 175e8: 1f ef ldi r17, 0xFF ; 255 175ea: af e0 ldi r26, 0x0F ; 15 175ec: aa 2e mov r10, r26 175ee: 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; 175f0: 21 2c mov r2, r1 175f2: 31 2c mov r3, r1 175f4: b0 ec ldi r27, 0xC0 ; 192 175f6: 4b 2e mov r4, r27 175f8: bf e7 ldi r27, 0x7F ; 127 175fa: 5b 2e mov r5, r27 175fc: f3 01 movw r30, r6 175fe: 20 82 st Z, r2 17600: 31 82 std Z+1, r3 ; 0x01 17602: 42 82 std Z+2, r4 ; 0x02 17604: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 17606: 81 2f mov r24, r17 17608: 0f 94 be 2d call 0x25b7c ; 0x25b7c wait(10000); 1760c: 80 e1 ldi r24, 0x10 ; 16 1760e: 97 e2 ldi r25, 0x27 ; 39 17610: 0f 94 b8 3a call 0x27570 ; 0x27570 sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 17614: bf 92 push r11 17616: af 92 push r10 17618: 20 eb ldi r18, 0xB0 ; 176 1761a: 33 e8 ldi r19, 0x83 ; 131 1761c: 3f 93 push r19 1761e: 2f 93 push r18 17620: 9f 92 push r9 17622: 8f 92 push r8 17624: 0f 94 3a db call 0x3b674 ; 0x3b674 lcd_setstatus_serial(tm_message); 17628: c4 01 movw r24, r8 1762a: 0e 94 53 f1 call 0x1e2a6 ; 0x1e2a6 samples = record(); 1762e: 0f 94 d3 0f call 0x21fa6 ; 0x21fa6 if(temp_error_state.v || !samples) 17632: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 17636: 0f 90 pop r0 17638: 0f 90 pop r0 1763a: 0f 90 pop r0 1763c: 0f 90 pop r0 1763e: 0f 90 pop r0 17640: 0f 90 pop r0 17642: 21 11 cpse r18, r1 17644: 7f cf rjmp .-258 ; 0x17544 17646: 00 97 sbiw r24, 0x00 ; 0 17648: 09 f4 brne .+2 ; 0x1764c 1764a: 7c cf rjmp .-264 ; 0x17544 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], 1764c: c0 90 56 06 lds r12, 0x0656 ; 0x800656 17650: d0 90 57 06 lds r13, 0x0657 ; 0x800657 17654: e0 90 58 06 lds r14, 0x0658 ; 0x800658 17658: f0 90 59 06 lds r15, 0x0659 ; 0x800659 1765c: 20 91 f0 12 lds r18, 0x12F0 ; 0x8012f0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x40> 17660: 30 91 f1 12 lds r19, 0x12F1 ; 0x8012f1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x41> 17664: 40 91 f2 12 lds r20, 0x12F2 ; 0x8012f2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x42> 17668: 50 91 f3 12 lds r21, 0x12F3 ; 0x8012f3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x43> 1766c: 0a 2d mov r16, r10 1766e: b3 01 movw r22, r6 17670: 0e 94 be e6 call 0x1cd7c ; 0x1cd7c 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)) 17674: 9b 01 movw r18, r22 17676: ac 01 movw r20, r24 17678: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1767c: 81 11 cpse r24, r1 1767e: 62 cf rjmp .-316 ; 0x17544 17680: 54 e0 ldi r21, 0x04 ; 4 17682: a5 1a sub r10, r21 17684: b1 08 sbc r11, r1 17686: 80 e1 ldi r24, 0x10 ; 16 17688: 68 1a sub r6, r24 1768a: 71 08 sbc r7, r1 1768c: 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) { 1768e: 9f ef ldi r25, 0xFF ; 255 17690: a9 16 cp r10, r25 17692: b9 06 cpc r11, r25 17694: 09 f0 breq .+2 ; 0x17698 17696: b2 cf rjmp .-156 ; 0x175fc 17698: 78 e2 ldi r23, 0x28 ; 40 1769a: e7 2e mov r14, r23 1769c: 73 e1 ldi r23, 0x13 ; 19 1769e: f7 2e mov r15, r23 176a0: 0e e0 ldi r16, 0x0E ; 14 176a2: 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; 176a4: ef e0 ldi r30, 0x0F ; 15 176a6: 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)) { 176a8: 8f e0 ldi r24, 0x0F ; 15 176aa: 90 e0 ldi r25, 0x00 ; 0 176ac: 80 1b sub r24, r16 176ae: 91 0b sbc r25, r17 176b0: 83 70 andi r24, 0x03 ; 3 176b2: 99 27 eor r25, r25 176b4: 89 2b or r24, r25 176b6: 59 f4 brne .+22 ; 0x176ce next = i; 176b8: 30 2e mov r3, r16 176ba: 01 50 subi r16, 0x01 ; 1 176bc: 11 09 sbc r17, r1 176be: f4 e0 ldi r31, 0x04 ; 4 176c0: ef 1a sub r14, r31 176c2: 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) { 176c4: 01 15 cp r16, r1 176c6: 11 05 cpc r17, r1 176c8: 79 f7 brne .-34 ; 0x176a8 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; 176ca: 80 e0 ldi r24, 0x00 ; 0 176cc: 3c cf rjmp .-392 ; 0x17546 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; 176ce: 8c ef ldi r24, 0xFC ; 252 176d0: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 176d2: 87 fd sbrc r24, 7 176d4: 80 e0 ldi r24, 0x00 ; 0 176d6: 08 2e mov r0, r24 176d8: 00 0c add r0, r0 176da: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 176dc: fc 01 movw r30, r24 176de: ee 0f add r30, r30 176e0: ff 1f adc r31, r31 176e2: ee 0f add r30, r30 176e4: ff 1f adc r31, r31 176e6: e0 51 subi r30, 0x10 ; 16 176e8: fd 4e sbci r31, 0xED ; 237 176ea: 40 80 ld r4, Z 176ec: 51 80 ldd r5, Z+1 ; 0x01 176ee: 62 80 ldd r6, Z+2 ; 0x02 176f0: 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; 176f2: b8 01 movw r22, r16 176f4: 68 1b sub r22, r24 176f6: 79 0b sbc r23, r25 176f8: 07 2e mov r0, r23 176fa: 00 0c add r0, r0 176fc: 88 0b sbc r24, r24 176fe: 99 0b sbc r25, r25 17700: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 17704: 20 e0 ldi r18, 0x00 ; 0 17706: 30 e0 ldi r19, 0x00 ; 0 17708: 40 e8 ldi r20, 0x80 ; 128 1770a: 5e e3 ldi r21, 0x3E ; 62 1770c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 17710: 5b 01 movw r10, r22 17712: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17714: a3 2d mov r26, r3 17716: b4 e0 ldi r27, 0x04 ; 4 17718: ab 02 muls r26, r27 1771a: f0 01 movw r30, r0 1771c: 11 24 eor r1, r1 1771e: e0 51 subi r30, 0x10 ; 16 17720: fd 4e sbci r31, 0xED ; 237 17722: a3 01 movw r20, r6 17724: 92 01 movw r18, r4 17726: 60 81 ld r22, Z 17728: 71 81 ldd r23, Z+1 ; 0x01 1772a: 82 81 ldd r24, Z+2 ; 0x02 1772c: 93 81 ldd r25, Z+3 ; 0x03 1772e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 17732: 9b 01 movw r18, r22 17734: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 17736: c6 01 movw r24, r12 17738: b5 01 movw r22, r10 1773a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1773e: a3 01 movw r20, r6 17740: 92 01 movw r18, r4 17742: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 17746: f7 01 movw r30, r14 17748: 60 83 st Z, r22 1774a: 71 83 std Z+1, r23 ; 0x01 1774c: 82 83 std Z+2, r24 ; 0x02 1774e: 93 83 std Z+3, r25 ; 0x03 17750: b4 cf rjmp .-152 ; 0x176ba // 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); 17752: 88 e0 ldi r24, 0x08 ; 8 17754: 0e 94 99 ee call 0x1dd32 ; 0x1dd32 lcd_setstatuspgm(MSG_WELCOME); 17758: 83 e7 ldi r24, 0x73 ; 115 1775a: 90 e7 ldi r25, 0x70 ; 112 1775c: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 thermal_model_cal::set_fan_speed(0); 17760: 80 e0 ldi r24, 0x00 ; 0 17762: 0f 94 be 2d call 0x25b7c ; 0x25b7c thermal_model_set_enabled(orig_enabled); 17766: 67 96 adiw r28, 0x17 ; 23 17768: 8f ad ldd r24, Y+63 ; 0x3f 1776a: 67 97 sbiw r28, 0x17 ; 23 1776c: 0f 94 44 32 call 0x26488 ; 0x26488 thermal_model_report_settings(); 17770: 0f 94 c8 2d call 0x25b90 ; 0x25b90 17774: 25 cf rjmp .-438 ; 0x175c0 M400 */ case 400: { st_synchronize(); 17776: 0f 94 ef 42 call 0x285de ; 0x285de 1777a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea */ 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()) 1777e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 17782: 81 30 cpi r24, 0x01 ; 1 17784: 11 f0 breq .+4 ; 0x1778a 17786: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 1778a: 85 e4 ldi r24, 0x45 ; 69 1778c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 17790: 81 11 cpse r24, r1 17792: 0e 94 6f 5b call 0xb6de ; 0xb6de if(code_seen('F')) filament = code_value_uint8(); 17796: 86 e4 ldi r24, 0x46 ; 70 17798: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1779c: 81 11 cpse r24, r1 1779e: 0e 94 6f 5b call 0xb6de ; 0xb6de MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 177a2: 0f 94 8b 88 call 0x31116 ; 0x31116 177a6: 88 23 and r24, r24 177a8: 11 f4 brne .+4 ; 0x177ae 177aa: 0c 94 f5 aa jmp 0x155ea ; 0x155ea // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 177ae: 60 e0 ldi r22, 0x00 ; 0 177b0: 80 e0 ldi r24, 0x00 ; 0 177b2: 0f 94 7d ac call 0x358fa ; 0x358fa 177b6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 177ba: 80 e0 ldi r24, 0x00 ; 0 177bc: 0e 94 d6 74 call 0xe9ac ; 0xe9ac 177c0: 0c 94 f5 aa jmp 0x155ea ; 0x155ea M500 */ case 500: { Config_StoreSettings(); 177c4: 0e 94 ab 82 call 0x10556 ; 0x10556 177c8: 0c 94 f5 aa jmp 0x155ea ; 0x155ea M501 */ case 501: { Config_RetrieveSettings(); 177cc: 0e 94 b3 93 call 0x12766 ; 0x12766 177d0: 0c 94 f5 aa jmp 0x155ea ; 0x155ea M502 */ case 502: { Config_ResetDefault(); 177d4: 0e 94 93 82 call 0x10526 ; 0x10526 177d8: 0c 94 f5 aa jmp 0x155ea ; 0x155ea #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( 177dc: 80 91 21 0e lds r24, 0x0E21 ; 0x800e21 177e0: 8f 93 push r24 177e2: 80 91 20 0e lds r24, 0x0E20 ; 0x800e20 177e6: 8f 93 push r24 177e8: 80 91 1f 0e lds r24, 0x0E1F ; 0x800e1f 177ec: 8f 93 push r24 177ee: 80 91 1e 0e lds r24, 0x0E1E ; 0x800e1e 177f2: 8f 93 push r24 177f4: 80 91 1d 0e lds r24, 0x0E1D ; 0x800e1d 177f8: 8f 93 push r24 177fa: 80 91 1c 0e lds r24, 0x0E1C ; 0x800e1c 177fe: 8f 93 push r24 17800: 80 91 1b 0e lds r24, 0x0E1B ; 0x800e1b 17804: 8f 93 push r24 17806: 80 91 1a 0e lds r24, 0x0E1A ; 0x800e1a 1780a: 8f 93 push r24 1780c: 80 91 19 0e lds r24, 0x0E19 ; 0x800e19 17810: 8f 93 push r24 17812: 80 91 18 0e lds r24, 0x0E18 ; 0x800e18 17816: 8f 93 push r24 17818: 80 91 17 0e lds r24, 0x0E17 ; 0x800e17 1781c: 8f 93 push r24 1781e: 80 91 16 0e lds r24, 0x0E16 ; 0x800e16 17822: 8f 93 push r24 17824: 00 ed ldi r16, 0xD0 ; 208 17826: 1b ea ldi r17, 0xAB ; 171 17828: 1f 93 push r17 1782a: 0f 93 push r16 1782c: 1f 93 push r17 1782e: 0f 93 push r16 17830: 80 91 15 0e lds r24, 0x0E15 ; 0x800e15 17834: 8f 93 push r24 17836: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 1783a: 8f 93 push r24 1783c: 80 91 13 0e lds r24, 0x0E13 ; 0x800e13 17840: 8f 93 push r24 17842: 80 91 12 0e lds r24, 0x0E12 ; 0x800e12 17846: 8f 93 push r24 17848: 80 91 11 0e lds r24, 0x0E11 ; 0x800e11 1784c: 8f 93 push r24 1784e: 80 91 10 0e lds r24, 0x0E10 ; 0x800e10 17852: 8f 93 push r24 17854: 80 91 0f 0e lds r24, 0x0E0F ; 0x800e0f 17858: 8f 93 push r24 1785a: 80 91 0e 0e lds r24, 0x0E0E ; 0x800e0e 1785e: 8f 93 push r24 17860: 80 91 0d 0e lds r24, 0x0E0D ; 0x800e0d 17864: 8f 93 push r24 17866: 80 91 0c 0e lds r24, 0x0E0C ; 0x800e0c 1786a: 8f 93 push r24 1786c: 80 91 0b 0e lds r24, 0x0E0B ; 0x800e0b 17870: 8f 93 push r24 17872: 80 91 0a 0e lds r24, 0x0E0A ; 0x800e0a 17876: 8f 93 push r24 17878: 80 91 09 0e lds r24, 0x0E09 ; 0x800e09 1787c: 8f 93 push r24 1787e: 80 91 08 0e lds r24, 0x0E08 ; 0x800e08 17882: 8f 93 push r24 17884: 80 91 07 0e lds r24, 0x0E07 ; 0x800e07 17888: 8f 93 push r24 1788a: 80 91 06 0e lds r24, 0x0E06 ; 0x800e06 1788e: 8f 93 push r24 17890: 80 91 05 0e lds r24, 0x0E05 ; 0x800e05 17894: 8f 93 push r24 17896: 80 91 04 0e lds r24, 0x0E04 ; 0x800e04 1789a: 8f 93 push r24 1789c: 80 91 03 0e lds r24, 0x0E03 ; 0x800e03 178a0: 8f 93 push r24 178a2: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 178a6: 8f 93 push r24 178a8: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 178ac: 8f 93 push r24 178ae: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 178b2: 8f 93 push r24 178b4: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 178b8: 8f 93 push r24 178ba: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 178be: 8f 93 push r24 178c0: 80 91 fd 0d lds r24, 0x0DFD ; 0x800dfd 178c4: 8f 93 push r24 178c6: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 178ca: 8f 93 push r24 178cc: 80 91 fb 0d lds r24, 0x0DFB ; 0x800dfb 178d0: 8f 93 push r24 178d2: 80 91 fa 0d lds r24, 0x0DFA ; 0x800dfa 178d6: 8f 93 push r24 178d8: 1f 93 push r17 178da: 0f 93 push r16 178dc: 1f 93 push r17 178de: 0f 93 push r16 178e0: 80 91 81 0e lds r24, 0x0E81 ; 0x800e81 178e4: 8f 93 push r24 178e6: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 178ea: 8f 93 push r24 178ec: 80 91 7f 0e lds r24, 0x0E7F ; 0x800e7f 178f0: 8f 93 push r24 178f2: 80 91 7e 0e lds r24, 0x0E7E ; 0x800e7e 178f6: 8f 93 push r24 178f8: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 178fc: 8f 93 push r24 178fe: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 17902: 8f 93 push r24 17904: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 17908: 8f 93 push r24 1790a: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 1790e: 8f 93 push r24 17910: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 17914: 8f 93 push r24 17916: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 1791a: 8f 93 push r24 1791c: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 17920: 8f 93 push r24 17922: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 17926: 8f 93 push r24 17928: 1f 93 push r17 1792a: 0f 93 push r16 1792c: 1f 93 push r17 1792e: 0f 93 push r16 17930: 80 91 79 0e lds r24, 0x0E79 ; 0x800e79 17934: 8f 93 push r24 17936: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 1793a: 8f 93 push r24 1793c: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 17940: 8f 93 push r24 17942: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 17946: 8f 93 push r24 17948: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 1794c: 8f 93 push r24 1794e: 80 91 74 0e lds r24, 0x0E74 ; 0x800e74 17952: 8f 93 push r24 17954: 80 91 73 0e lds r24, 0x0E73 ; 0x800e73 17958: 8f 93 push r24 1795a: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 1795e: 8f 93 push r24 17960: 80 91 71 0e lds r24, 0x0E71 ; 0x800e71 17964: 8f 93 push r24 17966: 80 91 70 0e lds r24, 0x0E70 ; 0x800e70 1796a: 8f 93 push r24 1796c: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 17970: 8f 93 push r24 17972: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 17976: 8f 93 push r24 17978: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 1797c: 8f 93 push r24 1797e: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 17982: 8f 93 push r24 17984: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 17988: 8f 93 push r24 1798a: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 1798e: 8f 93 push r24 17990: 1f 93 push r17 17992: 0f 93 push r16 17994: 1f 93 push r17 17996: 0f 93 push r16 17998: 80 91 f1 0d lds r24, 0x0DF1 ; 0x800df1 1799c: 8f 93 push r24 1799e: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 179a2: 8f 93 push r24 179a4: 80 91 ef 0d lds r24, 0x0DEF ; 0x800def 179a8: 8f 93 push r24 179aa: 80 91 ee 0d lds r24, 0x0DEE ; 0x800dee 179ae: 8f 93 push r24 179b0: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 179b4: 8f 93 push r24 179b6: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 179ba: 8f 93 push r24 179bc: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 179c0: 8f 93 push r24 179c2: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 179c6: 8f 93 push r24 179c8: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 179cc: 8f 93 push r24 179ce: 80 91 e8 0d lds r24, 0x0DE8 ; 0x800de8 179d2: 8f 93 push r24 179d4: 80 91 e7 0d lds r24, 0x0DE7 ; 0x800de7 179d8: 8f 93 push r24 179da: 80 91 e6 0d lds r24, 0x0DE6 ; 0x800de6 179de: 8f 93 push r24 179e0: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 179e4: 8f 93 push r24 179e6: 80 91 e4 0d lds r24, 0x0DE4 ; 0x800de4 179ea: 8f 93 push r24 179ec: 80 91 e3 0d lds r24, 0x0DE3 ; 0x800de3 179f0: 8f 93 push r24 179f2: 80 91 e2 0d lds r24, 0x0DE2 ; 0x800de2 179f6: 8f 93 push r24 179f8: 1f 93 push r17 179fa: 0f 93 push r16 179fc: 1f 93 push r17 179fe: 0f 93 push r16 17a00: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 17a04: 8f 93 push r24 17a06: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 17a0a: 8f 93 push r24 17a0c: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 17a10: 8f 93 push r24 17a12: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 17a16: 8f 93 push r24 17a18: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 17a1c: 8f 93 push r24 17a1e: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 17a22: 8f 93 push r24 17a24: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 17a28: 8f 93 push r24 17a2a: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 17a2e: 8f 93 push r24 17a30: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 17a34: 8f 93 push r24 17a36: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 17a3a: 8f 93 push r24 17a3c: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f 17a40: 8f 93 push r24 17a42: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e 17a46: 8f 93 push r24 17a48: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 17a4c: 8f 93 push r24 17a4e: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c 17a52: 8f 93 push r24 17a54: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 17a58: 8f 93 push r24 17a5a: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 17a5e: 8f 93 push r24 17a60: 1f 93 push r17 17a62: 0f 93 push r16 17a64: 1f 93 push r17 17a66: 0f 93 push r16 17a68: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 17a6c: 8f 93 push r24 17a6e: 80 91 e0 0d lds r24, 0x0DE0 ; 0x800de0 17a72: 8f 93 push r24 17a74: 80 91 df 0d lds r24, 0x0DDF ; 0x800ddf 17a78: 8f 93 push r24 17a7a: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 17a7e: 8f 93 push r24 17a80: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 17a84: 8f 93 push r24 17a86: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 17a8a: 8f 93 push r24 17a8c: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 17a90: 8f 93 push r24 17a92: 80 91 da 0d lds r24, 0x0DDA ; 0x800dda 17a96: 8f 93 push r24 17a98: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 17a9c: 8f 93 push r24 17a9e: 80 91 d8 0d lds r24, 0x0DD8 ; 0x800dd8 17aa2: 8f 93 push r24 17aa4: 80 91 d7 0d lds r24, 0x0DD7 ; 0x800dd7 17aa8: 8f 93 push r24 17aaa: 80 91 d6 0d lds r24, 0x0DD6 ; 0x800dd6 17aae: 8f 93 push r24 17ab0: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 17ab4: 8f 93 push r24 17ab6: 80 91 d4 0d lds r24, 0x0DD4 ; 0x800dd4 17aba: 8f 93 push r24 17abc: 80 91 d3 0d lds r24, 0x0DD3 ; 0x800dd3 17ac0: 8f 93 push r24 17ac2: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 17ac6: 8f 93 push r24 17ac8: 1f 93 push r17 17aca: 0f 93 push r16 17acc: 1f 93 push r17 17ace: 0f 93 push r16 17ad0: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 17ad4: 1f 92 push r1 17ad6: 8f 93 push r24 17ad8: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 17adc: 1f 92 push r1 17ade: 8f 93 push r24 17ae0: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 17ae4: 1f 92 push r1 17ae6: 8f 93 push r24 17ae8: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 17aec: 1f 92 push r1 17aee: 8f 93 push r24 17af0: 1f 93 push r17 17af2: 0f 93 push r16 17af4: 1f 93 push r17 17af6: 0f 93 push r16 17af8: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 17afc: 8f 93 push r24 17afe: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 17b02: 8f 93 push r24 17b04: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 17b08: 8f 93 push r24 17b0a: 80 91 ce 0d lds r24, 0x0DCE ; 0x800dce 17b0e: 8f 93 push r24 17b10: 80 91 cd 0d lds r24, 0x0DCD ; 0x800dcd 17b14: 8f 93 push r24 17b16: 80 91 cc 0d lds r24, 0x0DCC ; 0x800dcc 17b1a: 8f 93 push r24 17b1c: 80 91 cb 0d lds r24, 0x0DCB ; 0x800dcb 17b20: 8f 93 push r24 17b22: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 17b26: 8f 93 push r24 17b28: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 17b2c: 8f 93 push r24 17b2e: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 17b32: 8f 93 push r24 17b34: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 17b38: 8f 93 push r24 17b3a: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 17b3e: 8f 93 push r24 17b40: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 17b44: 8f 93 push r24 17b46: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 17b4a: 8f 93 push r24 17b4c: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 17b50: 8f 93 push r24 17b52: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 17b56: 8f 93 push r24 17b58: 1f 93 push r17 17b5a: 0f 93 push r16 17b5c: 1f 93 push r17 17b5e: 0f 93 push r16 17b60: 88 ed ldi r24, 0xD8 ; 216 17b62: 90 e8 ldi r25, 0x80 ; 128 17b64: 9f 93 push r25 17b66: 8f 93 push r24 17b68: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 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"), 17b6c: 0f b6 in r0, 0x3f ; 63 17b6e: f8 94 cli 17b70: de bf out 0x3e, r29 ; 62 17b72: 0f be out 0x3f, r0 ; 63 17b74: 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; 17b76: 2c ea ldi r18, 0xAC ; 172 17b78: 35 ec ldi r19, 0xC5 ; 197 17b7a: 47 e2 ldi r20, 0x27 ; 39 17b7c: 5e e3 ldi r21, 0x3E ; 62 17b7e: 60 91 2e 0e lds r22, 0x0E2E ; 0x800e2e 17b82: 70 91 2f 0e lds r23, 0x0E2F ; 0x800e2f 17b86: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 17b8a: 90 91 31 0e lds r25, 0x0E31 ; 0x800e31 17b8e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 17b92: 9f 93 push r25 17b94: 8f 93 push r24 17b96: 7f 93 push r23 17b98: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17b9a: 2c ea ldi r18, 0xAC ; 172 17b9c: 35 ec ldi r19, 0xC5 ; 197 17b9e: 47 e2 ldi r20, 0x27 ; 39 17ba0: 5e e3 ldi r21, 0x3E ; 62 17ba2: 60 91 2a 0e lds r22, 0x0E2A ; 0x800e2a 17ba6: 70 91 2b 0e lds r23, 0x0E2B ; 0x800e2b 17baa: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 17bae: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 17bb2: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 17bb6: 9f 93 push r25 17bb8: 8f 93 push r24 17bba: 7f 93 push r23 17bbc: 6f 93 push r22 17bbe: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 17bc2: 8f 93 push r24 17bc4: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 17bc8: 8f 93 push r24 17bca: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 17bce: 8f 93 push r24 17bd0: 80 91 26 0e lds r24, 0x0E26 ; 0x800e26 17bd4: 8f 93 push r24 17bd6: 1f 93 push r17 17bd8: 0f 93 push r16 17bda: 1f 93 push r17 17bdc: 0f 93 push r16 17bde: 8b ea ldi r24, 0xAB ; 171 17be0: 90 e8 ldi r25, 0x80 ; 128 17be2: 9f 93 push r25 17be4: 8f 93 push r24 17be6: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17bea: 2c ea ldi r18, 0xAC ; 172 17bec: 35 ec ldi r19, 0xC5 ; 197 17bee: 47 e2 ldi r20, 0x27 ; 39 17bf0: 5e e3 ldi r21, 0x3E ; 62 17bf2: 60 91 3a 0e lds r22, 0x0E3A ; 0x800e3a 17bf6: 70 91 3b 0e lds r23, 0x0E3B ; 0x800e3b 17bfa: 80 91 3c 0e lds r24, 0x0E3C ; 0x800e3c 17bfe: 90 91 3d 0e lds r25, 0x0E3D ; 0x800e3d 17c02: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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"), 17c06: 9f 93 push r25 17c08: 8f 93 push r24 17c0a: 7f 93 push r23 17c0c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17c0e: 2c ea ldi r18, 0xAC ; 172 17c10: 35 ec ldi r19, 0xC5 ; 197 17c12: 47 e2 ldi r20, 0x27 ; 39 17c14: 5e e3 ldi r21, 0x3E ; 62 17c16: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 17c1a: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 17c1e: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 17c22: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 17c26: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 17c2a: 9f 93 push r25 17c2c: 8f 93 push r24 17c2e: 7f 93 push r23 17c30: 6f 93 push r22 17c32: 80 91 35 0e lds r24, 0x0E35 ; 0x800e35 17c36: 8f 93 push r24 17c38: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 17c3c: 8f 93 push r24 17c3e: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 17c42: 8f 93 push r24 17c44: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 17c48: 8f 93 push r24 17c4a: 1f 93 push r17 17c4c: 0f 93 push r16 17c4e: 1f 93 push r17 17c50: 0f 93 push r16 17c52: 86 e7 ldi r24, 0x76 ; 118 17c54: 90 e8 ldi r25, 0x80 ; 128 17c56: 9f 93 push r25 17c58: 8f 93 push r24 17c5a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 17c5e: 0f b6 in r0, 0x3f ; 63 17c60: f8 94 cli 17c62: de bf out 0x3e, r29 ; 62 17c64: 0f be out 0x3f, r0 ; 63 17c66: cd bf out 0x3d, r28 ; 61 17c68: 80 91 40 0e lds r24, 0x0E40 ; 0x800e40 17c6c: 1f 92 push r1 17c6e: 8f 93 push r24 17c70: 1f 93 push r17 17c72: 0f 93 push r16 17c74: 1f 93 push r17 17c76: 0f 93 push r16 17c78: 20 e0 ldi r18, 0x00 ; 0 17c7a: 30 e0 ldi r19, 0x00 ; 0 17c7c: 40 e7 ldi r20, 0x70 ; 112 17c7e: 52 e4 ldi r21, 0x42 ; 66 17c80: 60 91 51 0e lds r22, 0x0E51 ; 0x800e51 17c84: 70 91 52 0e lds r23, 0x0E52 ; 0x800e52 17c88: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 17c8c: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 17c90: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 17c94: 9f 93 push r25 17c96: 8f 93 push r24 17c98: 7f 93 push r23 17c9a: 6f 93 push r22 17c9c: 80 91 50 0e lds r24, 0x0E50 ; 0x800e50 17ca0: 8f 93 push r24 17ca2: 80 91 4f 0e lds r24, 0x0E4F ; 0x800e4f 17ca6: 8f 93 push r24 17ca8: 80 91 4e 0e lds r24, 0x0E4E ; 0x800e4e 17cac: 8f 93 push r24 17cae: 80 91 4d 0e lds r24, 0x0E4D ; 0x800e4d 17cb2: 8f 93 push r24 17cb4: 1f 93 push r17 17cb6: 0f 93 push r16 17cb8: 1f 93 push r17 17cba: 0f 93 push r16 17cbc: 80 91 4c 0e lds r24, 0x0E4C ; 0x800e4c 17cc0: 8f 93 push r24 17cc2: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 17cc6: 8f 93 push r24 17cc8: 80 91 4a 0e lds r24, 0x0E4A ; 0x800e4a 17ccc: 8f 93 push r24 17cce: 80 91 49 0e lds r24, 0x0E49 ; 0x800e49 17cd2: 8f 93 push r24 17cd4: 20 e0 ldi r18, 0x00 ; 0 17cd6: 30 e0 ldi r19, 0x00 ; 0 17cd8: 40 e7 ldi r20, 0x70 ; 112 17cda: 52 e4 ldi r21, 0x42 ; 66 17cdc: 60 91 45 0e lds r22, 0x0E45 ; 0x800e45 17ce0: 70 91 46 0e lds r23, 0x0E46 ; 0x800e46 17ce4: 80 91 47 0e lds r24, 0x0E47 ; 0x800e47 17ce8: 90 91 48 0e lds r25, 0x0E48 ; 0x800e48 17cec: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 17cf0: 9f 93 push r25 17cf2: 8f 93 push r24 17cf4: 7f 93 push r23 17cf6: 6f 93 push r22 17cf8: 80 91 44 0e lds r24, 0x0E44 ; 0x800e44 17cfc: 8f 93 push r24 17cfe: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 17d02: 8f 93 push r24 17d04: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 17d08: 8f 93 push r24 17d0a: 80 91 41 0e lds r24, 0x0E41 ; 0x800e41 17d0e: 8f 93 push r24 17d10: 1f 93 push r17 17d12: 0f 93 push r16 17d14: 1f 93 push r17 17d16: 0f 93 push r16 17d18: 85 e7 ldi r24, 0x75 ; 117 17d1a: 9f e7 ldi r25, 0x7F ; 127 17d1c: 9f 93 push r25 17d1e: 8f 93 push r24 17d20: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca ); #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) { 17d24: 0f b6 in r0, 0x3f ; 63 17d26: f8 94 cli 17d28: de bf out 0x3e, r29 ; 62 17d2a: 0f be out 0x3f, r0 ; 63 17d2c: cd bf out 0x3d, r28 ; 61 17d2e: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 17d32: 88 23 and r24, r24 17d34: 09 f4 brne .+2 ; 0x17d38 17d36: 58 c0 rjmp .+176 ; 0x17de8 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 17d38: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 17d3c: 8f 93 push r24 17d3e: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 17d42: 8f 93 push r24 17d44: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 17d48: 8f 93 push r24 17d4a: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 17d4e: 8f 93 push r24 17d50: 1f 93 push r17 17d52: 0f 93 push r16 17d54: 1f 93 push r17 17d56: 0f 93 push r16 17d58: 8f e4 ldi r24, 0x4F ; 79 17d5a: 9f e7 ldi r25, 0x7F ; 127 17d5c: 9f 93 push r25 17d5e: 8f 93 push r24 17d60: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 17d64: 0f b6 in r0, 0x3f ; 63 17d66: f8 94 cli 17d68: de bf out 0x3e, r29 ; 62 17d6a: 0f be out 0x3f, r0 ; 63 17d6c: 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( 17d6e: 80 91 8e 0e lds r24, 0x0E8E ; 0x800e8e 17d72: 8f 93 push r24 17d74: 80 91 8d 0e lds r24, 0x0E8D ; 0x800e8d 17d78: 8f 93 push r24 17d7a: 80 91 8c 0e lds r24, 0x0E8C ; 0x800e8c 17d7e: 8f 93 push r24 17d80: 80 91 8b 0e lds r24, 0x0E8B ; 0x800e8b 17d84: 8f 93 push r24 17d86: 80 91 8a 0e lds r24, 0x0E8A ; 0x800e8a 17d8a: 1f 92 push r1 17d8c: 8f 93 push r24 17d8e: 80 91 89 0e lds r24, 0x0E89 ; 0x800e89 17d92: 8f 93 push r24 17d94: 80 91 88 0e lds r24, 0x0E88 ; 0x800e88 17d98: 8f 93 push r24 17d9a: 80 91 87 0e lds r24, 0x0E87 ; 0x800e87 17d9e: 8f 93 push r24 17da0: 80 91 86 0e lds r24, 0x0E86 ; 0x800e86 17da4: 8f 93 push r24 17da6: 80 91 85 0e lds r24, 0x0E85 ; 0x800e85 17daa: 8f 93 push r24 17dac: 80 91 84 0e lds r24, 0x0E84 ; 0x800e84 17db0: 8f 93 push r24 17db2: 80 91 83 0e lds r24, 0x0E83 ; 0x800e83 17db6: 8f 93 push r24 17db8: 80 91 82 0e lds r24, 0x0E82 ; 0x800e82 17dbc: 8f 93 push r24 17dbe: 80 ed ldi r24, 0xD0 ; 208 17dc0: 9b ea ldi r25, 0xAB ; 171 17dc2: 9f 93 push r25 17dc4: 8f 93 push r24 17dc6: 9f 93 push r25 17dc8: 8f 93 push r24 17dca: 8e ea ldi r24, 0xAE ; 174 17dcc: 9e e7 ldi r25, 0x7E ; 126 17dce: 9f 93 push r25 17dd0: 8f 93 push r24 17dd2: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca "%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(); 17dd6: 0f 94 c8 2d call 0x25b90 ; 0x25b90 17dda: 0f b6 in r0, 0x3f ; 63 17ddc: f8 94 cli 17dde: de bf out 0x3e, r29 ; 62 17de0: 0f be out 0x3f, r0 ; 63 17de2: cd bf out 0x3d, r28 ; 61 17de4: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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); 17de8: 1f 93 push r17 17dea: 0f 93 push r16 17dec: 80 e3 ldi r24, 0x30 ; 48 17dee: 9f e7 ldi r25, 0x7F ; 127 17df0: 9f 93 push r25 17df2: 8f 93 push r24 17df4: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 17df8: 0f 90 pop r0 17dfa: 0f 90 pop r0 17dfc: 0f 90 pop r0 17dfe: 0f 90 pop r0 17e00: b6 cf rjmp .-148 ; 0x17d6e #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 17e02: 80 e5 ldi r24, 0x50 ; 80 17e04: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 17e08: 88 23 and r24, r24 17e0a: 11 f4 brne .+4 ; 0x17e10 17e0c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { uint8_t valCnt = 0; IP_address = 0; 17e10: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 17e14: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 17e18: 10 92 60 06 sts 0x0660, r1 ; 0x800660 17e1c: 10 92 61 06 sts 0x0661, r1 ; 0x800661 17e20: 0e e5 ldi r16, 0x5E ; 94 17e22: 16 e0 ldi r17, 0x06 ; 6 17e24: 42 e6 ldi r20, 0x62 ; 98 17e26: e4 2e mov r14, r20 17e28: 46 e0 ldi r20, 0x06 ; 6 17e2a: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 17e2c: 5a e2 ldi r21, 0x2A ; 42 17e2e: d5 2e mov r13, r21 17e30: e0 91 95 03 lds r30, 0x0395 ; 0x800395 17e34: f0 91 96 03 lds r31, 0x0396 ; 0x800396 17e38: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 17e3a: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 17e3e: d8 01 movw r26, r16 17e40: 8d 93 st X+, r24 17e42: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 17e44: ea 16 cp r14, r26 17e46: fb 06 cpc r15, r27 17e48: 11 f4 brne .+4 ; 0x17e4e 17e4a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 17e4e: 8e e2 ldi r24, 0x2E ; 46 17e50: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 17e54: 81 11 cpse r24, r1 17e56: ec cf rjmp .-40 ; 0x17e30 if (valCnt != 4) IP_address = 0; 17e58: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 17e5c: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f 17e60: 10 92 60 06 sts 0x0660, r1 ; 0x800660 17e64: 10 92 61 06 sts 0x0661, r1 ; 0x800661 17e68: 0c 94 f5 aa jmp 0x155ea ; 0x155ea - `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(); 17e6c: 0f 94 ef 42 call 0x285de ; 0x285de /// 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; 17e70: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 17e74: 81 11 cpse r24, r1 17e76: 02 c0 rjmp .+4 ; 0x17e7c 17e78: 0e 94 50 64 call 0xc8a0 ; 0xc8a0 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(); 17e7c: 85 e4 ldi r24, 0x45 ; 69 17e7e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 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; 17e82: 81 2c mov r8, r1 17e84: 91 2c mov r9, r1 17e86: a1 2c mov r10, r1 17e88: 30 ec ldi r19, 0xC0 ; 192 17e8a: 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(); 17e8c: 88 23 and r24, r24 17e8e: 21 f0 breq .+8 ; 0x17e98 17e90: 0e 94 a4 60 call 0xc148 ; 0xc148 17e94: 4b 01 movw r8, r22 17e96: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 17e98: 8c e4 ldi r24, 0x4C ; 76 17e9a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 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; 17e9e: c1 2c mov r12, r1 17ea0: d1 2c mov r13, r1 17ea2: 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(); 17ea4: 88 23 and r24, r24 17ea6: 21 f0 breq .+8 ; 0x17eb0 17ea8: 0e 94 a4 60 call 0xc148 ; 0xc148 17eac: 6b 01 movw r12, r22 17eae: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 17eb0: 8a e5 ldi r24, 0x5A ; 90 17eb2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba // 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; 17eb6: 41 2c mov r4, r1 17eb8: 51 2c mov r5, r1 17eba: 28 ed ldi r18, 0xD8 ; 216 17ebc: 62 2e mov r6, r18 17ebe: 21 e4 ldi r18, 0x41 ; 65 17ec0: 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()); 17ec2: 88 23 and r24, r24 17ec4: 31 f0 breq .+12 ; 0x17ed2 17ec6: 0e 94 a4 60 call 0xc148 ; 0xc148 17eca: 2b 01 movw r4, r22 17ecc: 3c 01 movw r6, r24 17ece: e8 94 clt 17ed0: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 17ed2: 88 e5 ldi r24, 0x58 ; 88 17ed4: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 17ed8: 88 23 and r24, r24 17eda: 09 f4 brne .+2 ; 0x17ede 17edc: 49 c1 rjmp .+658 ; 0x18170 17ede: 0e 94 a4 60 call 0xc148 ; 0xc148 17ee2: 6a 96 adiw r28, 0x1a ; 26 17ee4: 6c af std Y+60, r22 ; 0x3c 17ee6: 7d af std Y+61, r23 ; 0x3d 17ee8: 8e af std Y+62, r24 ; 0x3e 17eea: 9f af std Y+63, r25 ; 0x3f 17eec: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 17eee: 89 e5 ldi r24, 0x59 ; 89 17ef0: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 17ef4: 88 23 and r24, r24 17ef6: 09 f4 brne .+2 ; 0x17efa 17ef8: 46 c1 rjmp .+652 ; 0x18186 17efa: 0e 94 a4 60 call 0xc148 ; 0xc148 17efe: 6e 96 adiw r28, 0x1e ; 30 17f00: 6c af std Y+60, r22 ; 0x3c 17f02: 7d af std Y+61, r23 ; 0x3d 17f04: 8e af std Y+62, r24 ; 0x3e 17f06: 9f af std Y+63, r25 ; 0x3f 17f08: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 17f0a: 1a 82 std Y+2, r1 ; 0x02 17f0c: 19 82 std Y+1, r1 ; 0x01 17f0e: fe 01 movw r30, r28 17f10: 33 96 adiw r30, 0x03 ; 3 17f12: 83 e1 ldi r24, 0x13 ; 19 17f14: df 01 movw r26, r30 17f16: 1d 92 st X+, r1 17f18: 8a 95 dec r24 17f1a: e9 f7 brne .-6 ; 0x17f16 if (code_seen('C')) { 17f1c: 83 e4 ldi r24, 0x43 ; 67 17f1e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 17f22: 88 23 and r24, r24 17f24: f9 f0 breq .+62 ; 0x17f64 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 17f26: 62 e2 ldi r22, 0x22 ; 34 17f28: 70 e0 ldi r23, 0x00 ; 0 17f2a: 80 91 95 03 lds r24, 0x0395 ; 0x800395 17f2e: 90 91 96 03 lds r25, 0x0396 ; 0x800396 17f32: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 17f36: 8c 01 movw r16, r24 if (!this->ptr) { 17f38: 89 2b or r24, r25 17f3a: a1 f0 breq .+40 ; 0x17f64 // First quote not found return; } // Skip the leading quote this->ptr++; 17f3c: 0f 5f subi r16, 0xFF ; 255 17f3e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 17f40: 62 e2 ldi r22, 0x22 ; 34 17f42: 70 e0 ldi r23, 0x00 ; 0 17f44: c8 01 movw r24, r16 17f46: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 if(!pStrEnd) { 17f4a: 00 97 sbiw r24, 0x00 ; 0 17f4c: 59 f0 breq .+22 ; 0x17f64 // Second quote not found return; } this->len = pStrEnd - this->ptr; 17f4e: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 17f50: 84 31 cpi r24, 0x14 ; 20 17f52: 08 f0 brcs .+2 ; 0x17f56 17f54: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 17f56: 48 2f mov r20, r24 17f58: 50 e0 ldi r21, 0x00 ; 0 17f5a: b8 01 movw r22, r16 17f5c: ce 01 movw r24, r28 17f5e: 01 96 adiw r24, 0x01 ; 1 17f60: 0f 94 4c e2 call 0x3c498 ; 0x3c498 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 17f64: 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; 17f68: 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"))) 17f6a: 81 30 cpi r24, 0x01 ; 1 17f6c: 29 f4 brne .+10 ; 0x17f78 17f6e: 8a e2 ldi r24, 0x2A ; 42 17f70: 96 e8 ldi r25, 0x86 ; 134 17f72: 0e 94 2d 68 call 0xd05a ; 0xd05a 17f76: 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(); 17f78: 0f 94 ef 42 call 0x285de ; 0x285de uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 17f7c: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 // Retract E if (!printingIsPaused()) 17f80: 0e 94 8c 67 call 0xcf18 ; 0xcf18 17f84: 81 11 cpse r24, r1 17f86: 06 c1 rjmp .+524 ; 0x18194 { current_position[E_AXIS] += e_shift; 17f88: a5 01 movw r20, r10 17f8a: 94 01 movw r18, r8 17f8c: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 17f90: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 17f94: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 17f98: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 17f9c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 17fa0: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 17fa4: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 17fa8: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 17fac: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 17fb0: 60 e0 ldi r22, 0x00 ; 0 17fb2: 70 e0 ldi r23, 0x00 ; 0 17fb4: 88 ee ldi r24, 0xE8 ; 232 17fb6: 92 e4 ldi r25, 0x42 ; 66 17fb8: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 17fbc: 0f 94 ef 42 call 0x285de ; 0x285de SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 17fc0: 89 ef ldi r24, 0xF9 ; 249 17fc2: 9e e6 ldi r25, 0x6E ; 110 17fc4: 0e 94 82 79 call 0xf304 ; 0xf304 // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 17fc8: c3 01 movw r24, r6 17fca: b2 01 movw r22, r4 17fcc: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 // Move XY to side current_position[X_AXIS] = x_position; 17fd0: 6a 96 adiw r28, 0x1a ; 26 17fd2: 2c ad ldd r18, Y+60 ; 0x3c 17fd4: 3d ad ldd r19, Y+61 ; 0x3d 17fd6: 4e ad ldd r20, Y+62 ; 0x3e 17fd8: 5f ad ldd r21, Y+63 ; 0x3f 17fda: 6a 97 sbiw r28, 0x1a ; 26 17fdc: 20 93 92 06 sts 0x0692, r18 ; 0x800692 17fe0: 30 93 93 06 sts 0x0693, r19 ; 0x800693 17fe4: 40 93 94 06 sts 0x0694, r20 ; 0x800694 17fe8: 50 93 95 06 sts 0x0695, r21 ; 0x800695 current_position[Y_AXIS] = y_position; 17fec: 6e 96 adiw r28, 0x1e ; 30 17fee: 8c ad ldd r24, Y+60 ; 0x3c 17ff0: 9d ad ldd r25, Y+61 ; 0x3d 17ff2: ae ad ldd r26, Y+62 ; 0x3e 17ff4: bf ad ldd r27, Y+63 ; 0x3f 17ff6: 6e 97 sbiw r28, 0x1e ; 30 17ff8: 80 93 96 06 sts 0x0696, r24 ; 0x800696 17ffc: 90 93 97 06 sts 0x0697, r25 ; 0x800697 18000: a0 93 98 06 sts 0x0698, r26 ; 0x800698 18004: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18008: 60 e0 ldi r22, 0x00 ; 0 1800a: 70 e0 ldi r23, 0x00 ; 0 1800c: 88 e4 ldi r24, 0x48 ; 72 1800e: 92 e4 ldi r25, 0x42 ; 66 18010: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 18014: 0f 94 ef 42 call 0x285de ; 0x285de bool repeat = false; 18018: 67 96 adiw r28, 0x17 ; 23 1801a: 1f ae std Y+63, r1 ; 0x3f 1801c: 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; 1801e: 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)); 18020: 0a e9 ldi r16, 0x9A ; 154 18022: 20 2e mov r2, r16 18024: 0e e7 ldi r16, 0x7E ; 126 18026: 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; 18028: 82 e0 ldi r24, 0x02 ; 2 1802a: 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)); 1802c: 92 ea ldi r25, 0xA2 ; 162 1802e: 89 2e mov r8, r25 18030: 9e e7 ldi r25, 0x7E ; 126 18032: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 18034: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 18038: 81 30 cpi r24, 0x01 ; 1 1803a: 09 f0 breq .+2 ; 0x1803e 1803c: ae c0 rjmp .+348 ; 0x1819a eject_slot = MMU2::mmu2.get_current_tool(); 1803e: 0f 94 c0 74 call 0x2e980 ; 0x2e980 18042: b8 2e mov r11, r24 mmu_M600_unload_filament(); 18044: 0e 94 1e 73 call 0xe63c ; 0xe63c } 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 18048: 0f 94 ef 42 call 0x285de ; 0x285de FSensorBlockRunout fsBlockRunout; 1804c: 0f 94 b5 86 call 0x30d6a ; 0x30d6a if (!MMU2::mmu2.Enabled()) 18050: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 18054: 81 30 cpi r24, 0x01 ; 1 18056: 09 f4 brne .+2 ; 0x1805a 18058: 6e c1 rjmp .+732 ; 0x18336 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1805a: 84 e0 ldi r24, 0x04 ; 4 1805c: 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); 18060: 82 e7 ldi r24, 0x72 ; 114 18062: 99 e3 ldi r25, 0x39 ; 57 18064: 0e 94 b3 72 call 0xe566 ; 0xe566 18068: 40 e0 ldi r20, 0x00 ; 0 1806a: 60 e0 ldi r22, 0x00 ; 0 1806c: 0f 94 47 4f call 0x29e8e ; 0x29e8e 18070: 08 2f mov r16, r24 lcd_update_enable(false); 18072: 80 e0 ldi r24, 0x00 ; 0 18074: 0e 94 2c 6f call 0xde58 ; 0xde58 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 18078: 01 30 cpi r16, 0x01 ; 1 1807a: 29 f5 brne .+74 ; 0x180c6 lcd_clear(); 1807c: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18080: 8a ee ldi r24, 0xEA ; 234 18082: 99 e3 ldi r25, 0x39 ; 57 18084: 0e 94 b3 72 call 0xe566 ; 0xe566 18088: ac 01 movw r20, r24 1808a: 62 e0 ldi r22, 0x02 ; 2 1808c: 80 e0 ldi r24, 0x00 ; 0 1808e: 0e 94 fb 6e call 0xddf6 ; 0xddf6 current_position[X_AXIS] = 100; 18092: 80 e0 ldi r24, 0x00 ; 0 18094: 90 e0 ldi r25, 0x00 ; 0 18096: a8 ec ldi r26, 0xC8 ; 200 18098: b2 e4 ldi r27, 0x42 ; 66 1809a: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1809e: 90 93 93 06 sts 0x0693, r25 ; 0x800693 180a2: a0 93 94 06 sts 0x0694, r26 ; 0x800694 180a6: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 180aa: 60 e0 ldi r22, 0x00 ; 0 180ac: 70 e0 ldi r23, 0x00 ; 0 180ae: 88 e4 ldi r24, 0x48 ; 72 180b0: 92 e4 ldi r25, 0x42 ; 66 180b2: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 180b6: 0f 94 ef 42 call 0x285de ; 0x285de lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 180ba: 80 e4 ldi r24, 0x40 ; 64 180bc: 99 e3 ldi r25, 0x39 ; 57 180be: 0e 94 b3 72 call 0xe566 ; 0xe566 180c2: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 180c6: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 180ca: 8e ec ldi r24, 0xCE ; 206 180cc: 98 e3 ldi r25, 0x38 ; 56 180ce: 0e 94 b3 72 call 0xe566 ; 0xe566 180d2: ac 01 movw r20, r24 180d4: 60 e0 ldi r22, 0x00 ; 0 180d6: 80 e0 ldi r24, 0x00 ; 0 180d8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(0, 1); 180dc: 61 e0 ldi r22, 0x01 ; 1 180de: 80 e0 ldi r24, 0x00 ; 0 180e0: 0e 94 e7 6e call 0xddce ; 0xddce if (filament_name[0]) { 180e4: 89 81 ldd r24, Y+1 ; 0x01 180e6: 88 23 and r24, r24 180e8: 41 f0 breq .+16 ; 0x180fa lcd_print(filament_name); 180ea: ce 01 movw r24, r28 180ec: 01 96 adiw r24, 0x01 ; 1 180ee: 0e 94 ee 70 call 0xe1dc ; 0xe1dc lcd_set_cursor(0, 2); 180f2: 62 e0 ldi r22, 0x02 ; 2 180f4: 80 e0 ldi r24, 0x00 ; 0 180f6: 0e 94 e7 6e call 0xddce ; 0xddce } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 180fa: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 180fe: 81 11 cpse r24, r1 18100: 06 c0 rjmp .+12 ; 0x1810e #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 18102: 89 eb ldi r24, 0xB9 ; 185 18104: 98 e3 ldi r25, 0x38 ; 56 18106: 0e 94 b3 72 call 0xe566 ; 0xe566 1810a: 0e 94 d2 6e call 0xdda4 ; 0xdda4 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); 1810e: 84 e0 ldi r24, 0x04 ; 4 18110: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be while(!lcd_clicked()) 18114: 0e 94 04 71 call 0xe208 ; 0xe208 18118: 81 11 cpse r24, r1 1811a: 10 c0 rjmp .+32 ; 0x1813c { manage_heater(); 1811c: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 18120: 81 e0 ldi r24, 0x01 ; 1 18122: 0e 94 b6 8a call 0x1156c ; 0x1156c #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 18126: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 1812a: 88 23 and r24, r24 1812c: 99 f3 breq .-26 ; 0x18114 Sound_MakeCustom(50,1000,false); 1812e: 40 e0 ldi r20, 0x00 ; 0 18130: 68 ee ldi r22, 0xE8 ; 232 18132: 73 e0 ldi r23, 0x03 ; 3 18134: 82 e3 ldi r24, 0x32 ; 50 18136: 90 e0 ldi r25, 0x00 ; 0 18138: 0f 94 4d 51 call 0x2a29a ; 0x2a29a break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 1813c: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be M600_load_filament_movements(filament_name); 18140: ce 01 movw r24, r28 18142: 01 96 adiw r24, 0x01 ; 1 18144: 0e 94 d7 72 call 0xe5ae ; 0xe5ae Sound_MakeCustom(50,1000,false); 18148: 40 e0 ldi r20, 0x00 ; 0 1814a: 68 ee ldi r22, 0xE8 ; 232 1814c: 73 e0 ldi r23, 0x03 ; 3 1814e: 82 e3 ldi r24, 0x32 ; 50 18150: 90 e0 ldi r25, 0x00 ; 0 18152: 0f 94 4d 51 call 0x2a29a ; 0x2a29a 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); 18156: b4 e0 ldi r27, 0x04 ; 4 18158: 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) 1815a: 11 23 and r17, r17 1815c: 09 f4 brne .+2 ; 0x18160 1815e: 00 c1 rjmp .+512 ; 0x18360 18160: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18164: 67 96 adiw r28, 0x17 ; 23 18166: 4f ad ldd r20, Y+63 ; 0x3f 18168: 67 97 sbiw r28, 0x17 ; 23 1816a: 41 11 cpse r20, r1 1816c: 63 cf rjmp .-314 ; 0x18034 1816e: a1 c1 rjmp .+834 ; 0x184b2 // 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; 18170: 20 e0 ldi r18, 0x00 ; 0 18172: 30 e0 ldi r19, 0x00 ; 0 18174: 43 e5 ldi r20, 0x53 ; 83 18176: 53 e4 ldi r21, 0x43 ; 67 18178: 6a 96 adiw r28, 0x1a ; 26 1817a: 2c af std Y+60, r18 ; 0x3c 1817c: 3d af std Y+61, r19 ; 0x3d 1817e: 4e af std Y+62, r20 ; 0x3e 18180: 5f af std Y+63, r21 ; 0x3f 18182: 6a 97 sbiw r28, 0x1a ; 26 18184: b4 ce rjmp .-664 ; 0x17eee float y_position = FILAMENTCHANGE_YPOS; 18186: 6e 96 adiw r28, 0x1e ; 30 18188: 1c ae std Y+60, r1 ; 0x3c 1818a: 1d ae std Y+61, r1 ; 0x3d 1818c: 1e ae std Y+62, r1 ; 0x3e 1818e: 1f ae std Y+63, r1 ; 0x3f 18190: 6e 97 sbiw r28, 0x1e ; 30 18192: bb ce rjmp .-650 ; 0x17f0a 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(); 18194: 0e 94 d0 64 call 0xc9a0 ; 0xc9a0 18198: 17 cf rjmp .-466 ; 0x17fc8 //! //! 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); 1819a: 84 e0 ldi r24, 0x04 ; 4 1819c: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be unsigned long waiting_start_time = _millis(); 181a0: 0f 94 53 29 call 0x252a6 ; 0x252a6 181a4: 2b 01 movw r4, r22 181a6: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 181a8: 8e e8 ldi r24, 0x8E ; 142 181aa: 98 e3 ldi r25, 0x38 ; 56 181ac: 0e 94 b3 72 call 0xe566 ; 0xe566 181b0: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 while (!(wait_for_user_state == 0 && lcd_clicked())){ 181b4: 0e 94 04 71 call 0xe208 ; 0xe208 181b8: 08 2f mov r16, r24 181ba: 81 11 cpse r24, r1 181bc: 38 c0 rjmp .+112 ; 0x1822e 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) { 181be: a3 01 movw r20, r6 181c0: 92 01 movw r18, r4 181c2: 20 54 subi r18, 0x40 ; 64 181c4: 38 4d sbci r19, 0xD8 ; 216 181c6: 46 4f sbci r20, 0xF6 ; 246 181c8: 5f 4f sbci r21, 0xFF ; 255 181ca: 6e 96 adiw r28, 0x1e ; 30 181cc: 2c af std Y+60, r18 ; 0x3c 181ce: 3d af std Y+61, r19 ; 0x3d 181d0: 4e af std Y+62, r20 ; 0x3e 181d2: 5f af std Y+63, r21 ; 0x3f 181d4: 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(); 181d6: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 181da: 81 e0 ldi r24, 0x01 ; 1 181dc: 0e 94 b6 8a call 0x1156c ; 0x1156c if (wait_for_user_state != 2) sound_wait_for_user(); 181e0: 02 30 cpi r16, 0x02 ; 2 181e2: 09 f4 brne .+2 ; 0x181e6 181e4: 67 c0 rjmp .+206 ; 0x182b4 181e6: 0f 94 f1 51 call 0x2a3e2 ; 0x2a3e2 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); 181ea: 84 e0 ldi r24, 0x04 ; 4 181ec: 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) { 181ee: 01 30 cpi r16, 0x01 ; 1 181f0: 39 f1 breq .+78 ; 0x18240 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 181f2: 0e 94 eb 8c call 0x119d6 ; 0x119d6 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 181f6: 0f 94 53 29 call 0x252a6 ; 0x252a6 181fa: 6e 96 adiw r28, 0x1e ; 30 181fc: 2c ad ldd r18, Y+60 ; 0x3c 181fe: 3d ad ldd r19, Y+61 ; 0x3d 18200: 4e ad ldd r20, Y+62 ; 0x3e 18202: 5f ad ldd r21, Y+63 ; 0x3f 18204: 6e 97 sbiw r28, 0x1e ; 30 18206: 26 17 cp r18, r22 18208: 37 07 cpc r19, r23 1820a: 48 07 cpc r20, r24 1820c: 59 07 cpc r21, r25 1820e: 90 f6 brcc .-92 ; 0x181b4 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 18210: 8d e5 ldi r24, 0x5D ; 93 18212: 98 e3 ldi r25, 0x38 ; 56 18214: 0e 94 b3 72 call 0xe566 ; 0xe566 18218: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1821c: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 18220: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18224: 0f 94 ef 42 call 0x285de ; 0x285de disable_e0(); 18228: 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; 1822a: 01 e0 ldi r16, 0x01 ; 1 1822c: d4 cf rjmp .-88 ; 0x181d6 1822e: 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; 18232: 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); 18236: c7 01 movw r24, r14 18238: b6 01 movw r22, r12 1823a: 0e 94 56 f8 call 0x1f0ac ; 0x1f0ac 1823e: 04 cf rjmp .-504 ; 0x18048 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); 18240: 0e 94 eb 8c call 0x119d6 ; 0x119d6 if (lcd_clicked()) { 18244: 0e 94 04 71 call 0xe208 ; 0xe208 18248: 88 23 and r24, r24 1824a: 29 f2 breq .-118 ; 0x181d6 1824c: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 18250: 90 91 ad 05 lds r25, 0x05AD ; 0x8005ad 18254: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 18258: 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)); 1825c: 8b e2 ldi r24, 0x2B ; 43 1825e: 9c e3 ldi r25, 0x3C ; 60 18260: 0e 94 b3 72 call 0xe566 ; 0xe566 18264: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 18268: 42 e8 ldi r20, 0x82 ; 130 1826a: 64 e0 ldi r22, 0x04 ; 4 1826c: 80 e0 ldi r24, 0x00 ; 0 1826e: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 18272: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 18276: 8f 93 push r24 18278: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 1827c: 8f 93 push r24 1827e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 18282: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 18286: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1828a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1828e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 18292: 7f 93 push r23 18294: 6f 93 push r22 18296: 3f 92 push r3 18298: 2f 92 push r2 1829a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 lcd_putc(LCD_STR_DEGREE[0]); 1829e: 81 e8 ldi r24, 0x81 ; 129 182a0: 0e 94 d6 6e call 0xddac ; 0xddac 182a4: 0f 90 pop r0 182a6: 0f 90 pop r0 182a8: 0f 90 pop r0 182aa: 0f 90 pop r0 182ac: 0f 90 pop r0 182ae: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 182b0: 02 e0 ldi r16, 0x02 ; 2 182b2: 91 cf rjmp .-222 ; 0x181d6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 182b4: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 182b8: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 182bc: 07 2e mov r0, r23 182be: 00 0c add r0, r0 182c0: 88 0b sbc r24, r24 182c2: 99 0b sbc r25, r25 182c4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 182c8: 20 91 b0 0d lds r18, 0x0DB0 ; 0x800db0 182cc: 30 91 b1 0d lds r19, 0x0DB1 ; 0x800db1 182d0: 40 91 b2 0d lds r20, 0x0DB2 ; 0x800db2 182d4: 50 91 b3 0d lds r21, 0x0DB3 ; 0x800db3 182d8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 182dc: 9f 77 andi r25, 0x7F ; 127 182de: 20 e0 ldi r18, 0x00 ; 0 182e0: 30 e0 ldi r19, 0x00 ; 0 182e2: 40 ea ldi r20, 0xA0 ; 160 182e4: 50 e4 ldi r21, 0x40 ; 64 182e6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 182ea: 87 ff sbrs r24, 7 182ec: 0b c0 rjmp .+22 ; 0x18304 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 182ee: 8e e8 ldi r24, 0x8E ; 142 182f0: 98 e3 ldi r25, 0x38 ; 56 182f2: 0e 94 b3 72 call 0xe566 ; 0xe566 182f6: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 waiting_start_time = _millis(); 182fa: 0f 94 53 29 call 0x252a6 ; 0x252a6 182fe: 2b 01 movw r4, r22 18300: 3c 01 movw r6, r24 18302: 58 cf rjmp .-336 ; 0x181b4 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 18304: 64 e0 ldi r22, 0x04 ; 4 18306: 81 e0 ldi r24, 0x01 ; 1 18308: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 1830c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 18310: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 18314: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 18318: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1831c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 18320: 7f 93 push r23 18322: 6f 93 push r22 18324: 9f 92 push r9 18326: 8f 92 push r8 18328: 0e 94 c0 6e call 0xdd80 ; 0xdd80 1832c: 0f 90 pop r0 1832e: 0f 90 pop r0 18330: 0f 90 pop r0 18332: 0f 90 pop r0 18334: 50 cf rjmp .-352 ; 0x181d6 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18336: 11 11 cpse r17, r1 18338: 03 c0 rjmp .+6 ; 0x18340 1833a: 8b 2d mov r24, r11 1833c: 0e 94 0e 8d call 0x11a1c ; 0x11a1c mmu_M600_load_filament(automatic); 18340: 81 2f mov r24, r17 18342: 0e 94 15 78 call 0xf02a ; 0xf02a 18346: 07 cf rjmp .-498 ; 0x18156 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 18348: 03 30 cpi r16, 0x03 ; 3 1834a: 10 f4 brcc .+4 ; 0x18350 cursor_pos++; 1834c: 0f 5f subi r16, 0xFF ; 255 1834e: 49 c0 rjmp .+146 ; 0x183e2 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18350: 87 e0 ldi r24, 0x07 ; 7 18352: 0f 94 0e 4e call 0x29c1c ; 0x29c1c 18356: 45 c0 rjmp .+138 ; 0x183e2 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); 18358: ce 01 movw r24, r28 1835a: 01 96 adiw r24, 0x01 ; 1 1835c: 0e 94 d7 72 call 0xe5ae ; 0xe5ae 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); 18360: 70 92 be 02 sts 0x02BE, r7 ; 0x8002be uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 18364: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 18368: 8a e0 ldi r24, 0x0A ; 10 1836a: 99 e3 ldi r25, 0x39 ; 57 1836c: 0e 94 b3 72 call 0xe566 ; 0xe566 18370: ac 01 movw r20, r24 18372: 60 e0 ldi r22, 0x00 ; 0 18374: 81 e0 ldi r24, 0x01 ; 1 18376: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 1837a: 84 ef ldi r24, 0xF4 ; 244 1837c: 98 e3 ldi r25, 0x38 ; 56 1837e: 0e 94 b3 72 call 0xe566 ; 0xe566 18382: ac 01 movw r20, r24 18384: 61 e0 ldi r22, 0x01 ; 1 18386: 81 e0 ldi r24, 0x01 ; 1 18388: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 1838c: 80 ee ldi r24, 0xE0 ; 224 1838e: 98 e3 ldi r25, 0x38 ; 56 18390: 0e 94 b3 72 call 0xe566 ; 0xe566 18394: ac 01 movw r20, r24 18396: 62 e0 ldi r22, 0x02 ; 2 18398: 81 e0 ldi r24, 0x01 ; 1 1839a: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 1839e: 82 e9 ldi r24, 0x92 ; 146 183a0: 96 e4 ldi r25, 0x46 ; 70 183a2: 0e 94 b3 72 call 0xe566 ; 0xe566 183a6: ac 01 movw r20, r24 183a8: 63 e0 ldi r22, 0x03 ; 3 183aa: 81 e0 ldi r24, 0x01 ; 1 183ac: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc_at(0, cursor_pos, '>'); 183b0: 4e e3 ldi r20, 0x3E ; 62 183b2: 60 e0 ldi r22, 0x00 ; 0 183b4: 80 e0 ldi r24, 0x00 ; 0 183b6: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_consume_click(); 183ba: 0e 94 ff 70 call 0xe1fe ; 0xe1fe uint8_t lcd_alright() { uint8_t cursor_pos = 0; 183be: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 183c0: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 183c4: 81 e0 ldi r24, 0x01 ; 1 183c6: 0e 94 b6 8a call 0x1156c ; 0x1156c if (lcd_encoder) 183ca: 80 91 70 06 lds r24, 0x0670 ; 0x800670 183ce: 90 91 71 06 lds r25, 0x0671 ; 0x800671 183d2: 00 97 sbiw r24, 0x00 ; 0 183d4: d9 f0 breq .+54 ; 0x1840c { if (lcd_encoder < 0 ) { 183d6: 97 ff sbrs r25, 7 183d8: b7 cf rjmp .-146 ; 0x18348 // Rotating knob counter clockwise if (cursor_pos > 0) 183da: 00 23 and r16, r16 183dc: 09 f4 brne .+2 ; 0x183e0 183de: b8 cf rjmp .-144 ; 0x18350 cursor_pos--; 183e0: 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 ")); 183e2: 46 ea ldi r20, 0xA6 ; 166 183e4: 5e e7 ldi r21, 0x7E ; 126 183e6: 60 e0 ldi r22, 0x00 ; 0 183e8: 80 e0 ldi r24, 0x00 ; 0 183ea: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc_at(0, cursor_pos, '>'); 183ee: 4e e3 ldi r20, 0x3E ; 62 183f0: 60 2f mov r22, r16 183f2: 80 e0 ldi r24, 0x00 ; 0 183f4: 0e 94 07 6f call 0xde0e ; 0xde0e // Consume rotation event and make feedback sound lcd_encoder = 0; 183f8: 10 92 71 06 sts 0x0671, r1 ; 0x800671 183fc: 10 92 70 06 sts 0x0670, r1 ; 0x800670 _delay(100); 18400: 64 e6 ldi r22, 0x64 ; 100 18402: 70 e0 ldi r23, 0x00 ; 0 18404: 80 e0 ldi r24, 0x00 ; 0 18406: 90 e0 ldi r25, 0x00 ; 0 18408: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 } if (lcd_clicked()) 1840c: 0e 94 04 71 call 0xe208 ; 0xe208 18410: 88 23 and r24, r24 18412: b1 f2 breq .-84 ; 0x183c0 { lcd_clear(); 18414: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_return_to_status(); 18418: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 1841c: a0 92 be 02 sts 0x02BE, r10 ; 0x8002be switch(lcd_change_filament_state) 18420: 02 30 cpi r16, 0x02 ; 2 18422: b1 f0 breq .+44 ; 0x18450 18424: 03 30 cpi r16, 0x03 ; 3 18426: 09 f4 brne .+2 ; 0x1842a 18428: f8 c0 rjmp .+496 ; 0x1861a 1842a: 01 30 cpi r16, 0x01 ; 1 1842c: 81 f5 brne .+96 ; 0x1848e { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 1842e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 18432: 81 30 cpi r24, 0x01 ; 1 18434: 09 f0 breq .+2 ; 0x18438 18436: 90 cf rjmp .-224 ; 0x18358 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 18438: 0f 94 c0 74 call 0x2e980 ; 0x2e980 1843c: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 1843e: 0e 94 1e 73 call 0xe63c ; 0xe63c // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 18442: 80 2f mov r24, r16 18444: 0e 94 0e 8d call 0x11a1c ; 0x11a1c // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 18448: 80 e0 ldi r24, 0x00 ; 0 1844a: 0e 94 15 78 call 0xf02a ; 0xf02a 1844e: 88 cf rjmp .-240 ; 0x18360 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18450: 0f 94 ef 42 call 0x285de ; 0x285de load_filament_final_feed(); 18454: 0e 94 9a 64 call 0xc934 ; 0xc934 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(); 18458: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 1845c: 8e e1 ldi r24, 0x1E ; 30 1845e: 99 e3 ldi r25, 0x39 ; 57 18460: 0e 94 b3 72 call 0xe566 ; 0xe566 18464: ac 01 movw r20, r24 18466: 60 e0 ldi r22, 0x00 ; 0 18468: 80 e0 ldi r24, 0x00 ; 0 1846a: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 1846e: 8a ee ldi r24, 0xEA ; 234 18470: 99 e3 ldi r25, 0x39 ; 57 18472: 0e 94 b3 72 call 0xe566 ; 0xe566 18476: ac 01 movw r20, r24 18478: 62 e0 ldi r22, 0x02 ; 2 1847a: 80 e0 ldi r24, 0x00 ; 0 1847c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 18480: 87 e9 ldi r24, 0x97 ; 151 18482: 9d e1 ldi r25, 0x1D ; 29 18484: 0f 94 76 20 call 0x240ec ; 0x240ec lcd_loading_color(); st_synchronize(); 18488: 0f 94 ef 42 call 0x285de ; 0x285de 1848c: 69 cf rjmp .-302 ; 0x18360 } void lcd_change_success() { lcd_clear(); 1848e: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 18492: 8e e2 ldi r24, 0x2E ; 46 18494: 99 e3 ldi r25, 0x39 ; 57 18496: 0e 94 b3 72 call 0xe566 ; 0xe566 1849a: ac 01 movw r20, r24 1849c: 62 e0 ldi r22, 0x02 ; 2 1849e: 80 e0 ldi r24, 0x00 ; 0 184a0: 0e 94 fb 6e call 0xddf6 ; 0xddf6 //! @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) 184a4: 00 23 and r16, r16 184a6: 19 f0 breq .+6 ; 0x184ae 184a8: 03 30 cpi r16, 0x03 ; 3 184aa: 09 f0 breq .+2 ; 0x184ae 184ac: 59 cf rjmp .-334 ; 0x18360 184ae: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 184b2: 81 e0 ldi r24, 0x01 ; 1 184b4: 0e 94 2c 6f call 0xde58 ; 0xde58 // Not let's go back to print fanSpeed = saved_fan_speed; 184b8: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 184bc: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 // Feed a little of filament to stabilize pressure if (!automatic) { 184c0: 11 11 cpse r17, r1 184c2: 27 c0 rjmp .+78 ; 0x18512 if (printingIsPaused()) 184c4: 0e 94 8c 67 call 0xcf18 ; 0xcf18 184c8: c0 90 9e 06 lds r12, 0x069E ; 0x80069e 184cc: d0 90 9f 06 lds r13, 0x069F ; 0x80069f 184d0: e0 90 a0 06 lds r14, 0x06A0 ; 0x8006a0 184d4: f0 90 a1 06 lds r15, 0x06A1 ; 0x8006a1 184d8: 88 23 and r24, r24 184da: 09 f4 brne .+2 ; 0x184de 184dc: a3 c0 rjmp .+326 ; 0x18624 { // 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; 184de: 20 e0 ldi r18, 0x00 ; 0 184e0: 30 e0 ldi r19, 0x00 ; 0 184e2: 40 e8 ldi r20, 0x80 ; 128 184e4: 5f e3 ldi r21, 0x3F ; 63 184e6: c7 01 movw r24, r14 184e8: b6 01 movw r22, r12 184ea: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 184ee: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 184f2: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 184f6: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 184fa: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 184fe: 60 e0 ldi r22, 0x00 ; 0 18500: 70 e0 ldi r23, 0x00 ; 0 18502: 88 ee ldi r24, 0xE8 ; 232 18504: 92 e4 ldi r25, 0x42 ; 66 18506: 0f 94 50 c0 call 0x380a0 ; 0x380a0 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1850a: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1850e: 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); 18512: e0 90 9a 06 lds r14, 0x069A ; 0x80069a 18516: f0 90 9b 06 lds r15, 0x069B ; 0x80069b 1851a: 00 91 9c 06 lds r16, 0x069C ; 0x80069c 1851e: 10 91 9d 06 lds r17, 0x069D ; 0x80069d 18522: 20 91 77 02 lds r18, 0x0277 ; 0x800277 18526: 30 91 78 02 lds r19, 0x0278 ; 0x800278 1852a: 40 91 79 02 lds r20, 0x0279 ; 0x800279 1852e: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 18532: 60 91 73 02 lds r22, 0x0273 ; 0x800273 18536: 70 91 74 02 lds r23, 0x0274 ; 0x800274 1853a: 80 91 75 02 lds r24, 0x0275 ; 0x800275 1853e: 90 91 76 02 lds r25, 0x0276 ; 0x800276 18542: 1f 92 push r1 18544: 1f 92 push r1 18546: 1f 92 push r1 18548: 1f 92 push r1 1854a: 81 2c mov r8, r1 1854c: 91 2c mov r9, r1 1854e: e8 e4 ldi r30, 0x48 ; 72 18550: ae 2e mov r10, r30 18552: e2 e4 ldi r30, 0x42 ; 66 18554: be 2e mov r11, r30 18556: fe e9 ldi r31, 0x9E ; 158 18558: cf 2e mov r12, r31 1855a: f6 e0 ldi r31, 0x06 ; 6 1855c: df 2e mov r13, r31 1855e: 0f 94 fb b0 call 0x361f6 ; 0x361f6 st_synchronize(); 18562: 0f 94 ef 42 call 0x285de ; 0x285de // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18566: e0 90 7b 02 lds r14, 0x027B ; 0x80027b 1856a: f0 90 7c 02 lds r15, 0x027C ; 0x80027c 1856e: 00 91 7d 02 lds r16, 0x027D ; 0x80027d 18572: 10 91 7e 02 lds r17, 0x027E ; 0x80027e 18576: 20 91 77 02 lds r18, 0x0277 ; 0x800277 1857a: 30 91 78 02 lds r19, 0x0278 ; 0x800278 1857e: 40 91 79 02 lds r20, 0x0279 ; 0x800279 18582: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 18586: 60 91 73 02 lds r22, 0x0273 ; 0x800273 1858a: 70 91 74 02 lds r23, 0x0274 ; 0x800274 1858e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 18592: 90 91 76 02 lds r25, 0x0276 ; 0x800276 18596: 1f 92 push r1 18598: 1f 92 push r1 1859a: 1f 92 push r1 1859c: 1f 92 push r1 1859e: 81 2c mov r8, r1 185a0: 91 2c mov r9, r1 185a2: a0 e7 ldi r26, 0x70 ; 112 185a4: aa 2e mov r10, r26 185a6: a1 e4 ldi r26, 0x41 ; 65 185a8: ba 2e mov r11, r26 185aa: 0f 94 fb b0 call 0x361f6 ; 0x361f6 st_synchronize(); 185ae: 0f 94 ef 42 call 0x285de ; 0x285de // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 185b2: 8f e7 ldi r24, 0x7F ; 127 185b4: 92 e0 ldi r25, 0x02 ; 2 185b6: 0f 94 c5 63 call 0x2c78a ; 0x2c78a memcpy(current_position, saved_pos, sizeof(saved_pos)); 185ba: 80 e1 ldi r24, 0x10 ; 16 185bc: e3 e7 ldi r30, 0x73 ; 115 185be: f2 e0 ldi r31, 0x02 ; 2 185c0: a2 e9 ldi r26, 0x92 ; 146 185c2: b6 e0 ldi r27, 0x06 ; 6 185c4: 01 90 ld r0, Z+ 185c6: 0d 92 st X+, r0 185c8: 8a 95 dec r24 185ca: e1 f7 brne .-8 ; 0x185c4 set_destination_to_current(); 185cc: 0e 94 41 68 call 0xd082 ; 0xd082 // Recover feed rate feedmultiply = saved_feedmultiply2; 185d0: 80 91 71 03 lds r24, 0x0371 ; 0x800371 185d4: 90 91 72 03 lds r25, 0x0372 ; 0x800372 185d8: 80 93 39 02 sts 0x0239, r24 ; 0x800239 185dc: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 185e0: 9f 93 push r25 185e2: 8f 93 push r24 185e4: 86 e2 ldi r24, 0x26 ; 38 185e6: 9e e6 ldi r25, 0x6E ; 110 185e8: 9f 93 push r25 185ea: 8f 93 push r24 185ec: 0e 94 bd 88 call 0x1117a ; 0x1117a if (printingIsPaused()) { 185f0: 0e 94 8c 67 call 0xcf18 ; 0xcf18 185f4: 0f b6 in r0, 0x3f ; 63 185f6: f8 94 cli 185f8: de bf out 0x3e, r29 ; 62 185fa: 0f be out 0x3f, r0 ; 63 185fc: cd bf out 0x3d, r28 ; 61 185fe: 88 23 and r24, r24 18600: 41 f1 breq .+80 ; 0x18652 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18602: 8f e2 ldi r24, 0x2F ; 47 18604: 9a e4 ldi r25, 0x4A ; 74 18606: 0e 94 b3 72 call 0xe566 ; 0xe566 1860a: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 1860e: 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; 18612: 10 92 a2 06 sts 0x06A2, r1 ; 0x8006a2 18616: 0c 94 f5 aa jmp 0x155ea ; 0x155ea st_synchronize(); break; // Unload filament case 3: return true; 1861a: 31 e0 ldi r19, 0x01 ; 1 1861c: 67 96 adiw r28, 0x17 ; 23 1861e: 3f af std Y+63, r19 ; 0x3f 18620: 67 97 sbiw r28, 0x17 ; 23 18622: 9e cd rjmp .-1220 ; 0x18160 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18624: 20 e0 ldi r18, 0x00 ; 0 18626: 30 e0 ldi r19, 0x00 ; 0 18628: 40 ea ldi r20, 0xA0 ; 160 1862a: 50 e4 ldi r21, 0x40 ; 64 1862c: c7 01 movw r24, r14 1862e: b6 01 movw r22, r12 18630: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 18634: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 18638: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1863c: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 18640: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18644: 60 e0 ldi r22, 0x00 ; 0 18646: 70 e0 ldi r23, 0x00 ; 0 18648: 80 e0 ldi r24, 0x00 ; 0 1864a: 90 e4 ldi r25, 0x40 ; 64 1864c: 0f 94 50 c0 call 0x380a0 ; 0x380a0 18650: 60 cf rjmp .-320 ; 0x18512 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18652: 83 e7 ldi r24, 0x73 ; 115 18654: 90 e7 ldi r25, 0x70 ; 112 18656: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 1865a: 87 ef ldi r24, 0xF7 ; 247 1865c: 9a e6 ldi r25, 0x6A ; 106 1865e: 0e 94 82 79 call 0xf304 ; 0xf304 18662: d5 cf rjmp .-86 ; 0x1860e SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18664: 0e 94 8c 67 call 0xcf18 ; 0xcf18 18668: 81 11 cpse r24, r1 1866a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea st_synchronize(); 1866e: 0f 94 ef 42 call 0x285de ; 0x285de ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18672: 0e 94 31 7f call 0xfe62 ; 0xfe62 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18676: 0e 94 c3 76 call 0xed86 ; 0xed86 lcd_pause_print(); 1867a: 0f 94 5f 29 call 0x252be ; 0x252be 1867e: 0c 94 f5 aa jmp 0x155ea ; 0x155ea /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18682: 0e 94 8c 67 call 0xcf18 ; 0xcf18 18686: 88 23 and r24, r24 18688: 11 f4 brne .+4 ; 0x1868e 1868a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 1868e: 0c 94 bc ab jmp 0x15778 ; 0x15778 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18692: 60 e0 ldi r22, 0x00 ; 0 18694: 80 e0 ldi r24, 0x00 ; 0 18696: 0e 94 a1 f4 call 0x1e942 ; 0x1e942 1869a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 1869e: 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')) { 186a0: 83 e5 ldi r24, 0x53 ; 83 186a2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 186a6: 88 23 and r24, r24 186a8: b1 f0 breq .+44 ; 0x186d6 iSel = code_value_uint8(); 186aa: 0e 94 6f 5b call 0xb6de ; 0xb6de 186ae: 18 2f mov r17, r24 if (iSel>=max_sheets) 186b0: 88 30 cpi r24, 0x08 ; 8 186b2: b0 f0 brcs .+44 ; 0x186e0 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 186b4: 8b e0 ldi r24, 0x0B ; 11 186b6: 96 e8 ldi r25, 0x86 ; 134 186b8: 0e 94 57 77 call 0xeeae ; 0xeeae } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 186bc: 4a e0 ldi r20, 0x0A ; 10 186be: 67 e0 ldi r22, 0x07 ; 7 186c0: 70 e0 ldi r23, 0x00 ; 0 186c2: 80 e0 ldi r24, 0x00 ; 0 186c4: 90 e0 ldi r25, 0x00 ; 0 186c6: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 186ca: 89 ef ldi r24, 0xF9 ; 249 186cc: 92 e0 ldi r25, 0x02 ; 2 186ce: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 186d2: 0c 94 f5 aa jmp 0x155ea ; 0x155ea break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 186d6: 81 ea ldi r24, 0xA1 ; 161 186d8: 9d e0 ldi r25, 0x0D ; 13 186da: 0f 94 23 dc call 0x3b846 ; 0x3b846 186de: 18 2f mov r17, r24 } if (code_seen('Z')){ 186e0: 8a e5 ldi r24, 0x5A ; 90 186e2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 186e6: 88 23 and r24, r24 186e8: 09 f4 brne .+2 ; 0x186ec 186ea: d7 c0 rjmp .+430 ; 0x1889a z_val = code_value(); 186ec: 0e 94 a4 60 call 0xc148 ; 0xc148 186f0: 2b 01 movw r4, r22 186f2: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 186f4: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 186f8: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 186fc: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 18700: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 18704: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 18708: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1870c: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 1870e: 9b 01 movw r18, r22 18710: 21 56 subi r18, 0x61 ; 97 18712: 30 4f sbci r19, 0xF0 ; 240 18714: 20 3a cpi r18, 0xA0 ; 160 18716: 3f 40 sbci r19, 0x0F ; 15 18718: 30 f0 brcs .+12 ; 0x18726 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 1871a: 85 ef ldi r24, 0xF5 ; 245 1871c: 95 e8 ldi r25, 0x85 ; 133 1871e: 0e 94 82 79 call 0xf304 ; 0xf304 18722: 0c 94 f5 aa jmp 0x155ea ; 0x155ea break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18726: 5b e0 ldi r21, 0x0B ; 11 18728: 15 9f mul r17, r21 1872a: 90 01 movw r18, r0 1872c: 11 24 eor r1, r1 1872e: c9 01 movw r24, r18 18730: 80 5b subi r24, 0xB0 ; 176 18732: 92 4f sbci r25, 0xF2 ; 242 18734: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca { 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')) 18738: 8c e4 ldi r24, 0x4C ; 76 1873a: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1873e: bb e0 ldi r27, 0x0B ; 11 18740: 1b 9f mul r17, r27 18742: 70 01 movw r14, r0 18744: 11 24 eor r1, r1 18746: 57 01 movw r10, r14 18748: e7 eb ldi r30, 0xB7 ; 183 1874a: ae 1a sub r10, r30 1874c: e2 ef ldi r30, 0xF2 ; 242 1874e: be 0a sbc r11, r30 18750: 88 23 and r24, r24 18752: 09 f4 brne .+2 ; 0x18756 18754: be c0 rjmp .+380 ; 0x188d2 { char *src = strchr_pointer + 1; 18756: e0 91 95 03 lds r30, 0x0395 ; 0x800395 1875a: f0 91 96 03 lds r31, 0x0396 ; 0x800396 1875e: 31 96 adiw r30, 0x01 ; 1 18760: bf 01 movw r22, r30 while (*src == ' ') ++src; 18762: 81 91 ld r24, Z+ 18764: 80 32 cpi r24, 0x20 ; 32 18766: e1 f3 breq .-8 ; 0x18760 if (*src != '\0') 18768: 88 23 and r24, r24 1876a: 31 f0 breq .+12 ; 0x18778 { strncpy(strLabel,src,7); 1876c: 47 e0 ldi r20, 0x07 ; 7 1876e: 50 e0 ldi r21, 0x00 ; 0 18770: ce 01 movw r24, r28 18772: 01 96 adiw r24, 0x01 ; 1 18774: 0f 94 a3 e2 call 0x3c546 ; 0x3c546 #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); 18778: 47 e0 ldi r20, 0x07 ; 7 1877a: 50 e0 ldi r21, 0x00 ; 0 1877c: b5 01 movw r22, r10 1877e: ce 01 movw r24, r28 18780: 01 96 adiw r24, 0x01 ; 1 18782: 0f 94 37 dc call 0x3b86e ; 0x3b86e else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18786: 82 e4 ldi r24, 0x42 ; 66 18788: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1878c: 57 01 movw r10, r14 1878e: fe ea ldi r31, 0xAE ; 174 18790: af 1a sub r10, r31 18792: f2 ef ldi r31, 0xF2 ; 242 18794: bf 0a sbc r11, r31 18796: 88 23 and r24, r24 18798: 09 f4 brne .+2 ; 0x1879c 1879a: a3 c0 rjmp .+326 ; 0x188e2 { iBedC = code_value_uint8(); 1879c: 0e 94 6f 5b call 0xb6de ; 0xb6de 187a0: 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); 187a2: 68 2f mov r22, r24 187a4: c5 01 movw r24, r10 187a6: 0f 94 47 dc call 0x3b88e ; 0x3b88e else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 187aa: 80 e5 ldi r24, 0x50 ; 80 187ac: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 187b0: 2d ea ldi r18, 0xAD ; 173 187b2: e2 1a sub r14, r18 187b4: 22 ef ldi r18, 0xF2 ; 242 187b6: f2 0a sbc r15, r18 187b8: 88 23 and r24, r24 187ba: 09 f4 brne .+2 ; 0x187be 187bc: 97 c0 rjmp .+302 ; 0x188ec { iPindaC = code_value_uint8(); 187be: 0e 94 6f 5b call 0xb6de ; 0xb6de 187c2: b8 2e mov r11, r24 187c4: 68 2f mov r22, r24 187c6: c7 01 movw r24, r14 187c8: 0f 94 47 dc call 0x3b88e ; 0x3b88e else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 187cc: 81 e4 ldi r24, 0x41 ; 65 187ce: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 187d2: 88 23 and r24, r24 187d4: 09 f4 brne .+2 ; 0x187d8 187d6: 8f c0 rjmp .+286 ; 0x188f6 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 187d8: 0e 94 6f 5b call 0xb6de ; 0xb6de 187dc: 81 11 cpse r24, r1 187de: 06 c0 rjmp .+12 ; 0x187ec 187e0: 81 ea ldi r24, 0xA1 ; 161 187e2: 9d e0 ldi r25, 0x0D ; 13 187e4: 0f 94 23 dc call 0x3b846 ; 0x3b846 187e8: 18 13 cpse r17, r24 187ea: 8d c0 rjmp .+282 ; 0x18906 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 187ec: 81 2f mov r24, r17 187ee: 0e 94 48 76 call 0xec90 ; 0xec90 187f2: 08 2f mov r16, r24 187f4: 88 23 and r24, r24 187f6: 29 f0 breq .+10 ; 0x18802 187f8: 61 2f mov r22, r17 187fa: 81 ea ldi r24, 0xA1 ; 161 187fc: 9d e0 ldi r25, 0x0D ; 13 187fe: 0f 94 47 dc call 0x3b88e ; 0x3b88e else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18802: 8e ee ldi r24, 0xEE ; 238 18804: 95 e8 ldi r25, 0x85 ; 133 18806: 0e 94 57 77 call 0xeeae ; 0xeeae print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1880a: 61 2f mov r22, r17 1880c: 70 e0 ldi r23, 0x00 ; 0 1880e: 90 e0 ldi r25, 0x00 ; 0 18810: 80 e0 ldi r24, 0x00 ; 0 18812: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18816: 81 2f mov r24, r17 18818: 0e 94 48 76 call 0xec90 ; 0xec90 1881c: 81 11 cpse r24, r1 1881e: 04 c0 rjmp .+8 ; 0x18828 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18820: 8d ed ldi r24, 0xDD ; 221 18822: 95 e8 ldi r25, 0x85 ; 133 18824: 0e 94 82 79 call 0xf304 ; 0xf304 SERIAL_PROTOCOLPGM(" Z"); 18828: 8a ed ldi r24, 0xDA ; 218 1882a: 95 e8 ldi r25, 0x85 ; 133 1882c: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18830: 44 e0 ldi r20, 0x04 ; 4 18832: c3 01 movw r24, r6 18834: b2 01 movw r22, r4 18836: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 1883a: 87 ed ldi r24, 0xD7 ; 215 1883c: 95 e8 ldi r25, 0x85 ; 133 1883e: 0e 94 57 77 call 0xeeae ; 0xeeae print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18842: b6 01 movw r22, r12 18844: dd 0c add r13, r13 18846: 88 0b sbc r24, r24 18848: 99 0b sbc r25, r25 1884a: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 1884e: 84 ed ldi r24, 0xD4 ; 212 18850: 95 e8 ldi r25, 0x85 ; 133 18852: 0e 94 57 77 call 0xeeae ; 0xeeae 18856: ce 01 movw r24, r28 18858: 01 96 adiw r24, 0x01 ; 1 1885a: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 1885e: 81 ed ldi r24, 0xD1 ; 209 18860: 95 e8 ldi r25, 0x85 ; 133 18862: 0e 94 57 77 call 0xeeae ; 0xeeae 18866: 69 2d mov r22, r9 18868: 70 e0 ldi r23, 0x00 ; 0 1886a: 90 e0 ldi r25, 0x00 ; 0 1886c: 80 e0 ldi r24, 0x00 ; 0 1886e: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18872: 8e ec ldi r24, 0xCE ; 206 18874: 95 e8 ldi r25, 0x85 ; 133 18876: 0e 94 57 77 call 0xeeae ; 0xeeae 1887a: 6b 2d mov r22, r11 1887c: 70 e0 ldi r23, 0x00 ; 0 1887e: 90 e0 ldi r25, 0x00 ; 0 18880: 80 e0 ldi r24, 0x00 ; 0 18882: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18886: 8b ec ldi r24, 0xCB ; 203 18888: 95 e8 ldi r25, 0x85 ; 133 1888a: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN((int)bIsActive); 1888e: 80 2f mov r24, r16 18890: 90 e0 ldi r25, 0x00 ; 0 18892: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 18896: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } 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))); 1889a: ab e0 ldi r26, 0x0B ; 11 1889c: 1a 9f mul r17, r26 1889e: c0 01 movw r24, r0 188a0: 11 24 eor r1, r1 188a2: 80 5b subi r24, 0xB0 ; 176 188a4: 92 4f sbci r25, 0xF2 ; 242 188a6: 0f 94 31 dc call 0x3b862 ; 0x3b862 188aa: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 188ac: bc 01 movw r22, r24 188ae: 99 0f add r25, r25 188b0: 88 0b sbc r24, r24 188b2: 99 0b sbc r25, r25 188b4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 188b8: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 188bc: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 188c0: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 188c4: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 188c8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 188cc: 2b 01 movw r4, r22 188ce: 3c 01 movw r6, r24 188d0: 33 cf rjmp .-410 ; 0x18738 } 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)); 188d2: 47 e0 ldi r20, 0x07 ; 7 188d4: 50 e0 ldi r21, 0x00 ; 0 188d6: b5 01 movw r22, r10 188d8: ce 01 movw r24, r28 188da: 01 96 adiw r24, 0x01 ; 1 188dc: 0f 94 13 dc call 0x3b826 ; 0x3b826 188e0: 52 cf rjmp .-348 ; 0x18786 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); 188e2: c5 01 movw r24, r10 188e4: 0f 94 23 dc call 0x3b846 ; 0x3b846 188e8: 98 2e mov r9, r24 188ea: 5f cf rjmp .-322 ; 0x187aa 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); 188ec: c7 01 movw r24, r14 188ee: 0f 94 23 dc call 0x3b846 ; 0x3b846 188f2: b8 2e mov r11, r24 188f4: 6b cf rjmp .-298 ; 0x187cc bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 188f6: 81 ea ldi r24, 0xA1 ; 161 188f8: 9d e0 ldi r25, 0x0D ; 13 188fa: 0f 94 23 dc call 0x3b846 ; 0x3b846 188fe: 01 e0 ldi r16, 0x01 ; 1 18900: 18 17 cp r17, r24 18902: 09 f4 brne .+2 ; 0x18906 18904: 7e cf rjmp .-260 ; 0x18802 { 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; 18906: 00 e0 ldi r16, 0x00 ; 0 18908: 7c cf rjmp .-264 ; 0x18802 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)) ) { 1890a: c3 01 movw r24, r6 1890c: b2 01 movw r22, r4 1890e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 18912: 20 91 99 03 lds r18, 0x0399 ; 0x800399 18916: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 1891a: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 1891e: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 18922: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18926: 87 fd sbrc r24, 7 18928: 02 c0 rjmp .+4 ; 0x1892e 1892a: 0c 94 df aa jmp 0x155be ; 0x155be if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 1892e: 0f 94 53 29 call 0x252a6 ; 0x252a6 18932: 68 19 sub r22, r8 18934: 79 09 sbc r23, r9 18936: 8a 09 sbc r24, r10 18938: 9b 09 sbc r25, r11 1893a: 69 3e cpi r22, 0xE9 ; 233 1893c: 73 40 sbci r23, 0x03 ; 3 1893e: 81 05 cpc r24, r1 18940: 91 05 cpc r25, r1 18942: c8 f0 brcs .+50 ; 0x18976 { SERIAL_PROTOCOLPGM("P:"); 18944: 85 ea ldi r24, 0xA5 ; 165 18946: 95 e8 ldi r25, 0x85 ; 133 18948: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1894c: 60 91 99 03 lds r22, 0x0399 ; 0x800399 18950: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 18954: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 18958: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1895c: 41 e0 ldi r20, 0x01 ; 1 1895e: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18962: 8f e2 ldi r24, 0x2F ; 47 18964: 0e 94 3e 77 call 0xee7c ; 0xee7c SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18968: c8 01 movw r24, r16 1896a: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 codenum = _millis(); 1896e: 0f 94 53 29 call 0x252a6 ; 0x252a6 18972: 4b 01 movw r8, r22 18974: 5c 01 movw r10, r24 } manage_heater(); 18976: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(); 1897a: 80 e0 ldi r24, 0x00 ; 0 1897c: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 18980: 80 e0 ldi r24, 0x00 ; 0 18982: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 18986: 0c 94 c6 aa jmp 0x1558c ; 0x1558c - `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 1898a: 8f e3 ldi r24, 0x3F ; 63 1898c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18990: 88 23 and r24, r24 18992: c9 f0 breq .+50 ; 0x189c6 SERIAL_PROTOCOLPGM("PINDA cal status: "); 18994: 82 e9 ldi r24, 0x92 ; 146 18996: 95 e8 ldi r25, 0x85 ; 133 18998: 0e 94 57 77 call 0xeeae ; 0xeeae 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); } 1899c: 86 ea ldi r24, 0xA6 ; 166 1899e: 9f e0 ldi r25, 0x0F ; 15 189a0: 0f 94 23 dc call 0x3b846 ; 0x3b846 189a4: 21 e0 ldi r18, 0x01 ; 1 189a6: 30 e0 ldi r19, 0x00 ; 0 189a8: 81 11 cpse r24, r1 189aa: 02 c0 rjmp .+4 ; 0x189b0 189ac: 30 e0 ldi r19, 0x00 ; 0 189ae: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 189b0: c9 01 movw r24, r18 189b2: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 SERIAL_PROTOCOLLNRPGM(_header); 189b6: 8b e7 ldi r24, 0x7B ; 123 189b8: 95 e8 ldi r25, 0x85 ; 133 189ba: 0e 94 82 79 call 0xf304 ; 0xf304 gcode_M861_print_pinda_cal_eeprom(); 189be: 0e 94 8f 77 call 0xef1e ; 0xef1e 189c2: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } else if (code_seen('!')) { // ! - Set factory default values 189c6: 81 e2 ldi r24, 0x21 ; 33 189c8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 189cc: 88 23 and r24, r24 189ce: 49 f1 breq .+82 ; 0x18a22 189d0: 61 e0 ldi r22, 0x01 ; 1 189d2: 86 ea ldi r24, 0xA6 ; 166 189d4: 9f e0 ldi r25, 0x0F ; 15 189d6: 0f 94 47 dc call 0x3b88e ; 0x3b88e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 189da: 68 e0 ldi r22, 0x08 ; 8 189dc: 70 e0 ldi r23, 0x00 ; 0 189de: 80 eb ldi r24, 0xB0 ; 176 189e0: 9f e0 ldi r25, 0x0F ; 15 189e2: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 189e6: 68 e1 ldi r22, 0x18 ; 24 189e8: 70 e0 ldi r23, 0x00 ; 0 189ea: 82 eb ldi r24, 0xB2 ; 178 189ec: 9f e0 ldi r25, 0x0F ; 15 189ee: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 189f2: 60 e3 ldi r22, 0x30 ; 48 189f4: 70 e0 ldi r23, 0x00 ; 0 189f6: 84 eb ldi r24, 0xB4 ; 180 189f8: 9f e0 ldi r25, 0x0F ; 15 189fa: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 189fe: 60 e5 ldi r22, 0x50 ; 80 18a00: 70 e0 ldi r23, 0x00 ; 0 18a02: 86 eb ldi r24, 0xB6 ; 182 18a04: 9f e0 ldi r25, 0x0F ; 15 18a06: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 18a0a: 68 e7 ldi r22, 0x78 ; 120 18a0c: 70 e0 ldi r23, 0x00 ; 0 18a0e: 88 eb ldi r24, 0xB8 ; 184 18a10: 9f e0 ldi r25, 0x0F ; 15 18a12: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 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"); 18a16: 8a e6 ldi r24, 0x6A ; 106 18a18: 95 e8 ldi r25, 0x85 ; 133 18a1a: 0e 94 82 79 call 0xf304 ; 0xf304 18a1e: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 18a22: 8a e5 ldi r24, 0x5A ; 90 18a24: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18a28: 88 23 and r24, r24 18a2a: c1 f0 breq .+48 ; 0x18a5c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18a2c: 61 e0 ldi r22, 0x01 ; 1 18a2e: 86 ea ldi r24, 0xA6 ; 166 18a30: 9f e0 ldi r25, 0x0F ; 15 18a32: 0f 94 47 dc call 0x3b88e ; 0x3b88e 18a36: 00 eb ldi r16, 0xB0 ; 176 18a38: 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); 18a3a: 70 e0 ldi r23, 0x00 ; 0 18a3c: 60 e0 ldi r22, 0x00 ; 0 18a3e: c8 01 movw r24, r16 18a40: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 18a44: 0e 5f subi r16, 0xFE ; 254 18a46: 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++) { 18a48: 0a 3b cpi r16, 0xBA ; 186 18a4a: 4f e0 ldi r20, 0x0F ; 15 18a4c: 14 07 cpc r17, r20 18a4e: a9 f7 brne .-22 ; 0x18a3a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 18a50: 80 e6 ldi r24, 0x60 ; 96 18a52: 95 e8 ldi r25, 0x85 ; 133 18a54: 0e 94 82 79 call 0xf304 ; 0xf304 18a58: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 18a5c: 83 e5 ldi r24, 0x53 ; 83 18a5e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18a62: 88 23 and r24, r24 18a64: 21 f1 breq .+72 ; 0x18aae int16_t usteps = code_value_short(); 18a66: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 18a6a: 8c 01 movw r16, r24 if (code_seen('I')) { 18a6c: 89 e4 ldi r24, 0x49 ; 73 18a6e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18a72: 88 23 and r24, r24 18a74: 11 f4 brne .+4 ; 0x18a7a 18a76: 0c 94 f5 aa jmp 0x155ea ; 0x155ea uint8_t index = code_value_uint8(); 18a7a: 0e 94 6f 5b call 0xb6de ; 0xb6de if (index < 5) { 18a7e: 85 30 cpi r24, 0x05 ; 5 18a80: 10 f0 brcs .+4 ; 0x18a86 18a82: 0c 94 f5 aa jmp 0x155ea ; 0x155ea eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 18a86: 90 e0 ldi r25, 0x00 ; 0 18a88: 88 52 subi r24, 0x28 ; 40 18a8a: 98 4f sbci r25, 0xF8 ; 248 18a8c: b8 01 movw r22, r16 18a8e: 88 0f add r24, r24 18a90: 99 1f adc r25, r25 18a92: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca SERIAL_PROTOCOLLNRPGM(MSG_OK); 18a96: 8b eb ldi r24, 0xBB ; 187 18a98: 9d e6 ldi r25, 0x6D ; 109 18a9a: 0e 94 82 79 call 0xf304 ; 0xf304 SERIAL_PROTOCOLLNRPGM(_header); 18a9e: 8b e7 ldi r24, 0x7B ; 123 18aa0: 95 e8 ldi r25, 0x85 ; 133 18aa2: 0e 94 82 79 call 0xf304 ; 0xf304 gcode_M861_print_pinda_cal_eeprom(); 18aa6: 0e 94 8f 77 call 0xef1e ; 0xef1e 18aaa: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 18aae: 8f e4 ldi r24, 0x4F ; 79 18ab0: 95 e8 ldi r25, 0x85 ; 133 18ab2: 0e 94 82 79 call 0xf304 ; 0xf304 18ab6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea */ 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); 18aba: 0e 94 a4 60 call 0xc148 ; 0xc148 18abe: 20 e0 ldi r18, 0x00 ; 0 18ac0: 30 e0 ldi r19, 0x00 ; 0 18ac2: 40 e2 ldi r20, 0x20 ; 32 18ac4: 51 e4 ldi r21, 0x41 ; 65 18ac6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 18aca: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 18ace: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 18ad0: 63 30 cpi r22, 0x03 ; 3 18ad2: 09 f4 brne .+2 ; 0x18ad6 18ad4: a2 c0 rjmp .+324 ; 0x18c1a 18ad6: 98 f5 brcc .+102 ; 0x18b3e 18ad8: 61 30 cpi r22, 0x01 ; 1 18ada: 09 f4 brne .+2 ; 0x18ade 18adc: 59 c0 rjmp .+178 ; 0x18b90 18ade: 62 30 cpi r22, 0x02 ; 2 18ae0: 11 f0 breq .+4 ; 0x18ae6 18ae2: 0c 94 f5 aa jmp 0x155ea ; 0x155ea ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18ae6: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba return pgm_read_word(&_nPrinterMmuType); 18aea: e6 e9 ldi r30, 0x96 ; 150 18aec: fe e7 ldi r31, 0x7E ; 126 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18aee: 81 30 cpi r24, 0x01 ; 1 18af0: 11 f0 breq .+4 ; 0x18af6 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 18af2: e8 e9 ldi r30, 0x98 ; 152 18af4: fe e7 ldi r31, 0x7E ; 126 18af6: 05 91 lpm r16, Z+ 18af8: 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')) 18afa: 80 e5 ldi r24, 0x50 ; 80 18afc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18b00: 88 23 and r24, r24 18b02: 09 f4 brne .+2 ; 0x18b06 18b04: 79 c0 rjmp .+242 ; 0x18bf8 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 18b06: 0e 94 89 5b call 0xb712 ; 0xb712 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 18b0a: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18b0e: ff 20 and r15, r15 18b10: 11 f4 brne .+4 ; 0x18b16 18b12: 0c 94 f5 aa jmp 0x155ea ; 0x155ea return; if (nPrinterModel == actualPrinterModel) 18b16: 60 17 cp r22, r16 18b18: 71 07 cpc r23, r17 18b1a: 11 f4 brne .+4 ; 0x18b20 18b1c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 18b20: 8d ef ldi r24, 0xFD ; 253 18b22: 97 e3 ldi r25, 0x37 ; 55 18b24: 0e 94 b3 72 call 0xe566 ; 0xe566 18b28: 8c 01 movw r16, r24 18b2a: 85 ec ldi r24, 0xC5 ; 197 18b2c: 97 e3 ldi r25, 0x37 ; 55 18b2e: 0e 94 b3 72 call 0xe566 ; 0xe566 18b32: 4f 2d mov r20, r15 18b34: b8 01 movw r22, r16 18b36: 0e 94 f8 f4 call 0x1e9f0 ; 0x1e9f0 18b3a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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) 18b3e: 64 30 cpi r22, 0x04 ; 4 18b40: 09 f4 brne .+2 ; 0x18b44 18b42: be c0 rjmp .+380 ; 0x18cc0 18b44: 65 30 cpi r22, 0x05 ; 5 18b46: 11 f0 breq .+4 ; 0x18b4c 18b48: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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')) 18b4c: 80 e5 ldi r24, 0x50 ; 80 18b4e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18b52: 88 23 and r24, r24 18b54: 09 f4 brne .+2 ; 0x18b58 18b56: 3a c1 rjmp .+628 ; 0x18dcc { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 18b58: 0e 94 89 5b call 0xb712 ; 0xb712 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 18b5c: 10 91 e8 04 lds r17, 0x04E8 ; 0x8004e8 18b60: 11 23 and r17, r17 18b62: 11 f4 brne .+4 ; 0x18b68 18b64: 0c 94 f5 aa jmp 0x155ea ; 0x155ea return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 18b68: 62 30 cpi r22, 0x02 ; 2 18b6a: 71 05 cpc r23, r1 18b6c: 10 f4 brcc .+4 ; 0x18b72 18b6e: 0c 94 f5 aa jmp 0x155ea ; 0x155ea // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 18b72: 89 ee ldi r24, 0xE9 ; 233 18b74: 96 e3 ldi r25, 0x36 ; 54 18b76: 0e 94 b3 72 call 0xe566 ; 0xe566 18b7a: 7c 01 movw r14, r24 18b7c: 88 eb ldi r24, 0xB8 ; 184 18b7e: 96 e3 ldi r25, 0x36 ; 54 18b80: 0e 94 b3 72 call 0xe566 ; 0xe566 18b84: 41 2f mov r20, r17 18b86: b7 01 movw r22, r14 18b88: 0e 94 f8 f4 call 0x1e9f0 ; 0x1e9f0 18b8c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 18b90: 80 e5 ldi r24, 0x50 ; 80 18b92: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18b96: 88 23 and r24, r24 18b98: a9 f0 breq .+42 ; 0x18bc4 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 18b9a: 0e 94 a4 60 call 0xc148 ; 0xc148 18b9e: 20 e0 ldi r18, 0x00 ; 0 18ba0: 30 e0 ldi r19, 0x00 ; 0 18ba2: 4a e7 ldi r20, 0x7A ; 122 18ba4: 54 e4 ldi r21, 0x44 ; 68 18ba6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 18baa: 20 e0 ldi r18, 0x00 ; 0 18bac: 30 e0 ldi r19, 0x00 ; 0 18bae: 40 e0 ldi r20, 0x00 ; 0 18bb0: 5f e3 ldi r21, 0x3F ; 63 18bb2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 18bb6: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> nozzle_diameter_check(nDiameter); 18bba: cb 01 movw r24, r22 18bbc: 0e 94 37 f5 call 0x1ea6e ; 0x1ea6e 18bc0: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } else if(code_seen('Q')) 18bc4: 81 e5 ldi r24, 0x51 ; 81 18bc6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18bca: 88 23 and r24, r24 18bcc: 11 f4 brne .+4 ; 0x18bd2 18bce: 0c 94 f5 aa jmp 0x155ea ; 0x155ea SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 18bd2: 85 ea ldi r24, 0xA5 ; 165 18bd4: 9d e0 ldi r25, 0x0D ; 13 18bd6: 0f 94 31 dc call 0x3b862 ; 0x3b862 18bda: bc 01 movw r22, r24 18bdc: 90 e0 ldi r25, 0x00 ; 0 18bde: 80 e0 ldi r24, 0x00 ; 0 18be0: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 18be4: 20 e0 ldi r18, 0x00 ; 0 18be6: 30 e0 ldi r19, 0x00 ; 0 18be8: 4a e7 ldi r20, 0x7A ; 122 18bea: 54 e4 ldi r21, 0x44 ; 68 18bec: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 18bf0: 0f 94 bb 74 call 0x2e976 ; 0x2e976 18bf4: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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')) 18bf8: 81 e5 ldi r24, 0x51 ; 81 18bfa: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18bfe: 88 23 and r24, r24 18c00: 11 f4 brne .+4 ; 0x18c06 18c02: 0c 94 f5 aa jmp 0x155ea ; 0x155ea print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 18c06: b8 01 movw r22, r16 18c08: 90 e0 ldi r25, 0x00 ; 0 18c0a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18c0c: 4a e0 ldi r20, 0x0A ; 10 18c0e: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 18c12: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 18c16: 0c 94 f5 aa jmp 0x155ea ; 0x155ea return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18c1a: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba return _sPrinterMmuName; 18c1e: 6e e8 ldi r22, 0x8E ; 142 18c20: e6 2e mov r14, r22 18c22: 6e e7 ldi r22, 0x7E ; 126 18c24: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 18c26: 81 30 cpi r24, 0x01 ; 1 18c28: 21 f0 breq .+8 ; 0x18c32 return _sPrinterMmuName; } else { return _sPrinterName; 18c2a: 5a e8 ldi r21, 0x8A ; 138 18c2c: e5 2e mov r14, r21 18c2e: 5e e7 ldi r21, 0x7E ; 126 18c30: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 18c32: 80 e5 ldi r24, 0x50 ; 80 18c34: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18c38: 88 23 and r24, r24 18c3a: b1 f1 breq .+108 ; 0x18ca8 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18c3c: 62 e2 ldi r22, 0x22 ; 34 18c3e: 70 e0 ldi r23, 0x00 ; 0 18c40: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18c44: 90 91 96 03 lds r25, 0x0396 ; 0x800396 18c48: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 18c4c: 8c 01 movw r16, r24 if (!this->ptr) { 18c4e: 89 2b or r24, r25 18c50: d1 f0 breq .+52 ; 0x18c86 // First quote not found return; } // Skip the leading quote this->ptr++; 18c52: 0f 5f subi r16, 0xFF ; 255 18c54: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 18c56: 62 e2 ldi r22, 0x22 ; 34 18c58: 70 e0 ldi r23, 0x00 ; 0 18c5a: c8 01 movw r24, r16 18c5c: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 if(!pStrEnd) { 18c60: 00 97 sbiw r24, 0x00 ; 0 18c62: 89 f0 breq .+34 ; 0x18c86 // Second quote not found return; } this->len = pStrEnd - this->ptr; 18c64: d8 2e mov r13, r24 18c66: d0 1a sub r13, r16 18c68: c7 01 movw r24, r14 18c6a: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 18c6e: d8 12 cpse r13, r24 18c70: 0a c0 rjmp .+20 ; 0x18c86 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 18c72: ac 01 movw r20, r24 18c74: 55 27 eor r21, r21 18c76: b7 01 movw r22, r14 18c78: c8 01 movw r24, r16 18c7a: 0f 94 02 da call 0x3b404 ; 0x3b404 18c7e: 89 2b or r24, r25 18c80: 11 f4 brne .+4 ; 0x18c86 18c82: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } } render_M862_warnings( 18c86: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18c8a: 8d ef ldi r24, 0xFD ; 253 18c8c: 97 e3 ldi r25, 0x37 ; 55 18c8e: 0e 94 b3 72 call 0xe566 ; 0xe566 18c92: 8c 01 movw r16, r24 18c94: 85 ec ldi r24, 0xC5 ; 197 18c96: 97 e3 ldi r25, 0x37 ; 55 18c98: 0e 94 b3 72 call 0xe566 ; 0xe566 18c9c: 4f 2d mov r20, r15 18c9e: b8 01 movw r22, r16 18ca0: 0e 94 f8 f4 call 0x1e9f0 ; 0x1e9f0 18ca4: 0c 94 f5 aa jmp 0x155ea ; 0x155ea { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 18ca8: 81 e5 ldi r24, 0x51 ; 81 18caa: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18cae: 88 23 and r24, r24 18cb0: 11 f4 brne .+4 ; 0x18cb6 18cb2: 0c 94 f5 aa jmp 0x155ea ; 0x155ea SERIAL_PROTOCOLLNRPGM(type); 18cb6: c7 01 movw r24, r14 18cb8: 0e 94 82 79 call 0xf304 ; 0xf304 18cbc: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 18cc0: 80 e5 ldi r24, 0x50 ; 80 18cc2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18cc6: 88 23 and r24, r24 18cc8: 09 f4 brne .+2 ; 0x18ccc 18cca: 77 c0 rjmp .+238 ; 0x18dba fw_version_check(++strchr_pointer); 18ccc: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18cd0: 90 91 96 03 lds r25, 0x0396 ; 0x800396 18cd4: 01 96 adiw r24, 0x01 ; 1 18cd6: 90 93 96 03 sts 0x0396, r25 ; 0x800396 18cda: 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) 18cde: 20 91 e9 04 lds r18, 0x04E9 ; 0x8004e9 18ce2: 22 23 and r18, r18 18ce4: 11 f4 brne .+4 ; 0x18cea 18ce6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 18cea: be 01 movw r22, r28 18cec: 6f 5f subi r22, 0xFF ; 255 18cee: 7f 4f sbci r23, 0xFF ; 255 18cf0: 0e 94 78 ef call 0x1def0 ; 0x1def0 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 18cf4: 8a e0 ldi r24, 0x0A ; 10 18cf6: 90 e0 ldi r25, 0x00 ; 0 18cf8: 0f 94 31 dc call 0x3b862 ; 0x3b862 18cfc: 29 81 ldd r18, Y+1 ; 0x01 18cfe: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d00: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d02: 82 17 cp r24, r18 18d04: 93 07 cpc r25, r19 18d06: 28 f0 brcs .+10 ; 0x18d12 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d08: 11 e0 ldi r17, 0x01 ; 1 18d0a: 28 17 cp r18, r24 18d0c: 39 07 cpc r19, r25 18d0e: 08 f4 brcc .+2 ; 0x18d12 18d10: 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; 18d12: 12 95 swap r17 18d14: 11 0f add r17, r17 18d16: 11 0f add r17, r17 18d18: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 18d1a: 8c e0 ldi r24, 0x0C ; 12 18d1c: 90 e0 ldi r25, 0x00 ; 0 18d1e: 0f 94 31 dc call 0x3b862 ; 0x3b862 18d22: ac 01 movw r20, r24 18d24: 2b 81 ldd r18, Y+3 ; 0x03 18d26: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d28: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d2a: 42 17 cp r20, r18 18d2c: 53 07 cpc r21, r19 18d2e: 28 f0 brcs .+10 ; 0x18d3a return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d30: 81 e0 ldi r24, 0x01 ; 1 18d32: 24 17 cp r18, r20 18d34: 35 07 cpc r19, r21 18d36: 08 f4 brcc .+2 ; 0x18d3a 18d38: 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; 18d3a: 50 e1 ldi r21, 0x10 ; 16 18d3c: 85 9f mul r24, r21 18d3e: c0 01 movw r24, r0 18d40: 11 24 eor r1, r1 18d42: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 18d44: 8e e0 ldi r24, 0x0E ; 14 18d46: 90 e0 ldi r25, 0x00 ; 0 18d48: 0f 94 31 dc call 0x3b862 ; 0x3b862 18d4c: ac 01 movw r20, r24 18d4e: 2d 81 ldd r18, Y+5 ; 0x05 18d50: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d52: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d54: 42 17 cp r20, r18 18d56: 53 07 cpc r21, r19 18d58: 28 f0 brcs .+10 ; 0x18d64 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d5a: 81 e0 ldi r24, 0x01 ; 1 18d5c: 24 17 cp r18, r20 18d5e: 35 07 cpc r19, r21 18d60: 08 f4 brcc .+2 ; 0x18d64 18d62: 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; 18d64: a4 e0 ldi r26, 0x04 ; 4 18d66: 8a 9f mul r24, r26 18d68: c0 01 movw r24, r0 18d6a: 11 24 eor r1, r1 18d6c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 18d6e: 80 e1 ldi r24, 0x10 ; 16 18d70: 90 e0 ldi r25, 0x00 ; 0 18d72: 0f 94 31 dc call 0x3b862 ; 0x3b862 18d76: ac 01 movw r20, r24 18d78: 2f 81 ldd r18, Y+7 ; 0x07 18d7a: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 18d7c: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 18d7e: 42 17 cp r20, r18 18d80: 53 07 cpc r21, r19 18d82: 28 f0 brcs .+10 ; 0x18d8e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 18d84: 91 e0 ldi r25, 0x01 ; 1 18d86: 24 17 cp r18, r20 18d88: 35 07 cpc r19, r21 18d8a: 08 f4 brcc .+2 ; 0x18d8e 18d8c: 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)); 18d8e: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 18d90: 16 35 cpi r17, 0x56 ; 86 18d92: 10 f4 brcc .+4 ; 0x18d98 18d94: 0c 94 f5 aa jmp 0x155ea ; 0x155ea SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 18d98: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 18d9c: 82 e7 ldi r24, 0x72 ; 114 18d9e: 97 e3 ldi r25, 0x37 ; 55 18da0: 0e 94 b3 72 call 0xe566 ; 0xe566 18da4: 8c 01 movw r16, r24 18da6: 82 e4 ldi r24, 0x42 ; 66 18da8: 97 e3 ldi r25, 0x37 ; 55 18daa: 0e 94 b3 72 call 0xe566 ; 0xe566 18dae: 4f 2d mov r20, r15 18db0: b8 01 movw r22, r16 18db2: 0e 94 f8 f4 call 0x1e9f0 ; 0x1e9f0 18db6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea else if(code_seen('Q')) 18dba: 81 e5 ldi r24, 0x51 ; 81 18dbc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18dc0: 88 23 and r24, r24 18dc2: 11 f4 brne .+4 ; 0x18dc8 18dc4: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 18dc8: 0c 94 71 a7 jmp 0x14ee2 ; 0x14ee2 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 18dcc: 81 e5 ldi r24, 0x51 ; 81 18dce: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18dd2: 88 23 and r24, r24 18dd4: 11 f4 brne .+4 ; 0x18dda 18dd6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea SERIAL_PROTOCOLLN(GCODE_LEVEL); 18dda: 81 e0 ldi r24, 0x01 ; 1 18ddc: 90 e0 ldi r25, 0x00 ; 0 18dde: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 18de2: 0c 94 f5 aa jmp 0x155ea ; 0x155ea * 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; 18de6: 8b e4 ldi r24, 0x4B ; 75 18de8: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18dec: c1 2c mov r12, r1 18dee: d1 2c mov r13, r1 18df0: e1 2c mov r14, r1 18df2: 40 ec ldi r20, 0xC0 ; 192 18df4: f4 2e mov r15, r20 18df6: 88 23 and r24, r24 18df8: 49 f1 breq .+82 ; 0x18e4c 18dfa: 0e 94 a4 60 call 0xc148 ; 0xc148 18dfe: 6b 01 movw r12, r22 18e00: 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) 18e02: 20 e0 ldi r18, 0x00 ; 0 18e04: 30 e0 ldi r19, 0x00 ; 0 18e06: a9 01 movw r20, r18 18e08: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18e0c: 81 11 cpse r24, r1 18e0e: 1e c0 rjmp .+60 ; 0x18e4c { extruder_advance_K = 0; 18e10: 10 92 65 05 sts 0x0565, r1 ; 0x800565 18e14: 10 92 66 05 sts 0x0566, r1 ; 0x800566 18e18: 10 92 67 05 sts 0x0567, r1 ; 0x800567 18e1c: 10 92 68 05 sts 0x0568, r1 ; 0x800568 18e20: 0e 94 1e 82 call 0x1043c ; 0x1043c else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 18e24: 80 ed ldi r24, 0xD0 ; 208 18e26: 9b ea ldi r25, 0xAB ; 171 18e28: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM("Advance K="); 18e2c: 87 e6 ldi r24, 0x67 ; 103 18e2e: 9e e7 ldi r25, 0x7E ; 126 18e30: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(extruder_advance_K); 18e34: 60 91 65 05 lds r22, 0x0565 ; 0x800565 18e38: 70 91 66 05 lds r23, 0x0566 ; 0x800566 18e3c: 80 91 67 05 lds r24, 0x0567 ; 0x800567 18e40: 90 91 68 05 lds r25, 0x0568 ; 0x800568 18e44: 0f 94 bb 74 call 0x2e976 ; 0x2e976 18e48: 0c 94 f5 aa jmp 0x155ea ; 0x155ea } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 18e4c: 80 91 70 03 lds r24, 0x0370 ; 0x800370 18e50: 81 11 cpse r24, r1 18e52: 1b c0 rjmp .+54 ; 0x18e8a { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 18e54: 20 e0 ldi r18, 0x00 ; 0 18e56: 30 e0 ldi r19, 0x00 ; 0 18e58: a9 01 movw r20, r18 18e5a: c7 01 movw r24, r14 18e5c: b6 01 movw r22, r12 18e5e: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18e62: 87 ff sbrs r24, 7 18e64: 05 c0 rjmp .+10 ; 0x18e70 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 18e66: 82 e7 ldi r24, 0x72 ; 114 18e68: 9e e7 ldi r25, 0x7E ; 126 18e6a: 0e 94 82 79 call 0xf304 ; 0xf304 18e6e: da cf rjmp .-76 ; 0x18e24 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 18e70: 20 e0 ldi r18, 0x00 ; 0 18e72: 30 e0 ldi r19, 0x00 ; 0 18e74: 40 e2 ldi r20, 0x20 ; 32 18e76: 51 e4 ldi r21, 0x41 ; 65 18e78: c7 01 movw r24, r14 18e7a: b6 01 movw r22, r12 18e7c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18e80: 87 ff sbrs r24, 7 18e82: 2c c0 rjmp .+88 ; 0x18edc 18e84: 81 e0 ldi r24, 0x01 ; 1 18e86: 0e 94 1e 82 call 0x1043c ; 0x1043c } if(la10c_mode == LA10C_LA15) 18e8a: 80 91 70 03 lds r24, 0x0370 ; 0x800370 return (k >= 0 && k < LA_K_MAX? k: -1); 18e8e: 20 e0 ldi r18, 0x00 ; 0 18e90: 30 e0 ldi r19, 0x00 ; 0 18e92: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 18e94: 81 30 cpi r24, 0x01 ; 1 18e96: 21 f5 brne .+72 ; 0x18ee0 return (k >= 0 && k < LA_K_MAX? k: -1); 18e98: c7 01 movw r24, r14 18e9a: b6 01 movw r22, r12 18e9c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 18ea0: 87 fd sbrc r24, 7 18ea2: e1 cf rjmp .-62 ; 0x18e66 18ea4: 20 e0 ldi r18, 0x00 ; 0 18ea6: 30 e0 ldi r19, 0x00 ; 0 18ea8: 40 e2 ldi r20, 0x20 ; 32 18eaa: 51 e4 ldi r21, 0x41 ; 65 18eac: c7 01 movw r24, r14 18eae: b6 01 movw r22, r12 18eb0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18eb4: 87 ff sbrs r24, 7 18eb6: d7 cf rjmp .-82 ; 0x18e66 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 18eb8: 20 e0 ldi r18, 0x00 ; 0 18eba: 30 e0 ldi r19, 0x00 ; 0 18ebc: a9 01 movw r20, r18 18ebe: c7 01 movw r24, r14 18ec0: b6 01 movw r22, r12 18ec2: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18ec6: 87 fd sbrc r24, 7 18ec8: ce cf rjmp .-100 ; 0x18e66 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 18eca: c0 92 65 05 sts 0x0565, r12 ; 0x800565 18ece: d0 92 66 05 sts 0x0566, r13 ; 0x800566 18ed2: e0 92 67 05 sts 0x0567, r14 ; 0x800567 18ed6: f0 92 68 05 sts 0x0568, r15 ; 0x800568 18eda: a4 cf rjmp .-184 ; 0x18e24 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 18edc: 82 e0 ldi r24, 0x02 ; 2 18ede: d3 cf rjmp .-90 ; 0x18e86 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 18ee0: c7 01 movw r24, r14 18ee2: b6 01 movw r22, r12 18ee4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 18ee8: 87 fd sbrc r24, 7 18eea: bd cf rjmp .-134 ; 0x18e66 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 18eec: 2f e6 ldi r18, 0x6F ; 111 18eee: 32 e1 ldi r19, 0x12 ; 18 18ef0: 43 e0 ldi r20, 0x03 ; 3 18ef2: 5b e3 ldi r21, 0x3B ; 59 18ef4: c7 01 movw r24, r14 18ef6: b6 01 movw r22, r12 18ef8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 18efc: 2a e0 ldi r18, 0x0A ; 10 18efe: 37 ed ldi r19, 0xD7 ; 215 18f00: 43 e2 ldi r20, 0x23 ; 35 18f02: 5c e3 ldi r21, 0x3C ; 60 18f04: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 18f08: 6b 01 movw r12, r22 18f0a: 7c 01 movw r14, r24 return new_K < 0? 0: 18f0c: 20 e0 ldi r18, 0x00 ; 0 18f0e: 30 e0 ldi r19, 0x00 ; 0 18f10: a9 01 movw r20, r18 18f12: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18f16: 87 fd sbrc r24, 7 18f18: 11 c0 rjmp .+34 ; 0x18f3c new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 18f1a: 20 e0 ldi r18, 0x00 ; 0 18f1c: 30 e0 ldi r19, 0x00 ; 0 18f1e: 40 e2 ldi r20, 0x20 ; 32 18f20: 51 e4 ldi r21, 0x41 ; 65 18f22: c7 01 movw r24, r14 18f24: b6 01 movw r22, r12 18f26: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 18f2a: 18 16 cp r1, r24 18f2c: 2c f6 brge .-118 ; 0x18eb8 18f2e: c1 2c mov r12, r1 18f30: d1 2c mov r13, r1 18f32: 30 e2 ldi r19, 0x20 ; 32 18f34: e3 2e mov r14, r19 18f36: 31 e4 ldi r19, 0x41 ; 65 18f38: f3 2e mov r15, r19 18f3a: c7 cf rjmp .-114 ; 0x18eca // 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: 18f3c: c1 2c mov r12, r1 18f3e: d1 2c mov r13, r1 18f40: 76 01 movw r14, r12 18f42: c3 cf rjmp .-122 ; 0x18eca 18f44: 9d ed ldi r25, 0xDD ; 221 18f46: 89 2e mov r8, r25 18f48: 92 e0 ldi r25, 0x02 ; 2 18f4a: 99 2e mov r9, r25 18f4c: 0d e5 ldi r16, 0x5D ; 93 18f4e: 12 e0 ldi r17, 0x02 ; 2 18f50: 25 ef ldi r18, 0xF5 ; 245 18f52: a2 2e mov r10, r18 18f54: 24 e0 ldi r18, 0x04 ; 4 18f56: 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++){ 18f58: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 18f5a: f4 01 movw r30, r8 18f5c: 81 91 ld r24, Z+ 18f5e: 4f 01 movw r8, r30 18f60: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 18f64: 88 23 and r24, r24 18f66: 09 f4 brne .+2 ; 0x18f6a 18f68: 45 c0 rjmp .+138 ; 0x18ff4 if( i == E_AXIS && FarmOrUserECool() ){ 18f6a: f3 e0 ldi r31, 0x03 ; 3 18f6c: 7f 12 cpse r7, r31 18f6e: 04 c0 rjmp .+8 ; 0x18f78 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(); 18f70: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 18f74: 81 11 cpse r24, r1 18f76: 61 c0 rjmp .+194 ; 0x1903a SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 18f78: 0e 94 a4 60 call 0xc148 ; 0xc148 18f7c: 6b 01 movw r12, r22 18f7e: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 18f80: 20 e0 ldi r18, 0x00 ; 0 18f82: 30 e0 ldi r19, 0x00 ; 0 18f84: a9 01 movw r20, r18 18f86: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 18f8a: 87 fd sbrc r24, 7 18f8c: 46 c0 rjmp .+140 ; 0x1901a if (cur > 1029) cur = 1029; //limit max 18f8e: 20 e0 ldi r18, 0x00 ; 0 18f90: 30 ea ldi r19, 0xA0 ; 160 18f92: 40 e8 ldi r20, 0x80 ; 128 18f94: 54 e4 ldi r21, 0x44 ; 68 18f96: c7 01 movw r24, r14 18f98: b6 01 movw r22, r12 18f9a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 18f9e: 18 16 cp r1, r24 18fa0: a4 f1 brlt .+104 ; 0x1900a //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; 18fa2: 20 e0 ldi r18, 0x00 ; 0 18fa4: 30 e0 ldi r19, 0x00 ; 0 18fa6: 47 e0 ldi r20, 0x07 ; 7 18fa8: 54 e4 ldi r21, 0x44 ; 68 18faa: c7 01 movw r24, r14 18fac: b6 01 movw r22, r12 18fae: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 18fb2: 87 fd sbrc r24, 7 18fb4: 35 c0 rjmp .+106 ; 0x19020 18fb6: 20 e0 ldi r18, 0x00 ; 0 18fb8: 30 e0 ldi r19, 0x00 ; 0 18fba: 4c e7 ldi r20, 0x7C ; 124 18fbc: 52 e4 ldi r21, 0x42 ; 66 18fbe: c7 01 movw r24, r14 18fc0: b6 01 movw r22, r12 18fc2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 18fc6: 20 e0 ldi r18, 0x00 ; 0 18fc8: 30 ea ldi r19, 0xA0 ; 160 18fca: 40 e8 ldi r20, 0x80 ; 128 18fcc: 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); 18fce: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 18fd2: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 18fd6: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 18fd8: c8 01 movw r24, r16 18fda: 0e 94 05 68 call 0xd00a ; 0xd00a currents[i].setiRun(val); 18fde: 6f 2d mov r22, r15 18fe0: c8 01 movw r24, r16 18fe2: 0e 94 0d 68 call 0xd01a ; 0xd01a tmc2130_setup_chopper(i, tmc2130_mres[i]); 18fe6: 50 e0 ldi r21, 0x00 ; 0 18fe8: 40 e0 ldi r20, 0x00 ; 0 18fea: d5 01 movw r26, r10 18fec: 6c 91 ld r22, X 18fee: 87 2d mov r24, r7 18ff0: 0f 94 96 24 call 0x2492c ; 0x2492c */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 18ff4: 73 94 inc r7 18ff6: 0d 5f subi r16, 0xFD ; 253 18ff8: 1f 4f sbci r17, 0xFF ; 255 18ffa: bf ef ldi r27, 0xFF ; 255 18ffc: ab 1a sub r10, r27 18ffe: bb 0a sbc r11, r27 19000: e4 e0 ldi r30, 0x04 ; 4 19002: 7e 12 cpse r7, r30 19004: aa cf rjmp .-172 ; 0x18f5a 19006: 0c 94 f5 aa jmp 0x155ea ; 0x155ea //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 1900a: c1 2c mov r12, r1 1900c: 80 ea ldi r24, 0xA0 ; 160 1900e: d8 2e mov r13, r24 19010: 80 e8 ldi r24, 0x80 ; 128 19012: e8 2e mov r14, r24 19014: 84 e4 ldi r24, 0x44 ; 68 19016: f8 2e mov r15, r24 19018: ce cf rjmp .-100 ; 0x18fb6 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 1901a: c1 2c mov r12, r1 1901c: d1 2c mov r13, r1 1901e: 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); 19020: 20 e0 ldi r18, 0x00 ; 0 19022: 30 e0 ldi r19, 0x00 ; 0 19024: 4c e7 ldi r20, 0x7C ; 124 19026: 52 e4 ldi r21, 0x42 ; 66 19028: c7 01 movw r24, r14 1902a: b6 01 movw r22, r12 1902c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 19030: 20 e0 ldi r18, 0x00 ; 0 19032: 34 eb ldi r19, 0xB4 ; 180 19034: 40 e9 ldi r20, 0x90 ; 144 19036: 54 e4 ldi r21, 0x44 ; 68 19038: ca cf rjmp .-108 ; 0x18fce if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 1903a: 87 e7 ldi r24, 0x77 ; 119 1903c: 9f e9 ldi r25, 0x9F ; 159 1903e: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM(", M907 E ignored"); 19042: 8e e3 ldi r24, 0x3E ; 62 19044: 95 e8 ldi r25, 0x85 ; 133 19046: 0e 94 82 79 call 0xf304 ; 0xf304 1904a: d4 cf rjmp .-88 ; 0x18ff4 1904c: 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; } 19050: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19054: 81 11 cpse r24, r1 19056: 01 c0 rjmp .+2 ; 0x1905a 19058: 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"), 1905a: 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() 1905c: 86 e6 ldi r24, 0x66 ; 102 1905e: 92 e0 ldi r25, 0x02 ; 2 19060: 0f 94 1d 27 call 0x24e3a ; 0x24e3a 19064: 88 2e mov r8, r24 19066: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1906a: 80 91 63 02 lds r24, 0x0263 ; 0x800263 1906e: 81 11 cpse r24, r1 19070: 01 c0 rjmp .+2 ; 0x19074 19072: 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"), 19074: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 19076: 83 e6 ldi r24, 0x63 ; 99 19078: 92 e0 ldi r25, 0x02 ; 2 1907a: 0f 94 1d 27 call 0x24e3a ; 0x24e3a 1907e: 98 2e mov r9, r24 19080: 00 91 61 02 lds r16, 0x0261 ; 0x800261 19084: 80 91 60 02 lds r24, 0x0260 ; 0x800260 19088: 81 11 cpse r24, r1 1908a: 01 c0 rjmp .+2 ; 0x1908e 1908c: 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"), 1908e: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 19090: 80 e6 ldi r24, 0x60 ; 96 19092: 92 e0 ldi r25, 0x02 ; 2 19094: 0f 94 1d 27 call 0x24e3a ; 0x24e3a 19098: e8 2e mov r14, r24 1909a: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 1909e: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 190a2: 81 11 cpse r24, r1 190a4: 01 c0 rjmp .+2 ; 0x190a8 190a6: 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(), 190a8: 8d e5 ldi r24, 0x5D ; 93 190aa: 92 e0 ldi r25, 0x02 ; 2 190ac: 0f 94 1d 27 call 0x24e3a ; 0x24e3a 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"), 190b0: bf 92 push r11 190b2: af 92 push r10 190b4: 1f 92 push r1 190b6: 8f 92 push r8 190b8: df 92 push r13 190ba: cf 92 push r12 190bc: 1f 92 push r1 190be: 9f 92 push r9 190c0: 1f 93 push r17 190c2: 0f 93 push r16 190c4: 1f 92 push r1 190c6: ef 92 push r14 190c8: 1f 92 push r1 190ca: ff 92 push r15 190cc: 1f 92 push r1 190ce: 8f 93 push r24 190d0: 82 e9 ldi r24, 0x92 ; 146 190d2: 97 e6 ldi r25, 0x67 ; 103 190d4: 9f 93 push r25 190d6: 8f 93 push r24 190d8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 190dc: 0f b6 in r0, 0x3f ; 63 190de: f8 94 cli 190e0: de bf out 0x3e, r29 ; 62 190e2: 0f be out 0x3f, r0 ; 63 190e4: cd bf out 0x3d, r28 ; 61 190e6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea - `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; 190ea: 11 e0 ldi r17, 0x01 ; 1 190ec: 82 39 cpi r24, 0x92 ; 146 190ee: 93 40 sbci r25, 0x03 ; 3 190f0: 09 f4 brne .+2 ; 0x190f4 190f2: 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')) 190f4: 82 e5 ldi r24, 0x52 ; 82 190f6: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 190fa: 88 23 and r24, r24 190fc: 81 f0 breq .+32 ; 0x1911e { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 190fe: 8f ef ldi r24, 0xFF ; 255 19100: 9f e0 ldi r25, 0x0F ; 15 19102: 0f 94 23 dc call 0x3b846 ; 0x3b846 19106: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 19108: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 1910c: 81 17 cp r24, r17 1910e: 11 f4 brne .+4 ; 0x19114 19110: 0c 94 f5 aa jmp 0x155ea ; 0x155ea ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 19114: 81 2f mov r24, r17 19116: 0e 94 90 60 call 0xc120 ; 0xc120 1911a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea //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')) 1911e: 80 e5 ldi r24, 0x50 ; 80 19120: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 19124: 88 23 and r24, r24 19126: 89 f0 breq .+34 ; 0x1914a { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 19128: 01 e0 ldi r16, 0x01 ; 1 1912a: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> 1912e: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 19132: 82 39 cpi r24, 0x92 ; 146 19134: 93 40 sbci r25, 0x03 ; 3 19136: 09 f4 brne .+2 ; 0x1913a 19138: 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); 1913a: 60 2f mov r22, r16 1913c: 8f ef ldi r24, 0xFF ; 255 1913e: 9f e0 ldi r25, 0x0F ; 15 19140: 0f 94 47 dc call 0x3b88e ; 0x3b88e eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 19144: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 19148: df cf rjmp .-66 ; 0x19108 //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')) 1914a: 81 e5 ldi r24, 0x51 ; 81 1914c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 19150: 88 23 and r24, r24 19152: d1 f2 breq .-76 ; 0x19108 { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19154: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 19158: 81 11 cpse r24, r1 1915a: 15 c0 rjmp .+42 ; 0x19186 1915c: 8a e8 ldi r24, 0x8A ; 138 1915e: 94 e4 ldi r25, 0x44 ; 68 19160: 9f 93 push r25 19162: 8f 93 push r24 19164: 8d e0 ldi r24, 0x0D ; 13 19166: 98 e4 ldi r25, 0x48 ; 72 19168: 9f 93 push r25 1916a: 8f 93 push r24 1916c: 86 e3 ldi r24, 0x36 ; 54 1916e: 95 e8 ldi r25, 0x85 ; 133 19170: 9f 93 push r25 19172: 8f 93 push r24 19174: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 19178: 0f 90 pop r0 1917a: 0f 90 pop r0 1917c: 0f 90 pop r0 1917e: 0f 90 pop r0 19180: 0f 90 pop r0 19182: 0f 90 pop r0 19184: c1 cf rjmp .-126 ; 0x19108 19186: 8a e8 ldi r24, 0x8A ; 138 19188: 97 e4 ldi r25, 0x47 ; 71 1918a: ea cf rjmp .-44 ; 0x19160 1918c: 8d ed ldi r24, 0xDD ; 221 1918e: 92 e0 ldi r25, 0x02 ; 2 19190: 6c 96 adiw r28, 0x1c ; 28 19192: 9f af std Y+63, r25 ; 0x3f 19194: 8e af std Y+62, r24 ; 0x3e 19196: 6c 97 sbiw r28, 0x1c ; 28 19198: ee eb ldi r30, 0xBE ; 190 1919a: ee 2e mov r14, r30 1919c: ed e0 ldi r30, 0x0D ; 13 1919e: fe 2e mov r15, r30 191a0: f3 ea ldi r31, 0xA3 ; 163 191a2: cf 2e mov r12, r31 191a4: f6 e0 ldi r31, 0x06 ; 6 191a6: df 2e mov r13, r31 191a8: a5 ef ldi r26, 0xF5 ; 245 191aa: 2a 2e mov r2, r26 191ac: a4 e0 ldi r26, 0x04 ; 4 191ae: 3a 2e mov r3, r26 191b0: ba e7 ldi r27, 0x7A ; 122 191b2: 8b 2e mov r8, r27 191b4: be e0 ldi r27, 0x0E ; 14 191b6: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 191d4: b8 2e mov r11, r24 191d6: 88 23 and r24, r24 191d8: 09 f4 brne .+2 ; 0x191dc 191da: 7c c0 rjmp .+248 ; 0x192d4 { uint16_t res_new = code_value(); 191dc: 0e 94 a4 60 call 0xc148 ; 0xc148 191e0: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 191e4: 2b 01 movw r4, r22 191e6: 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 191e8: 68 30 cpi r22, 0x08 ; 8 191ea: 71 05 cpc r23, r1 191ec: 09 f4 brne .+2 ; 0x191f0 191ee: 60 c3 rjmp .+1728 ; 0x198b0 191f0: 60 31 cpi r22, 0x10 ; 16 191f2: 71 05 cpc r23, r1 191f4: 09 f4 brne .+2 ; 0x191f8 191f6: 5c c3 rjmp .+1720 ; 0x198b0 191f8: 81 e0 ldi r24, 0x01 ; 1 191fa: 00 32 cpi r16, 0x20 ; 32 191fc: 11 05 cpc r17, r1 191fe: 09 f0 breq .+2 ; 0x19202 19200: 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 19202: 67 96 adiw r28, 0x17 ; 23 19204: bf ad ldd r27, Y+63 ; 0x3f 19206: 67 97 sbiw r28, 0x17 ; 23 19208: b3 30 cpi r27, 0x03 ; 3 1920a: 09 f4 brne .+2 ; 0x1920e 1920c: 5c c3 rjmp .+1720 ; 0x198c6 1920e: 92 01 movw r18, r4 19210: 21 50 subi r18, 0x01 ; 1 19212: 31 09 sbc r19, r1 19214: 22 30 cpi r18, 0x02 ; 2 19216: 31 05 cpc r19, r1 19218: 08 f0 brcs .+2 ; 0x1921c 1921a: 50 c3 rjmp .+1696 ; 0x198bc 1921c: 9b 2d mov r25, r11 1921e: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 19220: 67 96 adiw r28, 0x17 ; 23 19222: ef ad ldd r30, Y+63 ; 0x3f 19224: 67 97 sbiw r28, 0x17 ; 23 19226: e3 30 cpi r30, 0x03 ; 3 19228: 41 f4 brne .+16 ; 0x1923a 1922a: 00 34 cpi r16, 0x40 ; 64 1922c: 11 05 cpc r17, r1 1922e: 31 f0 breq .+12 ; 0x1923c 19230: bb 24 eor r11, r11 19232: b3 94 inc r11 19234: 00 38 cpi r16, 0x80 ; 128 19236: 11 05 cpc r17, r1 19238: 09 f0 breq .+2 ; 0x1923c 1923a: b1 2c mov r11, r1 #endif if (res_valid) 1923c: 81 11 cpse r24, r1 1923e: 03 c0 rjmp .+6 ; 0x19246 19240: bb 20 and r11, r11 19242: 09 f4 brne .+2 ; 0x19246 19244: 47 c0 rjmp .+142 ; 0x192d4 { st_synchronize(); 19246: 0f 94 ef 42 call 0x285de ; 0x285de return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 1924a: d1 01 movw r26, r2 1924c: 8c 91 ld r24, X 1924e: a1 2c mov r10, r1 19250: bb 24 eor r11, r11 19252: b3 94 inc r11 19254: 02 c0 rjmp .+4 ; 0x1925a 19256: b6 94 lsr r11 19258: a7 94 ror r10 1925a: 8a 95 dec r24 1925c: e2 f7 brpl .-8 ; 0x19256 uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 1925e: b2 01 movw r22, r4 19260: 67 96 adiw r28, 0x17 ; 23 19262: 8f ad ldd r24, Y+63 ; 0x3f 19264: 67 97 sbiw r28, 0x17 ; 23 19266: 0f 94 01 25 call 0x24a02 ; 0x24a02 cs.axis_ustep_resolution[i] = res_new; 1926a: f4 01 movw r30, r8 1926c: 40 82 st Z, r4 if (res_new > res) 1926e: a0 16 cp r10, r16 19270: b1 06 cpc r11, r17 19272: 08 f0 brcs .+2 ; 0x19276 19274: 47 c0 rjmp .+142 ; 0x19304 { uint16_t fac = (res_new / res); 19276: c8 01 movw r24, r16 19278: b5 01 movw r22, r10 1927a: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 1927e: 2b 01 movw r4, r22 19280: 71 2c mov r7, r1 19282: 61 2c mov r6, r1 19284: c3 01 movw r24, r6 19286: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 1928a: 9b 01 movw r18, r22 1928c: ac 01 movw r20, r24 1928e: d7 01 movw r26, r14 19290: 14 96 adiw r26, 0x04 ; 4 19292: 6d 91 ld r22, X+ 19294: 7d 91 ld r23, X+ 19296: 8d 91 ld r24, X+ 19298: 9c 91 ld r25, X 1929a: 17 97 sbiw r26, 0x07 ; 7 1929c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 192a0: f7 01 movw r30, r14 192a2: 64 83 std Z+4, r22 ; 0x04 192a4: 75 83 std Z+5, r23 ; 0x05 192a6: 86 83 std Z+6, r24 ; 0x06 192a8: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 192aa: d6 01 movw r26, r12 192ac: 2d 91 ld r18, X+ 192ae: 3d 91 ld r19, X+ 192b0: 4d 91 ld r20, X+ 192b2: 5c 91 ld r21, X 192b4: c3 01 movw r24, r6 192b6: b2 01 movw r22, r4 192b8: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 192bc: f6 01 movw r30, r12 192be: 60 83 st Z, r22 192c0: 71 83 std Z+1, r23 ; 0x01 192c2: 82 83 std Z+2, r24 ; 0x02 192c4: 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) 192c6: 67 96 adiw r28, 0x17 ; 23 192c8: ff ad ldd r31, Y+63 ; 0x3f 192ca: 67 97 sbiw r28, 0x17 ; 23 192cc: f3 30 cpi r31, 0x03 ; 3 192ce: 11 f4 brne .+4 ; 0x192d4 fsensor.init(); 192d0: 0f 94 40 7b call 0x2f680 ; 0x2f680 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 192fe: 5f cf rjmp .-322 ; 0x191be 19300: 0c 94 7b b0 jmp 0x160f6 ; 0x160f6 cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 19304: c5 01 movw r24, r10 19306: b8 01 movw r22, r16 19308: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 1930c: 2b 01 movw r4, r22 1930e: 71 2c mov r7, r1 19310: 61 2c mov r6, r1 19312: c3 01 movw r24, r6 19314: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 19318: 9b 01 movw r18, r22 1931a: ac 01 movw r20, r24 1931c: d7 01 movw r26, r14 1931e: 14 96 adiw r26, 0x04 ; 4 19320: 6d 91 ld r22, X+ 19322: 7d 91 ld r23, X+ 19324: 8d 91 ld r24, X+ 19326: 9c 91 ld r25, X 19328: 17 97 sbiw r26, 0x07 ; 7 1932a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1932e: f7 01 movw r30, r14 19330: 64 83 std Z+4, r22 ; 0x04 19332: 75 83 std Z+5, r23 ; 0x05 19334: 86 83 std Z+6, r24 ; 0x06 19336: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 19338: d6 01 movw r26, r12 1933a: 6d 91 ld r22, X+ 1933c: 7d 91 ld r23, X+ 1933e: 8d 91 ld r24, X+ 19340: 9c 91 ld r25, X 19342: a3 01 movw r20, r6 19344: 92 01 movw r18, r4 19346: 0f 94 14 dd call 0x3ba28 ; 0x3ba28 <__divmodsi4> 1934a: f6 01 movw r30, r12 1934c: 20 83 st Z, r18 1934e: 31 83 std Z+1, r19 ; 0x01 19350: 42 83 std Z+2, r20 ; 0x02 19352: 53 83 std Z+3, r21 ; 0x03 19354: b8 cf rjmp .-144 ; 0x192c6 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') ) { 19356: 80 e5 ldi r24, 0x50 ; 80 19358: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1935c: 88 23 and r24, r24 1935e: 29 f0 breq .+10 ; 0x1936a mmuSlotIndex = code_value_uint8(); 19360: 0e 94 6f 5b call 0xb6de ; 0xb6de 19364: 18 2f mov r17, r24 19366: 0c 94 fb a9 jmp 0x153f6 ; 0x153f6 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') ) { 1936a: 84 e5 ldi r24, 0x54 ; 84 1936c: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 19370: 81 11 cpse r24, r1 19372: f6 cf rjmp .-20 ; 0x19360 19374: 0c 94 fa a9 jmp 0x153f4 ; 0x153f4 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 19378: 60 e0 ldi r22, 0x00 ; 0 1937a: 70 e0 ldi r23, 0x00 ; 0 1937c: cb 01 movw r24, r22 1937e: 0c 94 14 aa jmp 0x15428 ; 0x15428 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; 19382: 82 e0 ldi r24, 0x02 ; 2 19384: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 19388: 87 e3 ldi r24, 0x37 ; 55 1938a: 9c e5 ldi r25, 0x5C ; 92 1938c: 0e 94 b3 72 call 0xe566 ; 0xe566 19390: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 current_position[E_AXIS] += fastLoadLength; 19394: a7 01 movw r20, r14 19396: 96 01 movw r18, r12 19398: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1939c: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 193a0: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 193a4: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 193a8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 193ac: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 193b0: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 193b4: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 193b8: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 193bc: 60 e0 ldi r22, 0x00 ; 0 193be: 70 e0 ldi r23, 0x00 ; 0 193c0: 80 ea ldi r24, 0xA0 ; 160 193c2: 91 e4 ldi r25, 0x41 ; 65 193c4: 0f 94 50 c0 call 0x380a0 ; 0x380a0 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 193c8: 01 11 cpse r16, r1 193ca: 06 c0 rjmp .+12 ; 0x193d8 raise_z_above(MIN_Z_FOR_LOAD); 193cc: 60 e0 ldi r22, 0x00 ; 0 193ce: 70 e0 ldi r23, 0x00 ; 0 193d0: 88 e4 ldi r24, 0x48 ; 72 193d2: 92 e4 ldi r25, 0x42 ; 66 193d4: 0e 94 67 6e call 0xdcce ; 0xdcce } load_filament_final_feed(); // slow sequence 193d8: 0e 94 9a 64 call 0xc934 ; 0xc934 st_synchronize(); 193dc: 0f 94 ef 42 call 0x285de ; 0x285de Sound_MakeCustom(50, 500, false); 193e0: 40 e0 ldi r20, 0x00 ; 0 193e2: 64 ef ldi r22, 0xF4 ; 244 193e4: 71 e0 ldi r23, 0x01 ; 1 193e6: 82 e3 ldi r24, 0x32 ; 50 193e8: 90 e0 ldi r25, 0x00 ; 0 193ea: 0f 94 4d 51 call 0x2a29a ; 0x2a29a if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 193ee: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 193f2: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 193f4: 0f 94 70 4f call 0x29ee0 ; 0x29ee0 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 193f8: 81 e0 ldi r24, 0x01 ; 1 193fa: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_update(2); 193fe: 82 e0 ldi r24, 0x02 ; 2 19400: 0e 94 ae 6e call 0xdd5c ; 0xdd5c lcd_setstatuspgm(MSG_WELCOME); 19404: 83 e7 ldi r24, 0x73 ; 115 19406: 90 e7 ldi r25, 0x70 ; 112 19408: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 custom_message_type = CustomMsg::Status; 1940c: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 19410: 0c 94 29 aa jmp 0x15452 ; 0x15452 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 19414: 85 e5 ldi r24, 0x55 ; 85 19416: 0e 94 dd 5b call 0xb7ba ; 0xb7ba - `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; 1941a: c1 2c mov r12, r1 1941c: d1 2c mov r13, r1 1941e: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 19420: 88 23 and r24, r24 19422: 21 f0 breq .+8 ; 0x1942c 19424: 0e 94 a4 60 call 0xc148 ; 0xc148 19428: 6b 01 movw r12, r22 1942a: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 1942c: 8a e5 ldi r24, 0x5A ; 90 1942e: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 19432: 88 23 and r24, r24 19434: a1 f0 breq .+40 ; 0x1945e 19436: 0e 94 a4 60 call 0xc148 ; 0xc148 1943a: 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); 1943c: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 19440: 4b 01 movw r8, r22 19442: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19444: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19448: 81 30 cpi r24, 0x01 ; 1 1944a: 99 f4 brne .+38 ; 0x19472 1944c: 0f 94 44 ad call 0x35a88 ; 0x35a88 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19450: c5 01 movw r24, r10 19452: b4 01 movw r22, r8 19454: 90 58 subi r25, 0x80 ; 128 19456: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 1945a: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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 1945e: 60 e0 ldi r22, 0x00 ; 0 19460: 70 e0 ldi r23, 0x00 ; 0 19462: 80 ea ldi r24, 0xA0 ; 160 19464: 91 e4 ldi r25, 0x41 ; 65 19466: 0e 94 67 6e call 0xdcce ; 0xdcce - `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; 1946a: 60 e0 ldi r22, 0x00 ; 0 1946c: 70 e0 ldi r23, 0x00 ; 0 1946e: cb 01 movw r24, r22 19470: e5 cf rjmp .-54 ; 0x1943c // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19472: c7 01 movw r24, r14 19474: b6 01 movw r22, r12 19476: 0e 94 56 f8 call 0x1f0ac ; 0x1f0ac 1947a: ea cf rjmp .-44 ; 0x19450 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 1947c: 81 ec ldi r24, 0xC1 ; 193 1947e: 92 e0 ldi r25, 0x02 ; 2 19480: 0e 94 56 60 call 0xc0ac ; 0xc0ac 19484: 0c 94 f5 aa jmp 0x155ea ; 0x155ea #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 19488: 82 ec ldi r24, 0xC2 ; 194 1948a: 92 e0 ldi r25, 0x02 ; 2 1948c: 0e 94 56 60 call 0xc0ac ; 0xc0ac 19490: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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() ) { 19494: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19498: 81 30 cpi r24, 0x01 ; 1 1949a: 11 f0 breq .+4 ; 0x194a0 1949c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea if( code_seen('A') ) { 194a0: 81 e4 ldi r24, 0x41 ; 65 194a2: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 194a6: 88 23 and r24, r24 194a8: 11 f4 brne .+4 ; 0x194ae 194aa: 0c 94 f5 aa jmp 0x155ea ; 0x155ea MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 194ae: 80 91 95 03 lds r24, 0x0395 ; 0x800395 194b2: 90 91 96 03 lds r25, 0x0396 ; 0x800396 194b6: 40 e1 ldi r20, 0x10 ; 16 194b8: 50 e0 ldi r21, 0x00 ; 0 194ba: 70 e0 ldi r23, 0x00 ; 0 194bc: 60 e0 ldi r22, 0x00 ; 0 194be: 01 96 adiw r24, 0x01 ; 1 194c0: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 194c4: 86 2f mov r24, r22 194c6: 0f 94 a2 0f call 0x21f44 ; 0x21f44 194ca: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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() ){ 194ce: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 194d2: 81 30 cpi r24, 0x01 ; 1 194d4: 11 f0 breq .+4 ; 0x194da 194d6: 0c 94 f5 aa jmp 0x155ea ; 0x155ea uint8_t addr = 0; if( code_seen('A') ) { 194da: 81 e4 ldi r24, 0x41 ; 65 194dc: 0e 94 dd 5b call 0xb7ba ; 0xb7ba Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 194e0: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 194e2: 88 23 and r24, r24 194e4: 61 f0 breq .+24 ; 0x194fe addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 194e6: 80 91 95 03 lds r24, 0x0395 ; 0x800395 194ea: 90 91 96 03 lds r25, 0x0396 ; 0x800396 194ee: 40 e1 ldi r20, 0x10 ; 16 194f0: 50 e0 ldi r21, 0x00 ; 0 194f2: 70 e0 ldi r23, 0x00 ; 0 194f4: 60 e0 ldi r22, 0x00 ; 0 194f6: 01 96 adiw r24, 0x01 ; 1 194f8: 0f 94 ae d7 call 0x3af5c ; 0x3af5c 194fc: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 194fe: 88 e5 ldi r24, 0x58 ; 88 19500: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 19504: 88 23 and r24, r24 19506: 61 f0 breq .+24 ; 0x19520 data = code_value_short(); 19508: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 } if(addr){ 1950c: 11 23 and r17, r17 1950e: 11 f4 brne .+4 ; 0x19514 19510: 0c 94 f5 aa jmp 0x155ea ; 0x155ea MMU2::mmu2.WriteRegister(addr, data); 19514: bc 01 movw r22, r24 19516: 81 2f mov r24, r17 19518: 0e 94 4b e8 call 0x1d096 ; 0x1d096 1951c: 0c 94 f5 aa jmp 0x155ea ; 0x155ea 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; 19520: 90 e0 ldi r25, 0x00 ; 0 19522: 80 e0 ldi r24, 0x00 ; 0 19524: f3 cf rjmp .-26 ; 0x1950c 19526: 60 e0 ldi r22, 0x00 ; 0 19528: 8c ea ldi r24, 0xAC ; 172 1952a: 9c e0 ldi r25, 0x0C ; 12 1952c: 0f 94 47 dc call 0x3b88e ; 0x3b88e StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 19530: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19534: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 19538: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d 1953c: 0c 94 6d aa jmp 0x154da ; 0x154da 19540: 61 e0 ldi r22, 0x01 ; 1 19542: 8c ea ldi r24, 0xAC ; 172 19544: 9c e0 ldi r25, 0x0C ; 12 19546: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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(); 1954a: 0e 94 95 e3 call 0x1c72a ; 0x1c72a 1954e: 0c 94 6d aa jmp 0x154da ; 0x154da break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19552: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19554: 0f 94 83 0f call 0x21f06 ; 0x21f06 19558: 0c 94 83 aa jmp 0x15506 ; 0x15506 } void MMU2::TriggerResetPin() { reset(); 1955c: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 19560: 0c 94 83 aa jmp 0x15506 ; 0x15506 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19564: 8a e2 ldi r24, 0x2A ; 42 19566: f6 cf rjmp .-20 ; 0x19554 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') { 19568: 84 35 cpi r24, 0x54 ; 84 1956a: 09 f0 breq .+2 ; 0x1956e 1956c: 79 c0 rjmp .+242 ; 0x19660 strchr_pointer = CMDBUFFER_CURRENT_STRING; 1956e: 10 93 96 03 sts 0x0396, r17 ; 0x800396 19572: 00 93 95 03 sts 0x0395, r16 ; 0x800395 processing_tcode = true; 19576: 81 e0 ldi r24, 0x01 ; 1 19578: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 TCodes(strchr_pointer, code_value_uint8()); 1957c: 0e 94 6f 5b call 0xb6de ; 0xb6de 19580: 18 2f mov r17, r24 19582: 20 91 95 03 lds r18, 0x0395 ; 0x800395 19586: 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; 1958a: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 1958c: 79 01 movw r14, r18 1958e: e9 0e add r14, r25 19590: f1 1c adc r15, r1 19592: d7 01 movw r26, r14 19594: 8c 91 ld r24, X 19596: 80 32 cpi r24, 0x20 ; 32 19598: 11 f0 breq .+4 ; 0x1959e 1959a: 89 30 cpi r24, 0x09 ; 9 1959c: 11 f4 brne .+4 ; 0x195a2 1959e: 9f 5f subi r25, 0xFF ; 255 195a0: f5 cf rjmp .-22 ; 0x1958c ; strchr_pointer[index] = tolower(strchr_pointer[index]); 195a2: 08 2e mov r0, r24 195a4: 00 0c add r0, r0 195a6: 99 0b sbc r25, r25 195a8: 0f 94 37 e2 call 0x3c46e ; 0x3c46e 195ac: f7 01 movw r30, r14 195ae: 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'); 195b0: 90 ed ldi r25, 0xD0 ; 208 195b2: 98 0f add r25, r24 195b4: 95 30 cpi r25, 0x05 ; 5 195b6: 58 f0 brcs .+22 ; 0x195ce 195b8: 8f 33 cpi r24, 0x3F ; 63 195ba: 59 f0 breq .+22 ; 0x195d2 195bc: 88 37 cpi r24, 0x78 ; 120 195be: 49 f0 breq .+18 ; 0x195d2 195c0: 83 36 cpi r24, 0x63 ; 99 195c2: f1 f0 breq .+60 ; 0x19600 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 195c4: 8d e3 ldi r24, 0x3D ; 61 195c6: 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 195c8: 0e 94 82 79 call 0xf304 ; 0xf304 195cc: 13 c0 rjmp .+38 ; 0x195f4 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 195ce: 8f 33 cpi r24, 0x3F ; 63 195d0: a9 f4 brne .+42 ; 0x195fc // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 195d2: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 195d6: 81 30 cpi r24, 0x01 ; 1 195d8: 69 f4 brne .+26 ; 0x195f4 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 195da: 8d ea ldi r24, 0xAD ; 173 195dc: 9b e3 ldi r25, 0x3B ; 59 195de: 0e 94 b3 72 call 0xe566 ; 0xe566 195e2: 70 e0 ldi r23, 0x00 ; 0 195e4: 60 e0 ldi r22, 0x00 ; 0 195e6: 0e 94 08 e4 call 0x1c810 ; 0x1c810 195ea: 68 2f mov r22, r24 195ec: d7 01 movw r26, r14 195ee: 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()); 195f0: 0f 94 21 0f call 0x21e42 ; 0x21e42 processing_tcode = false; 195f4: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 195f8: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 } 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'){ 195fc: 83 36 cpi r24, 0x63 ; 99 195fe: 49 f4 brne .+18 ; 0x19612 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19600: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19604: 81 30 cpi r24, 0x01 ; 1 19606: b1 f7 brne .-20 ; 0x195f4 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19608: 0f 94 c0 74 call 0x2e980 ; 0x2e980 1960c: 68 2f mov r22, r24 1960e: 83 e6 ldi r24, 0x63 ; 99 19610: ef cf rjmp .-34 ; 0x195f0 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19612: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19616: 81 30 cpi r24, 0x01 ; 1 19618: 69 f4 brne .+26 ; 0x19634 if (codeValue == MMU2::mmu2.get_current_tool()){ 1961a: 0f 94 c0 74 call 0x2e980 ; 0x2e980 1961e: 18 13 cpse r17, r24 19620: 05 c0 rjmp .+10 ; 0x1962c // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19622: 8d e4 ldi r24, 0x4D ; 77 19624: 9e e7 ldi r25, 0x7E ; 126 19626: 0f 94 0c db call 0x3b618 ; 0x3b618 1962a: e4 cf rjmp .-56 ; 0x195f4 #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); 1962c: 81 2f mov r24, r17 1962e: 0f 94 fe 0e call 0x21dfc ; 0x21dfc 19632: e0 cf rjmp .-64 ; 0x195f4 } } else { SERIAL_ECHO_START; 19634: 80 ed ldi r24, 0xD0 ; 208 19636: 9b ea ldi r25, 0xAB ; 171 19638: 0e 94 57 77 call 0xeeae ; 0xeeae if (codeValue >= EXTRUDERS) { 1963c: 11 23 and r17, r17 1963e: 59 f0 breq .+22 ; 0x19656 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19640: 84 e5 ldi r24, 0x54 ; 84 19642: 0e 94 3e 77 call 0xee7c ; 0xee7c SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19646: 81 2f mov r24, r17 19648: 90 e0 ldi r25, 0x00 ; 0 1964a: c0 96 adiw r24, 0x30 ; 48 1964c: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19650: 81 e8 ldi r24, 0x81 ; 129 19652: 97 e6 ldi r25, 0x67 ; 103 19654: b9 cf rjmp .-142 ; 0x195c8 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19656: 8e e6 ldi r24, 0x6E ; 110 19658: 97 e6 ldi r25, 0x67 ; 103 1965a: 0e 94 57 77 call 0xeeae ; 0xeeae 1965e: ca cf rjmp .-108 ; 0x195f4 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19660: 84 34 cpi r24, 0x44 ; 68 19662: 09 f0 breq .+2 ; 0x19666 19664: ee c0 rjmp .+476 ; 0x19842 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19666: 10 93 96 03 sts 0x0396, r17 ; 0x800396 1966a: 00 93 95 03 sts 0x0395, r16 ; 0x800395 switch(code_value_short()) 1966e: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 19672: 86 30 cpi r24, 0x06 ; 6 19674: 91 05 cpc r25, r1 19676: 09 f4 brne .+2 ; 0x1967a 19678: 79 c0 rjmp .+242 ; 0x1976c 1967a: 9c f4 brge .+38 ; 0x196a2 1967c: 82 30 cpi r24, 0x02 ; 2 1967e: 91 05 cpc r25, r1 19680: 09 f4 brne .+2 ; 0x19684 19682: 52 c0 rjmp .+164 ; 0x19728 19684: 83 30 cpi r24, 0x03 ; 3 19686: 91 05 cpc r25, r1 19688: 09 f4 brne .+2 ; 0x1968c 1968a: 61 c0 rjmp .+194 ; 0x1974e 1968c: 01 96 adiw r24, 0x01 ; 1 1968e: 89 f4 brne .+34 ; 0x196b2 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19690: 8a e5 ldi r24, 0x5A ; 90 19692: 97 e6 ldi r25, 0x67 ; 103 19694: 9f 93 push r25 19696: 8f 93 push r24 19698: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 1969c: 0f 90 pop r0 1969e: 0f 90 pop r0 196a0: ff cf rjmp .-2 ; 0x196a0 196a2: 85 31 cpi r24, 0x15 ; 21 196a4: 91 05 cpc r25, r1 196a6: 09 f4 brne .+2 ; 0x196aa 196a8: 8d c0 rjmp .+282 ; 0x197c4 196aa: 94 f4 brge .+36 ; 0x196d0 196ac: 44 97 sbiw r24, 0x14 ; 20 196ae: 09 f4 brne .+2 ; 0x196b2 196b0: 69 c0 rjmp .+210 ; 0x19784 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 196b2: 80 91 92 12 lds r24, 0x1292 ; 0x801292 196b6: 90 91 93 12 lds r25, 0x1293 ; 0x801293 196ba: 88 55 subi r24, 0x58 ; 88 196bc: 9f 4e sbci r25, 0xEF ; 239 196be: 9f 93 push r25 196c0: 8f 93 push r24 196c2: 1f 92 push r1 196c4: 84 e4 ldi r24, 0x44 ; 68 196c6: 8f 93 push r24 196c8: 82 e5 ldi r24, 0x52 ; 82 196ca: 99 e6 ldi r25, 0x69 ; 105 196cc: 0c 94 db 97 jmp 0x12fb6 ; 0x12fb6 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 196d0: 86 31 cpi r24, 0x16 ; 22 196d2: 91 05 cpc r25, r1 196d4: 09 f4 brne .+2 ; 0x196d8 196d6: 9b c0 rjmp .+310 ; 0x1980e 196d8: 86 34 cpi r24, 0x46 ; 70 196da: 91 05 cpc r25, r1 196dc: 51 f7 brne .-44 ; 0x196b2 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 196de: 83 e5 ldi r24, 0x53 ; 83 196e0: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 196e4: 88 23 and r24, r24 196e6: 11 f4 brne .+4 ; 0x196ec 196e8: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 thermal_model_log_enable(code_value_short()); 196ec: 0e 94 7c 5b call 0xb6f8 ; 0xb6f8 196f0: 11 e0 ldi r17, 0x01 ; 1 196f2: 00 97 sbiw r24, 0x00 ; 0 196f4: 09 f4 brne .+2 ; 0x196f8 196f6: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 196f8: 89 2b or r24, r25 196fa: 91 f0 breq .+36 ; 0x19720 TempMgrGuard temp_mgr_guard; 196fc: ce 01 movw r24, r28 196fe: 01 96 adiw r24, 0x01 ; 1 19700: 0f 94 a1 31 call 0x26342 ; 0x26342 thermal_model::log_buf.entry.stamp = _millis(); 19704: 0f 94 53 29 call 0x252a6 ; 0x252a6 19708: 60 93 24 06 sts 0x0624, r22 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 1970c: 70 93 25 06 sts 0x0625, r23 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 19710: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 19714: 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; 19718: ce 01 movw r24, r28 1971a: 01 96 adiw r24, 0x01 ; 1 1971c: 0f 94 94 31 call 0x26328 ; 0x26328 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19720: 10 93 34 06 sts 0x0634, r17 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 19724: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19728: 45 e5 ldi r20, 0x55 ; 85 1972a: c4 2e mov r12, r20 1972c: 47 e6 ldi r20, 0x67 ; 103 1972e: d4 2e mov r13, r20 19730: 52 e0 ldi r21, 0x02 ; 2 19732: e5 2e mov r14, r21 19734: 00 e0 ldi r16, 0x00 ; 0 19736: 20 e0 ldi r18, 0x00 ; 0 19738: 32 e2 ldi r19, 0x22 ; 34 1973a: 40 e0 ldi r20, 0x00 ; 0 1973c: 50 e0 ldi r21, 0x00 ; 0 1973e: 60 e0 ldi r22, 0x00 ; 0 19740: 72 e0 ldi r23, 0x02 ; 2 19742: 80 e0 ldi r24, 0x00 ; 0 19744: 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")); 19746: 0e 94 aa 62 call 0xc554 ; 0xc554 1974a: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 1974e: 2e e4 ldi r18, 0x4E ; 78 19750: c2 2e mov r12, r18 19752: 27 e6 ldi r18, 0x67 ; 103 19754: d2 2e mov r13, r18 19756: 33 e0 ldi r19, 0x03 ; 3 19758: e3 2e mov r14, r19 1975a: 01 e0 ldi r16, 0x01 ; 1 1975c: 20 e0 ldi r18, 0x00 ; 0 1975e: 30 e1 ldi r19, 0x10 ; 16 19760: 40 e0 ldi r20, 0x00 ; 0 19762: 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")); 19764: 60 e0 ldi r22, 0x00 ; 0 19766: 70 e0 ldi r23, 0x00 ; 0 19768: cb 01 movw r24, r22 1976a: ed cf rjmp .-38 ; 0x19746 1976c: 87 e4 ldi r24, 0x47 ; 71 1976e: c8 2e mov r12, r24 19770: 87 e6 ldi r24, 0x67 ; 103 19772: d8 2e mov r13, r24 19774: 96 e0 ldi r25, 0x06 ; 6 19776: e9 2e mov r14, r25 19778: 03 e0 ldi r16, 0x03 ; 3 1977a: 20 e0 ldi r18, 0x00 ; 0 1977c: 30 e0 ldi r19, 0x00 ; 0 1977e: 44 e0 ldi r20, 0x04 ; 4 19780: 50 e0 ldi r21, 0x00 ; 0 19782: f0 cf rjmp .-32 ; 0x19764 #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19784: 85 e4 ldi r24, 0x45 ; 69 19786: 0e 94 dd 5b call 0xb7ba ; 0xb7ba 1978a: 88 23 and r24, r24 1978c: 29 f0 breq .+10 ; 0x19798 xfdump_full_dump_and_reset(); 1978e: 80 e0 ldi r24, 0x00 ; 0 19790: 0e 94 c3 ed call 0x1db86 ; 0x1db86 19794: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 else { unsigned long ts = _millis(); 19798: 0f 94 53 29 call 0x252a6 ; 0x252a6 1979c: 6b 01 movw r12, r22 1979e: 7c 01 movw r14, r24 xfdump_dump(); 197a0: 0e 94 f1 ed call 0x1dbe2 ; 0x1dbe2 ts = _millis() - ts; 197a4: 0f 94 53 29 call 0x252a6 ; 0x252a6 197a8: dc 01 movw r26, r24 197aa: cb 01 movw r24, r22 197ac: 8c 19 sub r24, r12 197ae: 9d 09 sbc r25, r13 197b0: ae 09 sbc r26, r14 197b2: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 197b4: bf 93 push r27 197b6: af 93 push r26 197b8: 9f 93 push r25 197ba: 8f 93 push r24 197bc: 8e e2 ldi r24, 0x2E ; 46 197be: 97 e6 ldi r25, 0x67 ; 103 197c0: 0c 94 db 97 jmp 0x12fb6 ; 0x12fb6 } } void dcode_21() { if(!xfdump_check_state()) 197c4: 90 e0 ldi r25, 0x00 ; 0 197c6: 80 e0 ldi r24, 0x00 ; 0 197c8: 0e 94 0f ed call 0x1da1e ; 0x1da1e 197cc: 81 11 cpse r24, r1 197ce: 07 c0 rjmp .+14 ; 0x197de DBG(_N("no dump available\n")); 197d0: 8b e1 ldi r24, 0x1B ; 27 197d2: 97 e6 ldi r25, 0x67 ; 103 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 197d4: 9f 93 push r25 197d6: 8f 93 push r24 197d8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 197dc: 14 c0 rjmp .+40 ; 0x19806 { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 197de: 81 e0 ldi r24, 0x01 ; 1 197e0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be DBG(_N("D21 - read crash dump\n")); 197e4: 84 e0 ldi r24, 0x04 ; 4 197e6: 97 e6 ldi r25, 0x67 ; 103 197e8: 9f 93 push r25 197ea: 8f 93 push r24 197ec: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 197f0: 03 e0 ldi r16, 0x03 ; 3 197f2: 20 e0 ldi r18, 0x00 ; 0 197f4: 33 e2 ldi r19, 0x23 ; 35 197f6: 40 e0 ldi r20, 0x00 ; 0 197f8: 50 e0 ldi r21, 0x00 ; 0 197fa: 60 e0 ldi r22, 0x00 ; 0 197fc: 70 ed ldi r23, 0xD0 ; 208 197fe: 83 e0 ldi r24, 0x03 ; 3 19800: 90 e0 ldi r25, 0x00 ; 0 19802: 0f 94 30 86 call 0x30c60 ; 0x30c60 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19806: 0f 90 pop r0 19808: 0f 90 pop r0 1980a: 0c 94 40 96 jmp 0x12c80 ; 0x12c80 } } void dcode_22() { if(!xfdump_check_state()) 1980e: 90 e0 ldi r25, 0x00 ; 0 19810: 80 e0 ldi r24, 0x00 ; 0 19812: 0e 94 0f ed call 0x1da1e ; 0x1da1e 19816: 81 11 cpse r24, r1 19818: 03 c0 rjmp .+6 ; 0x19820 DBG(_N("no dump available\n")); 1981a: 81 ef ldi r24, 0xF1 ; 241 1981c: 96 e6 ldi r25, 0x66 ; 102 1981e: da cf rjmp .-76 ; 0x197d4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19820: 8c e5 ldi r24, 0x5C ; 92 19822: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19824: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19826: 0e 94 47 ed call 0x1da8e ; 0x1da8e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1982a: 40 e0 ldi r20, 0x00 ; 0 1982c: 50 ed ldi r21, 0xD0 ; 208 1982e: 63 e0 ldi r22, 0x03 ; 3 19830: 70 e0 ldi r23, 0x00 ; 0 19832: 80 e2 ldi r24, 0x20 ; 32 19834: 0e 94 c9 ec call 0x1d992 ; 0x1d992 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19838: 0e 94 ab ec call 0x1d956 ; 0x1d956 else { xfdump_reset(); DBG(_N("dump cleared\n")); 1983c: 83 ee ldi r24, 0xE3 ; 227 1983e: 96 e6 ldi r25, 0x66 ; 102 19840: c9 cf rjmp .-110 ; 0x197d4 } } else { SERIAL_ECHO_START; 19842: 80 ed ldi r24, 0xD0 ; 208 19844: 9b ea ldi r25, 0xAB ; 171 19846: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1984a: 83 ee ldi r24, 0xE3 ; 227 1984c: 97 e6 ldi r25, 0x67 ; 103 1984e: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19852: 80 91 92 12 lds r24, 0x1292 ; 0x801292 19856: 90 91 93 12 lds r25, 0x1293 ; 0x801293 1985a: 88 55 subi r24, 0x58 ; 88 1985c: 9f 4e sbci r25, 0xEF ; 239 1985e: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_ECHOLNPGM("\"(2)"); 19862: 81 e3 ldi r24, 0x31 ; 49 19864: 95 e8 ldi r25, 0x85 ; 133 19866: 0c 94 4b 98 jmp 0x13096 ; 0x13096 #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 1986a: 2d ec ldi r18, 0xCD ; 205 1986c: 3c ec ldi r19, 0xCC ; 204 1986e: 4c ec ldi r20, 0xCC ; 204 19870: 5d e3 ldi r21, 0x3D ; 61 19872: c7 01 movw r24, r14 19874: b6 01 movw r22, r12 19876: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1987a: 18 16 cp r1, r24 1987c: 14 f4 brge .+4 ; 0x19882 1987e: 0c 94 88 99 jmp 0x13310 ; 0x13310 19882: 0c 94 f6 9a jmp 0x135ec ; 0x135ec 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; 19886: a3 01 movw r20, r6 19888: 92 01 movw r18, r4 1988a: 62 2d mov r22, r2 1988c: 73 2d mov r23, r3 1988e: 8e 2d mov r24, r14 19890: 9f 2d mov r25, r15 19892: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 19896: 18 16 cp r1, r24 19898: 14 f0 brlt .+4 ; 0x1989e 1989a: 0c 94 d7 a2 jmp 0x145ae ; 0x145ae 1989e: e5 e0 ldi r30, 0x05 ; 5 198a0: ce 0e add r12, r30 198a2: d1 1c adc r13, r1 198a4: f2 e0 ldi r31, 0x02 ; 2 198a6: 8f 0e add r8, r31 198a8: 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; 198aa: 85 01 movw r16, r10 198ac: 0c 94 9e a2 jmp 0x1453c ; 0x1453c 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 198b0: 67 96 adiw r28, 0x17 ; 23 198b2: 2f ad ldd r18, Y+63 ; 0x3f 198b4: 67 97 sbiw r28, 0x17 ; 23 198b6: 8b 2d mov r24, r11 198b8: 23 30 cpi r18, 0x03 ; 3 198ba: 29 f0 breq .+10 ; 0x198c6 198bc: 91 e0 ldi r25, 0x01 ; 1 198be: 04 30 cpi r16, 0x04 ; 4 198c0: 11 05 cpc r17, r1 198c2: 09 f4 brne .+2 ; 0x198c6 198c4: ac cc rjmp .-1704 ; 0x1921e 198c6: 90 e0 ldi r25, 0x00 ; 0 198c8: aa cc rjmp .-1708 ; 0x1921e 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)); 198ca: 86 ea ldi r24, 0xA6 ; 166 198cc: 99 e3 ldi r25, 0x39 ; 57 198ce: 0e 94 b3 72 call 0xe566 ; 0xe566 198d2: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_puts_at_P(0, 2, PSTR("")); 198d6: 44 e9 ldi r20, 0x94 ; 148 198d8: 54 e8 ldi r21, 0x84 ; 132 198da: 62 e0 ldi r22, 0x02 ; 2 198dc: 80 e0 ldi r24, 0x00 ; 0 198de: 0e 94 fb 6e call 0xddf6 ; 0xddf6 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 198e2: f8 01 movw r30, r16 198e4: 81 91 ld r24, Z+ 198e6: 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'; 198e8: 98 2f mov r25, r24 198ea: 9f 7d andi r25, 0xDF ; 223 198ec: 11 f4 brne .+4 ; 0x198f2 198ee: 0c 94 e4 b0 jmp 0x161c8 ; 0x161c8 198f2: 97 ef ldi r25, 0xF7 ; 247 198f4: 98 0f add r25, r24 198f6: 92 30 cpi r25, 0x02 ; 2 198f8: 10 f4 brcc .+4 ; 0x198fe 198fa: 0c 94 e4 b0 jmp 0x161c8 ; 0x161c8 198fe: 8d 30 cpi r24, 0x0D ; 13 19900: 11 f4 brne .+4 ; 0x19906 19902: 0c 94 e4 b0 jmp 0x161c8 ; 0x161c8 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); 19906: 0e 94 d6 6e call 0xddac ; 0xddac 1990a: eb cf rjmp .-42 ; 0x198e2 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; 1990c: ce 01 movw r24, r28 1990e: 01 96 adiw r24, 0x01 ; 1 19910: 0f 94 a1 31 call 0x26342 ; 0x26342 19914: 0c 94 18 b7 jmp 0x16e30 ; 0x16e30 00019918 : uint8_t check_pinda_0() { return _PINDA?0:1; } 19918: 22 e0 ldi r18, 0x02 ; 2 1991a: 20 93 c0 00 sts 0x00C0, r18 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 1991e: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> 19922: 90 e1 ldi r25, 0x10 ; 16 19924: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> 19928: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1992c: 80 61 ori r24, 0x10 ; 16 1992e: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19932: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19936: 88 60 ori r24, 0x08 ; 8 19938: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1993c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19940: 80 68 ori r24, 0x80 ; 128 19942: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 19946: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1994a: 81 30 cpi r24, 0x01 ; 1 1994c: a9 f4 brne .+42 ; 0x19978 1994e: 20 93 c8 00 sts 0x00C8, r18 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> 19952: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> 19956: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> 1995a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1995e: 80 61 ori r24, 0x10 ; 16 19960: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19964: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19968: 88 60 ori r24, 0x08 ; 8 1996a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1996e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19972: 80 68 ori r24, 0x80 ; 128 19974: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 19978: 08 95 ret 0001997a : 1997a: 81 50 subi r24, 0x01 ; 1 1997c: 82 31 cpi r24, 0x12 ; 18 1997e: 08 f0 brcs .+2 ; 0x19982 19980: 5a c0 rjmp .+180 ; 0x19a36 19982: e8 2f mov r30, r24 19984: f0 e0 ldi r31, 0x00 ; 0 19986: 88 27 eor r24, r24 19988: e7 53 subi r30, 0x37 ; 55 1998a: f3 43 sbci r31, 0x33 ; 51 1998c: 8f 4f sbci r24, 0xFF ; 255 1998e: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 19992: e9 cc rjmp .-1582 ; 0x19366 19994: ed cc rjmp .-1574 ; 0x19370 19996: db cc rjmp .-1610 ; 0x1934e 19998: e1 cc rjmp .-1598 ; 0x1935c 1999a: e5 cc rjmp .-1590 ; 0x19366 1999c: 1b cd rjmp .-1482 ; 0x193d4 1999e: f0 cc rjmp .-1568 ; 0x19380 199a0: f6 cc rjmp .-1556 ; 0x1938e 199a2: fa cc rjmp .-1548 ; 0x19398 199a4: 00 cd rjmp .-1536 ; 0x193a6 199a6: 04 cd rjmp .-1528 ; 0x193b0 199a8: 08 cd rjmp .-1520 ; 0x193ba 199aa: 0e cd rjmp .-1508 ; 0x193c8 199ac: 12 cd rjmp .-1500 ; 0x193d2 199ae: 1b cd rjmp .-1482 ; 0x193e6 199b0: 16 cd rjmp .-1492 ; 0x193de 199b2: 1c cd rjmp .-1480 ; 0x193ec 199b4: 20 cd rjmp .-1472 ; 0x193f6 199b6: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199ba: 8f 77 andi r24, 0x7F ; 127 199bc: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199c0: 08 95 ret 199c2: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199c6: 8f 7d andi r24, 0xDF ; 223 199c8: f9 cf rjmp .-14 ; 0x199bc 199ca: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 199ce: 87 7f andi r24, 0xF7 ; 247 199d0: f5 cf rjmp .-22 ; 0x199bc 199d2: 84 b5 in r24, 0x24 ; 36 199d4: 8f 77 andi r24, 0x7F ; 127 199d6: 84 bd out 0x24, r24 ; 36 199d8: 08 95 ret 199da: 84 b5 in r24, 0x24 ; 36 199dc: 8f 7d andi r24, 0xDF ; 223 199de: fb cf rjmp .-10 ; 0x199d6 199e0: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 199e4: 8f 77 andi r24, 0x7F ; 127 199e6: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 199ea: 08 95 ret 199ec: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 199f0: 8f 7d andi r24, 0xDF ; 223 199f2: f9 cf rjmp .-14 ; 0x199e6 199f4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 199f8: 8f 77 andi r24, 0x7F ; 127 199fa: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 199fe: 08 95 ret 19a00: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19a04: 8f 7d andi r24, 0xDF ; 223 19a06: f9 cf rjmp .-14 ; 0x199fa 19a08: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19a0c: 87 7f andi r24, 0xF7 ; 247 19a0e: f5 cf rjmp .-22 ; 0x199fa 19a10: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a14: 8f 77 andi r24, 0x7F ; 127 19a16: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a1a: 08 95 ret 19a1c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a20: 8f 7d andi r24, 0xDF ; 223 19a22: f9 cf rjmp .-14 ; 0x19a16 19a24: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19a28: 87 7f andi r24, 0xF7 ; 247 19a2a: f5 cf rjmp .-22 ; 0x19a16 19a2c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a30: 8f 77 andi r24, 0x7F ; 127 19a32: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a36: 08 95 ret 19a38: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a3c: 8f 7d andi r24, 0xDF ; 223 19a3e: f9 cf rjmp .-14 ; 0x19a32 19a40: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19a44: 87 7f andi r24, 0xF7 ; 247 19a46: f5 cf rjmp .-22 ; 0x19a32 00019a48 : 19a48: 83 b1 in r24, 0x03 ; 3 19a4a: 82 95 swap r24 19a4c: 81 70 andi r24, 0x01 ; 1 19a4e: 08 95 ret 00019a50 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 19a50: 80 91 fd 03 lds r24, 0x03FD ; 0x8003fd 19a54: 90 91 fe 03 lds r25, 0x03FE ; 0x8003fe 19a58: 08 95 ret 00019a5a : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19a5a: cf 92 push r12 19a5c: df 92 push r13 19a5e: ef 92 push r14 19a60: 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; 19a62: 20 91 ff 03 lds r18, 0x03FF ; 0x8003ff 19a66: b0 e0 ldi r27, 0x00 ; 0 19a68: a0 e0 ldi r26, 0x00 ; 0 19a6a: c0 90 b3 06 lds r12, 0x06B3 ; 0x8006b3 19a6e: d0 90 b4 06 lds r13, 0x06B4 ; 0x8006b4 19a72: e0 90 b5 06 lds r14, 0x06B5 ; 0x8006b5 19a76: f0 90 b6 06 lds r15, 0x06B6 ; 0x8006b6 19a7a: 20 ff sbrs r18, 0 19a7c: 42 c0 rjmp .+132 ; 0x19b02 19a7e: c8 1a sub r12, r24 19a80: d9 0a sbc r13, r25 19a82: ea 0a sbc r14, r26 19a84: fb 0a sbc r15, r27 19a86: c0 92 b3 06 sts 0x06B3, r12 ; 0x8006b3 19a8a: d0 92 b4 06 sts 0x06B4, r13 ; 0x8006b4 19a8e: e0 92 b5 06 sts 0x06B5, r14 ; 0x8006b5 19a92: f0 92 b6 06 sts 0x06B6, r15 ; 0x8006b6 19a96: cb 01 movw r24, r22 19a98: b0 e0 ldi r27, 0x00 ; 0 19a9a: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19a9c: c0 90 b7 06 lds r12, 0x06B7 ; 0x8006b7 19aa0: d0 90 b8 06 lds r13, 0x06B8 ; 0x8006b8 19aa4: e0 90 b9 06 lds r14, 0x06B9 ; 0x8006b9 19aa8: f0 90 ba 06 lds r15, 0x06BA ; 0x8006ba 19aac: 21 ff sbrs r18, 1 19aae: 36 c0 rjmp .+108 ; 0x19b1c 19ab0: c8 1a sub r12, r24 19ab2: d9 0a sbc r13, r25 19ab4: ea 0a sbc r14, r26 19ab6: fb 0a sbc r15, r27 19ab8: c0 92 b7 06 sts 0x06B7, r12 ; 0x8006b7 19abc: d0 92 b8 06 sts 0x06B8, r13 ; 0x8006b8 19ac0: e0 92 b9 06 sts 0x06B9, r14 ; 0x8006b9 19ac4: f0 92 ba 06 sts 0x06BA, r15 ; 0x8006ba 19ac8: 70 e0 ldi r23, 0x00 ; 0 19aca: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19acc: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 19ad0: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 19ad4: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 19ad8: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 19adc: 22 ff sbrs r18, 2 19ade: 2b c0 rjmp .+86 ; 0x19b36 19ae0: 84 1b sub r24, r20 19ae2: 95 0b sbc r25, r21 19ae4: a6 0b sbc r26, r22 19ae6: b7 0b sbc r27, r23 19ae8: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 19aec: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 19af0: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 19af4: 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]); } 19af8: ff 90 pop r15 19afa: ef 90 pop r14 19afc: df 90 pop r13 19afe: cf 90 pop r12 19b00: 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; 19b02: 8c 0d add r24, r12 19b04: 9d 1d adc r25, r13 19b06: ae 1d adc r26, r14 19b08: bf 1d adc r27, r15 19b0a: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 19b0e: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 19b12: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 19b16: b0 93 b6 06 sts 0x06B6, r27 ; 0x8006b6 19b1a: bd cf rjmp .-134 ; 0x19a96 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19b1c: 8c 0d add r24, r12 19b1e: 9d 1d adc r25, r13 19b20: ae 1d adc r26, r14 19b22: bf 1d adc r27, r15 19b24: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 19b28: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 19b2c: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 19b30: b0 93 ba 06 sts 0x06BA, r27 ; 0x8006ba 19b34: c9 cf rjmp .-110 ; 0x19ac8 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19b36: 84 0f add r24, r20 19b38: 95 1f adc r25, r21 19b3a: a6 1f adc r26, r22 19b3c: b7 1f adc r27, r23 19b3e: d4 cf rjmp .-88 ; 0x19ae8 00019b40 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 19b40: fb 01 movw r30, r22 *v = 0; 19b42: 11 82 std Z+1, r1 ; 0x01 19b44: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 19b46: 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'; 19b48: dc 01 movw r26, r24 19b4a: 2c 91 ld r18, X 19b4c: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 19b4e: 2a 30 cpi r18, 0x0A ; 10 19b50: a0 f4 brcc .+40 ; 0x19b7a *v *= 10; 19b52: 40 81 ld r20, Z 19b54: 51 81 ldd r21, Z+1 ; 0x01 19b56: 64 9f mul r22, r20 19b58: 90 01 movw r18, r0 19b5a: 65 9f mul r22, r21 19b5c: 30 0d add r19, r0 19b5e: 11 24 eor r1, r1 19b60: 31 83 std Z+1, r19 ; 0x01 19b62: 20 83 st Z, r18 *v += *str - '0'; 19b64: 4d 91 ld r20, X+ 19b66: cd 01 movw r24, r26 19b68: 20 53 subi r18, 0x30 ; 48 19b6a: 31 09 sbc r19, r1 19b6c: 24 0f add r18, r20 19b6e: 31 1d adc r19, r1 19b70: 47 fd sbrc r20, 7 19b72: 3a 95 dec r19 19b74: 31 83 std Z+1, r19 ; 0x01 19b76: 20 83 st Z, r18 19b78: e7 cf rjmp .-50 ; 0x19b48 ++str; } return str; } 19b7a: 08 95 ret 00019b7c : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 19b7c: 85 e0 ldi r24, 0x05 ; 5 19b7e: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 19b82: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00019b86 : 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) { 19b86: fc 01 movw r30, r24 switch(*oCheckSetting) { 19b88: 80 81 ld r24, Z 19b8a: 88 23 and r24, r24 19b8c: 21 f0 breq .+8 ; 0x19b96 19b8e: 81 30 cpi r24, 0x01 ; 1 19b90: 29 f4 brne .+10 ; 0x19b9c case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19b92: 82 e0 ldi r24, 0x02 ; 2 19b94: 01 c0 rjmp .+2 ; 0x19b98 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 19b96: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 19b98: 80 83 st Z, r24 19b9a: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 19b9c: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 19b9e: 08 95 ret 00019ba0 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 19ba0: 88 ec ldi r24, 0xC8 ; 200 19ba2: 9b e6 ldi r25, 0x6B ; 107 19ba4: 0e 94 82 79 call 0xf304 ; 0xf304 lcd_return_to_status(); 19ba8: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00019bac : //! 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) { 19bac: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 19bb0: 81 30 cpi r24, 0x01 ; 1 19bb2: 21 f4 brne .+8 ; 0x19bbc SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 19bb4: 87 e2 ldi r24, 0x27 ; 39 19bb6: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 19bb8: 0c 94 82 79 jmp 0xf304 ; 0xf304 19bbc: 88 e1 ldi r24, 0x18 ; 24 19bbe: 9b e6 ldi r25, 0x6B ; 107 19bc0: fb cf rjmp .-10 ; 0x19bb8 00019bc2 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 19bc2: cf 93 push r28 19bc4: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 19bc6: 0f 94 ef 42 call 0x285de ; 0x285de float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 19bca: c2 e9 ldi r28, 0x92 ; 146 19bcc: 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)); 19bce: 60 91 97 13 lds r22, 0x1397 ; 0x801397 19bd2: 70 e0 ldi r23, 0x00 ; 0 19bd4: 90 e0 ldi r25, 0x00 ; 0 19bd6: 80 e0 ldi r24, 0x00 ; 0 19bd8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 19bdc: 20 e0 ldi r18, 0x00 ; 0 19bde: 30 e0 ldi r19, 0x00 ; 0 19be0: 40 e8 ldi r20, 0x80 ; 128 19be2: 51 e4 ldi r21, 0x41 ; 65 19be4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 19be8: 9b 01 movw r18, r22 19bea: ac 01 movw r20, r24 19bec: 6c 85 ldd r22, Y+12 ; 0x0c 19bee: 7d 85 ldd r23, Y+13 ; 0x0d 19bf0: 8e 85 ldd r24, Y+14 ; 0x0e 19bf2: 9f 85 ldd r25, Y+15 ; 0x0f 19bf4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 19bf8: 6c 87 std Y+12, r22 ; 0x0c 19bfa: 7d 87 std Y+13, r23 ; 0x0d 19bfc: 8e 87 std Y+14, r24 ; 0x0e 19bfe: 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])); 19c00: 62 e0 ldi r22, 0x02 ; 2 19c02: 84 e0 ldi r24, 0x04 ; 4 19c04: 9f e8 ldi r25, 0x8F ; 143 } 19c06: df 91 pop r29 19c08: 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])); 19c0a: 0d 94 62 88 jmp 0x310c4 ; 0x310c4 00019c0e : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 19c0e: df 92 push r13 19c10: ef 92 push r14 19c12: ff 92 push r15 19c14: 0f 93 push r16 19c16: 1f 93 push r17 19c18: cf 93 push r28 19c1a: df 93 push r29 19c1c: cd b7 in r28, 0x3d ; 61 19c1e: de b7 in r29, 0x3e ; 62 19c20: 63 97 sbiw r28, 0x13 ; 19 19c22: 0f b6 in r0, 0x3f ; 63 19c24: f8 94 cli 19c26: de bf out 0x3e, r29 ; 62 19c28: 0f be out 0x3f, r0 ; 63 19c2a: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 19c2c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 19c30: 20 91 14 05 lds r18, 0x0514 ; 0x800514 19c34: 32 13 cpse r19, r18 19c36: 73 c0 rjmp .+230 ; 0x19d1e 19c38: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 19c3a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 19c3e: 88 23 and r24, r24 19c40: 09 f4 brne .+2 ; 0x19c44 19c42: 45 c0 rjmp .+138 ; 0x19cce //! //! @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)); 19c44: 83 e9 ldi r24, 0x93 ; 147 19c46: 9d e4 ldi r25, 0x4D ; 77 19c48: 0e 94 b3 72 call 0xe566 ; 0xe566 19c4c: 9f 93 push r25 19c4e: 8f 93 push r24 19c50: 8d eb ldi r24, 0xBD ; 189 19c52: 9e e8 ldi r25, 0x8E ; 142 19c54: 9f 93 push r25 19c56: 8f 93 push r24 19c58: 8e 01 movw r16, r28 19c5a: 0f 5f subi r16, 0xFF ; 255 19c5c: 1f 4f sbci r17, 0xFF ; 255 19c5e: 1f 93 push r17 19c60: 0f 93 push r16 19c62: 0f 94 3a db call 0x3b674 ; 0x3b674 19c66: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 19c68: 47 e0 ldi r20, 0x07 ; 7 19c6a: 50 e0 ldi r21, 0x00 ; 0 19c6c: b7 01 movw r22, r14 19c6e: 80 0f add r24, r16 19c70: 91 2f mov r25, r17 19c72: 91 1d adc r25, r1 19c74: 0f 94 13 dc call 0x3b826 ; 0x3b826 19c78: 0f 90 pop r0 19c7a: 0f 90 pop r0 19c7c: 0f 90 pop r0 19c7e: 0f 90 pop r0 19c80: 0f 90 pop r0 19c82: 0f 90 pop r0 19c84: 20 e0 ldi r18, 0x00 ; 0 19c86: 82 2f mov r24, r18 19c88: 8d 0d add r24, r13 19c8a: 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) 19c8c: 27 30 cpi r18, 0x07 ; 7 19c8e: 39 f0 breq .+14 ; 0x19c9e 19c90: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 19c92: f8 01 movw r30, r16 19c94: e8 0f add r30, r24 19c96: f9 1f adc r31, r25 19c98: 30 81 ld r19, Z 19c9a: 31 11 cpse r19, r1 19c9c: f4 cf rjmp .-24 ; 0x19c86 } buffer.c[index] = ']'; 19c9e: f8 01 movw r30, r16 19ca0: e8 0f add r30, r24 19ca2: f9 1f adc r31, r25 19ca4: 2d e5 ldi r18, 0x5D ; 93 19ca6: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 19ca8: 8c 0f add r24, r28 19caa: 9d 1f adc r25, r29 19cac: fc 01 movw r30, r24 19cae: 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()); 19cb0: 0f 94 5f d0 call 0x3a0be ; 0x3a0be 19cb4: 48 2f mov r20, r24 19cb6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 19cba: 80 e0 ldi r24, 0x00 ; 0 19cbc: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_print_pad(buffer.c, LCD_WIDTH - 2); 19cc0: 62 e1 ldi r22, 0x12 ; 18 19cc2: c8 01 movw r24, r16 19cc4: 0e 94 d6 70 call 0xe1ac ; 0xe1ac lcd_putc(type_char); 19cc8: 80 e2 ldi r24, 0x20 ; 32 19cca: 0e 94 d6 6e call 0xddac ; 0xddac 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)) 19cce: 80 91 13 05 lds r24, 0x0513 ; 0x800513 19cd2: 88 23 and r24, r24 19cd4: 21 f1 breq .+72 ; 0x19d1e 19cd6: 20 91 15 05 lds r18, 0x0515 ; 0x800515 19cda: 80 91 70 06 lds r24, 0x0670 ; 0x800670 19cde: 90 91 71 06 lds r25, 0x0671 ; 0x800671 19ce2: 28 17 cp r18, r24 19ce4: 19 06 cpc r1, r25 19ce6: d9 f4 brne .+54 ; 0x19d1e { lcd_update_enabled = 0; 19ce8: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 19cec: 8a e6 ldi r24, 0x6A ; 106 19cee: 96 e7 ldi r25, 0x76 ; 118 19cf0: 89 2b or r24, r25 19cf2: 11 f0 breq .+4 ; 0x19cf8 19cf4: 0e 94 6a 76 call 0xecd4 ; 0xecd4 lcd_update_enabled = 1; 19cf8: 81 e0 ldi r24, 0x01 ; 1 19cfa: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 19cfe: 0f 94 83 d0 call 0x3a106 ; 0x3a106 return; } } menu_item++; } 19d02: 63 96 adiw r28, 0x13 ; 19 19d04: 0f b6 in r0, 0x3f ; 63 19d06: f8 94 cli 19d08: de bf out 0x3e, r29 ; 62 19d0a: 0f be out 0x3f, r0 ; 63 19d0c: cd bf out 0x3d, r28 ; 61 19d0e: df 91 pop r29 19d10: cf 91 pop r28 19d12: 1f 91 pop r17 19d14: 0f 91 pop r16 19d16: ff 90 pop r15 19d18: ef 90 pop r14 19d1a: df 90 pop r13 19d1c: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 19d1e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 19d22: 8f 5f subi r24, 0xFF ; 255 19d24: 80 93 15 05 sts 0x0515, r24 ; 0x800515 19d28: ec cf rjmp .-40 ; 0x19d02 00019d2a : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 19d2a: 61 e0 ldi r22, 0x01 ; 1 19d2c: 81 ec ldi r24, 0xC1 ; 193 19d2e: 99 e8 ldi r25, 0x89 ; 137 19d30: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_return_to_status(); 19d34: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00019d38 : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 19d38: 61 e0 ldi r22, 0x01 ; 1 19d3a: 85 ec ldi r24, 0xC5 ; 197 19d3c: 99 e8 ldi r25, 0x89 ; 137 19d3e: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_return_to_status(); 19d42: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00019d46 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 19d46: 61 e0 ldi r22, 0x01 ; 1 19d48: 8d eb ldi r24, 0xBD ; 189 19d4a: 99 e8 ldi r25, 0x89 ; 137 19d4c: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_return_to_status(); 19d50: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00019d54 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 19d54: 61 e0 ldi r22, 0x01 ; 1 19d56: 8b ec ldi r24, 0xCB ; 203 19d58: 99 e8 ldi r25, 0x89 ; 137 19d5a: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_return_to_status(); 19d5e: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00019d62 : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 19d62: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 19d66: 88 23 and r24, r24 19d68: 61 f0 breq .+24 ; 0x19d82 19d6a: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 19d6e: 88 23 and r24, r24 19d70: 41 f0 breq .+16 ; 0x19d82 lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 19d72: 89 e1 ldi r24, 0x19 ; 25 19d74: 94 e4 ldi r25, 0x44 ; 68 19d76: 0e 94 b3 72 call 0xe566 ; 0xe566 19d7a: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 19d7e: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 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; 19d82: 86 e0 ldi r24, 0x06 ; 6 19d84: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 19d88: fa cf rjmp .-12 ; 0x19d7e 00019d8a : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 19d8a: cf 93 push r28 19d8c: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 19d8e: 8d e1 ldi r24, 0x1D ; 29 19d90: 9e e3 ldi r25, 0x3E ; 62 19d92: 0e 94 b3 72 call 0xe566 ; 0xe566 19d96: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 19d9a: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19d9e: 81 30 cpi r24, 0x01 ; 1 19da0: 69 f4 brne .+26 ; 0x19dbc { lcd_show_fullscreen_message_and_wait_P( 19da2: 84 ec ldi r24, 0xC4 ; 196 19da4: 9d e3 ldi r25, 0x3D ; 61 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 19da6: 0e 94 b3 72 call 0xe566 ; 0xe566 19daa: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 19dae: 82 ef ldi r24, 0xF2 ; 242 19db0: 9c e3 ldi r25, 0x3C ; 60 19db2: 0e 94 b3 72 call 0xe566 ; 0xe566 _T(MSG_WIZARD_V2_CAL_2)); } 19db6: 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( 19db8: 0d 94 f8 1f jmp 0x23ff0 ; 0x23ff0 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 19dbc: cc 23 and r28, r28 19dbe: b9 f3 breq .-18 ; 0x19dae { lcd_show_fullscreen_message_and_wait_P( 19dc0: 82 e9 ldi r24, 0x92 ; 146 19dc2: 9d e3 ldi r25, 0x3D ; 61 19dc4: f0 cf rjmp .-32 ; 0x19da6 00019dc6 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 19dc6: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 19dca: 81 30 cpi r24, 0x01 ; 1 19dcc: 71 f4 brne .+28 ; 0x19dea lcd_show_fullscreen_message_and_wait_P( 19dce: 89 e9 ldi r24, 0x99 ; 153 19dd0: 9c e3 ldi r25, 0x3C ; 60 19dd2: 0e 94 b3 72 call 0xe566 ; 0xe566 19dd6: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 _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; 19dda: 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; 19ddc: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 19de0: 61 e0 ldi r22, 0x01 ; 1 19de2: 8f ec ldi r24, 0xCF ; 207 19de4: 99 e8 ldi r25, 0x89 ; 137 19de6: 0c 94 27 88 jmp 0x1104e ; 0x1104e // 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( 19dea: 8d e4 ldi r24, 0x4D ; 77 19dec: 9c e3 ldi r25, 0x3C ; 60 19dee: 0e 94 b3 72 call 0xe566 ; 0xe566 19df2: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 19df6: 80 e0 ldi r24, 0x00 ; 0 19df8: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 19dfc: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 19e00: 87 e3 ldi r24, 0x37 ; 55 19e02: 9c e5 ldi r25, 0x5C ; 92 19e04: 0e 94 b3 72 call 0xe566 ; 0xe566 19e08: ac 01 movw r20, r24 19e0a: 62 e0 ldi r22, 0x02 ; 2 19e0c: 80 e0 ldi r24, 0x00 ; 0 19e0e: 0e 94 fb 6e call 0xddf6 ; 0xddf6 eFilamentAction = FilamentAction::Load; 19e12: 81 e0 ldi r24, 0x01 ; 1 19e14: e3 cf rjmp .-58 ; 0x19ddc 00019e16 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 19e16: 0d 94 40 7b jmp 0x2f680 ; 0x2f680 00019e1a : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 19e1a: cf 92 push r12 19e1c: df 92 push r13 19e1e: ef 92 push r14 19e20: ff 92 push r15 19e22: 0f 93 push r16 19e24: 1f 93 push r17 19e26: cf 93 push r28 19e28: df 93 push r29 19e2a: 6c 01 movw r12, r24 19e2c: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 19e2e: c4 2f mov r28, r20 19e30: d0 e0 ldi r29, 0x00 ; 0 19e32: ae 01 movw r20, r28 19e34: 0f 94 02 da call 0x3b404 ; 0x3b404 19e38: 89 2b or r24, r25 19e3a: b9 f4 brne .+46 ; 0x19e6a Number(str + tagSize, v); 19e3c: b8 01 movw r22, r16 19e3e: c6 01 movw r24, r12 19e40: 8c 0f add r24, r28 19e42: 9d 1f adc r25, r29 19e44: 0e 94 a0 cd call 0x19b40 ; 0x19b40 *v |= tagMask; 19e48: f8 01 movw r30, r16 19e4a: 20 81 ld r18, Z 19e4c: 31 81 ldd r19, Z+1 ; 0x01 19e4e: 2e 29 or r18, r14 19e50: 3f 29 or r19, r15 19e52: 31 83 std Z+1, r19 ; 0x01 19e54: 20 83 st Z, r18 return true; 19e56: 81 e0 ldi r24, 0x01 ; 1 } return false; } 19e58: df 91 pop r29 19e5a: cf 91 pop r28 19e5c: 1f 91 pop r17 19e5e: 0f 91 pop r16 19e60: ff 90 pop r15 19e62: ef 90 pop r14 19e64: df 90 pop r13 19e66: cf 90 pop r12 19e68: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 19e6a: 80 e0 ldi r24, 0x00 ; 0 19e6c: f5 cf rjmp .-22 ; 0x19e58 00019e6e : } #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); 19e6e: 87 ea ldi r24, 0xA7 ; 167 19e70: 9c e0 ldi r25, 0x0C ; 12 19e72: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (value > 1) value = 1; 19e76: 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) 19e78: 82 30 cpi r24, 0x02 ; 2 19e7a: 08 f4 brcc .+2 ; 0x19e7e 19e7c: 68 27 eor r22, r24 19e7e: 87 ea ldi r24, 0xA7 ; 167 19e80: 9c e0 ldi r25, 0x0C ; 12 19e82: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019e86 : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 19e86: cf 93 push r28 19e88: df 93 push r29 19e8a: c5 e1 ldi r28, 0x15 ; 21 19e8c: 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++)); 19e8e: fe 01 movw r30, r28 19e90: ef 56 subi r30, 0x6F ; 111 19e92: f2 48 sbci r31, 0x82 ; 130 19e94: 64 91 lpm r22, Z 19e96: ce 01 movw r24, r28 19e98: 0f 94 47 dc call 0x3b88e ; 0x3b88e 19e9c: 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++) { 19e9e: c9 32 cpi r28, 0x29 ; 41 19ea0: 8d e0 ldi r24, 0x0D ; 13 19ea2: d8 07 cpc r29, r24 19ea4: a1 f7 brne .-24 ; 0x19e8e eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 19ea6: df 91 pop r29 19ea8: cf 91 pop r28 19eaa: 08 95 ret 00019eac : 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); 19eac: 8a ea ldi r24, 0xAA ; 170 19eae: 9d e0 ldi r25, 0x0D ; 13 19eb0: 0f 94 23 dc call 0x3b846 ; 0x3b846 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 19eb4: 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) { 19eb6: 83 30 cpi r24, 0x03 ; 3 19eb8: 21 f0 breq .+8 ; 0x19ec2 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 19eba: 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) { 19ebc: 85 30 cpi r24, 0x05 ; 5 19ebe: 09 f0 breq .+2 ; 0x19ec2 case 1: mbl_z_probe_nr = 3; break; 19ec0: 63 e0 ldi r22, 0x03 ; 3 19ec2: 8a ea ldi r24, 0xAA ; 170 19ec4: 9d e0 ldi r25, 0x0D ; 13 19ec6: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019eca : 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); 19eca: 8b ea ldi r24, 0xAB ; 171 19ecc: 9d e0 ldi r25, 0x0D ; 13 19ece: 0f 94 23 dc call 0x3b846 ; 0x3b846 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 19ed2: 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; 19ed4: 83 30 cpi r24, 0x03 ; 3 19ed6: 09 f4 brne .+2 ; 0x19eda 19ed8: 67 e0 ldi r22, 0x07 ; 7 19eda: 8b ea ldi r24, 0xAB ; 171 19edc: 9d e0 ldi r25, 0x0D ; 13 19ede: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019ee2 : #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); 19ee2: 8c ea ldi r24, 0xAC ; 172 19ee4: 9d e0 ldi r25, 0x0D ; 13 19ee6: 0f 94 23 dc call 0x3b846 ; 0x3b846 magnet_elimination = !magnet_elimination; 19eea: 61 e0 ldi r22, 0x01 ; 1 19eec: 81 11 cpse r24, r1 19eee: 60 e0 ldi r22, 0x00 ; 0 19ef0: 8c ea ldi r24, 0xAC ; 172 19ef2: 9d e0 ldi r25, 0x0D ; 13 19ef4: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019ef8 : 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); 19ef8: 87 ee ldi r24, 0xE7 ; 231 19efa: 94 e0 ldi r25, 0x04 ; 4 19efc: 0e 94 c3 cd call 0x19b86 ; 0x19b86 19f00: 60 91 e7 04 lds r22, 0x04E7 ; 0x8004e7 19f04: 80 e2 ldi r24, 0x20 ; 32 19f06: 9c e0 ldi r25, 0x0C ; 12 19f08: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f0c : 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); 19f0c: 89 ee ldi r24, 0xE9 ; 233 19f0e: 94 e0 ldi r25, 0x04 ; 4 19f10: 0e 94 c3 cd call 0x19b86 ; 0x19b86 19f14: 60 91 e9 04 lds r22, 0x04E9 ; 0x8004e9 19f18: 83 ea ldi r24, 0xA3 ; 163 19f1a: 9d e0 ldi r25, 0x0D ; 13 19f1c: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f20 : 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); 19f20: 8a ee ldi r24, 0xEA ; 234 19f22: 94 e0 ldi r25, 0x04 ; 4 19f24: 0e 94 c3 cd call 0x19b86 ; 0x19b86 19f28: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 19f2c: 84 ea ldi r24, 0xA4 ; 164 19f2e: 9d e0 ldi r25, 0x0D ; 13 19f30: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f34 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 19f34: 8c ee ldi r24, 0xEC ; 236 19f36: 94 e0 ldi r25, 0x04 ; 4 19f38: 0e 94 c3 cd call 0x19b86 ; 0x19b86 19f3c: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 19f40: 88 ea ldi r24, 0xA8 ; 168 19f42: 9d e0 ldi r25, 0x0D ; 13 19f44: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f48 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 19f48: 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; 19f4c: 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) { 19f4e: 81 11 cpse r24, r1 19f50: 01 c0 rjmp .+2 ; 0x19f54 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 19f52: 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; 19f54: 60 93 b2 17 sts 0x17B2, r22 ; 0x8017b2 19f58: 87 e4 ldi r24, 0x47 ; 71 19f5a: 9d e0 ldi r25, 0x0D ; 13 19f5c: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f60 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 19f60: ea ea ldi r30, 0xAA ; 170 19f62: f7 e1 ldi r31, 0x17 ; 23 19f64: 61 81 ldd r22, Z+1 ; 0x01 19f66: 81 e0 ldi r24, 0x01 ; 1 19f68: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 19f6a: 61 83 std Z+1, r22 ; 0x01 19f6c: 87 e0 ldi r24, 0x07 ; 7 19f6e: 9f e0 ldi r25, 0x0F ; 15 19f70: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f74 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 19f74: ea ea ldi r30, 0xAA ; 170 19f76: f7 e1 ldi r31, 0x17 ; 23 19f78: 62 81 ldd r22, Z+2 ; 0x02 19f7a: 81 e0 ldi r24, 0x01 ; 1 19f7c: 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; 19f7e: 62 83 std Z+2, r22 ; 0x02 19f80: 85 ed ldi r24, 0xD5 ; 213 19f82: 9e e0 ldi r25, 0x0E ; 14 19f84: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f88 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 19f88: e1 e0 ldi r30, 0x01 ; 1 19f8a: f7 e1 ldi r31, 0x17 ; 23 19f8c: 60 81 ld r22, Z 19f8e: 81 e0 ldi r24, 0x01 ; 1 19f90: 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; } 19f92: 60 83 st Z, r22 19f94: 8b eb ldi r24, 0xBB ; 187 19f96: 9f e0 ldi r25, 0x0F ; 15 19f98: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019f9c : 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; 19f9c: 80 91 39 05 lds r24, 0x0539 ; 0x800539 19fa0: 81 30 cpi r24, 0x01 ; 1 19fa2: 51 f4 brne .+20 ; 0x19fb8 19fa4: 10 92 39 05 sts 0x0539, r1 ; 0x800539 19fa8: 60 91 39 05 lds r22, 0x0539 ; 0x800539 19fac: 88 e0 ldi r24, 0x08 ; 8 19fae: 9f e0 ldi r25, 0x0F ; 15 19fb0: 0f 94 47 dc call 0x3b88e ; 0x3b88e else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 19fb4: 0c 94 8c cc jmp 0x19918 ; 0x19918 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 19fb8: 81 e0 ldi r24, 0x01 ; 1 19fba: 80 93 39 05 sts 0x0539, r24 ; 0x800539 19fbe: f4 cf rjmp .-24 ; 0x19fa8 00019fc0 : 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); 19fc0: 8f ea ldi r24, 0xAF ; 175 19fc2: 9f e0 ldi r25, 0x0F ; 15 19fc4: 0f 94 23 dc call 0x3b846 ; 0x3b846 temp_cal_active = !temp_cal_active; 19fc8: 61 e0 ldi r22, 0x01 ; 1 19fca: 81 11 cpse r24, r1 19fcc: 60 e0 ldi r22, 0x00 ; 0 19fce: 8f ea ldi r24, 0xAF ; 175 19fd0: 9f e0 ldi r25, 0x0F ; 15 19fd2: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00019fd6 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 19fd6: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 19fda: 81 30 cpi r24, 0x01 ; 1 19fdc: 71 f0 breq .+28 ; 0x19ffa 19fde: 20 f0 brcs .+8 ; 0x19fe8 19fe0: 82 30 cpi r24, 0x02 ; 2 19fe2: 69 f4 brne .+26 ; 0x19ffe break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 19fe4: 83 e0 ldi r24, 0x03 ; 3 19fe6: 01 c0 rjmp .+2 ; 0x19fea void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 19fe8: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 19fea: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de 19fee: 60 91 de 04 lds r22, 0x04DE ; 0x8004de 19ff2: 87 ed ldi r24, 0xD7 ; 215 19ff4: 9e e0 ldi r25, 0x0E ; 14 19ff6: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 19ffa: 82 e0 ldi r24, 0x02 ; 2 19ffc: f6 cf rjmp .-20 ; 0x19fea break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 19ffe: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 1a002: f5 cf rjmp .-22 ; 0x19fee 0001a004 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 1a004: 89 e0 ldi r24, 0x09 ; 9 1a006: 9f e0 ldi r25, 0x0F ; 15 1a008: 0f 94 23 dc call 0x3b846 ; 0x3b846 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 1a00c: 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) { 1a00e: 88 23 and r24, r24 1a010: 21 f0 breq .+8 ; 0x1a01a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 1a012: 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) { 1a014: 81 30 cpi r24, 0x01 ; 1 1a016: 09 f0 breq .+2 ; 0x1a01a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 1a018: 60 e0 ldi r22, 0x00 ; 0 1a01a: 89 e0 ldi r24, 0x09 ; 9 1a01c: 9f e0 ldi r25, 0x0F ; 15 1a01e: 0f 94 47 dc call 0x3b88e ; 0x3b88e } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 1a022: 81 e0 ldi r24, 0x01 ; 1 1a024: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df } 1a028: 08 95 ret 0001a02a : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 1a02a: cf 93 push r28 1a02c: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 1a02e: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a032: 8c 33 cpi r24, 0x3C ; 60 1a034: e1 f0 breq .+56 ; 0x1a06e 1a036: 80 35 cpi r24, 0x50 ; 80 1a038: 01 f1 breq .+64 ; 0x1a07a 1a03a: 88 32 cpi r24, 0x28 ; 40 1a03c: 91 f0 breq .+36 ; 0x1a062 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 1a03e: 88 e2 ldi r24, 0x28 ; 40 1a040: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=400; 1a044: c0 e9 ldi r28, 0x90 ; 144 1a046: d1 e0 ldi r29, 0x01 ; 1 1a048: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 1a04c: 87 ea ldi r24, 0xA7 ; 167 1a04e: 9d e0 ldi r25, 0x0D ; 13 1a050: 0f 94 47 dc call 0x3b88e ; 0x3b88e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1a054: be 01 movw r22, r28 1a056: 85 ea ldi r24, 0xA5 ; 165 1a058: 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); } 1a05a: df 91 pop r29 1a05c: cf 91 pop r28 1a05e: 0d 94 65 dc jmp 0x3b8ca ; 0x3b8ca case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 1a062: 8c e3 ldi r24, 0x3C ; 60 1a064: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=600; 1a068: c8 e5 ldi r28, 0x58 ; 88 1a06a: d2 e0 ldi r29, 0x02 ; 2 1a06c: ed cf rjmp .-38 ; 0x1a048 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 1a06e: 80 e5 ldi r24, 0x50 ; 80 1a070: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=800; 1a074: c0 e2 ldi r28, 0x20 ; 32 1a076: d3 e0 ldi r29, 0x03 ; 3 1a078: e7 cf rjmp .-50 ; 0x1a048 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 1a07a: 89 e1 ldi r24, 0x19 ; 25 1a07c: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=250; 1a080: ca ef ldi r28, 0xFA ; 250 1a082: d0 e0 ldi r29, 0x00 ; 0 1a084: e1 cf rjmp .-62 ; 0x1a048 0001a086 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a086: 0f 93 push r16 1a088: 1f 93 push r17 1a08a: cf 93 push r28 1a08c: df 93 push r29 1a08e: 00 d0 rcall .+0 ; 0x1a090 1a090: 00 d0 rcall .+0 ; 0x1a092 1a092: 1f 92 push r1 1a094: 1f 92 push r1 1a096: cd b7 in r28, 0x3d ; 61 1a098: de b7 in r29, 0x3e ; 62 1a09a: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a09c: 8a e0 ldi r24, 0x0A ; 10 1a09e: 90 e0 ldi r25, 0x00 ; 0 1a0a0: 0f 94 31 dc call 0x3b862 ; 0x3b862 1a0a4: 9a 83 std Y+2, r25 ; 0x02 1a0a6: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a0a8: 8c e0 ldi r24, 0x0C ; 12 1a0aa: 90 e0 ldi r25, 0x00 ; 0 1a0ac: 0f 94 31 dc call 0x3b862 ; 0x3b862 1a0b0: 9c 83 std Y+4, r25 ; 0x04 1a0b2: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a0b4: 8e e0 ldi r24, 0x0E ; 14 1a0b6: 90 e0 ldi r25, 0x00 ; 0 1a0b8: 0f 94 31 dc call 0x3b862 ; 0x3b862 1a0bc: 9e 83 std Y+6, r25 ; 0x06 1a0be: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a0c0: 80 e1 ldi r24, 0x10 ; 16 1a0c2: 90 e0 ldi r25, 0x00 ; 0 1a0c4: 0f 94 31 dc call 0x3b862 ; 0x3b862 1a0c8: 98 87 std Y+8, r25 ; 0x08 1a0ca: 8f 83 std Y+7, r24 ; 0x07 1a0cc: c8 01 movw r24, r16 1a0ce: de 01 movw r26, r28 1a0d0: 11 96 adiw r26, 0x01 ; 1 1a0d2: be 01 movw r22, r28 1a0d4: 67 5f subi r22, 0xF7 ; 247 1a0d6: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a0d8: fc 01 movw r30, r24 1a0da: 25 91 lpm r18, Z+ 1a0dc: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a0de: 4d 91 ld r20, X+ 1a0e0: 5d 91 ld r21, X+ 1a0e2: 42 17 cp r20, r18 1a0e4: 53 07 cpc r21, r19 1a0e6: 48 f0 brcs .+18 ; 0x1a0fa return true; else if (v < ver_eeprom[i]) 1a0e8: 24 17 cp r18, r20 1a0ea: 35 07 cpc r19, r21 1a0ec: 20 f0 brcs .+8 ; 0x1a0f6 1a0ee: 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) { 1a0f0: a6 17 cp r26, r22 1a0f2: b7 07 cpc r27, r23 1a0f4: 89 f7 brne .-30 ; 0x1a0d8 return true; else if (v < ver_eeprom[i]) break; } return false; 1a0f6: 80 e0 ldi r24, 0x00 ; 0 1a0f8: 01 c0 rjmp .+2 ; 0x1a0fc 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; 1a0fa: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a0fc: 28 96 adiw r28, 0x08 ; 8 1a0fe: 0f b6 in r0, 0x3f ; 63 1a100: f8 94 cli 1a102: de bf out 0x3e, r29 ; 62 1a104: 0f be out 0x3f, r0 ; 63 1a106: cd bf out 0x3d, r28 ; 61 1a108: df 91 pop r29 1a10a: cf 91 pop r28 1a10c: 1f 91 pop r17 1a10e: 0f 91 pop r16 1a110: 08 95 ret 0001a112 : 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) { 1a112: 0f 93 push r16 1a114: 1f 93 push r17 1a116: cf 93 push r28 1a118: df 93 push r29 1a11a: 98 2f mov r25, r24 1a11c: 86 2f mov r24, r22 1a11e: 14 2f mov r17, r20 1a120: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a122: 69 2f mov r22, r25 1a124: 0e 94 e7 6e call 0xddce ; 0xddce switch (_state) 1a128: 11 30 cpi r17, 0x01 ; 1 1a12a: 21 f0 breq .+8 ; 0x1a134 1a12c: 12 30 cpi r17, 0x02 ; 2 1a12e: 79 f0 breq .+30 ; 0x1a14e lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a130: ce 01 movw r24, r28 1a132: 15 c0 rjmp .+42 ; 0x1a15e { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a134: ce 01 movw r24, r28 1a136: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_putc(':'); 1a13a: 8a e3 ldi r24, 0x3A ; 58 1a13c: 0e 94 d6 6e call 0xddac ; 0xddac lcd_putc(_indicator); 1a140: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a142: df 91 pop r29 1a144: cf 91 pop r28 1a146: 1f 91 pop r17 1a148: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a14a: 0c 94 d6 6e jmp 0xddac ; 0xddac break; case 2: lcd_puts_P(_name_PROGMEM); 1a14e: ce 01 movw r24, r28 1a150: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_putc(':'); 1a154: 8a e3 ldi r24, 0x3A ; 58 1a156: 0e 94 d6 6e call 0xddac ; 0xddac lcd_puts_P(MSG_OK_CAPS); 1a15a: 82 e8 ldi r24, 0x82 ; 130 1a15c: 9b e6 ldi r25, 0x6B ; 107 break; default: lcd_puts_P(_name_PROGMEM); } } 1a15e: df 91 pop r29 1a160: cf 91 pop r28 1a162: 1f 91 pop r17 1a164: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a166: 0c 94 d2 6e jmp 0xdda4 ; 0xdda4 0001a16a : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 1a16a: 81 e0 ldi r24, 0x01 ; 1 1a16c: 90 91 aa 17 lds r25, 0x17AA ; 0x8017aa 1a170: 91 11 cpse r25, r1 1a172: 80 e0 ldi r24, 0x00 ; 0 1a174: 0c 94 d6 74 jmp 0xe9ac ; 0xe9ac 0001a178 : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 1a178: 0f 93 push r16 1a17a: 1f 93 push r17 1a17c: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 1a17e: 0a ea ldi r16, 0xAA ; 170 1a180: 17 e1 ldi r17, 0x17 ; 23 1a182: f8 01 movw r30, r16 1a184: c6 85 ldd r28, Z+14 ; 0x0e 1a186: 81 e0 ldi r24, 0x01 ; 1 1a188: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1a18a: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 1a18c: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1a190: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 1a194: 90 8b std Z+16, r25 ; 0x10 1a196: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 1a198: 0f 94 f1 7a call 0x2f5e2 ; 0x2f5e2 jamErrCnt = 0; 1a19c: f8 01 movw r30, r16 1a19e: 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); 1a1a0: 6c 2f mov r22, r28 1a1a2: 8d ea ldi r24, 0xAD ; 173 1a1a4: 9c e0 ldi r25, 0x0C ; 12 } 1a1a6: cf 91 pop r28 1a1a8: 1f 91 pop r17 1a1aa: 0f 91 pop r16 1a1ac: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0001a1b0 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 1a1b0: 89 ea ldi r24, 0xA9 ; 169 1a1b2: 9d e0 ldi r25, 0x0D ; 13 1a1b4: 0c 94 3b 76 jmp 0xec76 ; 0xec76 0001a1b8 : 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)) { 1a1b8: 0f 93 push r16 1a1ba: 1f 93 push r17 1a1bc: cf 93 push r28 1a1be: df 93 push r29 1a1c0: eb 01 movw r28, r22 1a1c2: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1a1c4: 81 30 cpi r24, 0x01 ; 1 1a1c6: 81 f0 breq .+32 ; 0x1a1e8 1a1c8: 82 30 cpi r24, 0x02 ; 2 1a1ca: 89 f0 breq .+34 ; 0x1a1ee case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1a1cc: 83 ed ldi r24, 0xD3 ; 211 1a1ce: 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); 1a1d0: 0e 94 b3 72 call 0xe566 ; 0xe566 1a1d4: 22 e0 ldi r18, 0x02 ; 2 1a1d6: a8 01 movw r20, r16 1a1d8: bc 01 movw r22, r24 1a1da: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1a1dc: df 91 pop r29 1a1de: cf 91 pop r28 1a1e0: 1f 91 pop r17 1a1e2: 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); 1a1e4: 0d 94 2c d3 jmp 0x3a658 ; 0x3a658 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); 1a1e8: 8c ec ldi r24, 0xCC ; 204 1a1ea: 99 e4 ldi r25, 0x49 ; 73 1a1ec: f1 cf rjmp .-30 ; 0x1a1d0 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1a1ee: 83 ec ldi r24, 0xC3 ; 195 1a1f0: 99 e4 ldi r25, 0x49 ; 73 1a1f2: ee cf rjmp .-36 ; 0x1a1d0 0001a1f4 : 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() { 1a1f4: cf 93 push r28 1a1f6: 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); 1a1f8: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1a1fc: 88 23 and r24, r24 1a1fe: 89 f0 breq .+34 ; 0x1a222 1a200: 89 ed ldi r24, 0xD9 ; 217 1a202: 9c e5 ldi r25, 0x5C ; 92 1a204: 0e 94 b3 72 call 0xe566 ; 0xe566 1a208: ec 01 movw r28, r24 1a20a: 8b ef ldi r24, 0xFB ; 251 1a20c: 93 e4 ldi r25, 0x43 ; 67 1a20e: 0e 94 b3 72 call 0xe566 ; 0xe566 1a212: 22 e0 ldi r18, 0x02 ; 2 1a214: 46 ef ldi r20, 0xF6 ; 246 1a216: 59 e3 ldi r21, 0x39 ; 57 1a218: be 01 movw r22, r28 } 1a21a: df 91 pop r29 1a21c: 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); 1a21e: 0d 94 2c d3 jmp 0x3a658 ; 0x3a658 1a222: 83 ed ldi r24, 0xD3 ; 211 1a224: 9c e5 ldi r25, 0x5C ; 92 1a226: ee cf rjmp .-36 ; 0x1a204 0001a228 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 1a228: cf 93 push r28 1a22a: 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); 1a22c: 8f ef ldi r24, 0xFF ; 255 1a22e: 9f e0 ldi r25, 0x0F ; 15 1a230: 0f 94 23 dc call 0x3b846 ; 0x3b846 bool bDesync = tmc2130_mode ^ eeprom_mode; 1a234: 90 91 8c 06 lds r25, 0x068C ; 0x80068c if (eeprom_mode == SILENT_MODE_NORMAL) 1a238: 81 11 cpse r24, r1 1a23a: 35 c0 rjmp .+106 ; 0x1a2a6 { if (bDesync) 1a23c: 99 23 and r25, r25 1a23e: 11 f1 breq .+68 ; 0x1a284 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 1a240: 8b e0 ldi r24, 0x0B ; 11 1a242: 98 e4 ldi r25, 0x48 ; 72 1a244: 0e 94 b3 72 call 0xe566 ; 0xe566 1a248: 22 e0 ldi r18, 0x02 ; 2 1a24a: 41 e3 ldi r20, 0x31 ; 49 1a24c: 50 ef ldi r21, 0xF0 ; 240 1a24e: 6e ee ldi r22, 0xEE ; 238 1a250: 79 e8 ldi r23, 0x89 ; 137 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 1a252: 0f 94 2c d3 call 0x3a658 ; 0x3a658 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a256: 89 e6 ldi r24, 0x69 ; 105 1a258: 9f e0 ldi r25, 0x0F ; 15 1a25a: 0f 94 23 dc call 0x3b846 ; 0x3b846 1a25e: 88 23 and r24, r24 1a260: f9 f0 breq .+62 ; 0x1a2a0 1a262: 89 ed ldi r24, 0xD9 ; 217 1a264: 9c e5 ldi r25, 0x5C ; 92 1a266: 0e 94 b3 72 call 0xe566 ; 0xe566 1a26a: ec 01 movw r28, r24 1a26c: 8c ed ldi r24, 0xDC ; 220 1a26e: 93 e4 ldi r25, 0x43 ; 67 1a270: 0e 94 b3 72 call 0xe566 ; 0xe566 1a274: 22 e0 ldi r18, 0x02 ; 2 1a276: 45 e3 ldi r20, 0x35 ; 53 1a278: 5f ed ldi r21, 0xDF ; 223 1a27a: 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 } } 1a27c: df 91 pop r29 1a27e: 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); 1a280: 0d 94 2c d3 jmp 0x3a658 ; 0x3a658 { 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); 1a284: 88 e8 ldi r24, 0x88 ; 136 1a286: 94 e4 ldi r25, 0x44 ; 68 1a288: 0e 94 b3 72 call 0xe566 ; 0xe566 1a28c: ec 01 movw r28, r24 1a28e: 8b e0 ldi r24, 0x0B ; 11 1a290: 98 e4 ldi r25, 0x48 ; 72 1a292: 0e 94 b3 72 call 0xe566 ; 0xe566 1a296: 22 e0 ldi r18, 0x02 ; 2 1a298: 41 e3 ldi r20, 0x31 ; 49 1a29a: 50 ef ldi r21, 0xF0 ; 240 1a29c: be 01 movw r22, r28 1a29e: d9 cf rjmp .-78 ; 0x1a252 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 1a2a0: 83 ed ldi r24, 0xD3 ; 211 1a2a2: 9c e5 ldi r25, 0x5C ; 92 1a2a4: e0 cf rjmp .-64 ; 0x1a266 } else { if (bDesync) 1a2a6: 98 17 cp r25, r24 1a2a8: a9 f0 breq .+42 ; 0x1a2d4 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 1a2aa: 8b e0 ldi r24, 0x0B ; 11 1a2ac: 98 e4 ldi r25, 0x48 ; 72 1a2ae: 0e 94 b3 72 call 0xe566 ; 0xe566 1a2b2: 22 e0 ldi r18, 0x02 ; 2 1a2b4: 41 e3 ldi r20, 0x31 ; 49 1a2b6: 50 ef ldi r21, 0xF0 ; 240 1a2b8: 69 ee ldi r22, 0xE9 ; 233 1a2ba: 79 e8 ldi r23, 0x89 ; 137 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 1a2bc: 0f 94 2c d3 call 0x3a658 ; 0x3a658 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 1a2c0: 8c ed ldi r24, 0xDC ; 220 1a2c2: 93 e4 ldi r25, 0x43 ; 67 1a2c4: 0e 94 b3 72 call 0xe566 ; 0xe566 1a2c8: 22 e0 ldi r18, 0x02 ; 2 1a2ca: 4b e3 ldi r20, 0x3B ; 59 1a2cc: 5f ed ldi r21, 0xDF ; 223 1a2ce: 70 e0 ldi r23, 0x00 ; 0 1a2d0: 60 e0 ldi r22, 0x00 ; 0 1a2d2: d4 cf rjmp .-88 ; 0x1a27c { 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); 1a2d4: 82 ed ldi r24, 0xD2 ; 210 1a2d6: 93 e4 ldi r25, 0x43 ; 67 1a2d8: 0e 94 b3 72 call 0xe566 ; 0xe566 1a2dc: ec 01 movw r28, r24 1a2de: 8b e0 ldi r24, 0x0B ; 11 1a2e0: 98 e4 ldi r25, 0x48 ; 72 1a2e2: 0e 94 b3 72 call 0xe566 ; 0xe566 1a2e6: 22 e0 ldi r18, 0x02 ; 2 1a2e8: 41 e3 ldi r20, 0x31 ; 49 1a2ea: 50 ef ldi r21, 0xF0 ; 240 1a2ec: be 01 movw r22, r28 1a2ee: e6 cf rjmp .-52 ; 0x1a2bc 0001a2f0 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 1a2f0: cf 93 push r28 1a2f2: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 1a2f4: 86 ed ldi r24, 0xD6 ; 214 1a2f6: 9e e0 ldi r25, 0x0E ; 14 1a2f8: 0f 94 23 dc call 0x3b846 ; 0x3b846 1a2fc: 81 30 cpi r24, 0x01 ; 1 1a2fe: c1 f5 brne .+112 ; 0x1a370 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 1a300: 89 ed ldi r24, 0xD9 ; 217 1a302: 9c e5 ldi r25, 0x5C ; 92 1a304: 0e 94 b3 72 call 0xe566 ; 0xe566 1a308: 22 e0 ldi r18, 0x02 ; 2 1a30a: 4a ef ldi r20, 0xFA ; 250 1a30c: 5a e3 ldi r21, 0x3A ; 58 1a30e: bc 01 movw r22, r24 1a310: 82 e9 ldi r24, 0x92 ; 146 1a312: 9a e6 ldi r25, 0x6A ; 106 1a314: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 1a318: 8e ec ldi r24, 0xCE ; 206 1a31a: 9e e0 ldi r25, 0x0E ; 14 1a31c: 0f 94 23 dc call 0x3b846 ; 0x3b846 1a320: 81 30 cpi r24, 0x01 ; 1 1a322: 49 f5 brne .+82 ; 0x1a376 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 1a324: 89 ed ldi r24, 0xD9 ; 217 1a326: 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); 1a328: 0e 94 b3 72 call 0xe566 ; 0xe566 1a32c: ec 01 movw r28, r24 1a32e: 89 ec ldi r24, 0xC9 ; 201 1a330: 93 e4 ldi r25, 0x43 ; 67 1a332: 0e 94 b3 72 call 0xe566 ; 0xe566 1a336: 22 e0 ldi r18, 0x02 ; 2 1a338: 48 e7 ldi r20, 0x78 ; 120 1a33a: 59 e3 ldi r21, 0x39 ; 57 1a33c: be 01 movw r22, r28 1a33e: 0f 94 2c d3 call 0x3a658 ; 0x3a658 } #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); 1a342: 89 ea ldi r24, 0xA9 ; 169 1a344: 9d e0 ldi r25, 0x0D ; 13 1a346: 0f 94 23 dc call 0x3b846 ; 0x3b846 1a34a: 88 23 and r24, r24 1a34c: b9 f0 breq .+46 ; 0x1a37c 1a34e: 82 ed ldi r24, 0xD2 ; 210 1a350: 93 e4 ldi r25, 0x43 ; 67 1a352: 0e 94 b3 72 call 0xe566 ; 0xe566 1a356: ec 01 movw r28, r24 1a358: 8e eb ldi r24, 0xBE ; 190 1a35a: 93 e4 ldi r25, 0x43 ; 67 1a35c: 0e 94 b3 72 call 0xe566 ; 0xe566 1a360: 22 e0 ldi r18, 0x02 ; 2 1a362: 48 ed ldi r20, 0xD8 ; 216 1a364: 50 ed ldi r21, 0xD0 ; 208 1a366: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 1a368: df 91 pop r29 1a36a: 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); 1a36c: 0d 94 2c d3 jmp 0x3a658 ; 0x3a658 #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); 1a370: 83 ed ldi r24, 0xD3 ; 211 1a372: 9c e5 ldi r25, 0x5C ; 92 1a374: c7 cf rjmp .-114 ; 0x1a304 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); 1a376: 83 ed ldi r24, 0xD3 ; 211 1a378: 9c e5 ldi r25, 0x5C ; 92 1a37a: d6 cf rjmp .-84 ; 0x1a328 } #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); 1a37c: 88 e8 ldi r24, 0x88 ; 136 1a37e: 94 e4 ldi r25, 0x44 ; 68 1a380: e8 cf rjmp .-48 ; 0x1a352 0001a382 : 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) 1a382: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1a386: 88 23 and r24, r24 1a388: 21 f0 breq .+8 ; 0x1a392 1a38a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a38e: 88 23 and r24, r24 1a390: 51 f0 breq .+20 ; 0x1a3a6 { _md->status = 1; 1a392: 81 e0 ldi r24, 0x01 ; 1 1a394: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 1a398: 60 e0 ldi r22, 0x00 ; 0 1a39a: 8a e2 ldi r24, 0x2A ; 42 1a39c: 9d e0 ldi r25, 0x0D ; 13 1a39e: 0e 94 10 76 call 0xec20 ; 0xec20 1a3a2: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } MENU_BEGIN(); 1a3a6: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a3aa: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a3ae: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a3b2: 84 30 cpi r24, 0x04 ; 4 1a3b4: 08 f0 brcs .+2 ; 0x1a3b8 1a3b6: 76 c0 rjmp .+236 ; 0x1a4a4 1a3b8: 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 1a3bc: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 1a3c0: 81 11 cpse r24, r1 1a3c2: 3f c0 rjmp .+126 ; 0x1a442 1a3c4: 8c eb ldi r24, 0xBC ; 188 1a3c6: 99 e4 ldi r25, 0x49 ; 73 1a3c8: 0e 94 b3 72 call 0xe566 ; 0xe566 1a3cc: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 1a3d0: 8c e1 ldi r24, 0x1C ; 28 1a3d2: 96 e4 ldi r25, 0x46 ; 70 1a3d4: 0e 94 b3 72 call 0xe566 ; 0xe566 1a3d8: 6d e0 ldi r22, 0x0D ; 13 1a3da: 72 ee ldi r23, 0xE2 ; 226 1a3dc: 0f 94 1b d4 call 0x3a836 ; 0x3a836 SETTINGS_NOZZLE; 1a3e0: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1a3e4: 8c 33 cpi r24, 0x3C ; 60 1a3e6: 09 f4 brne .+2 ; 0x1a3ea 1a3e8: 49 c0 rjmp .+146 ; 0x1a47c 1a3ea: 70 f5 brcc .+92 ; 0x1a448 1a3ec: 89 31 cpi r24, 0x19 ; 25 1a3ee: d1 f1 breq .+116 ; 0x1a464 1a3f0: 88 32 cpi r24, 0x28 ; 40 1a3f2: 71 f1 breq .+92 ; 0x1a450 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 1a3f4: 8f e5 ldi r24, 0x5F ; 95 1a3f6: 94 e4 ldi r25, 0x44 ; 68 1a3f8: 0e 94 b3 72 call 0xe566 ; 0xe566 1a3fc: 61 eb ldi r22, 0xB1 ; 177 1a3fe: 7e ec ldi r23, 0xCE ; 206 1a400: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 1a404: 86 e5 ldi r24, 0x56 ; 86 1a406: 94 e4 ldi r25, 0x44 ; 68 1a408: 0e 94 b3 72 call 0xe566 ; 0xe566 1a40c: 69 e0 ldi r22, 0x09 ; 9 1a40e: 74 ed ldi r23, 0xD4 ; 212 1a410: 0f 94 1b d4 call 0x3a836 ; 0x3a836 //! 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) 1a414: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1a418: 88 23 and r24, r24 1a41a: 31 f0 breq .+12 ; 0x1a428 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 1a41c: 68 ee ldi r22, 0xE8 ; 232 1a41e: 7f ee ldi r23, 0xEF ; 239 1a420: 83 ef ldi r24, 0xF3 ; 243 1a422: 99 e8 ldi r25, 0x89 ; 137 1a424: 0f 94 1b d4 call 0x3a836 ; 0x3a836 //! //! 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(); 1a428: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 1a42c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a430: 8f 5f subi r24, 0xFF ; 255 1a432: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a436: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a43a: 8f 5f subi r24, 0xFF ; 255 1a43c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a440: b6 cf rjmp .-148 ; 0x1a3ae MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 1a442: 86 e4 ldi r24, 0x46 ; 70 1a444: 98 e4 ldi r25, 0x48 ; 72 1a446: c0 cf rjmp .-128 ; 0x1a3c8 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 1a448: 80 35 cpi r24, 0x50 ; 80 1a44a: 11 f1 breq .+68 ; 0x1a490 1a44c: 8f 3f cpi r24, 0xFF ; 255 1a44e: 91 f6 brne .-92 ; 0x1a3f4 1a450: 86 ec ldi r24, 0xC6 ; 198 1a452: 96 e4 ldi r25, 0x46 ; 70 1a454: 0e 94 b3 72 call 0xe566 ; 0xe566 1a458: 22 e0 ldi r18, 0x02 ; 2 1a45a: 45 e1 ldi r20, 0x15 ; 21 1a45c: 50 ed ldi r21, 0xD0 ; 208 1a45e: 6a e0 ldi r22, 0x0A ; 10 1a460: 7a e8 ldi r23, 0x8A ; 138 1a462: 09 c0 rjmp .+18 ; 0x1a476 1a464: 86 ec ldi r24, 0xC6 ; 198 1a466: 96 e4 ldi r25, 0x46 ; 70 1a468: 0e 94 b3 72 call 0xe566 ; 0xe566 1a46c: 22 e0 ldi r18, 0x02 ; 2 1a46e: 45 e1 ldi r20, 0x15 ; 21 1a470: 50 ed ldi r21, 0xD0 ; 208 1a472: 6f e0 ldi r22, 0x0F ; 15 1a474: 7a e8 ldi r23, 0x8A ; 138 1a476: 0f 94 2c d3 call 0x3a658 ; 0x3a658 1a47a: bc cf rjmp .-136 ; 0x1a3f4 1a47c: 86 ec ldi r24, 0xC6 ; 198 1a47e: 96 e4 ldi r25, 0x46 ; 70 1a480: 0e 94 b3 72 call 0xe566 ; 0xe566 1a484: 22 e0 ldi r18, 0x02 ; 2 1a486: 45 e1 ldi r20, 0x15 ; 21 1a488: 50 ed ldi r21, 0xD0 ; 208 1a48a: 65 e0 ldi r22, 0x05 ; 5 1a48c: 7a e8 ldi r23, 0x8A ; 138 1a48e: f3 cf rjmp .-26 ; 0x1a476 1a490: 86 ec ldi r24, 0xC6 ; 198 1a492: 96 e4 ldi r25, 0x46 ; 70 1a494: 0e 94 b3 72 call 0xe566 ; 0xe566 1a498: 22 e0 ldi r18, 0x02 ; 2 1a49a: 45 e1 ldi r20, 0x15 ; 21 1a49c: 50 ed ldi r21, 0xD0 ; 208 1a49e: 60 e0 ldi r22, 0x00 ; 0 1a4a0: 7a e8 ldi r23, 0x8A ; 138 1a4a2: e9 cf rjmp .-46 ; 0x1a476 //! 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(); } 1a4a4: 08 95 ret 0001a4a6 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a4a6: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a4a8: 8c e5 ldi r24, 0x5C ; 92 1a4aa: 98 e4 ldi r25, 0x48 ; 72 1a4ac: 0e 94 b3 72 call 0xe566 ; 0xe566 1a4b0: ac 01 movw r20, r24 1a4b2: 60 e0 ldi r22, 0x00 ; 0 1a4b4: 80 e0 ldi r24, 0x00 ; 0 1a4b6: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc_at(0, 1, '\n'); 1a4ba: 4a e0 ldi r20, 0x0A ; 10 1a4bc: 61 e0 ldi r22, 0x01 ; 1 1a4be: 80 e0 ldi r24, 0x00 ; 0 1a4c0: 0e 94 07 6f call 0xde0e ; 0xde0e MENU_BEGIN(); 1a4c4: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a4c8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a4cc: 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(); 1a4ce: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a4d2: 84 30 cpi r24, 0x04 ; 4 1a4d4: 18 f5 brcc .+70 ; 0x1a51c 1a4d6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a4da: 81 11 cpse r24, r1 1a4dc: 02 c0 rjmp .+4 ; 0x1a4e2 1a4de: 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); 1a4e2: 87 e5 ldi r24, 0x57 ; 87 1a4e4: 98 e4 ldi r25, 0x48 ; 72 1a4e6: 0e 94 b3 72 call 0xe566 ; 0xe566 1a4ea: 6e e5 ldi r22, 0x5E ; 94 1a4ec: 79 e3 ldi r23, 0x39 ; 57 1a4ee: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a4f2: 81 e5 ldi r24, 0x51 ; 81 1a4f4: 98 e4 ldi r25, 0x48 ; 72 1a4f6: 0e 94 b3 72 call 0xe566 ; 0xe566 1a4fa: 64 ef ldi r22, 0xF4 ; 244 1a4fc: 74 ef ldi r23, 0xF4 ; 244 1a4fe: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_END(); 1a502: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a506: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a50a: 8f 5f subi r24, 0xFF ; 255 1a50c: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a510: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a514: 8f 5f subi r24, 0xFF ; 255 1a516: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a51a: d9 cf rjmp .-78 ; 0x1a4ce // 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(); } 1a51c: cf 91 pop r28 1a51e: 08 95 ret 0001a520 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 1a520: cf 93 push r28 1a522: df 93 push r29 MENU_BEGIN(); 1a524: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a528: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a52c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a530: 84 30 cpi r24, 0x04 ; 4 1a532: 08 f0 brcs .+2 ; 0x1a536 1a534: bd c0 rjmp .+378 ; 0x1a6b0 1a536: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1a53a: 8c eb ldi r24, 0xBC ; 188 1a53c: 99 e4 ldi r25, 0x49 ; 73 1a53e: 0e 94 b3 72 call 0xe566 ; 0xe566 1a542: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 1a546: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1a54a: 88 23 and r24, r24 1a54c: 09 f4 brne .+2 ; 0x1a550 1a54e: 4e c0 rjmp .+156 ; 0x1a5ec 1a550: 89 ed ldi r24, 0xD9 ; 217 1a552: 9c e5 ldi r25, 0x5C ; 92 1a554: 0e 94 b3 72 call 0xe566 ; 0xe566 1a558: ec 01 movw r28, r24 1a55a: 87 ea ldi r24, 0xA7 ; 167 1a55c: 97 e4 ldi r25, 0x47 ; 71 1a55e: 0e 94 b3 72 call 0xe566 ; 0xe566 1a562: 22 e0 ldi r18, 0x02 ; 2 1a564: 45 eb ldi r20, 0xB5 ; 181 1a566: 50 ed ldi r21, 0xD0 ; 208 1a568: be 01 movw r22, r28 1a56a: 0f 94 2c d3 call 0x3a658 ; 0x3a658 1a56e: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa if (fsensor.isEnabled()) { 1a572: 88 23 and r24, r24 1a574: 09 f4 brne .+2 ; 0x1a578 1a576: 8c c0 rjmp .+280 ; 0x1a690 if (fsensor.isError()) { 1a578: 83 30 cpi r24, 0x03 ; 3 1a57a: d9 f5 brne .+118 ; 0x1a5f2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 1a57c: 86 ee ldi r24, 0xE6 ; 230 1a57e: 97 e4 ldi r25, 0x47 ; 71 1a580: 0e 94 b3 72 call 0xe566 ; 0xe566 1a584: ec 01 movw r28, r24 1a586: 82 eb ldi r24, 0xB2 ; 178 1a588: 93 e4 ldi r25, 0x43 ; 67 1a58a: 0e 94 b3 72 call 0xe566 ; 0xe566 1a58e: 22 e0 ldi r18, 0x02 ; 2 1a590: 4b e0 ldi r20, 0x0B ; 11 1a592: 5f ec ldi r21, 0xCF ; 207 1a594: be 01 movw r22, r28 1a596: 0f 94 2c d3 call 0x3a658 ; 0x3a658 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 1a59a: 86 ee ldi r24, 0xE6 ; 230 1a59c: 97 e4 ldi r25, 0x47 ; 71 1a59e: 0e 94 b3 72 call 0xe566 ; 0xe566 1a5a2: ec 01 movw r28, r24 1a5a4: 84 ea ldi r24, 0xA4 ; 164 1a5a6: 93 e4 ldi r25, 0x43 ; 67 1a5a8: 0e 94 b3 72 call 0xe566 ; 0xe566 1a5ac: 22 e0 ldi r18, 0x02 ; 2 1a5ae: 4b e0 ldi r20, 0x0B ; 11 1a5b0: 5f ec ldi r21, 0xCF ; 207 1a5b2: be 01 movw r22, r28 1a5b4: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 1a5b8: 86 ee ldi r24, 0xE6 ; 230 1a5ba: 97 e4 ldi r25, 0x47 ; 71 1a5bc: 0e 94 b3 72 call 0xe566 ; 0xe566 1a5c0: ec 01 movw r28, r24 1a5c2: 84 e9 ldi r24, 0x94 ; 148 1a5c4: 93 e4 ldi r25, 0x43 ; 67 1a5c6: 0e 94 b3 72 call 0xe566 ; 0xe566 1a5ca: 22 e0 ldi r18, 0x02 ; 2 1a5cc: 4b e0 ldi r20, 0x0B ; 11 1a5ce: 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); 1a5d0: be 01 movw r22, r28 1a5d2: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1a5d6: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 1a5da: 88 23 and r24, r24 1a5dc: 09 f4 brne .+2 ; 0x1a5e0 1a5de: 49 c0 rjmp .+146 ; 0x1a672 1a5e0: 81 30 cpi r24, 0x01 ; 1 1a5e2: 09 f4 brne .+2 ; 0x1a5e6 1a5e4: 62 c0 rjmp .+196 ; 0x1a6aa 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(); 1a5e6: 0e 94 a4 cf call 0x19f48 ; 0x19f48 1a5ea: 52 c0 rjmp .+164 ; 0x1a690 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); 1a5ec: 83 ed ldi r24, 0xD3 ; 211 1a5ee: 9c e5 ldi r25, 0x5C ; 92 1a5f0: b1 cf rjmp .-158 ; 0x1a554 #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); 1a5f2: 80 91 ac 17 lds r24, 0x17AC ; 0x8017ac 1a5f6: 88 23 and r24, r24 1a5f8: 99 f1 breq .+102 ; 0x1a660 1a5fa: 89 ed ldi r24, 0xD9 ; 217 1a5fc: 9c e5 ldi r25, 0x5C ; 92 1a5fe: 0e 94 b3 72 call 0xe566 ; 0xe566 1a602: ec 01 movw r28, r24 1a604: 82 eb ldi r24, 0xB2 ; 178 1a606: 93 e4 ldi r25, 0x43 ; 67 1a608: 0e 94 b3 72 call 0xe566 ; 0xe566 1a60c: 22 e0 ldi r18, 0x02 ; 2 1a60e: 4a eb ldi r20, 0xBA ; 186 1a610: 5f ec ldi r21, 0xCF ; 207 1a612: be 01 movw r22, r28 1a614: 0f 94 2c d3 call 0x3a658 ; 0x3a658 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a618: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1a61c: 88 23 and r24, r24 1a61e: 19 f1 breq .+70 ; 0x1a666 1a620: 89 ed ldi r24, 0xD9 ; 217 1a622: 9c e5 ldi r25, 0x5C ; 92 1a624: 0e 94 b3 72 call 0xe566 ; 0xe566 1a628: ec 01 movw r28, r24 1a62a: 84 ea ldi r24, 0xA4 ; 164 1a62c: 93 e4 ldi r25, 0x43 ; 67 1a62e: 0e 94 b3 72 call 0xe566 ; 0xe566 1a632: 22 e0 ldi r18, 0x02 ; 2 1a634: 40 eb ldi r20, 0xB0 ; 176 1a636: 5f ec ldi r21, 0xCF ; 207 1a638: be 01 movw r22, r28 1a63a: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #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); 1a63e: 80 91 b8 17 lds r24, 0x17B8 ; 0x8017b8 1a642: 88 23 and r24, r24 1a644: 99 f0 breq .+38 ; 0x1a66c 1a646: 89 ed ldi r24, 0xD9 ; 217 1a648: 9c e5 ldi r25, 0x5C ; 92 1a64a: 0e 94 b3 72 call 0xe566 ; 0xe566 1a64e: ec 01 movw r28, r24 1a650: 84 e9 ldi r24, 0x94 ; 148 1a652: 93 e4 ldi r25, 0x43 ; 67 1a654: 0e 94 b3 72 call 0xe566 ; 0xe566 1a658: 22 e0 ldi r18, 0x02 ; 2 1a65a: 4c eb ldi r20, 0xBC ; 188 1a65c: 50 ed ldi r21, 0xD0 ; 208 1a65e: b8 cf rjmp .-144 ; 0x1a5d0 #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); 1a660: 83 ed ldi r24, 0xD3 ; 211 1a662: 9c e5 ldi r25, 0x5C ; 92 1a664: cc cf rjmp .-104 ; 0x1a5fe MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1a666: 83 ed ldi r24, 0xD3 ; 211 1a668: 9c e5 ldi r25, 0x5C ; 92 1a66a: dc cf rjmp .-72 ; 0x1a624 #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); 1a66c: 83 ed ldi r24, 0xD3 ; 211 1a66e: 9c e5 ldi r25, 0x5C ; 92 1a670: ec cf rjmp .-40 ; 0x1a64a #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); 1a672: 8c e8 ldi r24, 0x8C ; 140 1a674: 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); 1a676: 0e 94 b3 72 call 0xe566 ; 0xe566 1a67a: ec 01 movw r28, r24 1a67c: 80 e8 ldi r24, 0x80 ; 128 1a67e: 93 e4 ldi r25, 0x43 ; 67 1a680: 0e 94 b3 72 call 0xe566 ; 0xe566 1a684: 22 e0 ldi r18, 0x02 ; 2 1a686: 44 ea ldi r20, 0xA4 ; 164 1a688: 5f ec ldi r21, 0xCF ; 207 1a68a: be 01 movw r22, r28 1a68c: 0f 94 2c d3 call 0x3a658 ; 0x3a658 default: lcd_fsensor_actionNA_set(); } } MENU_END(); 1a690: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1a694: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a698: 8f 5f subi r24, 0xFF ; 255 1a69a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a69e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a6a2: 8f 5f subi r24, 0xFF ; 255 1a6a4: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a6a8: 41 cf rjmp .-382 ; 0x1a52c 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); 1a6aa: 88 e7 ldi r24, 0x78 ; 120 1a6ac: 93 e4 ldi r25, 0x43 ; 67 1a6ae: e3 cf rjmp .-58 ; 0x1a676 lcd_fsensor_actionNA_set(); } } MENU_END(); } 1a6b0: df 91 pop r29 1a6b2: cf 91 pop r28 1a6b4: 08 95 ret 0001a6b6 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a6b6: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a6ba: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a6be: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a6c2: 84 30 cpi r24, 0x04 ; 4 1a6c4: 08 f0 brcs .+2 ; 0x1a6c8 1a6c6: 3f c0 rjmp .+126 ; 0x1a746 1a6c8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a6cc: 8c e1 ldi r24, 0x1C ; 28 1a6ce: 96 e4 ldi r25, 0x46 ; 70 1a6d0: 0e 94 b3 72 call 0xe566 ; 0xe566 1a6d4: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a6d8: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1a6dc: 0e 94 48 76 call 0xec90 ; 0xec90 1a6e0: 88 23 and r24, r24 1a6e2: 41 f0 breq .+16 ; 0x1a6f4 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a6e4: 83 e1 ldi r24, 0x13 ; 19 1a6e6: 96 e4 ldi r25, 0x46 ; 70 1a6e8: 0e 94 b3 72 call 0xe566 ; 0xe566 1a6ec: 67 ed ldi r22, 0xD7 ; 215 1a6ee: 70 ee ldi r23, 0xE0 ; 224 1a6f0: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } if (lcd_commands_type == LcdCommands::Idle) 1a6f4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1a6f8: 81 11 cpse r24, r1 1a6fa: 08 c0 rjmp .+16 ; 0x1a70c { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a6fc: 80 e0 ldi r24, 0x00 ; 0 1a6fe: 96 e4 ldi r25, 0x46 ; 70 1a700: 0e 94 b3 72 call 0xe566 ; 0xe566 1a704: 60 e7 ldi r22, 0x70 ; 112 1a706: 7f ee ldi r23, 0xEF ; 239 1a708: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a70c: 87 ef ldi r24, 0xF7 ; 247 1a70e: 95 e4 ldi r25, 0x45 ; 69 1a710: 0e 94 b3 72 call 0xe566 ; 0xe566 1a714: 64 e9 ldi r22, 0x94 ; 148 1a716: 7b ed ldi r23, 0xDB ; 219 1a718: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a71c: 8f ee ldi r24, 0xEF ; 239 1a71e: 95 e4 ldi r25, 0x45 ; 69 1a720: 0e 94 b3 72 call 0xe566 ; 0xe566 1a724: 62 e5 ldi r22, 0x52 ; 82 1a726: 7e ee ldi r23, 0xEE ; 238 1a728: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_END(); 1a72c: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a730: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a734: 8f 5f subi r24, 0xFF ; 255 1a736: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a73a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a73e: 8f 5f subi r24, 0xFF ; 255 1a740: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a744: bc cf rjmp .-136 ; 0x1a6be } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a746: 08 95 ret 0001a748 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a748: 87 e0 ldi r24, 0x07 ; 7 1a74a: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a74e: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a752 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a752: 86 e0 ldi r24, 0x06 ; 6 1a754: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a758: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a75c ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a75c: 85 e0 ldi r24, 0x05 ; 5 1a75e: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a762: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a766 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a766: 84 e0 ldi r24, 0x04 ; 4 1a768: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a76c: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a770 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a770: 83 e0 ldi r24, 0x03 ; 3 1a772: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a776: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a77a ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a77a: 82 e0 ldi r24, 0x02 ; 2 1a77c: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a780: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a784 ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a784: 81 e0 ldi r24, 0x01 ; 1 1a786: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 lcd_sheet_menu(); 1a78a: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a78e ()>: } template static void select_sheet_menu() { selected_sheet = number; 1a78e: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_sheet_menu(); 1a792: 0c 94 5b d3 jmp 0x1a6b6 ; 0x1a6b6 0001a796 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a796: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a79a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a79e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a7a2: 84 30 cpi r24, 0x04 ; 4 1a7a4: a8 f5 brcc .+106 ; 0x1a810 1a7a6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a7aa: 86 e4 ldi r24, 0x46 ; 70 1a7ac: 98 e4 ldi r25, 0x48 ; 72 1a7ae: 0e 94 b3 72 call 0xe566 ; 0xe566 1a7b2: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1a7b6: 80 ea ldi r24, 0xA0 ; 160 1a7b8: 9a e3 ldi r25, 0x3A ; 58 1a7ba: 0e 94 b3 72 call 0xe566 ; 0xe566 1a7be: 62 e8 ldi r22, 0x82 ; 130 1a7c0: 7a e3 ldi r23, 0x3A ; 58 1a7c2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1a7c6: 87 e9 ldi r24, 0x97 ; 151 1a7c8: 9a e3 ldi r25, 0x3A ; 58 1a7ca: 0e 94 b3 72 call 0xe566 ; 0xe566 1a7ce: 68 e3 ldi r22, 0x38 ; 56 1a7d0: 7a e3 ldi r23, 0x3A ; 58 1a7d2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1a7d6: 8e e8 ldi r24, 0x8E ; 142 1a7d8: 9a e3 ldi r25, 0x3A ; 58 1a7da: 0e 94 b3 72 call 0xe566 ; 0xe566 1a7de: 62 ee ldi r22, 0xE2 ; 226 1a7e0: 7a e3 ldi r23, 0x3A ; 58 1a7e2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1a7e6: 83 e8 ldi r24, 0x83 ; 131 1a7e8: 9a e3 ldi r25, 0x3A ; 58 1a7ea: 0e 94 b3 72 call 0xe566 ; 0xe566 1a7ee: 64 ea ldi r22, 0xA4 ; 164 1a7f0: 7a e3 ldi r23, 0x3A ; 58 1a7f2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_END(); 1a7f6: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1a7fa: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a7fe: 8f 5f subi r24, 0xFF ; 255 1a800: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a804: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a808: 8f 5f subi r24, 0xFF ; 255 1a80a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a80e: c7 cf rjmp .-114 ; 0x1a79e 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(); } 1a810: 08 95 ret 0001a812 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a812: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a816: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a81a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a81e: 84 30 cpi r24, 0x04 ; 4 1a820: d8 f5 brcc .+118 ; 0x1a898 1a822: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1a826: 8a ec ldi r24, 0xCA ; 202 1a828: 94 e4 ldi r25, 0x44 ; 68 1a82a: 0e 94 b3 72 call 0xe566 ; 0xe566 1a82e: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 1a832: 80 e1 ldi r24, 0x10 ; 16 1a834: 94 e4 ldi r25, 0x44 ; 68 1a836: 0e 94 b3 72 call 0xe566 ; 0xe566 1a83a: 4a e9 ldi r20, 0x9A ; 154 1a83c: 5f ec ldi r21, 0xCF ; 207 1a83e: bc 01 movw r22, r24 1a840: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 1a844: 0e 94 dc d0 call 0x1a1b8 ; 0x1a1b8 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 1a848: 88 e0 ldi r24, 0x08 ; 8 1a84a: 94 e4 ldi r25, 0x44 ; 68 1a84c: 0e 94 b3 72 call 0xe566 ; 0xe566 1a850: 40 e9 ldi r20, 0x90 ; 144 1a852: 5f ec ldi r21, 0xCF ; 207 1a854: bc 01 movw r22, r24 1a856: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 1a85a: 0e 94 dc d0 call 0x1a1b8 ; 0x1a1b8 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 1a85e: 46 e8 ldi r20, 0x86 ; 134 1a860: 5f ec ldi r21, 0xCF ; 207 1a862: 6c e9 ldi r22, 0x9C ; 156 1a864: 7a e6 ldi r23, 0x6A ; 106 1a866: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 1a86a: 0e 94 dc d0 call 0x1a1b8 ; 0x1a1b8 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 1a86e: 4c e7 ldi r20, 0x7C ; 124 1a870: 5f ec ldi r21, 0xCF ; 207 1a872: 6e eb ldi r22, 0xBE ; 190 1a874: 7d e6 ldi r23, 0x6D ; 109 1a876: 80 91 e7 04 lds r24, 0x04E7 ; 0x8004e7 1a87a: 0e 94 dc d0 call 0x1a1b8 ; 0x1a1b8 MENU_END(); 1a87e: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 1a882: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a886: 8f 5f subi r24, 0xFF ; 255 1a888: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a88c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a890: 8f 5f subi r24, 0xFF ; 255 1a892: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a896: c1 cf rjmp .-126 ; 0x1a81a 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(); } 1a898: 08 95 ret 0001a89a : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a89a: 0e 94 e2 88 call 0x111c4 ; 0x111c4 // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a89e: 61 e0 ldi r22, 0x01 ; 1 1a8a0: 81 ef ldi r24, 0xF1 ; 241 1a8a2: 90 e7 ldi r25, 0x70 ; 112 1a8a4: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_return_to_status(); 1a8a8: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 0001a8ac : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a8ac: cf 93 push r28 1a8ae: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a8b0: 8c ed ldi r24, 0xDC ; 220 1a8b2: 93 e0 ldi r25, 0x03 ; 3 1a8b4: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a8b8: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 1a8bc: 81 11 cpse r24, r1 1a8be: 18 c0 rjmp .+48 ; 0x1a8f0 1a8c0: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 1a8c4: 81 11 cpse r24, r1 1a8c6: 14 c0 rjmp .+40 ; 0x1a8f0 1a8c8: c0 91 13 04 lds r28, 0x0413 ; 0x800413 1a8cc: d0 91 14 04 lds r29, 0x0414 ; 0x800414 1a8d0: 89 e3 ldi r24, 0x39 ; 57 1a8d2: c6 3e cpi r28, 0xE6 ; 230 1a8d4: d8 07 cpc r29, r24 1a8d6: 61 f0 breq .+24 ; 0x1a8f0 1a8d8: 8a e3 ldi r24, 0x3A ; 58 1a8da: c2 3e cpi r28, 0xE2 ; 226 1a8dc: d8 07 cpc r29, r24 1a8de: 41 f0 breq .+16 ; 0x1a8f0 1a8e0: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 1a8e4: 81 11 cpse r24, r1 1a8e6: 04 c0 rjmp .+8 ; 0x1a8f0 1a8e8: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a8ec: 88 23 and r24, r24 1a8ee: 31 f0 breq .+12 ; 0x1a8fc { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a8f0: 82 e0 ldi r24, 0x02 ; 2 1a8f2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a8f6: df 91 pop r29 1a8f8: cf 91 pop r28 1a8fa: 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) 1a8fc: 81 ed ldi r24, 0xD1 ; 209 1a8fe: c1 3c cpi r28, 0xC1 ; 193 1a900: d8 07 cpc r29, r24 1a902: 49 f4 brne .+18 ; 0x1a916 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a904: 82 e0 ldi r24, 0x02 ; 2 1a906: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a90a: 8a e2 ldi r24, 0x2A ; 42 1a90c: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a90e: df 91 pop r29 1a910: 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); 1a912: 0c 94 3b 76 jmp 0xec76 ; 0xec76 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); 1a916: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1a91a: 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 1a91e: 98 13 cpse r25, r24 1a920: 04 c0 rjmp .+8 ; 0x1a92a 1a922: 0e 94 97 67 call 0xcf2e ; 0xcf2e 1a926: 88 23 and r24, r24 1a928: 61 f0 breq .+24 ; 0x1a942 if ( babystep_allowed_strict() 1a92a: 0e 94 d2 67 call 0xcfa4 ; 0xcfa4 && (menu_menu == lcd_status_screen // and in listed menus... 1a92e: 81 11 cpse r24, r1 1a930: 10 c0 rjmp .+32 ; 0x1a952 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a932: 82 e0 ldi r24, 0x02 ; 2 1a934: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a938: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a93a: df 91 pop r29 1a93c: cf 91 pop r28 1a93e: 0d 94 0e 4e jmp 0x29c1c ; 0x29c1c menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a942: 89 e3 ldi r24, 0x39 ; 57 1a944: c8 31 cpi r28, 0x18 ; 24 1a946: d8 07 cpc r29, r24 1a948: e1 f4 brne .+56 ; 0x1a982 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a94a: 60 e0 ldi r22, 0x00 ; 0 1a94c: 82 ee ldi r24, 0xE2 ; 226 1a94e: 9a e3 ldi r25, 0x3A ; 58 1a950: 14 c0 rjmp .+40 ; 0x1a97a // 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... 1a952: 89 e3 ldi r24, 0x39 ; 57 1a954: c8 31 cpi r28, 0x18 ; 24 1a956: d8 07 cpc r29, r24 1a958: 59 f0 breq .+22 ; 0x1a970 || menu_menu == lcd_main_menu 1a95a: 84 ed ldi r24, 0xD4 ; 212 1a95c: ce 3d cpi r28, 0xDE ; 222 1a95e: d8 07 cpc r29, r24 1a960: 39 f0 breq .+14 ; 0x1a970 || menu_menu == lcd_tune_menu 1a962: 89 ed ldi r24, 0xD9 ; 217 1a964: c2 39 cpi r28, 0x92 ; 146 1a966: d8 07 cpc r29, r24 1a968: 19 f0 breq .+6 ; 0x1a970 || menu_menu == lcd_support_menu 1a96a: c4 5f subi r28, 0xF4 ; 244 1a96c: d9 43 sbci r29, 0x39 ; 57 1a96e: 09 f7 brne .-62 ; 0x1a932 ) ){ lcd_clear(); 1a970: 0e 94 1a 6f call 0xde34 ; 0xde34 menu_submenu(lcd_babystep_z); 1a974: 60 e0 ldi r22, 0x00 ; 0 1a976: 86 ee ldi r24, 0xE6 ; 230 1a978: 99 e3 ldi r25, 0x39 ; 57 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a97a: df 91 pop r29 1a97c: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a97e: 0d 94 0a d3 jmp 0x3a614 ; 0x3a614 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a982: 84 ed ldi r24, 0xD4 ; 212 1a984: ce 3d cpi r28, 0xDE ; 222 1a986: d8 07 cpc r29, r24 1a988: 01 f3 breq .-64 ; 0x1a94a || menu_menu == lcd_preheat_menu 1a98a: 8a e3 ldi r24, 0x3A ; 58 1a98c: c2 3d cpi r28, 0xD2 ; 210 1a98e: d8 07 cpc r29, r24 1a990: e1 f2 breq .-72 ; 0x1a94a || menu_menu == lcd_sdcard_menu 1a992: 81 ef ldi r24, 0xF1 ; 241 1a994: c5 37 cpi r28, 0x75 ; 117 1a996: d8 07 cpc r29, r24 1a998: c1 f2 breq .-80 ; 0x1a94a || menu_menu == lcd_settings_menu 1a99a: 87 ed ldi r24, 0xD7 ; 215 1a99c: cd 32 cpi r28, 0x2D ; 45 1a99e: d8 07 cpc r29, r24 1a9a0: a1 f2 breq .-88 ; 0x1a94a || menu_menu == lcd_control_temperature_menu 1a9a2: 89 ed ldi r24, 0xD9 ; 217 1a9a4: c2 37 cpi r28, 0x72 ; 114 1a9a6: d8 07 cpc r29, r24 1a9a8: 81 f2 breq .-96 ; 0x1a94a #if (LANG_MODE != 0) || menu_menu == lcd_language 1a9aa: 8a ed ldi r24, 0xDA ; 218 1a9ac: c6 35 cpi r28, 0x56 ; 86 1a9ae: d8 07 cpc r29, r24 1a9b0: 61 f2 breq .-104 ; 0x1a94a #endif || menu_menu == lcd_support_menu 1a9b2: c4 5f subi r28, 0xF4 ; 244 1a9b4: d9 43 sbci r29, 0x39 ; 57 1a9b6: 09 f0 breq .+2 ; 0x1a9ba 1a9b8: bc cf rjmp .-136 ; 0x1a932 1a9ba: c7 cf rjmp .-114 ; 0x1a94a 0001a9bc : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1a9bc: 1f 93 push r17 1a9be: cf 93 push r28 1a9c0: df 93 push r29 MENU_BEGIN(); 1a9c2: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1a9c6: 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); 1a9ca: 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 1a9cc: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1a9ce: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a9d2: 84 30 cpi r24, 0x04 ; 4 1a9d4: 08 f0 brcs .+2 ; 0x1a9d8 1a9d6: 3d c2 rjmp .+1146 ; 0x1ae52 1a9d8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1a9dc: 84 e6 ldi r24, 0x64 ; 100 1a9de: 97 e4 ldi r25, 0x47 ; 71 1a9e0: 0e 94 b3 72 call 0xe566 ; 0xe566 1a9e4: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 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)) { 1a9e8: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 1a9ec: 81 11 cpse r24, r1 1a9ee: 19 c0 rjmp .+50 ; 0x1aa22 1a9f0: 0e 94 82 67 call 0xcf04 ; 0xcf04 1a9f4: 81 11 cpse r24, r1 1a9f6: 15 c0 rjmp .+42 ; 0x1aa22 1a9f8: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1a9fc: 81 11 cpse r24, r1 1a9fe: 11 c0 rjmp .+34 ; 0x1aa22 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1aa00: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1aa04: 83 30 cpi r24, 0x03 ; 3 1aa06: 09 f0 breq .+2 ; 0x1aa0a 1aa08: 51 c0 rjmp .+162 ; 0x1aaac 1aa0a: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1aa0e: 88 23 and r24, r24 1aa10: 41 f0 breq .+16 ; 0x1aa22 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1aa12: 8a e5 ldi r24, 0x5A ; 90 1aa14: 97 e4 ldi r25, 0x47 ; 71 1aa16: 0e 94 b3 72 call 0xe566 ; 0xe566 1aa1a: 6d e4 ldi r22, 0x4D ; 77 1aa1c: 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); 1aa1e: 0f 94 1a d1 call 0x3a234 ; 0x3a234 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1aa22: 0e 94 d2 67 call 0xcfa4 ; 0xcfa4 1aa26: 88 23 and r24, r24 1aa28: 81 f0 breq .+32 ; 0x1aa4a 1aa2a: 0e 94 97 67 call 0xcf2e ; 0xcf2e 1aa2e: 81 11 cpse r24, r1 1aa30: 04 c0 rjmp .+8 ; 0x1aa3a 1aa32: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1aa36: 84 30 cpi r24, 0x04 ; 4 1aa38: 41 f4 brne .+16 ; 0x1aa4a MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1aa3a: 8a e4 ldi r24, 0x4A ; 74 1aa3c: 97 e4 ldi r25, 0x47 ; 71 1aa3e: 0e 94 b3 72 call 0xe566 ; 0xe566 1aa42: 66 ee ldi r22, 0xE6 ; 230 1aa44: 79 e3 ldi r23, 0x39 ; 57 1aa46: 0f 94 1b d4 call 0x3a836 ; 0x3a836 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1aa4a: 0e 94 82 67 call 0xcf04 ; 0xcf04 1aa4e: 81 11 cpse r24, r1 1aa50: 61 c0 rjmp .+194 ; 0x1ab14 } //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); 1aa52: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1aa56: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 1aa5a: 89 1b sub r24, r25 1aa5c: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1aa5e: a9 f5 brne .+106 ; 0x1aaca if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1aa60: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 1aa64: 81 11 cpse r24, r1 1aa66: 31 c0 rjmp .+98 ; 0x1aaca #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1aa68: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1aa6c: 82 30 cpi r24, 0x02 ; 2 1aa6e: 69 f1 breq .+90 ; 0x1aaca #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1aa70: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1aa74: 81 11 cpse r24, r1 1aa76: 31 c0 rjmp .+98 ; 0x1aada MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1aa78: 89 e3 ldi r24, 0x39 ; 57 1aa7a: 97 e4 ldi r25, 0x47 ; 71 1aa7c: 0e 94 b3 72 call 0xe566 ; 0xe566 1aa80: 62 ed ldi r22, 0xD2 ; 210 1aa82: 7a e3 ldi r23, 0x3A ; 58 1aa84: 0f 94 1b d4 call 0x3a836 ; 0x3a836 if (M79_timer_get_status()) { 1aa88: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 1aa8c: 88 23 and r24, r24 1aa8e: 29 f1 breq .+74 ; 0x1aada #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1aa90: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 1aa94: 81 30 cpi r24, 0x01 ; 1 1aa96: 09 f0 breq .+2 ; 0x1aa9a 1aa98: 7e c0 rjmp .+252 ; 0x1ab96 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1aa9a: 89 e2 ldi r24, 0x29 ; 41 1aa9c: 97 e4 ldi r25, 0x47 ; 71 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1aa9e: 0e 94 b3 72 call 0xe566 ; 0xe566 1aaa2: 66 ed ldi r22, 0xD6 ; 214 1aaa4: 7d ec ldi r23, 0xCD ; 205 1aaa6: 0f 94 1a d1 call 0x3a234 ; 0x3a234 1aaaa: 17 c0 rjmp .+46 ; 0x1aada // 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()) { 1aaac: 84 30 cpi r24, 0x04 ; 4 1aaae: 09 f0 breq .+2 ; 0x1aab2 1aab0: b8 cf rjmp .-144 ; 0x1aa22 1aab2: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 1aab6: 88 23 and r24, r24 1aab8: 09 f4 brne .+2 ; 0x1aabc 1aaba: b3 cf rjmp .-154 ; 0x1aa22 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1aabc: 8a e5 ldi r24, 0x5A ; 90 1aabe: 97 e4 ldi r25, 0x47 ; 71 1aac0: 0e 94 b3 72 call 0xe566 ; 0xe566 1aac4: 60 ed ldi r22, 0xD0 ; 208 1aac6: 7d ec ldi r23, 0xCD ; 205 1aac8: aa cf rjmp .-172 ; 0x1aa1e 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); 1aaca: 83 e4 ldi r24, 0x43 ; 67 1aacc: 97 e4 ldi r25, 0x47 ; 71 1aace: 0e 94 b3 72 call 0xe566 ; 0xe566 1aad2: 62 e9 ldi r22, 0x92 ; 146 1aad4: 79 ed ldi r23, 0xD9 ; 217 1aad6: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #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) { 1aada: c0 91 a8 0d lds r28, 0x0DA8 ; 0x800da8 1aade: 0e 94 8c 67 call 0xcf18 ; 0xcf18 1aae2: c1 11 cpse r28, r1 1aae4: 17 c0 rjmp .+46 ; 0x1ab14 1aae6: 90 91 a7 0d lds r25, 0x0DA7 ; 0x800da7 1aaea: 91 11 cpse r25, r1 1aaec: 13 c0 rjmp .+38 ; 0x1ab14 1aaee: 81 11 cpse r24, r1 1aaf0: 15 c0 rjmp .+42 ; 0x1ab1c 1aaf2: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1aaf6: 81 11 cpse r24, r1 1aaf8: 0d c0 rjmp .+26 ; 0x1ab14 if (usb_timer.running()) { 1aafa: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1aafe: 88 23 and r24, r24 1ab00: 09 f4 brne .+2 ; 0x1ab04 1ab02: 4c c0 rjmp .+152 ; 0x1ab9c MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1ab04: 8f e0 ldi r24, 0x0F ; 15 1ab06: 97 e4 ldi r25, 0x47 ; 71 1ab08: 0e 94 b3 72 call 0xe566 ; 0xe566 1ab0c: 6a e4 ldi r22, 0x4A ; 74 1ab0e: 79 e3 ldi r23, 0x39 ; 57 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1ab10: 0f 94 1a d1 call 0x3a234 ; 0x3a234 } } } if (printingIsPaused() 1ab14: 0e 94 8c 67 call 0xcf18 ; 0xcf18 && !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) { 1ab18: 88 23 and r24, r24 1ab1a: f1 f0 breq .+60 ; 0x1ab58 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1ab1c: 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() 1ab20: 81 11 cpse r24, r1 1ab22: 1a c0 rjmp .+52 ; 0x1ab58 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ab24: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1ab28: 82 30 cpi r24, 0x02 ; 2 1ab2a: b1 f0 breq .+44 ; 0x1ab58 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1ab2c: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1ab30: 82 30 cpi r24, 0x02 ; 2 1ab32: 21 f4 brne .+8 ; 0x1ab3c 1ab34: 90 91 a9 0d lds r25, 0x0DA9 ; 0x800da9 1ab38: 99 23 and r25, r25 1ab3a: 71 f0 breq .+28 ; 0x1ab58 && custom_message_type != CustomMsg::Resuming) { 1ab3c: 90 91 c4 06 lds r25, 0x06C4 ; 0x8006c4 1ab40: 98 30 cpi r25, 0x08 ; 8 1ab42: 51 f0 breq .+20 ; 0x1ab58 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1ab44: 81 11 cpse r24, r1 1ab46: 36 c0 rjmp .+108 ; 0x1abb4 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1ab48: 80 e0 ldi r24, 0x00 ; 0 1ab4a: 97 e4 ldi r25, 0x47 ; 71 1ab4c: 0e 94 b3 72 call 0xe566 ; 0xe566 1ab50: 6e e1 ldi r22, 0x1E ; 30 1ab52: 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); 1ab54: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1ab58: 0e 94 97 67 call 0xcf2e ; 0xcf2e && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ab5c: 81 11 cpse r24, r1 1ab5e: 08 c0 rjmp .+16 ; 0x1ab70 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())) 1ab60: 0e 94 8c 67 call 0xcf18 ; 0xcf18 1ab64: 81 11 cpse r24, r1 1ab66: 04 c0 rjmp .+8 ; 0x1ab70 1ab68: 0e 94 82 67 call 0xcf04 ; 0xcf04 1ab6c: 88 23 and r24, r24 1ab6e: 41 f0 breq .+16 ; 0x1ab80 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1ab70: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 1ab74: 81 30 cpi r24, 0x01 ; 1 1ab76: 21 f0 breq .+8 ; 0x1ab80 1ab78: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1ab7c: 88 23 and r24, r24 1ab7e: 39 f1 breq .+78 ; 0x1abce MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1ab80: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ab84: 88 23 and r24, r24 1ab86: 59 f1 breq .+86 ; 0x1abde MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1ab88: 8f ee ldi r24, 0xEF ; 239 1ab8a: 96 e4 ldi r25, 0x46 ; 70 1ab8c: 0e 94 b3 72 call 0xe566 ; 0xe566 1ab90: 64 ef ldi r22, 0xF4 ; 244 1ab92: 74 ef ldi r23, 0xF4 ; 244 1ab94: 22 c0 rjmp .+68 ; 0x1abda 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); 1ab96: 8d e1 ldi r24, 0x1D ; 29 1ab98: 97 e4 ldi r25, 0x47 ; 71 1ab9a: 81 cf rjmp .-254 ; 0x1aa9e } } 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) { 1ab9c: 80 91 90 14 lds r24, 0x1490 ; 0x801490 1aba0: 88 23 and r24, r24 1aba2: 09 f4 brne .+2 ; 0x1aba6 1aba4: b7 cf rjmp .-146 ; 0x1ab14 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1aba6: 8f e0 ldi r24, 0x0F ; 15 1aba8: 97 e4 ldi r25, 0x47 ; 71 1abaa: 0e 94 b3 72 call 0xe566 ; 0xe566 1abae: 62 e9 ldi r22, 0x92 ; 146 1abb0: 79 e3 ldi r23, 0x39 ; 57 1abb2: ae cf rjmp .-164 ; 0x1ab10 #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())) { 1abb4: 81 30 cpi r24, 0x01 ; 1 1abb6: 81 f6 brne .-96 ; 0x1ab58 1abb8: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 1abbc: 88 23 and r24, r24 1abbe: 61 f2 breq .-104 ; 0x1ab58 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1abc0: 80 e0 ldi r24, 0x00 ; 0 1abc2: 97 e4 ldi r25, 0x47 ; 71 1abc4: 0e 94 b3 72 call 0xe566 ; 0xe566 1abc8: 6d e4 ldi r22, 0x4D ; 77 1abca: 78 ef ldi r23, 0xF8 ; 248 1abcc: c3 cf rjmp .-122 ; 0x1ab54 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1abce: 8c e5 ldi r24, 0x5C ; 92 1abd0: 98 e4 ldi r25, 0x48 ; 72 1abd2: 0e 94 b3 72 call 0xe566 ; 0xe566 1abd6: 63 e5 ldi r22, 0x53 ; 83 1abd8: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1abda: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1abde: 0e 94 82 67 call 0xcf04 ; 0xcf04 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1abe2: 81 11 cpse r24, r1 1abe4: 9e c0 rjmp .+316 ; 0x1ad22 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() 1abe6: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 1abea: 81 11 cpse r24, r1 1abec: 9a c0 rjmp .+308 ; 0x1ad22 1abee: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 1abf2: 81 11 cpse r24, r1 1abf4: 96 c0 rjmp .+300 ; 0x1ad22 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1abf6: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 1abfa: 82 30 cpi r24, 0x02 ; 2 1abfc: 09 f4 brne .+2 ; 0x1ac00 1abfe: 91 c0 rjmp .+290 ; 0x1ad22 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1ac00: 80 91 91 14 lds r24, 0x1491 ; 0x801491 1ac04: 81 11 cpse r24, r1 1ac06: 05 c0 rjmp .+10 ; 0x1ac12 || lcd_commands_type != LcdCommands::Idle) { 1ac08: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1ac0c: 88 23 and r24, r24 1ac0e: 09 f4 brne .+2 ; 0x1ac12 1ac10: b9 c0 rjmp .+370 ; 0x1ad84 if (!card.isFileOpen()) { 1ac12: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1ac16: 81 11 cpse r24, r1 1ac18: 12 c0 rjmp .+36 ; 0x1ac3e if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1ac1a: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1ac1e: 81 11 cpse r24, r1 1ac20: 0e c0 rjmp .+28 ; 0x1ac3e 1ac22: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1ac26: 81 11 cpse r24, r1 1ac28: 0a c0 rjmp .+20 ; 0x1ac3e bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1ac2a: d0 93 e1 03 sts 0x03E1, r29 ; 0x8003e1 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1ac2e: 8f ed ldi r24, 0xDF ; 223 1ac30: 96 e4 ldi r25, 0x46 ; 70 1ac32: 0e 94 b3 72 call 0xe566 ; 0xe566 1ac36: 65 e7 ldi r22, 0x75 ; 117 1ac38: 71 ef ldi r23, 0xF1 ; 241 1ac3a: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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)); 1ac3e: 81 ea ldi r24, 0xA1 ; 161 1ac40: 9d e0 ldi r25, 0x0D ; 13 1ac42: 0f 94 23 dc call 0x3b846 ; 0x3b846 1ac46: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1ac48: 0e 94 56 76 call 0xecac ; 0xecac if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1ac4c: 87 fd sbrc r24, 7 1ac4e: 09 c0 rjmp .+18 ; 0x1ac62 1ac50: c8 17 cp r28, r24 1ac52: 39 f0 breq .+14 ; 0x1ac62 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ac54: c1 02 muls r28, r17 1ac56: c0 01 movw r24, r0 1ac58: 11 24 eor r1, r1 1ac5a: 87 5b subi r24, 0xB7 ; 183 1ac5c: 92 4f sbci r25, 0xF2 ; 242 1ac5e: 0e 94 07 ce call 0x19c0e ; 0x19c0e } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1ac62: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 1ac66: 8c 33 cpi r24, 0x3C ; 60 1ac68: 09 f4 brne .+2 ; 0x1ac6c 1ac6a: b0 c0 rjmp .+352 ; 0x1adcc 1ac6c: 08 f0 brcs .+2 ; 0x1ac70 1ac6e: 93 c0 rjmp .+294 ; 0x1ad96 1ac70: 89 31 cpi r24, 0x19 ; 25 1ac72: 09 f4 brne .+2 ; 0x1ac76 1ac74: 9f c0 rjmp .+318 ; 0x1adb4 1ac76: 88 32 cpi r24, 0x28 ; 40 1ac78: 09 f4 brne .+2 ; 0x1ac7c 1ac7a: 92 c0 rjmp .+292 ; 0x1ada0 #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1ac7c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1ac80: 81 11 cpse r24, r1 1ac82: 4f c0 rjmp .+158 ; 0x1ad22 1ac84: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ac88: 81 11 cpse r24, r1 1ac8a: 4b c0 rjmp .+150 ; 0x1ad22 if (MMU2::mmu2.Enabled()) { 1ac8c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1ac90: 81 30 cpi r24, 0x01 ; 1 1ac92: 09 f0 breq .+2 ; 0x1ac96 1ac94: af c0 rjmp .+350 ; 0x1adf4 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1ac96: 80 91 90 13 lds r24, 0x1390 ; 0x801390 1ac9a: 81 11 cpse r24, r1 1ac9c: 0c c0 rjmp .+24 ; 0x1acb6 1ac9e: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1aca2: 81 11 cpse r24, r1 1aca4: 08 c0 rjmp .+16 ; 0x1acb6 // 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); 1aca6: 85 eb ldi r24, 0xB5 ; 181 1aca8: 96 e4 ldi r25, 0x46 ; 70 1acaa: 0e 94 b3 72 call 0xe566 ; 0xe566 1acae: 61 e9 ldi r22, 0x91 ; 145 1acb0: 70 ee ldi r23, 0xE0 ; 224 1acb2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1acb6: 84 ea ldi r24, 0xA4 ; 164 1acb8: 96 e4 ldi r25, 0x46 ; 70 1acba: 0e 94 b3 72 call 0xe566 ; 0xe566 1acbe: 68 ec ldi r22, 0xC8 ; 200 1acc0: 70 ee ldi r23, 0xE0 ; 224 1acc2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1acc6: 82 e9 ldi r24, 0x92 ; 146 1acc8: 96 e4 ldi r25, 0x46 ; 70 1acca: 0e 94 b3 72 call 0xe566 ; 0xe566 1acce: 6b ec ldi r22, 0xCB ; 203 1acd0: 70 ee ldi r23, 0xE0 ; 224 1acd2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1acd6: 86 e2 ldi r24, 0x26 ; 38 1acd8: 9c e5 ldi r25, 0x5C ; 92 1acda: 0e 94 b3 72 call 0xe566 ; 0xe566 1acde: 6e ec ldi r22, 0xCE ; 206 1ace0: 70 ee ldi r23, 0xE0 ; 224 1ace2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1ace6: 8e ec ldi r24, 0xCE ; 206 1ace8: 9e e0 ldi r25, 0x0E ; 14 1acea: 0f 94 23 dc call 0x3b846 ; 0x3b846 1acee: 88 23 and r24, r24 1acf0: 41 f0 breq .+16 ; 0x1ad02 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1acf2: 87 e1 ldi r24, 0x17 ; 23 1acf4: 9c e5 ldi r25, 0x5C ; 92 1acf6: 0e 94 b3 72 call 0xe566 ; 0xe566 1acfa: 61 ed ldi r22, 0xD1 ; 209 1acfc: 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); 1acfe: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1ad02: 86 e4 ldi r24, 0x46 ; 70 1ad04: 98 e4 ldi r25, 0x48 ; 72 1ad06: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad0a: 6d e2 ldi r22, 0x2D ; 45 1ad0c: 77 ed ldi r23, 0xD7 ; 215 1ad0e: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1ad12: 80 e6 ldi r24, 0x60 ; 96 1ad14: 96 e4 ldi r25, 0x46 ; 70 1ad16: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad1a: 60 ea ldi r22, 0xA0 ; 160 1ad1c: 78 ed ldi r23, 0xD8 ; 216 1ad1e: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1ad22: 83 e5 ldi r24, 0x53 ; 83 1ad24: 96 e4 ldi r25, 0x46 ; 70 1ad26: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad2a: 6a e0 ldi r22, 0x0A ; 10 1ad2c: 7a e3 ldi r23, 0x3A ; 58 1ad2e: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1ad32: 86 e4 ldi r24, 0x46 ; 70 1ad34: 96 e4 ldi r25, 0x46 ; 70 1ad36: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad3a: 6e e1 ldi r22, 0x1E ; 30 1ad3c: 7b e3 ldi r23, 0x3B ; 59 1ad3e: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif if (MMU2::mmu2.Enabled()) { 1ad42: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1ad46: 81 30 cpi r24, 0x01 ; 1 1ad48: 41 f4 brne .+16 ; 0x1ad5a MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1ad4a: 85 e3 ldi r24, 0x35 ; 53 1ad4c: 96 e4 ldi r25, 0x46 ; 70 1ad4e: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad52: 60 e1 ldi r22, 0x10 ; 16 1ad54: 7a e3 ldi r23, 0x3A ; 58 1ad56: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 1ad5a: 8b e2 ldi r24, 0x2B ; 43 1ad5c: 96 e4 ldi r25, 0x46 ; 70 1ad5e: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad62: 64 ef ldi r22, 0xF4 ; 244 1ad64: 79 e3 ldi r23, 0x39 ; 57 1ad66: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_END(); 1ad6a: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1ad6e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ad72: 8f 5f subi r24, 0xFF ; 255 1ad74: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1ad78: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1ad7c: 8f 5f subi r24, 0xFF ; 255 1ad7e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1ad82: 25 ce rjmp .-950 ; 0x1a9ce #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 1ad84: d0 93 e1 03 sts 0x03E1, r29 ; 0x8003e1 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1ad88: 82 ed ldi r24, 0xD2 ; 210 1ad8a: 96 e4 ldi r25, 0x46 ; 70 1ad8c: 0e 94 b3 72 call 0xe566 ; 0xe566 1ad90: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 1ad94: 54 cf rjmp .-344 ; 0x1ac3e 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; 1ad96: 80 35 cpi r24, 0x50 ; 80 1ad98: 19 f1 breq .+70 ; 0x1ade0 1ad9a: 8f 3f cpi r24, 0xFF ; 255 1ad9c: 09 f0 breq .+2 ; 0x1ada0 1ad9e: 6e cf rjmp .-292 ; 0x1ac7c 1ada0: 86 ec ldi r24, 0xC6 ; 198 1ada2: 96 e4 ldi r25, 0x46 ; 70 1ada4: 0e 94 b3 72 call 0xe566 ; 0xe566 1ada8: 22 e0 ldi r18, 0x02 ; 2 1adaa: 45 e1 ldi r20, 0x15 ; 21 1adac: 50 ed ldi r21, 0xD0 ; 208 1adae: 60 e3 ldi r22, 0x30 ; 48 1adb0: 7a e8 ldi r23, 0x8A ; 138 1adb2: 09 c0 rjmp .+18 ; 0x1adc6 1adb4: 86 ec ldi r24, 0xC6 ; 198 1adb6: 96 e4 ldi r25, 0x46 ; 70 1adb8: 0e 94 b3 72 call 0xe566 ; 0xe566 1adbc: 22 e0 ldi r18, 0x02 ; 2 1adbe: 45 e1 ldi r20, 0x15 ; 21 1adc0: 50 ed ldi r21, 0xD0 ; 208 1adc2: 65 e3 ldi r22, 0x35 ; 53 1adc4: 7a e8 ldi r23, 0x8A ; 138 1adc6: 0f 94 2c d3 call 0x3a658 ; 0x3a658 1adca: 58 cf rjmp .-336 ; 0x1ac7c 1adcc: 86 ec ldi r24, 0xC6 ; 198 1adce: 96 e4 ldi r25, 0x46 ; 70 1add0: 0e 94 b3 72 call 0xe566 ; 0xe566 1add4: 22 e0 ldi r18, 0x02 ; 2 1add6: 45 e1 ldi r20, 0x15 ; 21 1add8: 50 ed ldi r21, 0xD0 ; 208 1adda: 6b e2 ldi r22, 0x2B ; 43 1addc: 7a e8 ldi r23, 0x8A ; 138 1adde: f3 cf rjmp .-26 ; 0x1adc6 1ade0: 86 ec ldi r24, 0xC6 ; 198 1ade2: 96 e4 ldi r25, 0x46 ; 70 1ade4: 0e 94 b3 72 call 0xe566 ; 0xe566 1ade8: 22 e0 ldi r18, 0x02 ; 2 1adea: 45 e1 ldi r20, 0x15 ; 21 1adec: 50 ed ldi r21, 0xD0 ; 208 1adee: 66 e2 ldi r22, 0x26 ; 38 1adf0: 7a e8 ldi r23, 0x8A ; 138 1adf2: e9 cf rjmp .-46 ; 0x1adc6 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1adf4: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1adf8: 88 23 and r24, r24 1adfa: e1 f0 breq .+56 ; 0x1ae34 if (!fsensor.getAutoLoadEnabled()) { 1adfc: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1ae00: 81 11 cpse r24, r1 1ae02: 08 c0 rjmp .+16 ; 0x1ae14 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1ae04: 82 e8 ldi r24, 0x82 ; 130 1ae06: 96 e4 ldi r25, 0x46 ; 70 1ae08: 0e 94 b3 72 call 0xe566 ; 0xe566 1ae0c: 6c ed ldi r22, 0xDC ; 220 1ae0e: 7a e3 ldi r23, 0x3A ; 58 1ae10: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } if (!fsensor.getFilamentPresent()) { 1ae14: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ae18: 81 11 cpse r24, r1 1ae1a: 14 c0 rjmp .+40 ; 0x1ae44 if (fsensor.getAutoLoadEnabled()) { 1ae1c: 80 91 ab 17 lds r24, 0x17AB ; 0x8017ab 1ae20: 88 23 and r24, r24 1ae22: 09 f4 brne .+2 ; 0x1ae26 1ae24: 6e cf rjmp .-292 ; 0x1ad02 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1ae26: 8e e6 ldi r24, 0x6E ; 110 1ae28: 96 e4 ldi r25, 0x46 ; 70 1ae2a: 0e 94 b3 72 call 0xe566 ; 0xe566 1ae2e: 6a e2 ldi r22, 0x2A ; 42 1ae30: 7a e3 ldi r23, 0x3A ; 58 1ae32: 65 cf rjmp .-310 ; 0x1acfe } 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); 1ae34: 82 e8 ldi r24, 0x82 ; 130 1ae36: 96 e4 ldi r25, 0x46 ; 70 1ae38: 0e 94 b3 72 call 0xe566 ; 0xe566 1ae3c: 6c ed ldi r22, 0xDC ; 220 1ae3e: 7a e3 ldi r23, 0x3A ; 58 1ae40: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1ae44: 82 e9 ldi r24, 0x92 ; 146 1ae46: 96 e4 ldi r25, 0x46 ; 70 1ae48: 0e 94 b3 72 call 0xe566 ; 0xe566 1ae4c: 6a e8 ldi r22, 0x8A ; 138 1ae4e: 7a e3 ldi r23, 0x3A ; 58 1ae50: 56 cf rjmp .-340 ; 0x1acfe #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1ae52: df 91 pop r29 1ae54: cf 91 pop r28 1ae56: 1f 91 pop r17 1ae58: 08 95 ret 0001ae5a : MENU_END(); } static void lcd_settings_menu() { 1ae5a: 1f 93 push r17 1ae5c: cf 93 push r28 1ae5e: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1ae60: 8f ef ldi r24, 0xFF ; 255 1ae62: 9f e0 ldi r25, 0x0F ; 15 1ae64: 0f 94 23 dc call 0x3b846 ; 0x3b846 1ae68: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1ae6c: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1ae70: 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 1ae74: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1ae76: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ae7a: 84 30 cpi r24, 0x04 ; 4 1ae7c: 08 f0 brcs .+2 ; 0x1ae80 1ae7e: 5c c1 rjmp .+696 ; 0x1b138 1ae80: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1ae84: 88 ea ldi r24, 0xA8 ; 168 1ae86: 98 e4 ldi r25, 0x48 ; 72 1ae88: 0e 94 b3 72 call 0xe566 ; 0xe566 1ae8c: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 1ae90: 83 e0 ldi r24, 0x03 ; 3 1ae92: 95 e4 ldi r25, 0x45 ; 69 1ae94: 0e 94 b3 72 call 0xe566 ; 0xe566 1ae98: 62 e7 ldi r22, 0x72 ; 114 1ae9a: 79 ed ldi r23, 0xD9 ; 217 1ae9c: 0f 94 1b d4 call 0x3a836 ; 0x3a836 if (!printer_active() || printingIsPaused()) 1aea0: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 1aea4: 88 23 and r24, r24 1aea6: 21 f0 breq .+8 ; 0x1aeb0 1aea8: 0e 94 8c 67 call 0xcf18 ; 0xcf18 1aeac: 88 23 and r24, r24 1aeae: 81 f0 breq .+32 ; 0x1aed0 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 1aeb0: 87 ef ldi r24, 0xF7 ; 247 1aeb2: 94 e4 ldi r25, 0x44 ; 68 1aeb4: 0e 94 b3 72 call 0xe566 ; 0xe566 1aeb8: 6b ec ldi r22, 0xCB ; 203 1aeba: 73 ed ldi r23, 0xD3 ; 211 1aebc: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 1aec0: 84 ee ldi r24, 0xE4 ; 228 1aec2: 94 e4 ldi r25, 0x44 ; 68 1aec4: 0e 94 b3 72 call 0xe566 ; 0xe566 1aec8: 67 ed ldi r22, 0xD7 ; 215 1aeca: 7b e6 ldi r23, 0x6B ; 107 1aecc: 0f 94 93 d0 call 0x3a126 ; 0x3a126 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1aed0: 87 ea ldi r24, 0xA7 ; 167 1aed2: 97 e4 ldi r25, 0x47 ; 71 1aed4: 0e 94 b3 72 call 0xe566 ; 0xe566 1aed8: 60 e9 ldi r22, 0x90 ; 144 1aeda: 72 ed ldi r23, 0xD2 ; 210 1aedc: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #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); 1aee0: 8c ea ldi r24, 0xAC ; 172 1aee2: 9c e0 ldi r25, 0x0C ; 12 1aee4: 0f 94 23 dc call 0x3b846 ; 0x3b846 1aee8: 88 23 and r24, r24 1aeea: 09 f4 brne .+2 ; 0x1aeee 1aeec: ac c0 rjmp .+344 ; 0x1b046 1aeee: 89 ed ldi r24, 0xD9 ; 217 1aef0: 9c e5 ldi r25, 0x5C ; 92 1aef2: 0e 94 b3 72 call 0xe566 ; 0xe566 1aef6: 22 e0 ldi r18, 0x02 ; 2 1aef8: 43 ef ldi r20, 0xF3 ; 243 1aefa: 53 ee ldi r21, 0xE3 ; 227 1aefc: bc 01 movw r22, r24 1aefe: 8e e1 ldi r24, 0x1E ; 30 1af00: 9a e8 ldi r25, 0x8A ; 138 1af02: 0f 94 2c d3 call 0x3a658 ; 0x3a658 if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 1af06: 8c ea ldi r24, 0xAC ; 172 1af08: 9c e0 ldi r25, 0x0C ; 12 1af0a: 0f 94 23 dc call 0x3b846 ; 0x3b846 1af0e: 88 23 and r24, r24 1af10: 31 f0 breq .+12 ; 0x1af1e { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 1af12: 6a e6 ldi r22, 0x6A ; 106 1af14: 79 e3 ldi r23, 0x39 ; 57 1af16: 84 e1 ldi r24, 0x14 ; 20 1af18: 9a e8 ldi r25, 0x8A ; 138 1af1a: 0f 94 1a d1 call 0x3a234 ; 0x3a234 } if (MMU2::mmu2.Enabled()) 1af1e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1af22: 81 30 cpi r24, 0x01 ; 1 1af24: 51 f4 brne .+20 ; 0x1af3a { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 1af26: 0e 94 78 d1 call 0x1a2f0 ; 0x1a2f0 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 1af2a: 85 ed ldi r24, 0xD5 ; 213 1af2c: 94 e4 ldi r25, 0x44 ; 68 1af2e: 0e 94 b3 72 call 0xe566 ; 0xe566 1af32: 64 ed ldi r22, 0xD4 ; 212 1af34: 70 ee ldi r23, 0xE0 ; 224 1af36: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } SETTINGS_FANS_CHECK(); 1af3a: 0e 94 fa d0 call 0x1a1f4 ; 0x1a1f4 SETTINGS_SILENT_MODE(); 1af3e: 0e 94 14 d1 call 0x1a228 ; 0x1a228 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1af42: 10 93 fc 03 sts 0x03FC, r17 ; 0x8003fc MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 1af46: 8a ec ldi r24, 0xCA ; 202 1af48: 94 e4 ldi r25, 0x44 ; 68 1af4a: 0e 94 b3 72 call 0xe566 ; 0xe566 1af4e: 61 ec ldi r22, 0xC1 ; 193 1af50: 71 ed ldi r23, 0xD1 ; 209 1af52: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } 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); 1af56: 88 e5 ldi r24, 0x58 ; 88 1af58: 95 e4 ldi r25, 0x45 ; 69 1af5a: 0e 94 b3 72 call 0xe566 ; 0xe566 1af5e: 6c e0 ldi r22, 0x0C ; 12 1af60: 7a e3 ldi r23, 0x3A ; 58 1af62: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 1af66: 88 eb ldi r24, 0xB8 ; 184 1af68: 94 e4 ldi r25, 0x44 ; 68 1af6a: 0e 94 b3 72 call 0xe566 ; 0xe566 1af6e: 65 e7 ldi r22, 0x75 ; 117 1af70: 70 ef ldi r23, 0xF0 ; 240 1af72: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1af76: 20 e0 ldi r18, 0x00 ; 0 1af78: 30 e0 ldi r19, 0x00 ; 0 1af7a: 40 e2 ldi r20, 0x20 ; 32 1af7c: 51 e4 ldi r21, 0x41 ; 65 1af7e: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1af82: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1af86: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1af8a: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1af8e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1af92: 87 fd sbrc r24, 7 1af94: 16 c0 rjmp .+44 ; 0x1afc2 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); 1af96: 8f ea ldi r24, 0xAF ; 175 1af98: 9f e0 ldi r25, 0x0F ; 15 1af9a: 0f 94 23 dc call 0x3b846 ; 0x3b846 1af9e: 88 23 and r24, r24 1afa0: 09 f4 brne .+2 ; 0x1afa4 1afa2: 54 c0 rjmp .+168 ; 0x1b04c 1afa4: 89 ed ldi r24, 0xD9 ; 217 1afa6: 9c e5 ldi r25, 0x5C ; 92 1afa8: 0e 94 b3 72 call 0xe566 ; 0xe566 1afac: ec 01 movw r28, r24 1afae: 81 e1 ldi r24, 0x11 ; 17 1afb0: 95 e4 ldi r25, 0x45 ; 69 1afb2: 0e 94 b3 72 call 0xe566 ; 0xe566 1afb6: 22 e0 ldi r18, 0x02 ; 2 1afb8: 40 ee ldi r20, 0xE0 ; 224 1afba: 5f ec ldi r21, 0xCF ; 207 1afbc: be 01 movw r22, r28 1afbe: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #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); 1afc2: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1afc6: 81 11 cpse r24, r1 1afc8: 44 c0 rjmp .+136 ; 0x1b052 1afca: 83 ed ldi r24, 0xD3 ; 211 1afcc: 9c e5 ldi r25, 0x5C ; 92 1afce: 0e 94 b3 72 call 0xe566 ; 0xe566 1afd2: ec 01 movw r28, r24 1afd4: 8d ea ldi r24, 0xAD ; 173 1afd6: 94 e4 ldi r25, 0x44 ; 68 1afd8: 0e 94 b3 72 call 0xe566 ; 0xe566 1afdc: 22 e0 ldi r18, 0x02 ; 2 1afde: 4e ec ldi r20, 0xCE ; 206 1afe0: 5f ec ldi r21, 0xCF ; 207 1afe2: be 01 movw r22, r28 1afe4: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 1afe8: 0e 94 8c 67 call 0xcf18 ; 0xcf18 1afec: 81 11 cpse r24, r1 1afee: 08 c0 rjmp .+16 ; 0x1b000 1aff0: 8a e4 ldi r24, 0x4A ; 74 1aff2: 97 e4 ldi r25, 0x47 ; 71 1aff4: 0e 94 b3 72 call 0xe566 ; 0xe566 1aff8: 66 ee ldi r22, 0xE6 ; 230 1affa: 79 e3 ldi r23, 0x39 ; 57 1affc: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 1b000: 8b e9 ldi r24, 0x9B ; 155 1b002: 94 e4 ldi r25, 0x44 ; 68 1b004: 0e 94 b3 72 call 0xe566 ; 0xe566 1b008: 66 ed ldi r22, 0xD6 ; 214 1b00a: 72 ee ldi r23, 0xE2 ; 226 1b00c: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 1b010: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1b014: 88 23 and r24, r24 1b016: 01 f1 breq .+64 ; 0x1b058 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 1b018: 81 e9 ldi r24, 0x91 ; 145 1b01a: 94 e4 ldi r25, 0x44 ; 68 1b01c: 0e 94 b3 72 call 0xe566 ; 0xe566 1b020: 22 e0 ldi r18, 0x02 ; 2 1b022: 44 ec ldi r20, 0xC4 ; 196 1b024: 5f ec ldi r21, 0xCF ; 207 1b026: 62 eb ldi r22, 0xB2 ; 178 1b028: 7a e6 ldi r23, 0x6A ; 106 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 1b02a: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 1b02e: 89 e0 ldi r24, 0x09 ; 9 1b030: 9f e0 ldi r25, 0x0F ; 15 1b032: 0f 94 23 dc call 0x3b846 ; 0x3b846 1b036: 88 23 and r24, r24 1b038: e9 f0 breq .+58 ; 0x1b074 1b03a: 81 30 cpi r24, 0x01 ; 1 1b03c: 09 f4 brne .+2 ; 0x1b040 1b03e: 6d c0 rjmp .+218 ; 0x1b11a 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); 1b040: 83 ed ldi r24, 0xD3 ; 211 1b042: 99 e4 ldi r25, 0x49 ; 73 1b044: 19 c0 rjmp .+50 ; 0x1b078 #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); 1b046: 83 ed ldi r24, 0xD3 ; 211 1b048: 9c e5 ldi r25, 0x5C ; 92 1b04a: 53 cf rjmp .-346 ; 0x1aef2 #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); 1b04c: 83 ed ldi r24, 0xD3 ; 211 1b04e: 9c e5 ldi r25, 0x5C ; 92 1b050: ab cf rjmp .-170 ; 0x1afa8 #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); 1b052: 89 ed ldi r24, 0xD9 ; 217 1b054: 9c e5 ldi r25, 0x5C ; 92 1b056: bb cf rjmp .-138 ; 0x1afce 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); 1b058: 88 e8 ldi r24, 0x88 ; 136 1b05a: 94 e4 ldi r25, 0x44 ; 68 1b05c: 0e 94 b3 72 call 0xe566 ; 0xe566 1b060: ec 01 movw r28, r24 1b062: 81 e9 ldi r24, 0x91 ; 145 1b064: 94 e4 ldi r25, 0x44 ; 68 1b066: 0e 94 b3 72 call 0xe566 ; 0xe566 1b06a: 22 e0 ldi r18, 0x02 ; 2 1b06c: 44 ec ldi r20, 0xC4 ; 196 1b06e: 5f ec ldi r21, 0xCF ; 207 1b070: be 01 movw r22, r28 1b072: db cf rjmp .-74 ; 0x1b02a #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; 1b074: 81 e8 ldi r24, 0x81 ; 129 1b076: 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); 1b078: 0e 94 b3 72 call 0xe566 ; 0xe566 1b07c: ec 01 movw r28, r24 1b07e: 8a e7 ldi r24, 0x7A ; 122 1b080: 94 e4 ldi r25, 0x44 ; 68 1b082: 0e 94 b3 72 call 0xe566 ; 0xe566 1b086: 22 e0 ldi r18, 0x02 ; 2 1b088: 42 e0 ldi r20, 0x02 ; 2 1b08a: 50 ed ldi r21, 0xD0 ; 208 1b08c: be 01 movw r22, r28 1b08e: 0f 94 2c d3 call 0x3a658 ; 0x3a658 } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b092: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1b096: 82 30 cpi r24, 0x02 ; 2 1b098: 09 f4 brne .+2 ; 0x1b09c 1b09a: 45 c0 rjmp .+138 ; 0x1b126 1b09c: 83 30 cpi r24, 0x03 ; 3 1b09e: 09 f4 brne .+2 ; 0x1b0a2 1b0a0: 45 c0 rjmp .+138 ; 0x1b12c 1b0a2: 81 30 cpi r24, 0x01 ; 1 1b0a4: e9 f1 breq .+122 ; 0x1b120 1b0a6: 80 ea ldi r24, 0xA0 ; 160 1b0a8: 97 e4 ldi r25, 0x47 ; 71 1b0aa: 0e 94 b3 72 call 0xe566 ; 0xe566 1b0ae: ec 01 movw r28, r24 1b0b0: 88 e9 ldi r24, 0x98 ; 152 1b0b2: 97 e4 ldi r25, 0x47 ; 71 1b0b4: 0e 94 b3 72 call 0xe566 ; 0xe566 1b0b8: 22 e0 ldi r18, 0x02 ; 2 1b0ba: 4b ee ldi r20, 0xEB ; 235 1b0bc: 5f ec ldi r21, 0xCF ; 207 1b0be: be 01 movw r22, r28 1b0c0: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #ifdef LCD_BL_PIN if (backlightSupport) 1b0c4: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1b0c8: 88 23 and r24, r24 1b0ca: 41 f0 breq .+16 ; 0x1b0dc { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b0cc: 82 e7 ldi r24, 0x72 ; 114 1b0ce: 97 e4 ldi r25, 0x47 ; 71 1b0d0: 0e 94 b3 72 call 0xe566 ; 0xe566 1b0d4: 68 e0 ldi r22, 0x08 ; 8 1b0d6: 70 ee ldi r23, 0xE0 ; 224 1b0d8: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } #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 1b0dc: 87 ea ldi r24, 0xA7 ; 167 1b0de: 9c e0 ldi r25, 0x0C ; 12 1b0e0: 0f 94 23 dc call 0x3b846 ; 0x3b846 1b0e4: 88 23 and r24, r24 1b0e6: 29 f1 breq .+74 ; 0x1b132 1b0e8: 81 e5 ldi r24, 0x51 ; 81 1b0ea: 98 e4 ldi r25, 0x48 ; 72 1b0ec: 0e 94 b3 72 call 0xe566 ; 0xe566 1b0f0: 22 e0 ldi r18, 0x02 ; 2 1b0f2: 47 e3 ldi r20, 0x37 ; 55 1b0f4: 5f ec ldi r21, 0xCF ; 207 1b0f6: bc 01 movw r22, r24 1b0f8: 85 ea ldi r24, 0xA5 ; 165 1b0fa: 9a e6 ldi r25, 0x6A ; 106 1b0fc: 0f 94 2c d3 call 0x3a658 ; 0x3a658 if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 1b100: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b104: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b108: 8f 5f subi r24, 0xFF ; 255 1b10a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b10e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b112: 8f 5f subi r24, 0xFF ; 255 1b114: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b118: ae ce rjmp .-676 ; 0x1ae76 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; 1b11a: 8f e6 ldi r24, 0x6F ; 111 1b11c: 94 e4 ldi r25, 0x44 ; 68 1b11e: ac cf rjmp .-168 ; 0x1b078 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 1b120: 81 e9 ldi r24, 0x91 ; 145 1b122: 97 e4 ldi r25, 0x47 ; 71 1b124: c2 cf rjmp .-124 ; 0x1b0aa 1b126: 88 e8 ldi r24, 0x88 ; 136 1b128: 97 e4 ldi r25, 0x47 ; 71 1b12a: bf cf rjmp .-130 ; 0x1b0aa 1b12c: 8f e7 ldi r24, 0x7F ; 127 1b12e: 97 e4 ldi r25, 0x47 ; 71 1b130: bc cf rjmp .-136 ; 0x1b0aa 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 1b132: 87 e5 ldi r24, 0x57 ; 87 1b134: 98 e4 ldi r25, 0x48 ; 72 1b136: da cf rjmp .-76 ; 0x1b0ec { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1b138: df 91 pop r29 1b13a: cf 91 pop r28 1b13c: 1f 91 pop r17 1b13e: 08 95 ret 0001b140 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b140: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1b144: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b148: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b14c: 84 30 cpi r24, 0x04 ; 4 1b14e: 08 f0 brcs .+2 ; 0x1b152 1b150: 8f c0 rjmp .+286 ; 0x1b270 1b152: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b156: 88 ea ldi r24, 0xA8 ; 168 1b158: 98 e4 ldi r25, 0x48 ; 72 1b15a: 0e 94 b3 72 call 0xe566 ; 0xe566 1b15e: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1b162: 81 ea ldi r24, 0xA1 ; 161 1b164: 95 e4 ldi r25, 0x45 ; 69 1b166: 0e 94 b3 72 call 0xe566 ; 0xe566 1b16a: 60 e6 ldi r22, 0x60 ; 96 1b16c: 7a e3 ldi r23, 0x3A ; 58 1b16e: 0f 94 1a d1 call 0x3a234 ; 0x3a234 if (lcd_commands_type == LcdCommands::Idle) 1b172: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 1b176: 81 11 cpse r24, r1 1b178: 08 c0 rjmp .+16 ; 0x1b18a { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1b17a: 80 e0 ldi r24, 0x00 ; 0 1b17c: 96 e4 ldi r25, 0x46 ; 70 1b17e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b182: 63 eb ldi r22, 0xB3 ; 179 1b184: 7e ee ldi r23, 0xEE ; 238 1b186: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1b18a: 8b e0 ldi r24, 0x0B ; 11 1b18c: 9c e5 ldi r25, 0x5C ; 92 1b18e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b192: 64 ee ldi r22, 0xE4 ; 228 1b194: 7b e6 ldi r23, 0x6B ; 107 1b196: 0f 94 93 d0 call 0x3a126 ; 0x3a126 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1b19a: 85 e9 ldi r24, 0x95 ; 149 1b19c: 95 e4 ldi r25, 0x45 ; 69 1b19e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b1a2: 6f e4 ldi r22, 0x4F ; 79 1b1a4: 7f ed ldi r23, 0xDF ; 223 1b1a6: 0f 94 1a d1 call 0x3a234 ; 0x3a234 #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1b1aa: 8a e8 ldi r24, 0x8A ; 138 1b1ac: 95 e4 ldi r25, 0x45 ; 69 1b1ae: 0e 94 b3 72 call 0xe566 ; 0xe566 1b1b2: 66 ed ldi r22, 0xD6 ; 214 1b1b4: 77 ef ldi r23, 0xF7 ; 247 1b1b6: 0f 94 1a d1 call 0x3a234 ; 0x3a234 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1b1ba: 8a e7 ldi r24, 0x7A ; 122 1b1bc: 95 e4 ldi r25, 0x45 ; 69 1b1be: 0e 94 b3 72 call 0xe566 ; 0xe566 1b1c2: 65 e9 ldi r22, 0x95 ; 149 1b1c4: 7e ec ldi r23, 0xCE ; 206 1b1c6: 0f 94 1a d1 call 0x3a234 ; 0x3a234 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1b1ca: 8c e6 ldi r24, 0x6C ; 108 1b1cc: 95 e4 ldi r25, 0x45 ; 69 1b1ce: 0e 94 b3 72 call 0xe566 ; 0xe566 1b1d2: 6c e9 ldi r22, 0x9C ; 156 1b1d4: 7e ec ldi r23, 0xCE ; 206 1b1d6: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1b1da: 88 e5 ldi r24, 0x58 ; 88 1b1dc: 95 e4 ldi r25, 0x45 ; 69 1b1de: 0e 94 b3 72 call 0xe566 ; 0xe566 1b1e2: 63 ea ldi r22, 0xA3 ; 163 1b1e4: 7e ec ldi r23, 0xCE ; 206 1b1e6: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1b1ea: 84 e4 ldi r24, 0x44 ; 68 1b1ec: 95 e4 ldi r25, 0x45 ; 69 1b1ee: 0e 94 b3 72 call 0xe566 ; 0xe566 1b1f2: 66 ed ldi r22, 0xD6 ; 214 1b1f4: 7a e3 ldi r23, 0x3A ; 58 1b1f6: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1b1fa: 82 e3 ldi r24, 0x32 ; 50 1b1fc: 95 e4 ldi r25, 0x45 ; 69 1b1fe: 0e 94 b3 72 call 0xe566 ; 0xe566 1b202: 62 e6 ldi r22, 0x62 ; 98 1b204: 79 e3 ldi r23, 0x39 ; 57 1b206: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #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")); 1b20a: 8e e1 ldi r24, 0x1E ; 30 1b20c: 95 e4 ldi r25, 0x45 ; 69 1b20e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b212: 62 e2 ldi r22, 0x22 ; 34 1b214: 7a e8 ldi r23, 0x8A ; 138 1b216: 0f 94 93 d0 call 0x3a126 ; 0x3a126 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1b21a: 20 e0 ldi r18, 0x00 ; 0 1b21c: 30 e0 ldi r19, 0x00 ; 0 1b21e: 40 e2 ldi r20, 0x20 ; 32 1b220: 51 e4 ldi r21, 0x41 ; 65 1b222: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1b226: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1b22a: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1b22e: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1b232: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1b236: 87 fd sbrc r24, 7 1b238: 08 c0 rjmp .+16 ; 0x1b24a MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1b23a: 81 e1 ldi r24, 0x11 ; 17 1b23c: 95 e4 ldi r25, 0x45 ; 69 1b23e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b242: 6a ea ldi r22, 0xAA ; 170 1b244: 7e ec ldi r23, 0xCE ; 206 1b246: 0f 94 1a d1 call 0x3a234 ; 0x3a234 #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1b24a: 6e eb ldi r22, 0xBE ; 190 1b24c: 7d ec ldi r23, 0xCD ; 205 1b24e: 8b eb ldi r24, 0xBB ; 187 1b250: 9a e6 ldi r25, 0x6A ; 106 1b252: 0f 94 1a d1 call 0x3a234 ; 0x3a234 #endif //THERMAL_MODEL MENU_END(); 1b256: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1b25a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b25e: 8f 5f subi r24, 0xFF ; 255 1b260: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b264: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b268: 8f 5f subi r24, 0xFF ; 255 1b26a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b26e: 6c cf rjmp .-296 ; 0x1b148 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1b270: 08 95 ret 0001b272 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 1b272: ef 92 push r14 1b274: ff 92 push r15 1b276: 0f 93 push r16 1b278: 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); 1b27a: 80 e1 ldi r24, 0x10 ; 16 1b27c: 94 e4 ldi r25, 0x44 ; 68 1b27e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b282: 28 ec ldi r18, 0xC8 ; 200 1b284: e2 2e mov r14, r18 1b286: f1 2c mov r15, r1 1b288: 07 e2 ldi r16, 0x27 ; 39 1b28a: 11 e0 ldi r17, 0x01 ; 1 1b28c: 30 e0 ldi r19, 0x00 ; 0 1b28e: 20 e0 ldi r18, 0x00 ; 0 1b290: 40 e1 ldi r20, 0x10 ; 16 1b292: 66 eb ldi r22, 0xB6 ; 182 1b294: 7d e0 ldi r23, 0x0D ; 13 1b296: 0f 94 ed d1 call 0x3a3da ; 0x3a3da #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); 1b29a: 85 ef ldi r24, 0xF5 ; 245 1b29c: 93 e4 ldi r25, 0x43 ; 67 1b29e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b2a2: 32 e3 ldi r19, 0x32 ; 50 1b2a4: e3 2e mov r14, r19 1b2a6: f1 2c mov r15, r1 1b2a8: 08 e7 ldi r16, 0x78 ; 120 1b2aa: 10 e0 ldi r17, 0x00 ; 0 1b2ac: 30 e0 ldi r19, 0x00 ; 0 1b2ae: 20 e0 ldi r18, 0x00 ; 0 1b2b0: 40 e1 ldi r20, 0x10 ; 16 1b2b2: 62 e7 ldi r22, 0x72 ; 114 1b2b4: 76 e0 ldi r23, 0x06 ; 6 1b2b6: 0f 94 ed d1 call 0x3a3da ; 0x3a3da #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 1b2ba: 89 ee ldi r24, 0xE9 ; 233 1b2bc: 93 e4 ldi r25, 0x43 ; 67 1b2be: 0e 94 b3 72 call 0xe566 ; 0xe566 1b2c2: 4f e7 ldi r20, 0x7F ; 127 1b2c4: e4 2e mov r14, r20 1b2c6: f1 2c mov r15, r1 1b2c8: 0f ef ldi r16, 0xFF ; 255 1b2ca: 10 e0 ldi r17, 0x00 ; 0 1b2cc: 30 e0 ldi r19, 0x00 ; 0 1b2ce: 20 e0 ldi r18, 0x00 ; 0 1b2d0: 48 e0 ldi r20, 0x08 ; 8 1b2d2: 67 ee ldi r22, 0xE7 ; 231 1b2d4: 73 e0 ldi r23, 0x03 ; 3 1b2d6: 0f 94 ed d1 call 0x3a3da ; 0x3a3da } 1b2da: 1f 91 pop r17 1b2dc: 0f 91 pop r16 1b2de: ff 90 pop r15 1b2e0: ef 90 pop r14 1b2e2: 08 95 ret 0001b2e4 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b2e4: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1b2e8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b2ec: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b2f0: 84 30 cpi r24, 0x04 ; 4 1b2f2: b8 f4 brcc .+46 ; 0x1b322 1b2f4: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1b2f8: 86 e4 ldi r24, 0x46 ; 70 1b2fa: 98 e4 ldi r25, 0x48 ; 72 1b2fc: 0e 94 b3 72 call 0xe566 ; 0xe566 1b300: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 menuitems_temperature_common(); 1b304: 0e 94 39 d9 call 0x1b272 ; 0x1b272 MENU_END(); 1b308: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1b30c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b310: 8f 5f subi r24, 0xFF ; 255 1b312: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b316: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b31a: 8f 5f subi r24, 0xFF ; 255 1b31c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b320: e5 cf rjmp .-54 ; 0x1b2ec MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1b322: 08 95 ret 0001b324 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1b324: ef 92 push r14 1b326: ff 92 push r15 1b328: 0f 93 push r16 1b32a: 1f 93 push r17 1b32c: cf 93 push r28 1b32e: df 93 push r29 1b330: 80 91 bc 02 lds r24, 0x02BC ; 0x8002bc 1b334: 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) 1b338: 20 91 b6 03 lds r18, 0x03B6 ; 0x8003b6 1b33c: 21 11 cpse r18, r1 1b33e: 97 c0 rjmp .+302 ; 0x1b46e { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1b340: 21 e0 ldi r18, 0x01 ; 1 1b342: 20 93 b6 03 sts 0x03B6, r18 ; 0x8003b6 _md->extrudemultiply = extrudemultiply; 1b346: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1b34a: 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); 1b34e: 8f ef ldi r24, 0xFF ; 255 1b350: 9f e0 ldi r25, 0x0F ; 15 1b352: 0f 94 23 dc call 0x3b846 ; 0x3b846 1b356: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1b35a: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1b35e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b362: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b366: 84 30 cpi r24, 0x04 ; 4 1b368: 08 f0 brcs .+2 ; 0x1b36c 1b36a: 99 c0 rjmp .+306 ; 0x1b49e 1b36c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b370: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 1b374: 81 11 cpse r24, r1 1b376: 0e 94 ea 64 call 0xc9d4 ; 0xc9d4 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b37a: 88 ea ldi r24, 0xA8 ; 168 1b37c: 98 e4 ldi r25, 0x48 ; 72 1b37e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b382: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1b386: 8e ec ldi r24, 0xCE ; 206 1b388: 97 e4 ldi r25, 0x47 ; 71 1b38a: 0e 94 b3 72 call 0xe566 ; 0xe566 1b38e: f1 2c mov r15, r1 1b390: e1 2c mov r14, r1 1b392: 07 ee ldi r16, 0xE7 ; 231 1b394: 13 e0 ldi r17, 0x03 ; 3 1b396: 2a e0 ldi r18, 0x0A ; 10 1b398: 30 e0 ldi r19, 0x00 ; 0 1b39a: 40 e1 ldi r20, 0x10 ; 16 1b39c: 69 e3 ldi r22, 0x39 ; 57 1b39e: 72 e0 ldi r23, 0x02 ; 2 1b3a0: 0f 94 ed d1 call 0x3a3da ; 0x3a3da menuitems_temperature_common(); 1b3a4: 0e 94 39 d9 call 0x1b272 ; 0x1b272 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1b3a8: 87 ec ldi r24, 0xC7 ; 199 1b3aa: 97 e4 ldi r25, 0x47 ; 71 1b3ac: 0e 94 b3 72 call 0xe566 ; 0xe566 1b3b0: 2a e0 ldi r18, 0x0A ; 10 1b3b2: 30 e0 ldi r19, 0x00 ; 0 1b3b4: 40 e1 ldi r20, 0x10 ; 16 1b3b6: 6c eb ldi r22, 0xBC ; 188 1b3b8: 72 e0 ldi r23, 0x02 ; 2 1b3ba: 0f 94 ed d1 call 0x3a3da ; 0x3a3da #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); 1b3be: 85 eb ldi r24, 0xB5 ; 181 1b3c0: 97 e4 ldi r25, 0x47 ; 71 1b3c2: 0e 94 b3 72 call 0xe566 ; 0xe566 1b3c6: 6c e7 ldi r22, 0x7C ; 124 1b3c8: 74 ef ldi r23, 0xF4 ; 244 1b3ca: 0f 94 1a d1 call 0x3a234 ; 0x3a234 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1b3ce: 0e 94 8c 67 call 0xcf18 ; 0xcf18 1b3d2: 88 23 and r24, r24 1b3d4: 41 f0 breq .+16 ; 0x1b3e6 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1b3d6: 8b e0 ldi r24, 0x0B ; 11 1b3d8: 9c e5 ldi r25, 0x5C ; 92 1b3da: 0e 94 b3 72 call 0xe566 ; 0xe566 1b3de: 6a e3 ldi r22, 0x3A ; 58 1b3e0: 7a e8 ldi r23, 0x8A ; 138 1b3e2: 0f 94 93 d0 call 0x3a126 ; 0x3a126 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1b3e6: 87 ea ldi r24, 0xA7 ; 167 1b3e8: 97 e4 ldi r25, 0x47 ; 71 1b3ea: 0e 94 b3 72 call 0xe566 ; 0xe566 1b3ee: 60 e9 ldi r22, 0x90 ; 144 1b3f0: 72 ed ldi r23, 0xD2 ; 210 1b3f2: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1b3f6: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1b3fa: 81 30 cpi r24, 0x01 ; 1 1b3fc: 11 f4 brne .+4 ; 0x1b402 { menuitems_MMU_settings_common(); 1b3fe: 0e 94 78 d1 call 0x1a2f0 ; 0x1a2f0 } SETTINGS_FANS_CHECK(); 1b402: 0e 94 fa d0 call 0x1a1f4 ; 0x1a1f4 SETTINGS_SILENT_MODE(); 1b406: 0e 94 14 d1 call 0x1a228 ; 0x1a228 SETTINGS_SOUND; 1b40a: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1b40e: 82 30 cpi r24, 0x02 ; 2 1b410: 09 f4 brne .+2 ; 0x1b414 1b412: 3f c0 rjmp .+126 ; 0x1b492 1b414: 83 30 cpi r24, 0x03 ; 3 1b416: 09 f4 brne .+2 ; 0x1b41a 1b418: 3f c0 rjmp .+126 ; 0x1b498 1b41a: 81 30 cpi r24, 0x01 ; 1 1b41c: b9 f1 breq .+110 ; 0x1b48c 1b41e: 80 ea ldi r24, 0xA0 ; 160 1b420: 97 e4 ldi r25, 0x47 ; 71 1b422: 0e 94 b3 72 call 0xe566 ; 0xe566 1b426: ec 01 movw r28, r24 1b428: 88 e9 ldi r24, 0x98 ; 152 1b42a: 97 e4 ldi r25, 0x47 ; 71 1b42c: 0e 94 b3 72 call 0xe566 ; 0xe566 1b430: 22 e0 ldi r18, 0x02 ; 2 1b432: 4b ee ldi r20, 0xEB ; 235 1b434: 5f ec ldi r21, 0xCF ; 207 1b436: be 01 movw r22, r28 1b438: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #ifdef LCD_BL_PIN if (backlightSupport) 1b43c: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1b440: 88 23 and r24, r24 1b442: 41 f0 breq .+16 ; 0x1b454 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1b444: 82 e7 ldi r24, 0x72 ; 114 1b446: 97 e4 ldi r25, 0x47 ; 71 1b448: 0e 94 b3 72 call 0xe566 ; 0xe566 1b44c: 68 e0 ldi r22, 0x08 ; 8 1b44e: 70 ee ldi r23, 0xE0 ; 224 1b450: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } #endif //LCD_BL_PIN MENU_END(); 1b454: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1b458: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b45c: 8f 5f subi r24, 0xFF ; 255 1b45e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b462: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b466: 8f 5f subi r24, 0xFF ; 255 1b468: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b46c: 7a cf rjmp .-268 ; 0x1b362 { // 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) 1b46e: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 1b472: 30 91 b8 03 lds r19, 0x03B8 ; 0x8003b8 1b476: 28 17 cp r18, r24 1b478: 39 07 cpc r19, r25 1b47a: 09 f4 brne .+2 ; 0x1b47e 1b47c: 68 cf rjmp .-304 ; 0x1b34e { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1b47e: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1b482: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 calculate_extruder_multipliers(); 1b486: 0e 94 c0 65 call 0xcb80 ; 0xcb80 1b48a: 61 cf rjmp .-318 ; 0x1b34e menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1b48c: 81 e9 ldi r24, 0x91 ; 145 1b48e: 97 e4 ldi r25, 0x47 ; 71 1b490: c8 cf rjmp .-112 ; 0x1b422 1b492: 88 e8 ldi r24, 0x88 ; 136 1b494: 97 e4 ldi r25, 0x47 ; 71 1b496: c5 cf rjmp .-118 ; 0x1b422 1b498: 8f e7 ldi r24, 0x7F ; 127 1b49a: 97 e4 ldi r25, 0x47 ; 71 1b49c: c2 cf rjmp .-124 ; 0x1b422 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1b49e: df 91 pop r29 1b4a0: cf 91 pop r28 1b4a2: 1f 91 pop r17 1b4a4: 0f 91 pop r16 1b4a6: ff 90 pop r15 1b4a8: ef 90 pop r14 1b4aa: 08 95 ret 0001b4ac : } } #if (LANG_MODE != 0) void lcd_language() { 1b4ac: cf 93 push r28 1b4ae: df 93 push r29 lcd_update_enable(true); 1b4b0: 81 e0 ldi r24, 0x01 ; 1 1b4b2: 0e 94 2c 6f call 0xde58 ; 0xde58 menu_goto(lcd_language_menu, 0, true, true); 1b4b6: 21 e0 ldi r18, 0x01 ; 1 1b4b8: 41 e0 ldi r20, 0x01 ; 1 1b4ba: 70 e0 ldi r23, 0x00 ; 0 1b4bc: 60 e0 ldi r22, 0x00 ; 0 1b4be: 86 ed ldi r24, 0xD6 ; 214 1b4c0: 92 ee ldi r25, 0xE2 ; 226 1b4c2: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e 1b4c6: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 1b4ca: c0 91 13 04 lds r28, 0x0413 ; 0x800413 1b4ce: d0 91 14 04 lds r29, 0x0414 ; 0x800414 1b4d2: 0e 94 24 71 call 0xe248 ; 0xe248 1b4d6: c8 51 subi r28, 0x18 ; 24 1b4d8: d9 43 sbci r29, 0x39 ; 57 1b4da: 39 f0 breq .+14 ; 0x1b4ea 1b4dc: 81 11 cpse r24, r1 1b4de: 07 c0 rjmp .+14 ; 0x1b4ee { delay_keep_alive(50); 1b4e0: 82 e3 ldi r24, 0x32 ; 50 1b4e2: 90 e0 ldi r25, 0x00 ; 0 1b4e4: 0e 94 eb 8c call 0x119d6 ; 0x119d6 1b4e8: f0 cf rjmp .-32 ; 0x1b4ca } if (lang_is_selected()) 1b4ea: 88 23 and r24, r24 1b4ec: 21 f0 breq .+8 ; 0x1b4f6 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 1b4ee: df 91 pop r29 1b4f0: 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(); 1b4f2: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a else lang_select(LANG_ID_PRI); 1b4f6: 80 e0 ldi r24, 0x00 ; 0 } 1b4f8: df 91 pop r29 1b4fa: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 1b4fc: 0c 94 3b 72 jmp 0xe476 ; 0xe476 0001b500 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1b500: bf 92 push r11 1b502: cf 92 push r12 1b504: df 92 push r13 1b506: ef 92 push r14 1b508: ff 92 push r15 1b50a: 0f 93 push r16 1b50c: 1f 93 push r17 1b50e: cf 93 push r28 1b510: df 93 push r29 1b512: c8 2f mov r28, r24 1b514: f6 2e mov r15, r22 1b516: e4 2e mov r14, r20 1b518: b2 2e mov r11, r18 1b51a: 68 01 movw r12, r16 lcd_update_enable(false); 1b51c: 80 e0 ldi r24, 0x00 ; 0 1b51e: 0e 94 2c 6f call 0xde58 ; 0xde58 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1b522: dc e7 ldi r29, 0x7C ; 124 1b524: fe 14 cp r15, r14 1b526: 08 f0 brcs .+2 ; 0x1b52a 1b528: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1b52a: bb 20 and r11, r11 1b52c: 09 f1 breq .+66 ; 0x1b570 lcd_clear(); 1b52e: 0e 94 1a 6f call 0xde34 ; 0xde34 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b532: c1 11 cpse r28, r1 1b534: 20 c0 rjmp .+64 ; 0x1b576 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b536: 8c e9 ldi r24, 0x9C ; 156 1b538: 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)); 1b53a: 0e 94 b3 72 call 0xe566 ; 0xe566 1b53e: 0e 94 d2 6e call 0xdda4 ; 0xdda4 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b542: 88 ef ldi r24, 0xF8 ; 248 1b544: 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 1b546: 82 30 cpi r24, 0x02 ; 2 1b548: 78 f5 brcc .+94 ; 0x1b5a8 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1b54a: 82 e4 ldi r24, 0x42 ; 66 1b54c: 99 e4 ldi r25, 0x49 ; 73 1b54e: 0e 94 b3 72 call 0xe566 ; 0xe566 1b552: 0e 94 d2 6e call 0xdda4 ; 0xdda4 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)); 1b556: 81 e2 ldi r24, 0x21 ; 33 1b558: 99 e4 ldi r25, 0x49 ; 73 1b55a: cc 30 cpi r28, 0x0C ; 12 1b55c: 49 f1 breq .+82 ; 0x1b5b0 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1b55e: 87 ea ldi r24, 0xA7 ; 167 1b560: 96 e5 ldi r25, 0x56 ; 86 1b562: cd 30 cpi r28, 0x0D ; 13 1b564: 29 f1 breq .+74 ; 0x1b5b0 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1b566: ce 30 cpi r28, 0x0E ; 14 1b568: 39 f5 brne .+78 ; 0x1b5b8 1b56a: 8e e0 ldi r24, 0x0E ; 14 1b56c: 99 e4 ldi r25, 0x49 ; 73 1b56e: 20 c0 rjmp .+64 ; 0x1b5b0 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1b570: 0e 94 13 6f call 0xde26 ; 0xde26 1b574: de cf rjmp .-68 ; 0x1b532 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b576: c1 30 cpi r28, 0x01 ; 1 1b578: f1 f2 breq .-68 ; 0x1b536 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1b57a: c2 30 cpi r28, 0x02 ; 2 1b57c: e1 f2 breq .-72 ; 0x1b536 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1b57e: 89 e9 ldi r24, 0x99 ; 153 1b580: 99 e4 ldi r25, 0x49 ; 73 1b582: c3 30 cpi r28, 0x03 ; 3 1b584: d1 f2 breq .-76 ; 0x1b53a if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1b586: 87 e8 ldi r24, 0x87 ; 135 1b588: 99 e4 ldi r25, 0x49 ; 73 1b58a: c4 30 cpi r28, 0x04 ; 4 1b58c: b1 f2 breq .-84 ; 0x1b53a if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1b58e: 85 e7 ldi r24, 0x75 ; 117 1b590: 99 e4 ldi r25, 0x49 ; 73 1b592: c5 30 cpi r28, 0x05 ; 5 1b594: 91 f2 breq .-92 ; 0x1b53a if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1b596: 83 e6 ldi r24, 0x63 ; 99 1b598: 99 e4 ldi r25, 0x49 ; 73 1b59a: c6 30 cpi r28, 0x06 ; 6 1b59c: 71 f2 breq .-100 ; 0x1b53a if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1b59e: c7 30 cpi r28, 0x07 ; 7 1b5a0: 81 f6 brne .-96 ; 0x1b542 1b5a2: 84 e5 ldi r24, 0x54 ; 84 1b5a4: 99 e4 ldi r25, 0x49 ; 73 1b5a6: c9 cf rjmp .-110 ; 0x1b53a 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)); 1b5a8: ca 30 cpi r28, 0x0A ; 10 1b5aa: 99 f5 brne .+102 ; 0x1b612 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1b5ac: 8f e2 ldi r24, 0x2F ; 47 1b5ae: 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)); 1b5b0: 0e 94 b3 72 call 0xe566 ; 0xe566 1b5b4: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1b5b8: 41 e9 ldi r20, 0x91 ; 145 1b5ba: 5a e8 ldi r21, 0x8A ; 138 1b5bc: 61 e0 ldi r22, 0x01 ; 1 1b5be: 80 e0 ldi r24, 0x00 ; 0 1b5c0: 0e 94 fb 6e call 0xddf6 ; 0xddf6 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1b5c4: c3 30 cpi r28, 0x03 ; 3 1b5c6: 70 f5 brcc .+92 ; 0x1b624 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1b5c8: 80 e0 ldi r24, 0x00 ; 0 1b5ca: 99 e4 ldi r25, 0x49 ; 73 1b5cc: 0e 94 b3 72 call 0xe566 ; 0xe566 1b5d0: ac 01 movw r20, r24 1b5d2: 62 e0 ldi r22, 0x02 ; 2 1b5d4: 80 e0 ldi r24, 0x00 ; 0 1b5d6: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(18, 2); 1b5da: 62 e0 ldi r22, 0x02 ; 2 1b5dc: 82 e1 ldi r24, 0x12 ; 18 1b5de: 0e 94 e7 6e call 0xddce ; 0xddce (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b5e2: c1 11 cpse r28, r1 1b5e4: 1a c0 rjmp .+52 ; 0x1b61a 1b5e6: 8d 2f mov r24, r29 1b5e8: 0e 94 d6 6e call 0xddac ; 0xddac lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1b5ec: 83 ef ldi r24, 0xF3 ; 243 1b5ee: 98 e4 ldi r25, 0x48 ; 72 1b5f0: 0e 94 b3 72 call 0xe566 ; 0xe566 1b5f4: ac 01 movw r20, r24 1b5f6: 63 e0 ldi r22, 0x03 ; 3 1b5f8: 80 e0 ldi r24, 0x00 ; 0 1b5fa: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(18, 3); 1b5fe: 63 e0 ldi r22, 0x03 ; 3 1b600: 82 e1 ldi r24, 0x12 ; 18 1b602: 0e 94 e7 6e call 0xddce ; 0xddce (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b606: c2 30 cpi r28, 0x02 ; 2 1b608: 19 f1 breq .+70 ; 0x1b650 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); 1b60a: 8d 2f mov r24, r29 1b60c: 0e 94 d6 6e call 0xddac ; 0xddac 1b610: 23 c0 rjmp .+70 ; 0x1b658 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)); 1b612: cb 30 cpi r28, 0x0B ; 11 1b614: 09 f0 breq .+2 ; 0x1b618 1b616: 9f cf rjmp .-194 ; 0x1b556 1b618: c9 cf rjmp .-110 ; 0x1b5ac 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); 1b61a: 82 e8 ldi r24, 0x82 ; 130 1b61c: 9b e6 ldi r25, 0x6B ; 107 1b61e: 0e 94 d2 6e call 0xdda4 ; 0xdda4 1b622: e4 cf rjmp .-56 ; 0x1b5ec 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) 1b624: 86 ef ldi r24, 0xF6 ; 246 1b626: 8c 0f add r24, r28 1b628: 82 30 cpi r24, 0x02 ; 2 1b62a: a8 f5 brcc .+106 ; 0x1b696 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b62c: 89 eb ldi r24, 0xB9 ; 185 1b62e: 96 e5 ldi r25, 0x56 ; 86 1b630: 0e 94 b3 72 call 0xe566 ; 0xe566 1b634: ac 01 movw r20, r24 1b636: 62 e0 ldi r22, 0x02 ; 2 1b638: 80 e0 ldi r24, 0x00 ; 0 1b63a: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc(':'); 1b63e: 8a e3 ldi r24, 0x3A ; 58 1b640: 0e 94 d6 6e call 0xddac ; 0xddac lcd_set_cursor(18, 2); 1b644: 62 e0 ldi r22, 0x02 ; 2 1b646: 82 e1 ldi r24, 0x12 ; 18 1b648: 0e 94 e7 6e call 0xddce ; 0xddce (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1b64c: ca 30 cpi r28, 0x0A ; 10 1b64e: e9 f2 breq .-70 ; 0x1b60a 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); 1b650: 82 e8 ldi r24, 0x82 ; 130 1b652: 9b e6 ldi r25, 0x6B ; 107 1b654: 0e 94 d2 6e call 0xdda4 ; 0xdda4 _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); 1b658: c1 14 cp r12, r1 1b65a: d1 04 cpc r13, r1 1b65c: 19 f0 breq .+6 ; 0x1b664 1b65e: c6 01 movw r24, r12 1b660: 0e 94 eb 8c call 0x119d6 ; 0x119d6 _progress++; 1b664: 81 e0 ldi r24, 0x01 ; 1 1b666: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1b668: 48 2f mov r20, r24 1b66a: 50 e0 ldi r21, 0x00 ; 0 1b66c: 92 e0 ldi r25, 0x02 ; 2 1b66e: 24 e0 ldi r18, 0x04 ; 4 1b670: 30 e0 ldi r19, 0x00 ; 0 1b672: e9 16 cp r14, r25 1b674: 11 f0 breq .+4 ; 0x1b67a 1b676: 26 e0 ldi r18, 0x06 ; 6 1b678: 30 e0 ldi r19, 0x00 ; 0 1b67a: 42 17 cp r20, r18 1b67c: 53 07 cpc r21, r19 1b67e: 0c f0 brlt .+2 ; 0x1b682 1b680: 80 e0 ldi r24, 0x00 ; 0 } 1b682: df 91 pop r29 1b684: cf 91 pop r28 1b686: 1f 91 pop r17 1b688: 0f 91 pop r16 1b68a: ff 90 pop r15 1b68c: ef 90 pop r14 1b68e: df 90 pop r13 1b690: cf 90 pop r12 1b692: bf 90 pop r11 1b694: 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) 1b696: ca 30 cpi r28, 0x0A ; 10 1b698: f8 f6 brcc .-66 ; 0x1b658 { //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); 1b69a: 41 e0 ldi r20, 0x01 ; 1 1b69c: c4 30 cpi r28, 0x04 ; 4 1b69e: 21 f0 breq .+8 ; 0x1b6a8 1b6a0: 42 e0 ldi r20, 0x02 ; 2 1b6a2: c3 30 cpi r28, 0x03 ; 3 1b6a4: 09 f4 brne .+2 ; 0x1b6a8 1b6a6: 40 e0 ldi r20, 0x00 ; 0 1b6a8: 0d 2f mov r16, r29 1b6aa: 2f e8 ldi r18, 0x8F ; 143 1b6ac: 3a e8 ldi r19, 0x8A ; 138 1b6ae: 62 e0 ldi r22, 0x02 ; 2 1b6b0: 82 e0 ldi r24, 0x02 ; 2 1b6b2: 0e 94 89 d0 call 0x1a112 ; 0x1a112 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1b6b6: 41 e0 ldi r20, 0x01 ; 1 1b6b8: c5 30 cpi r28, 0x05 ; 5 1b6ba: 21 f0 breq .+8 ; 0x1b6c4 1b6bc: 42 e0 ldi r20, 0x02 ; 2 1b6be: c5 30 cpi r28, 0x05 ; 5 1b6c0: 08 f4 brcc .+2 ; 0x1b6c4 1b6c2: 40 e0 ldi r20, 0x00 ; 0 1b6c4: 0d 2f mov r16, r29 1b6c6: 2d e8 ldi r18, 0x8D ; 141 1b6c8: 3a e8 ldi r19, 0x8A ; 138 1b6ca: 68 e0 ldi r22, 0x08 ; 8 1b6cc: 82 e0 ldi r24, 0x02 ; 2 1b6ce: 0e 94 89 d0 call 0x1a112 ; 0x1a112 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1b6d2: 41 e0 ldi r20, 0x01 ; 1 1b6d4: c6 30 cpi r28, 0x06 ; 6 1b6d6: 21 f0 breq .+8 ; 0x1b6e0 1b6d8: 42 e0 ldi r20, 0x02 ; 2 1b6da: c6 30 cpi r28, 0x06 ; 6 1b6dc: 08 f4 brcc .+2 ; 0x1b6e0 1b6de: 40 e0 ldi r20, 0x00 ; 0 1b6e0: 0d 2f mov r16, r29 1b6e2: 2b e8 ldi r18, 0x8B ; 139 1b6e4: 3a e8 ldi r19, 0x8A ; 138 1b6e6: 6e e0 ldi r22, 0x0E ; 14 1b6e8: 82 e0 ldi r24, 0x02 ; 2 1b6ea: 0e 94 89 d0 call 0x1a112 ; 0x1a112 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1b6ee: 41 e0 ldi r20, 0x01 ; 1 1b6f0: c7 30 cpi r28, 0x07 ; 7 1b6f2: 21 f0 breq .+8 ; 0x1b6fc 1b6f4: 42 e0 ldi r20, 0x02 ; 2 1b6f6: c7 30 cpi r28, 0x07 ; 7 1b6f8: 08 f4 brcc .+2 ; 0x1b6fc 1b6fa: 40 e0 ldi r20, 0x00 ; 0 1b6fc: 0d 2f mov r16, r29 1b6fe: 27 e8 ldi r18, 0x87 ; 135 1b700: 3a e8 ldi r19, 0x8A ; 138 1b702: 60 e0 ldi r22, 0x00 ; 0 1b704: 83 e0 ldi r24, 0x03 ; 3 1b706: 0e 94 89 d0 call 0x1a112 ; 0x1a112 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1b70a: 41 e0 ldi r20, 0x01 ; 1 1b70c: c8 30 cpi r28, 0x08 ; 8 1b70e: 21 f0 breq .+8 ; 0x1b718 1b710: 42 e0 ldi r20, 0x02 ; 2 1b712: c8 30 cpi r28, 0x08 ; 8 1b714: 08 f4 brcc .+2 ; 0x1b718 1b716: 40 e0 ldi r20, 0x00 ; 0 1b718: 0d 2f mov r16, r29 1b71a: 20 e8 ldi r18, 0x80 ; 128 1b71c: 3a e8 ldi r19, 0x8A ; 138 1b71e: 69 e0 ldi r22, 0x09 ; 9 1b720: 83 e0 ldi r24, 0x03 ; 3 1b722: 0e 94 89 d0 call 0x1a112 ; 0x1a112 1b726: 98 cf rjmp .-208 ; 0x1b658 0001b728 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1b728: cf 93 push r28 1b72a: 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) 1b72c: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1b730: 81 11 cpse r24, r1 1b732: 18 c0 rjmp .+48 ; 0x1b764 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1b734: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1b738: 8b e0 ldi r24, 0x0B ; 11 1b73a: 68 9f mul r22, r24 1b73c: b0 01 movw r22, r0 1b73e: 11 24 eor r1, r1 1b740: 67 5b subi r22, 0xB7 ; 183 1b742: 72 4f sbci r23, 0xF2 ; 242 1b744: 47 e0 ldi r20, 0x07 ; 7 1b746: 50 e0 ldi r21, 0x00 ; 0 1b748: 8b ea ldi r24, 0xAB ; 171 1b74a: 93 e0 ldi r25, 0x03 ; 3 1b74c: 0f 94 13 dc call 0x3b826 ; 0x3b826 lcd_encoder = menuData->name[0]; 1b750: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1b754: 90 e0 ldi r25, 0x00 ; 0 1b756: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b75a: 80 93 70 06 sts 0x0670, r24 ; 0x800670 menuData->initialized = true; 1b75e: 81 e0 ldi r24, 0x01 ; 1 1b760: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1b764: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b768: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1b76c: 80 97 sbiw r24, 0x20 ; 32 1b76e: 34 f4 brge .+12 ; 0x1b77c 1b770: 80 e2 ldi r24, 0x20 ; 32 1b772: 90 e0 ldi r25, 0x00 ; 0 1b774: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b778: 80 93 70 06 sts 0x0670, r24 ; 0x800670 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1b77c: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b780: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1b784: 8f 3f cpi r24, 0xFF ; 255 1b786: 91 05 cpc r25, r1 1b788: 39 f0 breq .+14 ; 0x1b798 1b78a: 34 f0 brlt .+12 ; 0x1b798 1b78c: 8f ef ldi r24, 0xFF ; 255 1b78e: 90 e0 ldi r25, 0x00 ; 0 1b790: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b794: 80 93 70 06 sts 0x0670, r24 ; 0x800670 menuData->name[menuData->selected] = lcd_encoder; 1b798: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1b79c: f0 e0 ldi r31, 0x00 ; 0 1b79e: e7 55 subi r30, 0x57 ; 87 1b7a0: fc 4f sbci r31, 0xFC ; 252 1b7a2: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1b7a6: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1b7a8: 0e 94 13 6f call 0xde26 ; 0xde26 1b7ac: cb ea ldi r28, 0xAB ; 171 1b7ae: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1b7b0: 89 91 ld r24, Y+ 1b7b2: 0e 94 d6 6e call 0xddac ; 0xddac 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) 1b7b6: 83 e0 ldi r24, 0x03 ; 3 1b7b8: c2 3b cpi r28, 0xB2 ; 178 1b7ba: d8 07 cpc r29, r24 1b7bc: c9 f7 brne .-14 ; 0x1b7b0 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1b7be: 4e e5 ldi r20, 0x5E ; 94 1b7c0: 61 e0 ldi r22, 0x01 ; 1 1b7c2: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1b7c6: 0e 94 07 6f call 0xde0e ; 0xde0e if (menuData->selected > 0) 1b7ca: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1b7ce: 88 23 and r24, r24 1b7d0: 29 f0 breq .+10 ; 0x1b7dc { lcd_putc_at(menuData->selected-1, 1, ' '); 1b7d2: 40 e2 ldi r20, 0x20 ; 32 1b7d4: 61 e0 ldi r22, 0x01 ; 1 1b7d6: 81 50 subi r24, 0x01 ; 1 1b7d8: 0e 94 07 6f call 0xde0e ; 0xde0e } if (lcd_clicked()) 1b7dc: 0e 94 04 71 call 0xe208 ; 0xe208 1b7e0: 88 23 and r24, r24 1b7e2: 99 f0 breq .+38 ; 0x1b80a { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1b7e4: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1b7e8: 8e 2f mov r24, r30 1b7ea: 90 e0 ldi r25, 0x00 ; 0 1b7ec: 01 96 adiw r24, 0x01 ; 1 1b7ee: 07 97 sbiw r24, 0x07 ; 7 1b7f0: 78 f4 brcc .+30 ; 0x1b810 { lcd_encoder = menuData->name[++(menuData->selected)]; 1b7f2: ef 5f subi r30, 0xFF ; 255 1b7f4: e0 93 aa 03 sts 0x03AA, r30 ; 0x8003aa 1b7f8: f0 e0 ldi r31, 0x00 ; 0 1b7fa: e7 55 subi r30, 0x57 ; 87 1b7fc: fc 4f sbci r31, 0xFC ; 252 1b7fe: 82 81 ldd r24, Z+2 ; 0x02 1b800: 90 e0 ldi r25, 0x00 ; 0 1b802: 90 93 71 06 sts 0x0671, r25 ; 0x800671 1b806: 80 93 70 06 sts 0x0670, r24 ; 0x800670 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b80a: df 91 pop r29 1b80c: cf 91 pop r28 1b80e: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1b810: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1b814: 8b e0 ldi r24, 0x0B ; 11 1b816: 68 9f mul r22, r24 1b818: b0 01 movw r22, r0 1b81a: 11 24 eor r1, r1 1b81c: 67 5b subi r22, 0xB7 ; 183 1b81e: 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); 1b820: 47 e0 ldi r20, 0x07 ; 7 1b822: 50 e0 ldi r21, 0x00 ; 0 1b824: 8b ea ldi r24, 0xAB ; 171 1b826: 93 e0 ldi r25, 0x03 ; 3 1b828: 0f 94 37 dc call 0x3b86e ; 0x3b86e EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1b82c: df 91 pop r29 1b82e: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1b830: 0d 94 65 d4 jmp 0x3a8ca ; 0x3a8ca 0001b834 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b834: 8f 92 push r8 1b836: 9f 92 push r9 1b838: af 92 push r10 1b83a: bf 92 push r11 1b83c: cf 92 push r12 1b83e: df 92 push r13 1b840: ef 92 push r14 1b842: ff 92 push r15 1b844: 0f 93 push r16 1b846: 1f 93 push r17 1b848: cf 93 push r28 1b84a: df 93 push r29 1b84c: f8 2e mov r15, r24 1b84e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1b852: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1b856: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1b85a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1b85e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1b862: 4b 01 movw r8, r22 1b864: 6b 01 movw r12, r22 1b866: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1b86a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1b86e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1b872: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1b876: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1b87a: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 1b87c: ff 20 and r15, r15 1b87e: 09 f4 brne .+2 ; 0x1b882 1b880: a6 c0 rjmp .+332 ; 0x1b9ce 1b882: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1b884: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1b886: 24 eb ldi r18, 0xB4 ; 180 1b888: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1b88a: 90 e0 ldi r25, 0x00 ; 0 1b88c: 80 e0 ldi r24, 0x00 ; 0 1b88e: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 1b892: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 target_temperature_bed = (_isbed) ? 100 : 0; 1b896: 84 e6 ldi r24, 0x64 ; 100 1b898: 90 e0 ldi r25, 0x00 ; 0 1b89a: f1 10 cpse r15, r1 1b89c: 02 c0 rjmp .+4 ; 0x1b8a2 1b89e: 90 e0 ldi r25, 0x00 ; 0 1b8a0: 80 e0 ldi r24, 0x00 ; 0 1b8a2: 90 93 73 06 sts 0x0673, r25 ; 0x800673 1b8a6: 80 93 72 06 sts 0x0672, r24 ; 0x800672 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 1b8aa: 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); 1b8ae: 80 e0 ldi r24, 0x00 ; 0 1b8b0: 0f 94 44 32 call 0x26488 ; 0x26488 #endif //THERMAL_MODEL manage_heater(); 1b8b4: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 1b8b8: 81 e0 ldi r24, 0x01 ; 1 1b8ba: 0e 94 b6 8a call 0x1156c ; 0x1156c for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b8be: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1b8c0: 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 1b8c2: 85 e0 ldi r24, 0x05 ; 5 1b8c4: 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) 1b8c6: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1b8ca: 81 11 cpse r24, r1 1b8cc: 1c c0 rjmp .+56 ; 0x1b906 { manage_heater(); 1b8ce: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 1b8d2: 81 e0 ldi r24, 0x01 ; 1 1b8d4: 0e 94 b6 8a call 0x1156c ; 0x1156c _progress = (_isbed? 1b8d8: 00 e9 ldi r16, 0x90 ; 144 1b8da: 11 e0 ldi r17, 0x01 ; 1 1b8dc: 20 e0 ldi r18, 0x00 ; 0 1b8de: 42 e0 ldi r20, 0x02 ; 2 1b8e0: 6a 2d mov r22, r10 1b8e2: 87 e0 ldi r24, 0x07 ; 7 1b8e4: f1 10 cpse r15, r1 1b8e6: 01 c0 rjmp .+2 ; 0x1b8ea 1b8e8: 88 e0 ldi r24, 0x08 ; 8 1b8ea: 0e 94 80 da call 0x1b500 ; 0x1b500 1b8ee: 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 1b8f0: 8b 2d mov r24, r11 1b8f2: 68 2d mov r22, r8 1b8f4: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 1b8f8: 91 11 cpse r25, r1 1b8fa: 02 c0 rjmp .+4 ; 0x1b900 1b8fc: 0e 94 65 77 call 0xeeca ; 0xeeca thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b900: b3 94 inc r11 1b902: b9 10 cpse r11, r9 1b904: e0 cf rjmp .-64 ; 0x1b8c6 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1b906: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1b90a: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 target_temperature_bed = 0; 1b90e: 10 92 73 06 sts 0x0673, r1 ; 0x800673 1b912: 10 92 72 06 sts 0x0672, r1 ; 0x800672 manage_heater(); 1b916: 0f 94 63 38 call 0x270c6 ; 0x270c6 1b91a: b6 01 movw r22, r12 1b91c: dd 0c add r13, r13 1b91e: 88 0b sbc r24, r24 1b920: 99 0b sbc r25, r25 1b922: 4e 01 movw r8, r28 1b924: dd 0f add r29, r29 1b926: aa 08 sbc r10, r10 1b928: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b92a: ff 20 and r15, r15 1b92c: 09 f4 brne .+2 ; 0x1b930 1b92e: 54 c0 rjmp .+168 ; 0x1b9d8 1b930: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1b934: 9b 01 movw r18, r22 1b936: ac 01 movw r20, r24 1b938: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1b93c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1b940: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1b944: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1b948: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1b94c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1b950: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b952: c5 01 movw r24, r10 1b954: b4 01 movw r22, r8 1b956: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1b95a: 9b 01 movw r18, r22 1b95c: ac 01 movw r20, r24 1b95e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1b962: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1b966: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1b96a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1b96e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1b972: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b976: 10 91 11 05 lds r17, 0x0511 ; 0x800511 1b97a: 11 11 cpse r17, r1 1b97c: 0c c0 rjmp .+24 ; 0x1b996 1b97e: f1 10 cpse r15, r1 1b980: 4b c0 rjmp .+150 ; 0x1ba18 1b982: 69 30 cpi r22, 0x09 ; 9 1b984: 71 05 cpc r23, r1 1b986: 0c f0 brlt .+2 ; 0x1b98a 1b988: 4d c0 rjmp .+154 ; 0x1ba24 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b98a: 8e e1 ldi r24, 0x1E ; 30 1b98c: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1b98e: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b990: c8 17 cp r28, r24 1b992: d9 07 cpc r29, r25 1b994: 34 f4 brge .+12 ; 0x1b9a2 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1b996: 69 ef ldi r22, 0xF9 ; 249 1b998: 72 e0 ldi r23, 0x02 ; 2 1b99a: 80 e0 ldi r24, 0x00 ; 0 1b99c: 0f 94 75 9f call 0x33eea ; 0x33eea MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1b9a0: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 1b9a2: 8e 2d mov r24, r14 1b9a4: 0f 94 44 32 call 0x26488 ; 0x26488 #endif //THERMAL_MODEL manage_heater(); 1b9a8: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 1b9ac: 81 e0 ldi r24, 0x01 ; 1 1b9ae: 0e 94 b6 8a call 0x1156c ; 0x1156c return _stepresult; } 1b9b2: 81 2f mov r24, r17 1b9b4: df 91 pop r29 1b9b6: cf 91 pop r28 1b9b8: 1f 91 pop r17 1b9ba: 0f 91 pop r16 1b9bc: ff 90 pop r15 1b9be: ef 90 pop r14 1b9c0: df 90 pop r13 1b9c2: cf 90 pop r12 1b9c4: bf 90 pop r11 1b9c6: af 90 pop r10 1b9c8: 9f 90 pop r9 1b9ca: 8f 90 pop r8 1b9cc: 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 1b9ce: 9c e3 ldi r25, 0x3C ; 60 1b9d0: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1b9d2: 88 ec ldi r24, 0xC8 ; 200 1b9d4: 90 e0 ldi r25, 0x00 ; 0 1b9d6: 5b cf rjmp .-330 ; 0x1b88e target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b9d8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1b9dc: 9b 01 movw r18, r22 1b9de: ac 01 movw r20, r24 1b9e0: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1b9e4: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1b9e8: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1b9ec: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1b9f0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1b9f4: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1b9f8: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b9fa: c5 01 movw r24, r10 1b9fc: b4 01 movw r22, r8 1b9fe: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1ba02: 9b 01 movw r18, r22 1ba04: ac 01 movw r20, r24 1ba06: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1ba0a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1ba0e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1ba12: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1ba16: ab cf rjmp .-170 ; 0x1b96e */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1ba18: 89 e0 ldi r24, 0x09 ; 9 1ba1a: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1ba1c: 6e 31 cpi r22, 0x1E ; 30 1ba1e: 71 05 cpc r23, r1 1ba20: 0c f4 brge .+2 ; 0x1ba24 1ba22: b5 cf rjmp .-150 ; 0x1b98e else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1ba24: 69 ef ldi r22, 0xF9 ; 249 1ba26: 72 e0 ldi r23, 0x02 ; 2 1ba28: 81 e0 ldi r24, 0x01 ; 1 1ba2a: 0f 94 75 9f call 0x33eea ; 0x33eea 1ba2e: b9 cf rjmp .-142 ; 0x1b9a2 0001ba30 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1ba30: cf 93 push r28 1ba32: df 93 push r29 current_position[axis] += 10; 1ba34: 94 e0 ldi r25, 0x04 ; 4 1ba36: 89 9f mul r24, r25 1ba38: e0 01 movw r28, r0 1ba3a: 11 24 eor r1, r1 1ba3c: ce 56 subi r28, 0x6E ; 110 1ba3e: d9 4f sbci r29, 0xF9 ; 249 1ba40: 20 e0 ldi r18, 0x00 ; 0 1ba42: 30 e0 ldi r19, 0x00 ; 0 1ba44: 40 e2 ldi r20, 0x20 ; 32 1ba46: 51 e4 ldi r21, 0x41 ; 65 1ba48: 68 81 ld r22, Y 1ba4a: 79 81 ldd r23, Y+1 ; 0x01 1ba4c: 8a 81 ldd r24, Y+2 ; 0x02 1ba4e: 9b 81 ldd r25, Y+3 ; 0x03 1ba50: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1ba54: 68 83 st Y, r22 1ba56: 79 83 std Y+1, r23 ; 0x01 1ba58: 8a 83 std Y+2, r24 ; 0x02 1ba5a: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ba5c: 60 e0 ldi r22, 0x00 ; 0 1ba5e: 70 e0 ldi r23, 0x00 ; 0 1ba60: 84 e3 ldi r24, 0x34 ; 52 1ba62: 92 e4 ldi r25, 0x42 ; 66 1ba64: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1ba68: 0f 94 ef 42 call 0x285de ; 0x285de crashdet_use_eeprom_setting(); } 1ba6c: df 91 pop r29 1ba6e: 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(); 1ba70: 0d 94 5c 26 jmp 0x24cb8 ; 0x24cb8 0001ba74 : } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 1ba74: 2f 92 push r2 1ba76: 3f 92 push r3 1ba78: 4f 92 push r4 1ba7a: 5f 92 push r5 1ba7c: 6f 92 push r6 1ba7e: 7f 92 push r7 1ba80: 8f 92 push r8 1ba82: 9f 92 push r9 1ba84: af 92 push r10 1ba86: bf 92 push r11 1ba88: cf 92 push r12 1ba8a: df 92 push r13 1ba8c: ef 92 push r14 1ba8e: ff 92 push r15 1ba90: 1f 93 push r17 1ba92: cf 93 push r28 1ba94: df 93 push r29 1ba96: 00 d0 rcall .+0 ; 0x1ba98 1ba98: 00 d0 rcall .+0 ; 0x1ba9a 1ba9a: 1f 92 push r1 1ba9c: cd b7 in r28, 0x3d ; 61 1ba9e: de b7 in r29, 0x3e ; 62 1baa0: 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) { 1baa2: 68 2e mov r6, r24 1baa4: 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; 1baa6: 81 2c mov r8, r1 1baa8: 20 e8 ldi r18, 0x80 ; 128 1baaa: 92 2e mov r9, r18 1baac: 2c e5 ldi r18, 0x5C ; 92 1baae: a2 2e mov r10, r18 1bab0: 23 e4 ldi r18, 0x43 ; 67 1bab2: 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) { 1bab4: 81 30 cpi r24, 0x01 ; 1 1bab6: 31 f0 breq .+12 ; 0x1bac4 case 0: axis_length = X_MAX_POS; break; 1bab8: 81 2c mov r8, r1 1baba: 91 2c mov r9, r1 1babc: 9f e7 ldi r25, 0x7F ; 127 1babe: a9 2e mov r10, r25 1bac0: 93 e4 ldi r25, 0x43 ; 67 1bac2: 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; 1bac4: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 1bac8: 0f 94 b0 25 call 0x24b60 ; 0x24b60 1bacc: 81 e0 ldi r24, 0x01 ; 1 1bace: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 1bad2: 60 e0 ldi r22, 0x00 ; 0 1bad4: 70 e0 ldi r23, 0x00 ; 0 1bad6: 80 ea ldi r24, 0xA0 ; 160 1bad8: 90 e4 ldi r25, 0x40 ; 64 1bada: 0e 94 67 6e call 0xdcce ; 0xdcce tmc2130_home_enter(1 << axis); 1bade: 81 e0 ldi r24, 0x01 ; 1 1bae0: 01 2e mov r0, r17 1bae2: 01 c0 rjmp .+2 ; 0x1bae6 1bae4: 88 0f add r24, r24 1bae6: 0a 94 dec r0 1bae8: ea f7 brpl .-6 ; 0x1bae4 1baea: 0f 94 df 25 call 0x24bbe ; 0x24bbe // first axis length measurement begin current_position[axis] -= (axis_length + margin); 1baee: 20 e0 ldi r18, 0x00 ; 0 1baf0: 30 e0 ldi r19, 0x00 ; 0 1baf2: 40 e7 ldi r20, 0x70 ; 112 1baf4: 52 e4 ldi r21, 0x42 ; 66 1baf6: c5 01 movw r24, r10 1baf8: b4 01 movw r22, r8 1bafa: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1bafe: 69 83 std Y+1, r22 ; 0x01 1bb00: 7a 83 std Y+2, r23 ; 0x02 1bb02: 8b 83 std Y+3, r24 ; 0x03 1bb04: 9c 83 std Y+4, r25 ; 0x04 1bb06: 13 01 movw r2, r6 1bb08: 22 0c add r2, r2 1bb0a: 33 1c adc r3, r3 1bb0c: 22 0c add r2, r2 1bb0e: 33 1c adc r3, r3 1bb10: c1 01 movw r24, r2 1bb12: 8e 56 subi r24, 0x6E ; 110 1bb14: 99 4f sbci r25, 0xF9 ; 249 1bb16: 9e 83 std Y+6, r25 ; 0x06 1bb18: 8d 83 std Y+5, r24 ; 0x05 1bb1a: 29 81 ldd r18, Y+1 ; 0x01 1bb1c: 3a 81 ldd r19, Y+2 ; 0x02 1bb1e: 4b 81 ldd r20, Y+3 ; 0x03 1bb20: 5c 81 ldd r21, Y+4 ; 0x04 1bb22: fc 01 movw r30, r24 1bb24: 60 81 ld r22, Z 1bb26: 71 81 ldd r23, Z+1 ; 0x01 1bb28: 82 81 ldd r24, Z+2 ; 0x02 1bb2a: 93 81 ldd r25, Z+3 ; 0x03 1bb2c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bb30: ed 81 ldd r30, Y+5 ; 0x05 1bb32: fe 81 ldd r31, Y+6 ; 0x06 1bb34: 60 83 st Z, r22 1bb36: 71 83 std Z+1, r23 ; 0x01 1bb38: 82 83 std Z+2, r24 ; 0x02 1bb3a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bb3c: 60 e0 ldi r22, 0x00 ; 0 1bb3e: 70 e0 ldi r23, 0x00 ; 0 1bb40: 84 e3 ldi r24, 0x34 ; 52 1bb42: 92 e4 ldi r25, 0x42 ; 66 1bb44: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1bb48: 0f 94 ef 42 call 0x285de ; 0x285de #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 1bb4c: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> tmc2130_sg_measure_cnt = 0; 1bb50: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 1bb54: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 1bb58: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 1bb5c: 10 92 d0 03 sts 0x03D0, r1 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> tmc2130_sg_measure_val = 0; 1bb60: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 1bb64: 10 92 d2 03 sts 0x03D2, r1 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 1bb68: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 1bb6c: 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); 1bb70: 81 2f mov r24, r17 1bb72: 0f 94 db 42 call 0x285b6 ; 0x285b6 1bb76: 6b 01 movw r12, r22 1bb78: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 1bb7a: 20 e0 ldi r18, 0x00 ; 0 1bb7c: 30 e0 ldi r19, 0x00 ; 0 1bb7e: 40 ef ldi r20, 0xF0 ; 240 1bb80: 52 e4 ldi r21, 0x42 ; 66 1bb82: ed 81 ldd r30, Y+5 ; 0x05 1bb84: fe 81 ldd r31, Y+6 ; 0x06 1bb86: 60 81 ld r22, Z 1bb88: 71 81 ldd r23, Z+1 ; 0x01 1bb8a: 82 81 ldd r24, Z+2 ; 0x02 1bb8c: 93 81 ldd r25, Z+3 ; 0x03 1bb8e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1bb92: ed 81 ldd r30, Y+5 ; 0x05 1bb94: fe 81 ldd r31, Y+6 ; 0x06 1bb96: 60 83 st Z, r22 1bb98: 71 83 std Z+1, r23 ; 0x01 1bb9a: 82 83 std Z+2, r24 ; 0x02 1bb9c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bb9e: 60 e0 ldi r22, 0x00 ; 0 1bba0: 70 e0 ldi r23, 0x00 ; 0 1bba2: 84 e3 ldi r24, 0x34 ; 52 1bba4: 92 e4 ldi r25, 0x42 ; 66 1bba6: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1bbaa: 0f 94 ef 42 call 0x285de ; 0x285de current_position[axis] += axis_length; 1bbae: a5 01 movw r20, r10 1bbb0: 94 01 movw r18, r8 1bbb2: ed 81 ldd r30, Y+5 ; 0x05 1bbb4: fe 81 ldd r31, Y+6 ; 0x06 1bbb6: 60 81 ld r22, Z 1bbb8: 71 81 ldd r23, Z+1 ; 0x01 1bbba: 82 81 ldd r24, Z+2 ; 0x02 1bbbc: 93 81 ldd r25, Z+3 ; 0x03 1bbbe: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1bbc2: ed 81 ldd r30, Y+5 ; 0x05 1bbc4: fe 81 ldd r31, Y+6 ; 0x06 1bbc6: 60 83 st Z, r22 1bbc8: 71 83 std Z+1, r23 ; 0x01 1bbca: 82 83 std Z+2, r24 ; 0x02 1bbcc: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bbce: 60 e0 ldi r22, 0x00 ; 0 1bbd0: 70 e0 ldi r23, 0x00 ; 0 1bbd2: 84 e3 ldi r24, 0x34 ; 52 1bbd4: 92 e4 ldi r25, 0x42 ; 66 1bbd6: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1bbda: 0f 94 ef 42 call 0x285de ; 0x285de } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 1bbde: 8f ef ldi r24, 0xFF ; 255 1bbe0: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 1bbe4: 60 91 d1 03 lds r22, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 1bbe8: 70 91 d2 03 lds r23, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 1bbec: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 1bbf0: 90 91 d4 03 lds r25, 0x03D4 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> 1bbf4: 20 91 cd 03 lds r18, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 1bbf8: 30 91 ce 03 lds r19, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 1bbfc: 40 91 cf 03 lds r20, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 1bc00: 50 91 d0 03 lds r21, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 1bc04: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 1bc08: 2d 83 std Y+5, r18 ; 0x05 1bc0a: 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); 1bc0c: 3f 93 push r19 1bc0e: 2f 93 push r18 1bc10: f8 e5 ldi r31, 0x58 ; 88 1bc12: 6f 0e add r6, r31 1bc14: 71 1c adc r7, r1 1bc16: 7f 92 push r7 1bc18: 6f 92 push r6 1bc1a: 80 e7 ldi r24, 0x70 ; 112 1bc1c: 9a e8 ldi r25, 0x8A ; 138 1bc1e: 9f 93 push r25 1bc20: 8f 93 push r24 1bc22: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 1bc26: 0f 90 pop r0 1bc28: 0f 90 pop r0 1bc2a: 0f 90 pop r0 1bc2c: 0f 90 pop r0 1bc2e: 0f 90 pop r0 1bc30: 0f 90 pop r0 1bc32: 8b e5 ldi r24, 0x5B ; 91 1bc34: 9f e0 ldi r25, 0x0F ; 15 1bc36: 11 11 cpse r17, r1 1bc38: 02 c0 rjmp .+4 ; 0x1bc3e 1bc3a: 8d e5 ldi r24, 0x5D ; 93 1bc3c: 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); 1bc3e: 6d 81 ldd r22, Y+5 ; 0x05 1bc40: 7f 81 ldd r23, Y+7 ; 0x07 1bc42: 0f 94 81 dc call 0x3b902 ; 0x3b902 current_position_final = st_get_position_mm(axis); 1bc46: 81 2f mov r24, r17 1bc48: 0f 94 db 42 call 0x285b6 ; 0x285b6 1bc4c: 2b 01 movw r4, r22 1bc4e: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 1bc50: a7 01 movw r20, r14 1bc52: 96 01 movw r18, r12 1bc54: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bc58: 6b 01 movw r12, r22 1bc5a: 7c 01 movw r14, r24 1bc5c: e8 94 clt 1bc5e: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 1bc60: c1 01 movw r24, r2 1bc62: 8e 56 subi r24, 0x6E ; 110 1bc64: 99 4f sbci r25, 0xF9 ; 249 1bc66: 9e 83 std Y+6, r25 ; 0x06 1bc68: 8d 83 std Y+5, r24 ; 0x05 1bc6a: 20 e0 ldi r18, 0x00 ; 0 1bc6c: 30 e0 ldi r19, 0x00 ; 0 1bc6e: 40 e7 ldi r20, 0x70 ; 112 1bc70: 52 e4 ldi r21, 0x42 ; 66 1bc72: fc 01 movw r30, r24 1bc74: 60 81 ld r22, Z 1bc76: 71 81 ldd r23, Z+1 ; 0x01 1bc78: 82 81 ldd r24, Z+2 ; 0x02 1bc7a: 93 81 ldd r25, Z+3 ; 0x03 1bc7c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bc80: ed 81 ldd r30, Y+5 ; 0x05 1bc82: fe 81 ldd r31, Y+6 ; 0x06 1bc84: 60 83 st Z, r22 1bc86: 71 83 std Z+1, r23 ; 0x01 1bc88: 82 83 std Z+2, r24 ; 0x02 1bc8a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bc8c: 60 e0 ldi r22, 0x00 ; 0 1bc8e: 70 e0 ldi r23, 0x00 ; 0 1bc90: 84 e3 ldi r24, 0x34 ; 52 1bc92: 92 e4 ldi r25, 0x42 ; 66 1bc94: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1bc98: 0f 94 ef 42 call 0x285de ; 0x285de current_position[axis] -= (axis_length + margin); 1bc9c: 29 81 ldd r18, Y+1 ; 0x01 1bc9e: 3a 81 ldd r19, Y+2 ; 0x02 1bca0: 4b 81 ldd r20, Y+3 ; 0x03 1bca2: 5c 81 ldd r21, Y+4 ; 0x04 1bca4: ed 81 ldd r30, Y+5 ; 0x05 1bca6: fe 81 ldd r31, Y+6 ; 0x06 1bca8: 60 81 ld r22, Z 1bcaa: 71 81 ldd r23, Z+1 ; 0x01 1bcac: 82 81 ldd r24, Z+2 ; 0x02 1bcae: 93 81 ldd r25, Z+3 ; 0x03 1bcb0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bcb4: ed 81 ldd r30, Y+5 ; 0x05 1bcb6: fe 81 ldd r31, Y+6 ; 0x06 1bcb8: 60 83 st Z, r22 1bcba: 71 83 std Z+1, r23 ; 0x01 1bcbc: 82 83 std Z+2, r24 ; 0x02 1bcbe: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1bcc0: 60 e0 ldi r22, 0x00 ; 0 1bcc2: 70 e0 ldi r23, 0x00 ; 0 1bcc4: 84 e3 ldi r24, 0x34 ; 52 1bcc6: 92 e4 ldi r25, 0x42 ; 66 1bcc8: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1bccc: 0f 94 ef 42 call 0x285de ; 0x285de current_position_init = st_get_position_mm(axis); 1bcd0: 81 2f mov r24, r17 1bcd2: 0f 94 db 42 call 0x285b6 ; 0x285b6 1bcd6: 9b 01 movw r18, r22 1bcd8: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 1bcda: c3 01 movw r24, r6 1bcdc: b2 01 movw r22, r4 1bcde: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bce2: 2b 01 movw r4, r22 1bce4: 3c 01 movw r6, r24 1bce6: e8 94 clt 1bce8: 77 f8 bld r7, 7 tmc2130_home_exit(); 1bcea: 0f 94 b0 25 call 0x24b60 ; 0x24b60 //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]); 1bcee: ff 92 push r15 1bcf0: ef 92 push r14 1bcf2: df 92 push r13 1bcf4: cf 92 push r12 1bcf6: 87 e6 ldi r24, 0x67 ; 103 1bcf8: 9b e6 ldi r25, 0x6B ; 107 1bcfa: 9f 93 push r25 1bcfc: 8f 93 push r24 1bcfe: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bd02: a5 01 movw r20, r10 1bd04: 94 01 movw r18, r8 1bd06: c7 01 movw r24, r14 1bd08: b6 01 movw r22, r12 1bd0a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bd0e: 9f 77 andi r25, 0x7F ; 127 1bd10: 0f 90 pop r0 1bd12: 0f 90 pop r0 1bd14: 0f 90 pop r0 1bd16: 0f 90 pop r0 1bd18: 0f 90 pop r0 1bd1a: 0f 90 pop r0 1bd1c: 20 e0 ldi r18, 0x00 ; 0 1bd1e: 30 e0 ldi r19, 0x00 ; 0 1bd20: 40 ea ldi r20, 0xA0 ; 160 1bd22: 50 e4 ldi r21, 0x40 ; 64 1bd24: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1bd28: 18 16 cp r1, r24 1bd2a: 0c f4 brge .+2 ; 0x1bd2e 1bd2c: 53 c0 rjmp .+166 ; 0x1bdd4 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]); 1bd2e: 7f 92 push r7 1bd30: 6f 92 push r6 1bd32: 5f 92 push r5 1bd34: 4f 92 push r4 1bd36: 87 e6 ldi r24, 0x67 ; 103 1bd38: 9b e6 ldi r25, 0x6B ; 107 1bd3a: 9f 93 push r25 1bd3c: 8f 93 push r24 1bd3e: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 1bd42: a5 01 movw r20, r10 1bd44: 94 01 movw r18, r8 1bd46: c3 01 movw r24, r6 1bd48: b2 01 movw r22, r4 1bd4a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bd4e: 9f 77 andi r25, 0x7F ; 127 1bd50: 0f 90 pop r0 1bd52: 0f 90 pop r0 1bd54: 0f 90 pop r0 1bd56: 0f 90 pop r0 1bd58: 0f 90 pop r0 1bd5a: 0f 90 pop r0 1bd5c: 20 e0 ldi r18, 0x00 ; 0 1bd5e: 30 e0 ldi r19, 0x00 ; 0 1bd60: 40 ea ldi r20, 0xA0 ; 160 1bd62: 50 e4 ldi r21, 0x40 ; 64 1bd64: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1bd68: 18 16 cp r1, r24 1bd6a: a4 f1 brlt .+104 ; 0x1bdd4 endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 1bd6c: a3 01 movw r20, r6 1bd6e: 92 01 movw r18, r4 1bd70: c7 01 movw r24, r14 1bd72: b6 01 movw r22, r12 1bd74: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1bd78: 6b 01 movw r12, r22 1bd7a: 7c 01 movw r14, r24 1bd7c: e8 94 clt 1bd7e: f7 f8 bld r15, 7 1bd80: ff 92 push r15 1bd82: ef 92 push r14 1bd84: df 92 push r13 1bd86: cf 92 push r12 1bd88: 8a e4 ldi r24, 0x4A ; 74 1bd8a: 9b e6 ldi r25, 0x6B ; 107 1bd8c: 9f 93 push r25 1bd8e: 8f 93 push r24 1bd90: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 1bd94: 0f 90 pop r0 1bd96: 0f 90 pop r0 1bd98: 0f 90 pop r0 1bd9a: 0f 90 pop r0 1bd9c: 0f 90 pop r0 1bd9e: 0f 90 pop r0 1bda0: 20 e0 ldi r18, 0x00 ; 0 1bda2: 30 e0 ldi r19, 0x00 ; 0 1bda4: 40 e8 ldi r20, 0x80 ; 128 1bda6: 5f e3 ldi r21, 0x3F ; 63 1bda8: c7 01 movw r24, r14 1bdaa: b6 01 movw r22, r12 1bdac: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1bdb0: 18 16 cp r1, r24 1bdb2: 0c f4 brge .+2 ; 0x1bdb6 1bdb4: 44 c0 rjmp .+136 ; 0x1be3e plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 1bdb6: ed 81 ldd r30, Y+5 ; 0x05 1bdb8: fe 81 ldd r31, Y+6 ; 0x06 1bdba: 10 82 st Z, r1 1bdbc: 11 82 std Z+1, r1 ; 0x01 1bdbe: 12 82 std Z+2, r1 ; 0x02 1bdc0: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bdc2: 0f 94 10 bf call 0x37e20 ; 0x37e20 reset_crash_det(axis); 1bdc6: 81 2f mov r24, r17 1bdc8: 0e 94 18 dd call 0x1ba30 ; 0x1ba30 endstops_hit_on_purpose(); 1bdcc: 0f 94 05 4e call 0x29c0a ; 0x29c0a return true; 1bdd0: 81 e0 ldi r24, 0x01 ; 1 1bdd2: 1d c0 rjmp .+58 ; 0x1be0e 1bdd4: 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"; 1bdd8: 63 ee ldi r22, 0xE3 ; 227 1bdda: 72 e0 ldi r23, 0x02 ; 2 1bddc: 11 30 cpi r17, 0x01 ; 1 1bdde: 11 f0 breq .+4 ; 0x1bde4 1bde0: 61 ee ldi r22, 0xE1 ; 225 1bde2: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 1bde4: 88 e0 ldi r24, 0x08 ; 8 1bde6: 0f 94 75 9f call 0x33eea ; 0x33eea current_position[axis] = 0; 1bdea: f1 01 movw r30, r2 1bdec: ee 56 subi r30, 0x6E ; 110 1bdee: f9 4f sbci r31, 0xF9 ; 249 1bdf0: 10 82 st Z, r1 1bdf2: 11 82 std Z+1, r1 ; 0x01 1bdf4: 12 82 std Z+2, r1 ; 0x02 1bdf6: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1bdf8: 0f 94 10 bf call 0x37e20 ; 0x37e20 reset_crash_det(axis); 1bdfc: 81 2f mov r24, r17 1bdfe: 0e 94 18 dd call 0x1ba30 ; 0x1ba30 1be02: 81 e0 ldi r24, 0x01 ; 1 1be04: 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(); 1be08: 0f 94 05 4e call 0x29c0a ; 0x29c0a return false; 1be0c: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 1be0e: 27 96 adiw r28, 0x07 ; 7 1be10: 0f b6 in r0, 0x3f ; 63 1be12: f8 94 cli 1be14: de bf out 0x3e, r29 ; 62 1be16: 0f be out 0x3f, r0 ; 63 1be18: cd bf out 0x3d, r28 ; 61 1be1a: df 91 pop r29 1be1c: cf 91 pop r28 1be1e: 1f 91 pop r17 1be20: ff 90 pop r15 1be22: ef 90 pop r14 1be24: df 90 pop r13 1be26: cf 90 pop r12 1be28: bf 90 pop r11 1be2a: af 90 pop r10 1be2c: 9f 90 pop r9 1be2e: 8f 90 pop r8 1be30: 7f 90 pop r7 1be32: 6f 90 pop r6 1be34: 5f 90 pop r5 1be36: 4f 90 pop r4 1be38: 3f 90 pop r3 1be3a: 2f 90 pop r2 1be3c: 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"; 1be3e: 63 ee ldi r22, 0xE3 ; 227 1be40: 72 e0 ldi r23, 0x02 ; 2 1be42: 11 30 cpi r17, 0x01 ; 1 1be44: 11 f0 breq .+4 ; 0x1be4a 1be46: 61 ee ldi r22, 0xE1 ; 225 1be48: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 1be4a: 87 e0 ldi r24, 0x07 ; 7 1be4c: 0f 94 75 9f call 0x33eea ; 0x33eea current_position[axis] = 0; 1be50: f1 01 movw r30, r2 1be52: ee 56 subi r30, 0x6E ; 110 1be54: f9 4f sbci r31, 0xF9 ; 249 1be56: 10 82 st Z, r1 1be58: 11 82 std Z+1, r1 ; 0x01 1be5a: 12 82 std Z+2, r1 ; 0x02 1be5c: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1be5e: 0f 94 10 bf call 0x37e20 ; 0x37e20 reset_crash_det(axis); 1be62: 81 2f mov r24, r17 1be64: 0e 94 18 dd call 0x1ba30 ; 0x1ba30 1be68: cf cf rjmp .-98 ; 0x1be08 0001be6a : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 1be6a: 89 e6 ldi r24, 0x69 ; 105 1be6c: 9f e0 ldi r25, 0x0F ; 15 1be6e: 0e 94 3b 76 call 0xec76 ; 0xec76 crashdet_use_eeprom_setting(); 1be72: 0d 94 5c 26 jmp 0x24cb8 ; 0x24cb8 0001be76 : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 1be76: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 1be7a: 89 ea ldi r24, 0xA9 ; 169 1be7c: 9a e3 ldi r25, 0x3A ; 58 1be7e: 0e 94 b3 72 call 0xe566 ; 0xe566 1be82: 0e 94 d2 6e call 0xdda4 ; 0xdda4 menu_back_if_clicked(); 1be86: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 0001be8a : } static void lcd_crash_mode_info2() { lcd_home(); 1be8a: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 1be8e: 80 ee ldi r24, 0xE0 ; 224 1be90: 9a e3 ldi r25, 0x3A ; 58 1be92: 0e 94 b3 72 call 0xe566 ; 0xe566 1be96: 0e 94 d2 6e call 0xdda4 ; 0xdda4 menu_back_if_clicked(); 1be9a: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 0001be9e : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 1be9e: 0f 93 push r16 1bea0: 1f 93 push r17 1bea2: cf 93 push r28 1bea4: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 1bea6: 0e 94 1a 6f call 0xde34 ; 0xde34 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 1beaa: 81 e0 ldi r24, 0x01 ; 1 1beac: 0e 94 b7 66 call 0xcd6e ; 0xcd6e uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1beb0: 8d e5 ldi r24, 0x5D ; 93 1beb2: 9f e0 ldi r25, 0x0F ; 15 1beb4: 0f 94 31 dc call 0x3b862 ; 0x3b862 1beb8: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1beba: 8b e5 ldi r24, 0x5B ; 91 1bebc: 9f e0 ldi r25, 0x0F ; 15 1bebe: 0f 94 31 dc call 0x3b862 ; 0x3b862 1bec2: 18 2f mov r17, r24 1bec4: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 1bec6: 87 e8 ldi r24, 0x87 ; 135 1bec8: 99 e4 ldi r25, 0x49 ; 73 1beca: 0e 94 b3 72 call 0xe566 ; 0xe566 1bece: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 1bed2: 61 e0 ldi r22, 0x01 ; 1 1bed4: 80 e0 ldi r24, 0x00 ; 0 1bed6: 0e 94 e7 6e call 0xddce ; 0xddce 1beda: df 93 push r29 1bedc: cf 93 push r28 1bede: 87 e5 ldi r24, 0x57 ; 87 1bee0: 9a e8 ldi r25, 0x8A ; 138 1bee2: 9f 93 push r25 1bee4: 8f 93 push r24 1bee6: 0e 94 c0 6e call 0xdd80 ; 0xdd80 KEEPALIVE_STATE(IN_HANDLER); 1beea: 82 e0 ldi r24, 0x02 ; 2 1beec: 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)){ 1bef0: 80 e0 ldi r24, 0x00 ; 0 1bef2: 0e 94 3a dd call 0x1ba74 ; 0x1ba74 1bef6: 0f 90 pop r0 1bef8: 0f 90 pop r0 1befa: 0f 90 pop r0 1befc: 0f 90 pop r0 1befe: 88 23 and r24, r24 1bf00: 09 f4 brne .+2 ; 0x1bf04 1bf02: 45 c0 rjmp .+138 ; 0x1bf8e X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 1bf04: 8d e5 ldi r24, 0x5D ; 93 1bf06: 9f e0 ldi r25, 0x0F ; 15 1bf08: 0f 94 31 dc call 0x3b862 ; 0x3b862 1bf0c: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 1bf0e: 61 e0 ldi r22, 0x01 ; 1 1bf10: 8a e0 ldi r24, 0x0A ; 10 1bf12: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1bf16: be 01 movw r22, r28 1bf18: 90 e0 ldi r25, 0x00 ; 0 1bf1a: 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); 1bf1c: 4a e0 ldi r20, 0x0A ; 10 1bf1e: 0e 94 3b 70 call 0xe076 ; 0xe076 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 1bf22: 85 e7 ldi r24, 0x75 ; 117 1bf24: 99 e4 ldi r25, 0x49 ; 73 1bf26: 0e 94 b3 72 call 0xe566 ; 0xe566 1bf2a: ac 01 movw r20, r24 1bf2c: 62 e0 ldi r22, 0x02 ; 2 1bf2e: 80 e0 ldi r24, 0x00 ; 0 1bf30: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 1bf34: 63 e0 ldi r22, 0x03 ; 3 1bf36: 80 e0 ldi r24, 0x00 ; 0 1bf38: 0e 94 e7 6e call 0xddce ; 0xddce 1bf3c: 0f 93 push r16 1bf3e: 1f 93 push r17 1bf40: 8a e4 ldi r24, 0x4A ; 74 1bf42: 9a e8 ldi r25, 0x8A ; 138 1bf44: 9f 93 push r25 1bf46: 8f 93 push r24 1bf48: 0e 94 c0 6e call 0xdd80 ; 0xdd80 if (lcd_selfcheck_axis_sg(Y_AXIS)) 1bf4c: 81 e0 ldi r24, 0x01 ; 1 1bf4e: 0e 94 3a dd call 0x1ba74 ; 0x1ba74 1bf52: 0f 90 pop r0 1bf54: 0f 90 pop r0 1bf56: 0f 90 pop r0 1bf58: 0f 90 pop r0 1bf5a: 88 23 and r24, r24 1bf5c: c1 f0 breq .+48 ; 0x1bf8e { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 1bf5e: 8b e5 ldi r24, 0x5B ; 91 1bf60: 9f e0 ldi r25, 0x0F ; 15 1bf62: 0f 94 31 dc call 0x3b862 ; 0x3b862 1bf66: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 1bf68: 63 e0 ldi r22, 0x03 ; 3 1bf6a: 8a e0 ldi r24, 0x0A ; 10 1bf6c: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 1bf70: be 01 movw r22, r28 1bf72: 90 e0 ldi r25, 0x00 ; 0 1bf74: 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); 1bf76: 4a e0 ldi r20, 0x0A ; 10 1bf78: 0e 94 3b 70 call 0xe076 ; 0xe076 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 1bf7c: 43 e8 ldi r20, 0x83 ; 131 1bf7e: 63 e0 ldi r22, 0x03 ; 3 1bf80: 83 e1 ldi r24, 0x13 ; 19 1bf82: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_wait_for_click_delay(10); 1bf86: 8a e0 ldi r24, 0x0A ; 10 1bf88: 90 e0 ldi r25, 0x00 ; 0 1bf8a: 0f 94 36 3a call 0x2746c ; 0x2746c } } FORCE_HIGH_POWER_END; 1bf8e: 80 e0 ldi r24, 0x00 ; 0 1bf90: 0e 94 b7 66 call 0xcd6e ; 0xcd6e KEEPALIVE_STATE(NOT_BUSY); 1bf94: 81 e0 ldi r24, 0x01 ; 1 1bf96: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 1bf9a: df 91 pop r29 1bf9c: cf 91 pop r28 1bf9e: 1f 91 pop r17 1bfa0: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 1bfa2: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 0001bfa6 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1bfa6: 0f 94 99 7c call 0x2f932 ; 0x2f932 #endif menu_top = 0; 1bfaa: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1bfae: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1bfb2: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1bfb6: 0d 94 bf d1 jmp 0x3a37e ; 0x3a37e 0001bfba : } } void CardReader::updir() { if(workDirDepth > 0) 1bfba: 80 91 30 16 lds r24, 0x1630 ; 0x801630 1bfbe: 88 23 and r24, r24 1bfc0: f9 f0 breq .+62 ; 0x1c000 { --workDirDepth; 1bfc2: 81 50 subi r24, 0x01 ; 1 1bfc4: 80 93 30 16 sts 0x1630, r24 ; 0x801630 workDir = workDirParents[0]; 1bfc8: 93 e2 ldi r25, 0x23 ; 35 1bfca: ee e5 ldi r30, 0x5E ; 94 1bfcc: f5 e1 ldi r31, 0x15 ; 21 1bfce: ab e3 ldi r26, 0x3B ; 59 1bfd0: b5 e1 ldi r27, 0x15 ; 21 1bfd2: 01 90 ld r0, Z+ 1bfd4: 0d 92 st X+, r0 1bfd6: 9a 95 dec r25 1bfd8: e1 f7 brne .-8 ; 0x1bfd2 1bfda: 2e e5 ldi r18, 0x5E ; 94 1bfdc: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1bfde: 90 e0 ldi r25, 0x00 ; 0 1bfe0: 98 17 cp r25, r24 1bfe2: 60 f4 brcc .+24 ; 0x1bffc { workDirParents[d] = workDirParents[d+1]; 1bfe4: 43 e2 ldi r20, 0x23 ; 35 1bfe6: f9 01 movw r30, r18 1bfe8: b3 96 adiw r30, 0x23 ; 35 1bfea: d9 01 movw r26, r18 1bfec: 01 90 ld r0, Z+ 1bfee: 0d 92 st X+, r0 1bff0: 4a 95 dec r20 1bff2: e1 f7 brne .-8 ; 0x1bfec { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1bff4: 9f 5f subi r25, 0xFF ; 255 1bff6: 2d 5d subi r18, 0xDD ; 221 1bff8: 3f 4f sbci r19, 0xFF ; 255 1bffa: f2 cf rjmp .-28 ; 0x1bfe0 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1bffc: 0f 94 99 7c call 0x2f932 ; 0x2f932 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1c000: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1c004: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1c008: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1c00c: 0d 94 bf d1 jmp 0x3a37e ; 0x3a37e 0001c010 : } backlight_save(); } static void lcd_backlight_menu() { 1c010: ef 92 push r14 1c012: ff 92 push r15 1c014: 0f 93 push r16 1c016: 1f 93 push r17 1c018: cf 93 push r28 1c01a: df 93 push r29 MENU_BEGIN(); 1c01c: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c020: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c024: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c028: 84 30 cpi r24, 0x04 ; 4 1c02a: 08 f0 brcs .+2 ; 0x1c02e 1c02c: 63 c0 rjmp .+198 ; 0x1c0f4 1c02e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c032: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 1c036: 81 11 cpse r24, r1 1c038: 0e 94 36 8a call 0x1146c ; 0x1146c backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1c03c: 8c eb ldi r24, 0xBC ; 188 1c03e: 99 e4 ldi r25, 0x49 ; 73 1c040: 0e 94 b3 72 call 0xe566 ; 0xe566 1c044: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1c048: c0 91 00 04 lds r28, 0x0400 ; 0x800400 1c04c: d0 e0 ldi r29, 0x00 ; 0 1c04e: 87 e3 ldi r24, 0x37 ; 55 1c050: 98 e4 ldi r25, 0x48 ; 72 1c052: 0e 94 b3 72 call 0xe566 ; 0xe566 1c056: f1 2c mov r15, r1 1c058: e1 2c mov r14, r1 1c05a: 0f ef ldi r16, 0xFF ; 255 1c05c: 10 e0 ldi r17, 0x00 ; 0 1c05e: 9e 01 movw r18, r28 1c060: 48 e0 ldi r20, 0x08 ; 8 1c062: 61 e0 ldi r22, 0x01 ; 1 1c064: 74 e0 ldi r23, 0x04 ; 4 1c066: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1c06a: 00 91 01 04 lds r16, 0x0401 ; 0x800401 1c06e: 10 e0 ldi r17, 0x00 ; 0 1c070: 88 e2 ldi r24, 0x28 ; 40 1c072: 98 e4 ldi r25, 0x48 ; 72 1c074: 0e 94 b3 72 call 0xe566 ; 0xe566 1c078: 30 e0 ldi r19, 0x00 ; 0 1c07a: 20 e0 ldi r18, 0x00 ; 0 1c07c: 48 e0 ldi r20, 0x08 ; 8 1c07e: 60 e0 ldi r22, 0x00 ; 0 1c080: 74 e0 ldi r23, 0x04 ; 4 1c082: 0f 94 ed d1 call 0x3a3da ; 0x3a3da 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); 1c086: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c08a: 81 30 cpi r24, 0x01 ; 1 1c08c: 59 f5 brne .+86 ; 0x1c0e4 1c08e: 8f e1 ldi r24, 0x1F ; 31 1c090: 98 e4 ldi r25, 0x48 ; 72 1c092: 0e 94 b3 72 call 0xe566 ; 0xe566 1c096: ec 01 movw r28, r24 1c098: 8b e0 ldi r24, 0x0B ; 11 1c09a: 98 e4 ldi r25, 0x48 ; 72 1c09c: 0e 94 b3 72 call 0xe566 ; 0xe566 1c0a0: 22 e0 ldi r18, 0x02 ; 2 1c0a2: 41 e8 ldi r20, 0x81 ; 129 1c0a4: 50 ee ldi r21, 0xE0 ; 224 1c0a6: be 01 movw r22, r28 1c0a8: 0f 94 2c d3 call 0x3a658 ; 0x3a658 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); 1c0ac: 81 e0 ldi r24, 0x01 ; 1 1c0ae: 98 e4 ldi r25, 0x48 ; 72 1c0b0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c0b4: f1 2c mov r15, r1 1c0b6: e1 2c mov r14, r1 1c0b8: 07 ee ldi r16, 0xE7 ; 231 1c0ba: 13 e0 ldi r17, 0x03 ; 3 1c0bc: 21 e0 ldi r18, 0x01 ; 1 1c0be: 30 e0 ldi r19, 0x00 ; 0 1c0c0: 40 e1 ldi r20, 0x10 ; 16 1c0c2: 6d e4 ldi r22, 0x4D ; 77 1c0c4: 72 e0 ldi r23, 0x02 ; 2 1c0c6: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_END(); 1c0ca: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1c0ce: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c0d2: 8f 5f subi r24, 0xFF ; 255 1c0d4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c0d8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c0dc: 8f 5f subi r24, 0xFF ; 255 1c0de: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c0e2: a0 cf rjmp .-192 ; 0x1c024 ); 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); 1c0e4: 81 11 cpse r24, r1 1c0e6: 03 c0 rjmp .+6 ; 0x1c0ee 1c0e8: 89 e1 ldi r24, 0x19 ; 25 1c0ea: 98 e4 ldi r25, 0x48 ; 72 1c0ec: d2 cf rjmp .-92 ; 0x1c092 1c0ee: 82 e1 ldi r24, 0x12 ; 18 1c0f0: 98 e4 ldi r25, 0x48 ; 72 1c0f2: cf cf rjmp .-98 ; 0x1c092 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); MENU_END(); } 1c0f4: df 91 pop r29 1c0f6: cf 91 pop r28 1c0f8: 1f 91 pop r17 1c0fa: 0f 91 pop r16 1c0fc: ff 90 pop r15 1c0fe: ef 90 pop r14 1c100: 08 95 ret 0001c102 : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1c102: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1c106: 88 23 and r24, r24 1c108: 31 f0 breq .+12 ; 0x1c116 1c10a: 81 30 cpi r24, 0x01 ; 1 1c10c: 41 f4 brne .+16 ; 0x1c11e { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1c10e: 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(); 1c112: 0c 94 36 8a jmp 0x1146c ; 0x1146c 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; 1c116: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1c118: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1c11c: fa cf rjmp .-12 ; 0x1c112 1c11e: 81 e0 ldi r24, 0x01 ; 1 1c120: fb cf rjmp .-10 ; 0x1c118 0001c122 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1c122: cf 93 push r28 MENU_BEGIN(); 1c124: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c128: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c12c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c130: 84 30 cpi r24, 0x04 ; 4 1c132: 60 f5 brcc .+88 ; 0x1c18c 1c134: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c138: 88 ea ldi r24, 0xA8 ; 168 1c13a: 98 e4 ldi r25, 0x48 ; 72 1c13c: 0e 94 b3 72 call 0xe566 ; 0xe566 1c140: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1c144: 8d eb ldi r24, 0xBD ; 189 1c146: 95 e4 ldi r25, 0x45 ; 69 1c148: 0e 94 b3 72 call 0xe566 ; 0xe566 1c14c: 65 e8 ldi r22, 0x85 ; 133 1c14e: 71 ee ldi r23, 0xE1 ; 225 1c150: 0f 94 1a d1 call 0x3a234 ; 0x3a234 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c154: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1c156: 82 e8 ldi r24, 0x82 ; 130 1c158: 96 e4 ldi r25, 0x46 ; 70 1c15a: 0e 94 b3 72 call 0xe566 ; 0xe566 1c15e: 61 e3 ldi r22, 0x31 ; 49 1c160: 6c 0f add r22, r28 1c162: 2c 2f mov r18, r28 1c164: 44 e9 ldi r20, 0x94 ; 148 1c166: 51 ee ldi r21, 0xE1 ; 225 1c168: 0f 94 c3 d0 call 0x3a186 ; 0x3a186 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++) 1c16c: cf 5f subi r28, 0xFF ; 255 1c16e: c5 30 cpi r28, 0x05 ; 5 1c170: 91 f7 brne .-28 ; 0x1c156 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1c172: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1c176: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c17a: 8f 5f subi r24, 0xFF ; 255 1c17c: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c180: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c184: 8f 5f subi r24, 0xFF ; 255 1c186: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c18a: d0 cf rjmp .-96 ; 0x1c12c 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(); } 1c18c: cf 91 pop r28 1c18e: 08 95 ret 0001c190 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1c190: 84 e0 ldi r24, 0x04 ; 4 1c192: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0001c196 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1c196: 85 e0 ldi r24, 0x05 ; 5 1c198: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0001c19c : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1c19c: 86 e0 ldi r24, 0x06 ; 6 1c19e: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0001c1a2 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1c1a2: 87 e0 ldi r24, 0x07 ; 7 1c1a4: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0001c1a8 : 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); 1c1a8: 88 e0 ldi r24, 0x08 ; 8 1c1aa: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0001c1ae : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1c1ae: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1c1b2: 81 ea ldi r24, 0xA1 ; 161 1c1b4: 9d e0 ldi r25, 0x0D ; 13 1c1b6: 0f 94 47 dc call 0x3b88e ; 0x3b88e } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1c1ba: 83 e0 ldi r24, 0x03 ; 3 1c1bc: 0d 94 49 d4 jmp 0x3a892 ; 0x3a892 0001c1c0 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1c1c0: cf 93 push r28 MENU_BEGIN(); 1c1c2: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c1c6: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c1ca: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c1ce: 84 30 cpi r24, 0x04 ; 4 1c1d0: 88 f5 brcc .+98 ; 0x1c234 1c1d2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c1d6: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 1c1da: 81 11 cpse r24, r1 1c1dc: 0f 94 9a 20 call 0x24134 ; 0x24134 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c1e0: 88 ea ldi r24, 0xA8 ; 168 1c1e2: 98 e4 ldi r25, 0x48 ; 72 1c1e4: 0e 94 b3 72 call 0xe566 ; 0xe566 1c1e8: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1c1ec: 8d eb ldi r24, 0xBD ; 189 1c1ee: 95 e4 ldi r25, 0x45 ; 69 1c1f0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c1f4: 6e e9 ldi r22, 0x9E ; 158 1c1f6: 7a e3 ldi r23, 0x3A ; 58 1c1f8: 0f 94 1a d1 call 0x3a234 ; 0x3a234 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c1fc: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1c1fe: 82 e8 ldi r24, 0x82 ; 130 1c200: 96 e4 ldi r25, 0x46 ; 70 1c202: 0e 94 b3 72 call 0xe566 ; 0xe566 1c206: 61 e3 ldi r22, 0x31 ; 49 1c208: 6c 0f add r22, r28 1c20a: 2c 2f mov r18, r28 1c20c: 46 e0 ldi r20, 0x06 ; 6 1c20e: 5b e3 ldi r21, 0x3B ; 59 1c210: 0f 94 c3 d0 call 0x3a186 ; 0x3a186 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++) 1c214: cf 5f subi r28, 0xFF ; 255 1c216: c5 30 cpi r28, 0x05 ; 5 1c218: 91 f7 brne .-28 ; 0x1c1fe MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1c21a: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1c21e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c222: 8f 5f subi r24, 0xFF ; 255 1c224: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c228: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c22c: 8f 5f subi r24, 0xFF ; 255 1c22e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c232: cb cf rjmp .-106 ; 0x1c1ca 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(); } 1c234: cf 91 pop r28 1c236: 08 95 ret 0001c238 : } // 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)) { 1c238: ef 92 push r14 1c23a: ff 92 push r15 1c23c: 0f 93 push r16 1c23e: 1f 93 push r17 1c240: cf 93 push r28 1c242: 8c 01 movw r16, r24 1c244: 7b 01 movw r14, r22 MENU_BEGIN(); 1c246: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c24a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c24e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c252: 84 30 cpi r24, 0x04 ; 4 1c254: 28 f5 brcc .+74 ; 0x1c2a0 1c256: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1c25a: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 1c25e: 81 11 cpse r24, r1 1c260: 0f 94 9a 20 call 0x24134 ; 0x24134 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1c264: 88 ea ldi r24, 0xA8 ; 168 1c266: 98 e4 ldi r25, 0x48 ; 72 1c268: 0e 94 b3 72 call 0xe566 ; 0xe566 1c26c: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c270: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1c272: 61 e3 ldi r22, 0x31 ; 49 1c274: 6c 0f add r22, r28 1c276: 2c 2f mov r18, r28 1c278: a7 01 movw r20, r14 1c27a: c8 01 movw r24, r16 1c27c: 0f 94 c3 d0 call 0x3a186 ; 0x3a186 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1c280: cf 5f subi r28, 0xFF ; 255 1c282: c5 30 cpi r28, 0x05 ; 5 1c284: b1 f7 brne .-20 ; 0x1c272 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1c286: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 // 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(); 1c28a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c28e: 8f 5f subi r24, 0xFF ; 255 1c290: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c294: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c298: 8f 5f subi r24, 0xFF ; 255 1c29a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c29e: d7 cf rjmp .-82 ; 0x1c24e ); 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(); } 1c2a0: cf 91 pop r28 1c2a2: 1f 91 pop r17 1c2a4: 0f 91 pop r16 1c2a6: ff 90 pop r15 1c2a8: ef 90 pop r14 1c2aa: 08 95 ret 0001c2ac : 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); 1c2ac: 87 e1 ldi r24, 0x17 ; 23 1c2ae: 9c e5 ldi r25, 0x5C ; 92 1c2b0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c2b4: 6e e6 ldi r22, 0x6E ; 110 1c2b6: 71 ee ldi r23, 0xE1 ; 225 1c2b8: 0c 94 1c e1 jmp 0x1c238 ; 0x1c238 0001c2bc : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1c2bc: 86 e2 ldi r24, 0x26 ; 38 1c2be: 9c e5 ldi r25, 0x5C ; 92 1c2c0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c2c4: 6a e7 ldi r22, 0x7A ; 122 1c2c6: 71 ee ldi r23, 0xE1 ; 225 1c2c8: 0c 94 1c e1 jmp 0x1c238 ; 0x1c238 0001c2cc : 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); 1c2cc: 82 e8 ldi r24, 0x82 ; 130 1c2ce: 96 e4 ldi r25, 0x46 ; 70 1c2d0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c2d4: 66 e0 ldi r22, 0x06 ; 6 1c2d6: 7a e3 ldi r23, 0x3A ; 58 1c2d8: 0c 94 1c e1 jmp 0x1c238 ; 0x1c238 0001c2dc : 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){ 1c2dc: cf 93 push r28 1c2de: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1c2e0: 0f 94 8b 88 call 0x31116 ; 0x31116 1c2e4: 88 23 and r24, r24 1c2e6: 21 f0 breq .+8 ; 0x1c2f0 1c2e8: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1c2ea: cf 91 pop r28 1c2ec: 0d 94 1c ae jmp 0x35c38 ; 0x35c38 1c2f0: cf 91 pop r28 1c2f2: 08 95 ret 0001c2f4 : 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) { 1c2f4: cf 93 push r28 1c2f6: c8 2f mov r28, r24 menu_back(); 1c2f8: 0f 94 65 d4 call 0x3a8ca ; 0x3a8ca MMU2::mmu2.eject_filament(filament, true); 1c2fc: 61 e0 ldi r22, 0x01 ; 1 1c2fe: 8c 2f mov r24, r28 1c300: 0f 94 9f ad call 0x35b3e ; 0x35b3e // Clear the filament action clearFilamentAction(); } 1c304: 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(); 1c306: 0d 94 9a 20 jmp 0x24134 ; 0x24134 0001c30a : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 1c30a: 80 e0 ldi r24, 0x00 ; 0 1c30c: 0f 94 5c ad call 0x35ab8 ; 0x35ab8 1c310: 81 e0 ldi r24, 0x01 ; 1 1c312: 0f 94 5c ad call 0x35ab8 ; 0x35ab8 1c316: 82 e0 ldi r24, 0x02 ; 2 1c318: 0f 94 5c ad call 0x35ab8 ; 0x35ab8 1c31c: 83 e0 ldi r24, 0x03 ; 3 1c31e: 0f 94 5c ad call 0x35ab8 ; 0x35ab8 1c322: 84 e0 ldi r24, 0x04 ; 4 1c324: 0d 94 5c ad jmp 0x35ab8 ; 0x35ab8 0001c328 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1c328: 0d 94 5c ad jmp 0x35ab8 ; 0x35ab8 0001c32c : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 1c32c: cf 93 push r28 1c32e: c8 2f mov r28, r24 if (!lang_select(lang)) 1c330: 0e 94 3b 72 call 0xe476 ; 0xe476 1c334: 81 11 cpse r24, r1 1c336: 37 c0 rjmp .+110 ; 0x1c3a6 { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 1c338: 81 e3 ldi r24, 0x31 ; 49 1c33a: 9b e3 ldi r25, 0x3B ; 59 1c33c: 0e 94 b3 72 call 0xe566 ; 0xe566 1c340: 40 e0 ldi r20, 0x00 ; 0 1c342: 60 e0 ldi r22, 0x00 ; 0 1c344: 0f 94 47 4f call 0x29e8e ; 0x29e8e 1c348: 81 11 cpse r24, r1 1c34a: 20 c0 rjmp .+64 ; 0x1c38c #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c34c: 0e 94 f0 71 call 0xe3e0 ; 0xe3e0 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c350: c2 30 cpi r28, 0x02 ; 2 1c352: e0 f0 brcs .+56 ; 0x1c38c 1c354: 8c 17 cp r24, r28 1c356: d0 f0 brcs .+52 ; 0x1c38c softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c358: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c35a: 8a ea ldi r24, 0xAA ; 170 1c35c: 95 e5 ldi r25, 0x55 ; 85 1c35e: dc 01 movw r26, r24 1c360: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dc> 1c364: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7dd> 1c368: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7de> 1c36c: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7df> boot_app_flags = BOOT_APP_FLG_USER0; 1c370: 80 e8 ldi r24, 0x80 ; 128 1c372: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7db> boot_copy_size = 0; 1c376: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7d9> 1c37a: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7d8> bootapp_reboot_user0(lang << 3); 1c37e: cc 0f add r28, r28 1c380: cc 0f add r28, r28 1c382: cc 0f add r28, r28 boot_reserved = reserved; 1c384: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7da> // bootapp_print_vars(); softReset(); 1c388: 0e 94 53 67 call 0xcea6 ; 0xcea6 lang_boot_update_start(lang); lcd_update_enable(true); 1c38c: 81 e0 ldi r24, 0x01 ; 1 1c38e: 0e 94 2c 6f call 0xde58 ; 0xde58 menu_goto(lcd_language_menu, 0, true, true); 1c392: 21 e0 ldi r18, 0x01 ; 1 1c394: 41 e0 ldi r20, 0x01 ; 1 1c396: 70 e0 ldi r23, 0x00 ; 0 1c398: 60 e0 ldi r22, 0x00 ; 0 1c39a: 86 ed ldi r24, 0xD6 ; 214 1c39c: 92 ee ldi r25, 0xE2 ; 226 1c39e: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e 1c3a2: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout } } 1c3a6: cf 91 pop r28 1c3a8: 08 95 ret 0001c3aa : #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 1c3aa: cf 93 push r28 1c3ac: df 93 push r29 MENU_BEGIN(); 1c3ae: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c3b2: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c3b6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c3ba: 84 30 cpi r24, 0x04 ; 4 1c3bc: 58 f5 brcc .+86 ; 0x1c414 1c3be: 10 92 15 05 sts 0x0515, r1 ; 0x800515 uint8_t cnt = lang_get_count(); 1c3c2: 0e 94 f0 71 call 0xe3e0 ; 0xe3e0 1c3c6: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 1c3c8: 8b e9 ldi r24, 0x9B ; 155 1c3ca: 94 e4 ldi r25, 0x44 ; 68 1c3cc: 0e 94 b3 72 call 0xe566 ; 0xe566 1c3d0: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 for (uint8_t i = 8; i < cnt; i++) //all community languages 1c3d4: c8 e0 ldi r28, 0x08 ; 8 1c3d6: cd 17 cp r28, r29 1c3d8: 80 f4 brcc .+32 ; 0x1c3fa if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c3da: 8c 2f mov r24, r28 1c3dc: 0e 94 a1 71 call 0xe342 ; 0xe342 1c3e0: 0e 94 3a 71 call 0xe274 ; 0xe274 1c3e4: 0f 94 4b d1 call 0x3a296 ; 0x3a296 1c3e8: 88 23 and r24, r24 1c3ea: 29 f0 breq .+10 ; 0x1c3f6 { menu_setlang(i); 1c3ec: 8c 2f mov r24, r28 return; } MENU_END(); } 1c3ee: df 91 pop r29 1c3f0: 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); 1c3f2: 0c 94 96 e1 jmp 0x1c32c ; 0x1c32c 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 1c3f6: cf 5f subi r28, 0xFF ; 255 1c3f8: ee cf rjmp .-36 ; 0x1c3d6 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 1c3fa: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 1c3fe: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c402: 8f 5f subi r24, 0xFF ; 255 1c404: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c408: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c40c: 8f 5f subi r24, 0xFF ; 255 1c40e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c412: d1 cf rjmp .-94 ; 0x1c3b6 { menu_setlang(i); return; } MENU_END(); } 1c414: df 91 pop r29 1c416: cf 91 pop r28 1c418: 08 95 ret 0001c41a : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c41a: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c41e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c422: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c426: 84 30 cpi r24, 0x04 ; 4 1c428: 08 f0 brcs .+2 ; 0x1c42c 1c42a: 45 c0 rjmp .+138 ; 0x1c4b6 1c42c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1c430: 8a ec ldi r24, 0xCA ; 202 1c432: 94 e4 ldi r25, 0x44 ; 68 1c434: 0e 94 b3 72 call 0xe566 ; 0xe566 1c438: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 1c43c: 67 ec ldi r22, 0xC7 ; 199 1c43e: 73 ed ldi r23, 0xD3 ; 211 1c440: 89 e4 ldi r24, 0x49 ; 73 1c442: 9d e0 ldi r25, 0x0D ; 13 1c444: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 1c448: 62 ec ldi r22, 0xC2 ; 194 1c44a: 73 ed ldi r23, 0xD3 ; 211 1c44c: 84 e5 ldi r24, 0x54 ; 84 1c44e: 9d e0 ldi r25, 0x0D ; 13 1c450: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 1c454: 6d eb ldi r22, 0xBD ; 189 1c456: 73 ed ldi r23, 0xD3 ; 211 1c458: 8f e5 ldi r24, 0x5F ; 95 1c45a: 9d e0 ldi r25, 0x0D ; 13 1c45c: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 1c460: 68 eb ldi r22, 0xB8 ; 184 1c462: 73 ed ldi r23, 0xD3 ; 211 1c464: 8a e6 ldi r24, 0x6A ; 106 1c466: 9d e0 ldi r25, 0x0D ; 13 1c468: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 1c46c: 63 eb ldi r22, 0xB3 ; 179 1c46e: 73 ed ldi r23, 0xD3 ; 211 1c470: 85 e7 ldi r24, 0x75 ; 117 1c472: 9d e0 ldi r25, 0x0D ; 13 1c474: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 1c478: 6e ea ldi r22, 0xAE ; 174 1c47a: 73 ed ldi r23, 0xD3 ; 211 1c47c: 80 e8 ldi r24, 0x80 ; 128 1c47e: 9d e0 ldi r25, 0x0D ; 13 1c480: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 1c484: 69 ea ldi r22, 0xA9 ; 169 1c486: 73 ed ldi r23, 0xD3 ; 211 1c488: 8b e8 ldi r24, 0x8B ; 139 1c48a: 9d e0 ldi r25, 0x0D ; 13 1c48c: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 1c490: 64 ea ldi r22, 0xA4 ; 164 1c492: 73 ed ldi r23, 0xD3 ; 211 1c494: 86 e9 ldi r24, 0x96 ; 150 1c496: 9d e0 ldi r25, 0x0D ; 13 1c498: 0f 94 cb d3 call 0x3a796 ; 0x3a796 MENU_END(); 1c49c: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 1c4a0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c4a4: 8f 5f subi r24, 0xFF ; 255 1c4a6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c4aa: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c4ae: 8f 5f subi r24, 0xFF ; 255 1c4b0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c4b4: b6 cf rjmp .-148 ; 0x1c422 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(); } 1c4b6: 08 95 ret 0001c4b8 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c4b8: cf 92 push r12 1c4ba: df 92 push r13 1c4bc: ef 92 push r14 1c4be: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c4c0: 80 e0 ldi r24, 0x00 ; 0 1c4c2: 90 e0 ldi r25, 0x00 ; 0 1c4c4: a8 ec ldi r26, 0xC8 ; 200 1c4c6: b2 e4 ldi r27, 0x42 ; 66 1c4c8: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 1c4cc: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 1c4d0: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 1c4d4: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c4d8: 65 e5 ldi r22, 0x55 ; 85 1c4da: 75 e5 ldi r23, 0x55 ; 85 1c4dc: 85 e5 ldi r24, 0x55 ; 85 1c4de: 91 e4 ldi r25, 0x41 ; 65 1c4e0: 0f 94 50 c0 call 0x380a0 ; 0x380a0 delay_keep_alive(2000); 1c4e4: 80 ed ldi r24, 0xD0 ; 208 1c4e6: 97 e0 ldi r25, 0x07 ; 7 1c4e8: 0e 94 eb 8c call 0x119d6 ; 0x119d6 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c4ec: 8b e2 ldi r24, 0x2B ; 43 1c4ee: 9c e3 ldi r25, 0x3C ; 60 1c4f0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c4f4: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c4f8: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1c4fc: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1c500: 07 2e mov r0, r23 1c502: 00 0c add r0, r0 1c504: 88 0b sbc r24, r24 1c506: 99 0b sbc r25, r25 1c508: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1c50c: 9b 01 movw r18, r22 1c50e: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c510: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1c514: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1c518: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1c51c: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1c520: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1c524: 9f 77 andi r25, 0x7F ; 127 1c526: 20 e0 ldi r18, 0x00 ; 0 1c528: 30 e0 ldi r19, 0x00 ; 0 1c52a: 40 ea ldi r20, 0xA0 ; 160 1c52c: 50 e4 ldi r21, 0x40 ; 64 1c52e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1c532: 18 16 cp r1, r24 1c534: b4 f5 brge .+108 ; 0x1c5a2 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c536: 8b e2 ldi r24, 0x2B ; 43 1c538: 9c e3 ldi r25, 0x3C ; 60 1c53a: 0e 94 b3 72 call 0xe566 ; 0xe566 1c53e: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_set_cursor(0, 4); 1c542: 64 e0 ldi r22, 0x04 ; 4 1c544: 80 e0 ldi r24, 0x00 ; 0 1c546: 0e 94 e7 6e call 0xddce ; 0xddce 1c54a: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 1c54e: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 1c552: 07 2e mov r0, r23 1c554: 00 0c add r0, r0 1c556: 88 0b sbc r24, r24 1c558: 99 0b sbc r25, r25 1c55a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__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)); 1c55e: 20 e0 ldi r18, 0x00 ; 0 1c560: 30 e0 ldi r19, 0x00 ; 0 1c562: 40 e0 ldi r20, 0x00 ; 0 1c564: 5f e3 ldi r21, 0x3F ; 63 1c566: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1c56a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1c56e: 6b 01 movw r12, r22 1c570: 20 e0 ldi r18, 0x00 ; 0 1c572: 30 e0 ldi r19, 0x00 ; 0 1c574: 40 e0 ldi r20, 0x00 ; 0 1c576: 5f e3 ldi r21, 0x3F ; 63 1c578: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1c57c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1c580: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1c584: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1c588: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1c58c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1c590: a6 01 movw r20, r12 1c592: 82 e8 ldi r24, 0x82 ; 130 1c594: 0f 94 80 21 call 0x24300 ; 0x24300 delay_keep_alive(1000); 1c598: 88 ee ldi r24, 0xE8 ; 232 1c59a: 93 e0 ldi r25, 0x03 ; 3 1c59c: 0e 94 eb 8c call 0x119d6 ; 0x119d6 1c5a0: ab cf rjmp .-170 ; 0x1c4f8 } } 1c5a2: ff 90 pop r15 1c5a4: ef 90 pop r14 1c5a6: df 90 pop r13 1c5a8: cf 90 pop r12 1c5aa: 08 95 ret 0001c5ac : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1c5ac: cf 93 push r28 MENU_BEGIN(); 1c5ae: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1c5b2: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1c5b6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c5ba: 84 30 cpi r24, 0x04 ; 4 1c5bc: 08 f0 brcs .+2 ; 0x1c5c0 1c5be: 4a c0 rjmp .+148 ; 0x1c654 1c5c0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1c5c4: 0e 94 24 71 call 0xe248 ; 0xe248 1c5c8: 88 23 and r24, r24 1c5ca: 31 f0 breq .+12 ; 0x1c5d8 1c5cc: 86 e4 ldi r24, 0x46 ; 70 1c5ce: 98 e4 ldi r25, 0x48 ; 72 1c5d0: 0e 94 b3 72 call 0xe566 ; 0xe566 1c5d4: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1c5d8: 8e e6 ldi r24, 0x6E ; 110 1c5da: 95 e6 ldi r25, 0x65 ; 101 1c5dc: 0e 94 3a 71 call 0xe274 ; 0xe274 1c5e0: 0f 94 4b d1 call 0x3a296 ; 0x3a296 1c5e4: 88 23 and r24, r24 1c5e6: 21 f0 breq .+8 ; 0x1c5f0 { menu_setlang(0); 1c5e8: 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(); } 1c5ea: 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); 1c5ec: 0c 94 96 e1 jmp 0x1c32c ; 0x1c32c 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(); 1c5f0: 0e 94 f0 71 call 0xe3e0 ; 0xe3e0 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 1c5f4: 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 1c5f6: 82 30 cpi r24, 0x02 ; 2 1c5f8: 51 f4 brne .+20 ; 0x1c60e 1c5fa: 0e 94 11 71 call 0xe222 ; 0xe222 { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 1c5fe: 0e 94 3a 71 call 0xe274 ; 0xe274 1c602: 0f 94 4b d1 call 0x3a296 ; 0x3a296 1c606: 88 23 and r24, r24 1c608: 81 f0 breq .+32 ; 0x1c62a { menu_setlang(1); 1c60a: 81 e0 ldi r24, 0x01 ; 1 1c60c: ee cf rjmp .-36 ; 0x1c5ea 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)))) 1c60e: 8c 2f mov r24, r28 1c610: 0e 94 a1 71 call 0xe342 ; 0xe342 1c614: 0e 94 3a 71 call 0xe274 ; 0xe274 1c618: 0f 94 4b d1 call 0x3a296 ; 0x3a296 1c61c: 88 23 and r24, r24 1c61e: 11 f0 breq .+4 ; 0x1c624 { menu_setlang(i); 1c620: 8c 2f mov r24, r28 1c622: e3 cf rjmp .-58 ; 0x1c5ea 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 1c624: cf 5f subi r28, 0xFF ; 255 1c626: c8 30 cpi r28, 0x08 ; 8 1c628: 91 f7 brne .-28 ; 0x1c60e return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 1c62a: 8b e4 ldi r24, 0x4B ; 75 1c62c: 9b e3 ldi r25, 0x3B ; 59 1c62e: 0e 94 b3 72 call 0xe566 ; 0xe566 1c632: 65 ed ldi r22, 0xD5 ; 213 1c634: 71 ee ldi r23, 0xE1 ; 225 1c636: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1c63a: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1c63e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c642: 8f 5f subi r24, 0xFF ; 255 1c644: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1c648: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1c64c: 8f 5f subi r24, 0xFF ; 255 1c64e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1c652: b1 cf rjmp .-158 ; 0x1c5b6 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c654: cf 91 pop r28 1c656: 08 95 ret 0001c658 : 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()") { 1c658: cf 93 push r28 1c65a: 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); 1c65e: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 1c660: 46 e7 ldi r20, 0x76 ; 118 1c662: 5a e6 ldi r21, 0x6A ; 106 1c664: 60 e0 ldi r22, 0x00 ; 0 1c666: 80 e0 ldi r24, 0x00 ; 0 1c668: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(LCD_WIDTH - 14, 0); 1c66c: 60 e0 ldi r22, 0x00 ; 0 1c66e: 86 e0 ldi r24, 0x06 ; 6 1c670: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print_state(pinda_state); 1c674: c4 fb bst r28, 4 1c676: 88 27 eor r24, r24 1c678: 80 f9 bld r24, 0 1c67a: 0f 94 91 1f call 0x23f22 ; 0x23f22 if (MMU2::mmu2.Enabled()) { 1c67e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1c682: 81 30 cpi r24, 0x01 ; 1 1c684: 99 f4 brne .+38 ; 0x1c6ac inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 1c686: c1 e0 ldi r28, 0x01 ; 1 1c688: 80 91 90 13 lds r24, 0x1390 ; 0x801390 1c68c: 81 11 cpse r24, r1 1c68e: 01 c0 rjmp .+2 ; 0x1c692 1c690: 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 1c692: 40 e7 ldi r20, 0x70 ; 112 1c694: 5a e6 ldi r21, 0x6A ; 106 1c696: 60 e0 ldi r22, 0x00 ; 0 1c698: 8a e0 ldi r24, 0x0A ; 10 1c69a: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(LCD_WIDTH - 3, 0); 1c69e: 60 e0 ldi r22, 0x00 ; 0 1c6a0: 81 e1 ldi r24, 0x11 ; 17 1c6a2: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print_state(finda_state); 1c6a6: 8c 2f mov r24, r28 1c6a8: 0f 94 91 1f call 0x23f22 ; 0x23f22 1c6ac: c1 e0 ldi r28, 0x01 ; 1 1c6ae: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1c6b2: 81 11 cpse r24, r1 1c6b4: 01 c0 rjmp .+2 ; 0x1c6b8 1c6b6: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 1c6b8: 87 ea ldi r24, 0xA7 ; 167 1c6ba: 97 e4 ldi r25, 0x47 ; 71 1c6bc: 0e 94 b3 72 call 0xe566 ; 0xe566 1c6c0: ac 01 movw r20, r24 1c6c2: 61 e0 ldi r22, 0x01 ; 1 1c6c4: 80 e0 ldi r24, 0x00 ; 0 1c6c6: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(LCD_WIDTH - 3, 1); 1c6ca: 61 e0 ldi r22, 0x01 ; 1 1c6cc: 81 e1 ldi r24, 0x11 ; 17 1c6ce: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print_state(idler_state); 1c6d2: 8c 2f mov r24, r28 1c6d4: 0f 94 91 1f call 0x23f22 ; 0x23f22 // 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); 1c6d8: 62 e0 ldi r22, 0x02 ; 2 1c6da: 80 e0 ldi r24, 0x00 ; 0 1c6dc: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(_N("B: %3d Xd:%6d\n" 1c6e0: 80 91 90 0e lds r24, 0x0E90 ; 0x800e90 1c6e4: 8f 93 push r24 1c6e6: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 1c6ea: 8f 93 push r24 1c6ec: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 1c6f0: 1f 92 push r1 1c6f2: 8f 93 push r24 1c6f4: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1c6f8: 8f 93 push r24 1c6fa: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1c6fe: 8f 93 push r24 1c700: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 1c704: 1f 92 push r1 1c706: 8f 93 push r24 1c708: 8c e4 ldi r24, 0x4C ; 76 1c70a: 9a e6 ldi r25, 0x6A ; 106 1c70c: 9f 93 push r25 1c70e: 8f 93 push r24 1c710: 0e 94 c0 6e call 0xdd80 ; 0xdd80 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(); 1c714: 8d b7 in r24, 0x3d ; 61 1c716: 9e b7 in r25, 0x3e ; 62 1c718: 0a 96 adiw r24, 0x0a ; 10 1c71a: 0f b6 in r0, 0x3f ; 63 1c71c: f8 94 cli 1c71e: 9e bf out 0x3e, r25 ; 62 1c720: 0f be out 0x3f, r0 ; 63 1c722: 8d bf out 0x3d, r24 ; 61 } 1c724: 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(); 1c726: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 0001c72a : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1c72a: 1f 93 push r17 1c72c: cf 93 push r28 1c72e: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1c730: e1 e0 ldi r30, 0x01 ; 1 1c732: f1 e0 ldi r31, 0x01 ; 1 1c734: 80 81 ld r24, Z 1c736: 8e 7f andi r24, 0xFE ; 254 1c738: 80 83 st Z, r24 PORTH |= 0x01; 1c73a: e2 e0 ldi r30, 0x02 ; 2 1c73c: f1 e0 ldi r31, 0x01 ; 1 1c73e: 80 81 ld r24, Z 1c740: 81 60 ori r24, 0x01 ; 1 1c742: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1c744: ea e3 ldi r30, 0x3A ; 58 1c746: f5 e0 ldi r31, 0x05 ; 5 1c748: 90 e1 ldi r25, 0x10 ; 16 1c74a: 90 83 st Z, r25 ptr[1] = 0; 1c74c: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1c74e: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1c750: e0 ed ldi r30, 0xD0 ; 208 1c752: f0 e0 ldi r31, 0x00 ; 0 1c754: 80 81 ld r24, Z 1c756: 82 60 ori r24, 0x02 ; 2 1c758: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1c75a: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1c75e: e1 ed ldi r30, 0xD1 ; 209 1c760: f0 e0 ldi r31, 0x00 ; 0 1c762: 88 e1 ldi r24, 0x18 ; 24 1c764: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1c766: 80 81 ld r24, Z 1c768: 80 68 ori r24, 0x80 ; 128 1c76a: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1c76c: e4 e9 ldi r30, 0x94 ; 148 1c76e: f2 e1 ldi r31, 0x12 ; 18 1c770: 8a eb ldi r24, 0xBA ; 186 1c772: 9a e3 ldi r25, 0x3A ; 58 1c774: 91 87 std Z+9, r25 ; 0x09 1c776: 80 87 std Z+8, r24 ; 0x08 1c778: 8c ec ldi r24, 0xCC ; 204 1c77a: 9a e3 ldi r25, 0x3A ; 58 1c77c: 93 87 std Z+11, r25 ; 0x0b 1c77e: 82 87 std Z+10, r24 ; 0x0a 1c780: 13 e0 ldi r17, 0x03 ; 3 1c782: 13 83 std Z+3, r17 ; 0x03 1c784: 15 86 std Z+13, r1 ; 0x0d 1c786: 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); 1c788: 9f b7 in r25, 0x3f ; 63 1c78a: f8 94 cli 1c78c: e5 e0 ldi r30, 0x05 ; 5 1c78e: f1 e0 ldi r31, 0x01 ; 1 1c790: 80 81 ld r24, Z 1c792: 80 62 ori r24, 0x20 ; 32 1c794: 80 83 st Z, r24 1c796: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1c798: e4 e0 ldi r30, 0x04 ; 4 1c79a: f1 e0 ldi r31, 0x01 ; 1 1c79c: 80 81 ld r24, Z 1c79e: 80 62 ori r24, 0x20 ; 32 1c7a0: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1c7a2: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1c7a6: 83 e6 ldi r24, 0x63 ; 99 1c7a8: 0f 94 0a 88 call 0x31014 ; 0x31014 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1c7ac: 89 e9 ldi r24, 0x99 ; 153 1c7ae: 97 ea ldi r25, 0xA7 ; 167 1c7b0: 0e 94 82 79 call 0xf304 ; 0xf304 retryAttempts = MAX_RETRIES; 1c7b4: cb e4 ldi r28, 0x4B ; 75 1c7b6: d3 e1 ldi r29, 0x13 ; 19 1c7b8: 10 93 9f 13 sts 0x139F, r17 ; 0x80139f } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1c7bc: 83 e7 ldi r24, 0x73 ; 115 1c7be: 9b ea ldi r25, 0xAB ; 171 1c7c0: 0e 94 82 79 call 0xf304 ; 0xf304 /// @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; } 1c7c4: 8a e0 ldi r24, 0x0A ; 10 1c7c6: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1c7c8: 82 e0 ldi r24, 0x02 ; 2 1c7ca: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1c7ce: 81 e0 ldi r24, 0x01 ; 1 1c7d0: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1c7d2: 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; 1c7d4: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1c7d6: 86 e0 ldi r24, 0x06 ; 6 1c7d8: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1c7da: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1c7dc: df 91 pop r29 1c7de: cf 91 pop r28 1c7e0: 1f 91 pop r17 1c7e2: 0d 94 83 a5 jmp 0x34b06 ; 0x34b06 0001c7e6 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 1c7e6: 8c ea ldi r24, 0xAC ; 172 1c7e8: 9c e0 ldi r25, 0x0C ; 12 1c7ea: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (current_state) 1c7ee: 88 23 and r24, r24 1c7f0: 61 f0 breq .+24 ; 0x1c80a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1c7f2: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 1c7f6: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 1c7fa: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 1c7fe: 8c ea ldi r24, 0xAC ; 172 1c800: 9c e0 ldi r25, 0x0C ; 12 1c802: 0e 94 3b 76 call 0xec76 ; 0xec76 MMU2::mmu2.Status(); 1c806: 0d 94 ea 74 jmp 0x2e9d4 ; 0x2e9d4 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 1c80a: 0e 94 95 e3 call 0x1c72a ; 0x1c72a 1c80e: f7 cf rjmp .-18 ; 0x1c7fe 0001c810 : //! //! @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) 1c810: 4f 92 push r4 1c812: 5f 92 push r5 1c814: 6f 92 push r6 1c816: 7f 92 push r7 1c818: 8f 92 push r8 1c81a: 9f 92 push r9 1c81c: af 92 push r10 1c81e: bf 92 push r11 1c820: cf 92 push r12 1c822: df 92 push r13 1c824: ef 92 push r14 1c826: ff 92 push r15 1c828: 0f 93 push r16 1c82a: 1f 93 push r17 1c82c: cf 93 push r28 1c82e: df 93 push r29 1c830: 6c 01 movw r12, r24 1c832: 7b 01 movw r14, r22 1c834: 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); 1c838: 67 2b or r22, r23 1c83a: 29 f0 breq .+10 ; 0x1c846 1c83c: 06 e0 ldi r16, 0x06 ; 6 1c83e: 81 30 cpi r24, 0x01 ; 1 1c840: 29 f0 breq .+10 ; 0x1c84c 1c842: 05 e0 ldi r16, 0x05 ; 5 1c844: 03 c0 rjmp .+6 ; 0x1c84c 1c846: 04 e0 ldi r16, 0x04 ; 4 1c848: 81 30 cpi r24, 0x01 ; 1 1c84a: d9 f3 breq .-10 ; 0x1c842 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1c84c: 0e 94 1a 6f call 0xde34 ; 0xde34 KEEPALIVE_STATE(PAUSED_FOR_USER); 1c850: 84 e0 ldi r24, 0x04 ; 4 1c852: 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; 1c856: 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; 1c858: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1c85a: 03 50 subi r16, 0x03 ; 3 1c85c: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1c85e: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 1c862: 81 e0 ldi r24, 0x01 ; 1 1c864: 0e 94 b6 8a call 0x1156c ; 0x1156c if (lcd_encoder) 1c868: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1c86c: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1c870: 00 97 sbiw r24, 0x00 ; 0 1c872: 09 f4 brne .+2 ; 0x1c876 1c874: 9d c0 rjmp .+314 ; 0x1c9b0 { if (lcd_encoder < 0) 1c876: 97 ff sbrs r25, 7 1c878: 88 c0 rjmp .+272 ; 0x1c98a { cursor_pos--; 1c87a: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1c87c: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1c880: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } if (cursor_pos > 3) 1c884: c4 30 cpi r28, 0x04 ; 4 1c886: 0c f4 brge .+2 ; 0x1c88a 1c888: 86 c0 rjmp .+268 ; 0x1c996 { cursor_pos = 3; if (first < items_no - 3) 1c88a: 88 2d mov r24, r8 1c88c: 08 2c mov r0, r8 1c88e: 00 0c add r0, r0 1c890: 99 0b sbc r25, r25 1c892: 80 17 cp r24, r16 1c894: 91 07 cpc r25, r17 1c896: 0c f0 brlt .+2 ; 0x1c89a 1c898: 7a c0 rjmp .+244 ; 0x1c98e { first++; 1c89a: 83 94 inc r8 lcd_clear(); 1c89c: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1c8a0: 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); 1c8a2: c1 14 cp r12, r1 1c8a4: d1 04 cpc r13, r1 1c8a6: 29 f0 breq .+10 ; 0x1c8b2 1c8a8: a6 01 movw r20, r12 1c8aa: 60 e0 ldi r22, 0x00 ; 0 1c8ac: 80 e0 ldi r24, 0x00 ; 0 1c8ae: 0e 94 fb 6e call 0xddf6 ; 0xddf6 const bool last_visible = (first == items_no - 3); 1c8b2: a8 2c mov r10, r8 1c8b4: 08 2c mov r0, r8 1c8b6: 00 0c add r0, r0 1c8b8: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1c8ba: e1 14 cp r14, r1 1c8bc: f1 04 cpc r15, r1 1c8be: 29 f0 breq .+10 ; 0x1c8ca 1c8c0: 82 e0 ldi r24, 0x02 ; 2 1c8c2: 98 2e mov r9, r24 1c8c4: a0 16 cp r10, r16 1c8c6: b1 06 cpc r11, r17 1c8c8: 11 f0 breq .+4 ; 0x1c8ce 1c8ca: 93 e0 ldi r25, 0x03 ; 3 1c8cc: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1c8ce: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1c8d0: df 5f subi r29, 0xFF ; 255 1c8d2: 4e eb ldi r20, 0xBE ; 190 1c8d4: 5d e6 ldi r21, 0x6D ; 109 1c8d6: 6d 2f mov r22, r29 1c8d8: 81 e0 ldi r24, 0x01 ; 1 1c8da: 0e 94 fb 6e call 0xddf6 ; 0xddf6 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++) 1c8de: 9d 12 cpse r9, r29 1c8e0: f7 cf rjmp .-18 ; 0x1c8d0 1c8e2: 48 2c mov r4, r8 1c8e4: 08 2c mov r0, r8 1c8e6: 00 0c add r0, r0 1c8e8: 55 08 sbc r5, r5 1c8ea: 66 08 sbc r6, r6 1c8ec: 77 08 sbc r7, r7 1c8ee: 8f ef ldi r24, 0xFF ; 255 1c8f0: 48 1a sub r4, r24 1c8f2: 58 0a sbc r5, r24 1c8f4: 68 0a sbc r6, r24 1c8f6: 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++) 1c8f8: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1c8fa: 93 94 inc r9 1c8fc: 69 2d mov r22, r9 1c8fe: 8a e0 ldi r24, 0x0A ; 10 1c900: 0e 94 e7 6e call 0xddce ; 0xddce 1c904: c3 01 movw r24, r6 1c906: b2 01 movw r22, r4 1c908: 0e 94 a0 70 call 0xe140 ; 0xe140 1c90c: 8f ef ldi r24, 0xFF ; 255 1c90e: 48 1a sub r4, r24 1c910: 58 0a sbc r5, r24 1c912: 68 0a sbc r6, r24 1c914: 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++) 1c916: d9 11 cpse r29, r9 1c918: f0 cf rjmp .-32 ; 0x1c8fa { 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); 1c91a: e1 14 cp r14, r1 1c91c: f1 04 cpc r15, r1 1c91e: 41 f0 breq .+16 ; 0x1c930 1c920: a0 16 cp r10, r16 1c922: b1 06 cpc r11, r17 1c924: 29 f4 brne .+10 ; 0x1c930 1c926: a7 01 movw r20, r14 1c928: 63 e0 ldi r22, 0x03 ; 3 1c92a: 81 e0 ldi r24, 0x01 ; 1 1c92c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1c930: 4e ef ldi r20, 0xFE ; 254 1c932: 5e e8 ldi r21, 0x8E ; 142 1c934: 61 e0 ldi r22, 0x01 ; 1 1c936: 80 e0 ldi r24, 0x00 ; 0 1c938: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc_at(0, cursor_pos, '>'); 1c93c: 4e e3 ldi r20, 0x3E ; 62 1c93e: 6c 2f mov r22, r28 1c940: 80 e0 ldi r24, 0x00 ; 0 1c942: 0e 94 07 6f call 0xde0e ; 0xde0e _delay(100); 1c946: 64 e6 ldi r22, 0x64 ; 100 1c948: 70 e0 ldi r23, 0x00 ; 0 1c94a: 80 e0 ldi r24, 0x00 ; 0 1c94c: 90 e0 ldi r25, 0x00 ; 0 1c94e: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 if (lcd_clicked()) 1c952: 0e 94 04 71 call 0xe208 ; 0xe208 1c956: 88 23 and r24, r24 1c958: 09 f4 brne .+2 ; 0x1c95c 1c95a: 81 cf rjmp .-254 ; 0x1c85e { KEEPALIVE_STATE(IN_HANDLER); 1c95c: 82 e0 ldi r24, 0x02 ; 2 1c95e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(cursor_pos + first - 1); 1c962: 8f ef ldi r24, 0xFF ; 255 1c964: 8c 0f add r24, r28 1c966: 88 0d add r24, r8 } } } 1c968: df 91 pop r29 1c96a: cf 91 pop r28 1c96c: 1f 91 pop r17 1c96e: 0f 91 pop r16 1c970: ff 90 pop r15 1c972: ef 90 pop r14 1c974: df 90 pop r13 1c976: cf 90 pop r12 1c978: bf 90 pop r11 1c97a: af 90 pop r10 1c97c: 9f 90 pop r9 1c97e: 8f 90 pop r8 1c980: 7f 90 pop r7 1c982: 6f 90 pop r6 1c984: 5f 90 pop r5 1c986: 4f 90 pop r4 1c988: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1c98a: cf 5f subi r28, 0xFF ; 255 1c98c: 77 cf rjmp .-274 ; 0x1c87c 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); 1c98e: 87 e0 ldi r24, 0x07 ; 7 1c990: 0f 94 0e 4e call 0x29c1c ; 0x29c1c 1c994: 85 cf rjmp .-246 ; 0x1c8a0 } } if (cursor_pos < 1) 1c996: c1 11 cpse r28, r1 1c998: 84 cf rjmp .-248 ; 0x1c8a2 { cursor_pos = 1; if (first > 0) 1c99a: 18 14 cp r1, r8 1c99c: 2c f4 brge .+10 ; 0x1c9a8 { first--; 1c99e: 8a 94 dec r8 lcd_clear(); 1c9a0: 0e 94 1a 6f call 0xde34 ; 0xde34 } } if (cursor_pos < 1) { cursor_pos = 1; 1c9a4: c1 e0 ldi r28, 0x01 ; 1 1c9a6: 7d cf rjmp .-262 ; 0x1c8a2 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1c9a8: 87 e0 ldi r24, 0x07 ; 7 1c9aa: 0f 94 0e 4e call 0x29c1c ; 0x29c1c 1c9ae: fa cf rjmp .-12 ; 0x1c9a4 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1c9b0: c4 30 cpi r28, 0x04 ; 4 1c9b2: 0c f0 brlt .+2 ; 0x1c9b6 1c9b4: 6a cf rjmp .-300 ; 0x1c88a 1c9b6: 75 cf rjmp .-278 ; 0x1c8a2 0001c9b8 : 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() { 1c9b8: cf 93 push r28 1c9ba: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1c9bc: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1c9c0: 81 30 cpi r24, 0x01 ; 1 1c9c2: f9 f4 brne .+62 ; 0x1ca02 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 1c9c4: 80 ec ldi r24, 0xC0 ; 192 1c9c6: 9b e3 ldi r25, 0x3B ; 59 1c9c8: 0e 94 b3 72 call 0xe566 ; 0xe566 1c9cc: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 1c9ce: 8d ea ldi r24, 0xAD ; 173 1c9d0: 9b e3 ldi r25, 0x3B ; 59 1c9d2: 0e 94 b3 72 call 0xe566 ; 0xe566 1c9d6: be 01 movw r22, r28 1c9d8: 6f 5f subi r22, 0xFF ; 255 1c9da: 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 1c9dc: 0e 94 08 e4 call 0x1c810 ; 0x1c810 if (filament < MMU_FILAMENT_COUNT) { 1c9e0: 85 30 cpi r24, 0x05 ; 5 1c9e2: 98 f5 brcc .+102 ; 0x1ca4a lay1cal_filament = filament; 1c9e4: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1c9e8: 8a e0 ldi r24, 0x0A ; 10 1c9ea: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 menu_goto(lcd_generic_preheat_menu, 0, true); 1c9ee: 20 e0 ldi r18, 0x00 ; 0 1c9f0: 41 e0 ldi r20, 0x01 ; 1 1c9f2: 70 e0 ldi r23, 0x00 ; 0 1c9f4: 60 e0 ldi r22, 0x00 ; 0 1c9f6: 8a e7 ldi r24, 0x7A ; 122 1c9f8: 99 e3 ldi r25, 0x39 ; 57 } 1c9fa: df 91 pop r29 1c9fc: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1c9fe: 0d 94 c7 d1 jmp 0x3a38e ; 0x3a38e menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1ca02: 8f e5 ldi r24, 0x5F ; 95 1ca04: 9f e0 ldi r25, 0x0F ; 15 1ca06: 0f 94 23 dc call 0x3b846 ; 0x3b846 1ca0a: 81 11 cpse r24, r1 1ca0c: ed cf rjmp .-38 ; 0x1c9e8 { bool loaded = false; if (fsensor.isReady()) { 1ca0e: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ca12: 82 30 cpi r24, 0x02 ; 2 1ca14: f1 f4 brne .+60 ; 0x1ca52 1ca16: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ca1a: 81 11 cpse r24, r1 1ca1c: e5 cf rjmp .-54 ; 0x1c9e8 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)); 1ca1e: 8f e8 ldi r24, 0x8F ; 143 1ca20: 9b e3 ldi r25, 0x3B ; 59 1ca22: 0e 94 b3 72 call 0xe566 ; 0xe566 1ca26: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_consume_click(); 1ca2a: 0e 94 ff 70 call 0xe1fe ; 0xe1fe 1ca2e: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1ca30: 84 e6 ldi r24, 0x64 ; 100 1ca32: 90 e0 ldi r25, 0x00 ; 0 1ca34: 0e 94 eb 8c call 0x119d6 ; 0x119d6 if (lcd_clicked()) { 1ca38: 0e 94 04 71 call 0xe208 ; 0xe208 1ca3c: 81 11 cpse r24, r1 1ca3e: 02 c0 rjmp .+4 ; 0x1ca44 1ca40: 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 1ca42: b1 f7 brne .-20 ; 0x1ca30 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1ca44: 81 e0 ldi r24, 0x01 ; 1 1ca46: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1ca4a: df 91 pop r29 1ca4c: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1ca4e: 0d 94 65 d4 jmp 0x3a8ca ; 0x3a8ca { 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); 1ca52: 86 ec ldi r24, 0xC6 ; 198 1ca54: 90 e4 ldi r25, 0x40 ; 64 1ca56: 0e 94 b3 72 call 0xe566 ; 0xe566 1ca5a: 41 e0 ldi r20, 0x01 ; 1 1ca5c: 60 e0 ldi r22, 0x00 ; 0 1ca5e: 0f 94 47 4f call 0x29e8e ; 0x29e8e 1ca62: 91 e0 ldi r25, 0x01 ; 1 1ca64: 81 11 cpse r24, r1 1ca66: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1ca68: 81 e0 ldi r24, 0x01 ; 1 1ca6a: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } if (!loaded) { 1ca6e: 91 11 cpse r25, r1 1ca70: bb cf rjmp .-138 ; 0x1c9e8 1ca72: d5 cf rjmp .-86 ; 0x1ca1e 0001ca74 : { 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) 1ca74: 2f 92 push r2 1ca76: 3f 92 push r3 1ca78: 4f 92 push r4 1ca7a: 5f 92 push r5 1ca7c: 6f 92 push r6 1ca7e: 7f 92 push r7 1ca80: 8f 92 push r8 1ca82: 9f 92 push r9 1ca84: af 92 push r10 1ca86: bf 92 push r11 1ca88: cf 92 push r12 1ca8a: df 92 push r13 1ca8c: ef 92 push r14 1ca8e: ff 92 push r15 1ca90: 0f 93 push r16 1ca92: 1f 93 push r17 1ca94: cf 93 push r28 1ca96: df 93 push r29 1ca98: 00 d0 rcall .+0 ; 0x1ca9a 1ca9a: 00 d0 rcall .+0 ; 0x1ca9c 1ca9c: 1f 92 push r1 1ca9e: cd b7 in r28, 0x3d ; 61 1caa0: de b7 in r29, 0x3e ; 62 1caa2: 69 83 std Y+1, r22 ; 0x01 1caa4: 49 01 movw r8, r18 1caa6: 5a 01 movw r10, r20 1caa8: 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; 1caaa: 68 2f mov r22, r24 1caac: 70 e0 ldi r23, 0x00 ; 0 1caae: 90 e0 ldi r25, 0x00 ; 0 1cab0: 80 e0 ldi r24, 0x00 ; 0 1cab2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1cab6: 24 e0 ldi r18, 0x04 ; 4 1cab8: 32 e0 ldi r19, 0x02 ; 2 1caba: 41 e0 ldi r20, 0x01 ; 1 1cabc: 5c e3 ldi r21, 0x3C ; 60 1cabe: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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] 1cac2: 20 91 da 12 lds r18, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 1cac6: 30 91 db 12 lds r19, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 1caca: 40 91 dc 12 lds r20, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 1cace: 50 91 dd 12 lds r21, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 1cad2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cad6: 6b 01 movw r12, r22 1cad8: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1cada: 20 91 de 12 lds r18, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 1cade: 30 91 df 12 lds r19, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 1cae2: 40 91 e0 12 lds r20, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 1cae6: 50 91 e1 12 lds r21, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 1caea: c5 01 movw r24, r10 1caec: b4 01 movw r22, r8 1caee: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1caf2: 20 91 e2 12 lds r18, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 1caf6: 30 91 e3 12 lds r19, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 1cafa: 40 91 e4 12 lds r20, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 1cafe: 50 91 e5 12 lds r21, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 1cb02: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1cb06: a7 01 movw r20, r14 1cb08: 96 01 movw r18, r12 1cb0a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cb0e: 6b 01 movw r12, r22 1cb10: 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; 1cb12: 20 91 30 13 lds r18, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 1cb16: 30 91 31 13 lds r19, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 1cb1a: 40 91 32 13 lds r20, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 1cb1e: 50 91 33 13 lds r21, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 1cb22: c8 01 movw r24, r16 1cb24: b2 01 movw r22, r4 1cb26: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1cb2a: 9b 01 movw r18, r22 1cb2c: 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 1cb2e: c5 01 movw r24, r10 1cb30: b4 01 movw r22, r8 1cb32: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__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) 1cb36: 39 81 ldd r19, Y+1 ; 0x01 1cb38: 24 e0 ldi r18, 0x04 ; 4 1cb3a: 32 9f mul r19, r18 1cb3c: f0 01 movw r30, r0 1cb3e: 11 24 eor r1, r1 1cb40: e0 51 subi r30, 0x10 ; 16 1cb42: 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 1cb44: 20 81 ld r18, Z 1cb46: 31 81 ldd r19, Z+1 ; 0x01 1cb48: 42 81 ldd r20, Z+2 ; 0x02 1cb4a: 53 81 ldd r21, Z+3 ; 0x03 1cb4c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1cb50: 9b 01 movw r18, r22 1cb52: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1cb54: c7 01 movw r24, r14 1cb56: b6 01 movw r22, r12 1cb58: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cb5c: 20 91 3d 13 lds r18, 0x133D ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 1cb60: 30 91 3e 13 lds r19, 0x133E ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 1cb64: 40 91 3f 13 lds r20, 0x133F ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 1cb68: 50 91 40 13 lds r21, 0x1340 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> 1cb6c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cb70: 6f 83 std Y+7, r22 ; 0x07 1cb72: 79 83 std Y+1, r23 ; 0x01 1cb74: 18 2f mov r17, r24 1cb76: 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); 1cb78: 20 91 d1 12 lds r18, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> 1cb7c: e2 2f mov r30, r18 1cb7e: f0 e0 ldi r31, 0x00 ; 0 1cb80: 80 91 d0 12 lds r24, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 1cb84: 81 50 subi r24, 0x01 ; 1 1cb86: 99 0b sbc r25, r25 1cb88: e8 17 cp r30, r24 1cb8a: f9 07 cpc r31, r25 1cb8c: 09 f4 brne .+2 ; 0x1cb90 1cb8e: f4 c0 rjmp .+488 ; 0x1cd78 1cb90: 2f 5f subi r18, 0xFF ; 255 1cb92: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1cb94: 5e 81 ldd r21, Y+6 ; 0x06 1cb96: 44 e0 ldi r20, 0x04 ; 4 1cb98: 54 9f mul r21, r20 1cb9a: 10 01 movw r2, r0 1cb9c: 11 24 eor r1, r1 1cb9e: d1 01 movw r26, r2 1cba0: a0 55 subi r26, 0x50 ; 80 1cba2: bd 4e sbci r27, 0xED ; 237 1cba4: 2d 91 ld r18, X+ 1cba6: 3d 91 ld r19, X+ 1cba8: 4d 91 ld r20, X+ 1cbaa: 5c 91 ld r21, X 1cbac: 2a 83 std Y+2, r18 ; 0x02 1cbae: 3b 83 std Y+3, r19 ; 0x03 1cbb0: 4c 83 std Y+4, r20 ; 0x04 1cbb2: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1cbb4: ee 0f add r30, r30 1cbb6: ff 1f adc r31, r31 1cbb8: ee 0f add r30, r30 1cbba: ff 1f adc r31, r31 1cbbc: e0 55 subi r30, 0x50 ; 80 1cbbe: fd 4e sbci r31, 0xED ; 237 1cbc0: 40 80 ld r4, Z 1cbc2: 51 80 ldd r5, Z+1 ; 0x01 1cbc4: 62 80 ldd r6, Z+2 ; 0x02 1cbc6: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1cbc8: c0 90 ea 12 lds r12, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 1cbcc: d0 90 eb 12 lds r13, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 1cbd0: e0 90 ec 12 lds r14, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 1cbd4: 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; 1cbd8: 92 01 movw r18, r4 1cbda: a3 01 movw r20, r6 1cbdc: b2 01 movw r22, r4 1cbde: c3 01 movw r24, r6 1cbe0: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1cbe4: 88 23 and r24, r24 1cbe6: 21 f0 breq .+8 ; 0x1cbf0 1cbe8: 4f 80 ldd r4, Y+7 ; 0x07 1cbea: 59 80 ldd r5, Y+1 ; 0x01 1cbec: 61 2e mov r6, r17 1cbee: 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; 1cbf0: a1 01 movw r20, r2 1cbf2: 40 55 subi r20, 0x50 ; 80 1cbf4: 5d 4e sbci r21, 0xED ; 237 1cbf6: 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); 1cbf8: a7 01 movw r20, r14 1cbfa: 96 01 movw r18, r12 1cbfc: 60 e0 ldi r22, 0x00 ; 0 1cbfe: 70 e0 ldi r23, 0x00 ; 0 1cc00: 80 e8 ldi r24, 0x80 ; 128 1cc02: 9f e3 ldi r25, 0x3F ; 63 1cc04: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cc08: 92 01 movw r18, r4 1cc0a: a3 01 movw r20, r6 1cc0c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cc10: 2b 01 movw r4, r22 1cc12: 3c 01 movw r6, r24 1cc14: a7 01 movw r20, r14 1cc16: 96 01 movw r18, r12 1cc18: 6f 81 ldd r22, Y+7 ; 0x07 1cc1a: 79 81 ldd r23, Y+1 ; 0x01 1cc1c: 81 2f mov r24, r17 1cc1e: 90 2f mov r25, r16 1cc20: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cc24: 9b 01 movw r18, r22 1cc26: ac 01 movw r20, r24 1cc28: c3 01 movw r24, r6 1cc2a: b2 01 movw r22, r4 1cc2c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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; 1cc30: f1 01 movw r30, r2 1cc32: 60 83 st Z, r22 1cc34: 71 83 std Z+1, r23 ; 0x01 1cc36: 82 83 std Z+2, r24 ; 0x02 1cc38: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1cc3a: fe 81 ldd r31, Y+6 ; 0x06 1cc3c: 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; 1cc40: 20 91 d6 12 lds r18, 0x12D6 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 1cc44: 30 91 d7 12 lds r19, 0x12D7 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 1cc48: 40 91 d8 12 lds r20, 0x12D8 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 1cc4c: 50 91 d9 12 lds r21, 0x12D9 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> 1cc50: c5 01 movw r24, r10 1cc52: b4 01 movw r22, r8 1cc54: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cc58: 2a 81 ldd r18, Y+2 ; 0x02 1cc5a: 3b 81 ldd r19, Y+3 ; 0x03 1cc5c: 4c 81 ldd r20, Y+4 ; 0x04 1cc5e: 5d 81 ldd r21, Y+5 ; 0x05 1cc60: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cc64: 2b 01 movw r4, r22 1cc66: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1cc68: c0 90 d2 12 lds r12, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 1cc6c: d0 90 d3 12 lds r13, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 1cc70: e0 90 d4 12 lds r14, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 1cc74: 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; 1cc78: a7 01 movw r20, r14 1cc7a: 96 01 movw r18, r12 1cc7c: c7 01 movw r24, r14 1cc7e: b6 01 movw r22, r12 1cc80: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 1cc84: 88 23 and r24, r24 1cc86: 19 f0 breq .+6 ; 0x1cc8e 1cc88: c1 2c mov r12, r1 1cc8a: d1 2c mov r13, r1 1cc8c: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1cc8e: 23 e3 ldi r18, 0x33 ; 51 1cc90: 33 e3 ldi r19, 0x33 ; 51 1cc92: 43 e7 ldi r20, 0x73 ; 115 1cc94: 5f e3 ldi r21, 0x3F ; 63 1cc96: c7 01 movw r24, r14 1cc98: b6 01 movw r22, r12 1cc9a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cc9e: 6b 01 movw r12, r22 1cca0: 7c 01 movw r14, r24 1cca2: 2d ec ldi r18, 0xCD ; 205 1cca4: 3c ec ldi r19, 0xCC ; 204 1cca6: 4c e4 ldi r20, 0x4C ; 76 1cca8: 5d e3 ldi r21, 0x3D ; 61 1ccaa: c3 01 movw r24, r6 1ccac: b2 01 movw r22, r4 1ccae: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1ccb2: 9b 01 movw r18, r22 1ccb4: ac 01 movw r20, r24 1ccb6: c7 01 movw r24, r14 1ccb8: b6 01 movw r22, r12 1ccba: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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; 1ccbe: 80 92 d6 12 sts 0x12D6, r8 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 1ccc2: 90 92 d7 12 sts 0x12D7, r9 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 1ccc6: a0 92 d8 12 sts 0x12D8, r10 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 1ccca: b0 92 d9 12 sts 0x12D9, r11 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> dT_err_prev = dT_err_f; 1ccce: 60 93 d2 12 sts 0x12D2, r22 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 1ccd2: 70 93 d3 12 sts 0x12D3, r23 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 1ccd6: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 1ccda: 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); 1ccde: 6b 01 movw r12, r22 1cce0: 7c 01 movw r14, r24 1cce2: e8 94 clt 1cce4: f7 f8 bld r15, 7 1cce6: 21 e0 ldi r18, 0x01 ; 1 1cce8: 29 83 std Y+1, r18 ; 0x01 1ccea: 20 91 45 13 lds r18, 0x1345 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 1ccee: 30 91 46 13 lds r19, 0x1346 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 1ccf2: 40 91 47 13 lds r20, 0x1347 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 1ccf6: 50 91 48 13 lds r21, 0x1348 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> 1ccfa: c7 01 movw r24, r14 1ccfc: b6 01 movw r22, r12 1ccfe: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1cd02: 18 16 cp r1, r24 1cd04: 0c f0 brlt .+2 ; 0x1cd08 1cd06: 19 82 std Y+1, r1 ; 0x01 1cd08: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 1cd0c: 39 81 ldd r19, Y+1 ; 0x01 1cd0e: 30 fb bst r19, 0 1cd10: 81 f9 bld r24, 1 1cd12: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1cd16: 41 e0 ldi r20, 0x01 ; 1 1cd18: 49 83 std Y+1, r20 ; 0x01 1cd1a: 20 91 41 13 lds r18, 0x1341 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 1cd1e: 30 91 42 13 lds r19, 0x1342 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 1cd22: 40 91 43 13 lds r20, 0x1343 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 1cd26: 50 91 44 13 lds r21, 0x1344 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> 1cd2a: c7 01 movw r24, r14 1cd2c: b6 01 movw r22, r12 1cd2e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1cd32: 18 16 cp r1, r24 1cd34: 0c f0 brlt .+2 ; 0x1cd38 1cd36: 19 82 std Y+1, r1 ; 0x01 1cd38: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 1cd3c: 59 81 ldd r21, Y+1 ; 0x01 1cd3e: 50 fb bst r21, 0 1cd40: 82 f9 bld r24, 2 1cd42: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> } 1cd46: 27 96 adiw r28, 0x07 ; 7 1cd48: 0f b6 in r0, 0x3f ; 63 1cd4a: f8 94 cli 1cd4c: de bf out 0x3e, r29 ; 62 1cd4e: 0f be out 0x3f, r0 ; 63 1cd50: cd bf out 0x3d, r28 ; 61 1cd52: df 91 pop r29 1cd54: cf 91 pop r28 1cd56: 1f 91 pop r17 1cd58: 0f 91 pop r16 1cd5a: ff 90 pop r15 1cd5c: ef 90 pop r14 1cd5e: df 90 pop r13 1cd60: cf 90 pop r12 1cd62: bf 90 pop r11 1cd64: af 90 pop r10 1cd66: 9f 90 pop r9 1cd68: 8f 90 pop r8 1cd6a: 7f 90 pop r7 1cd6c: 6f 90 pop r6 1cd6e: 5f 90 pop r5 1cd70: 4f 90 pop r4 1cd72: 3f 90 pop r3 1cd74: 2f 90 pop r2 1cd76: 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); 1cd78: 1e 82 std Y+6, r1 ; 0x06 1cd7a: 0c cf rjmp .-488 ; 0x1cb94 0001cd7c : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1cd7c: 2f 92 push r2 1cd7e: 3f 92 push r3 1cd80: 4f 92 push r4 1cd82: 5f 92 push r5 1cd84: 6f 92 push r6 1cd86: 7f 92 push r7 1cd88: 8f 92 push r8 1cd8a: 9f 92 push r9 1cd8c: af 92 push r10 1cd8e: bf 92 push r11 1cd90: cf 92 push r12 1cd92: df 92 push r13 1cd94: ef 92 push r14 1cd96: ff 92 push r15 1cd98: 0f 93 push r16 1cd9a: 1f 93 push r17 1cd9c: cf 93 push r28 1cd9e: df 93 push r29 1cda0: cd b7 in r28, 0x3d ; 61 1cda2: de b7 in r29, 0x3e ; 62 1cda4: a4 97 sbiw r28, 0x24 ; 36 1cda6: 0f b6 in r0, 0x3f ; 63 1cda8: f8 94 cli 1cdaa: de bf out 0x3e, r29 ; 62 1cdac: 0f be out 0x3f, r0 ; 63 1cdae: cd bf out 0x3d, r28 ; 61 1cdb0: 9b 8f std Y+27, r25 ; 0x1b 1cdb2: 8a 8f std Y+26, r24 ; 0x1a 1cdb4: 7a 8b std Y+18, r23 ; 0x12 1cdb6: 69 8b std Y+17, r22 ; 0x11 1cdb8: 2b 8b std Y+19, r18 ; 0x13 1cdba: 3c 8b std Y+20, r19 ; 0x14 1cdbc: 4d 8b std Y+21, r20 ; 0x15 1cdbe: 5e 8b std Y+22, r21 ; 0x16 1cdc0: 0c 8f std Y+28, r16 ; 0x1c 1cdc2: cd 8e std Y+29, r12 ; 0x1d 1cdc4: de 8e std Y+30, r13 ; 0x1e 1cdc6: ef 8e std Y+31, r14 ; 0x1f 1cdc8: 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; 1cdca: 20 91 1d 05 lds r18, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 1cdce: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1cdd0: 80 e0 ldi r24, 0x00 ; 0 1cdd2: 0f 94 66 32 call 0x264cc ; 0x264cc float orig = *var; 1cdd6: a9 89 ldd r26, Y+17 ; 0x11 1cdd8: ba 89 ldd r27, Y+18 ; 0x12 1cdda: 8d 91 ld r24, X+ 1cddc: 9d 91 ld r25, X+ 1cdde: 0d 90 ld r0, X+ 1cde0: bc 91 ld r27, X 1cde2: a0 2d mov r26, r0 1cde4: 89 a3 std Y+33, r24 ; 0x21 1cde6: 9a a3 std Y+34, r25 ; 0x22 1cde8: ab a3 std Y+35, r26 ; 0x23 1cdea: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1cdec: 80 e0 ldi r24, 0x00 ; 0 1cdee: 90 e0 ldi r25, 0x00 ; 0 1cdf0: a0 ea ldi r26, 0xA0 ; 160 1cdf2: b0 e4 ldi r27, 0x40 ; 64 1cdf4: 89 83 std Y+1, r24 ; 0x01 1cdf6: 9a 83 std Y+2, r25 ; 0x02 1cdf8: ab 83 std Y+3, r26 ; 0x03 1cdfa: bc 83 std Y+4, r27 ; 0x04 1cdfc: 8b 89 ldd r24, Y+19 ; 0x13 1cdfe: 9c 89 ldd r25, Y+20 ; 0x14 1ce00: ad 89 ldd r26, Y+21 ; 0x15 1ce02: be 89 ldd r27, Y+22 ; 0x16 1ce04: 8d 83 std Y+5, r24 ; 0x05 1ce06: 9e 83 std Y+6, r25 ; 0x06 1ce08: af 83 std Y+7, r26 ; 0x07 1ce0a: 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]); 1ce0c: 20 e0 ldi r18, 0x00 ; 0 1ce0e: 30 e0 ldi r19, 0x00 ; 0 1ce10: 40 ea ldi r20, 0xA0 ; 160 1ce12: 50 e4 ldi r21, 0x40 ; 64 1ce14: bc 01 movw r22, r24 1ce16: cd 01 movw r24, r26 1ce18: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1ce1c: 2a e7 ldi r18, 0x7A ; 122 1ce1e: 37 e3 ldi r19, 0x37 ; 55 1ce20: 4e e1 ldi r20, 0x1E ; 30 1ce22: 5f e3 ldi r21, 0x3F ; 63 1ce24: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1ce28: 6b 01 movw r12, r22 1ce2a: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1ce2c: 20 e0 ldi r18, 0x00 ; 0 1ce2e: 30 e0 ldi r19, 0x00 ; 0 1ce30: 40 ea ldi r20, 0xA0 ; 160 1ce32: 50 e4 ldi r21, 0x40 ; 64 1ce34: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1ce38: 69 87 std Y+9, r22 ; 0x09 1ce3a: 7a 87 std Y+10, r23 ; 0x0a 1ce3c: 8b 87 std Y+11, r24 ; 0x0b 1ce3e: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1ce40: a7 01 movw r20, r14 1ce42: 96 01 movw r18, r12 1ce44: 6b 89 ldd r22, Y+19 ; 0x13 1ce46: 7c 89 ldd r23, Y+20 ; 0x14 1ce48: 8d 89 ldd r24, Y+21 ; 0x15 1ce4a: 9e 89 ldd r25, Y+22 ; 0x16 1ce4c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1ce50: 6d 87 std Y+13, r22 ; 0x0d 1ce52: 7e 87 std Y+14, r23 ; 0x0e 1ce54: 8f 87 std Y+15, r24 ; 0x0f 1ce56: 98 8b std Y+16, r25 ; 0x10 1ce58: 31 2c mov r3, r1 1ce5a: 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); 1ce5c: 29 85 ldd r18, Y+9 ; 0x09 1ce5e: 3a 85 ldd r19, Y+10 ; 0x0a 1ce60: 4b 85 ldd r20, Y+11 ; 0x0b 1ce62: 5c 85 ldd r21, Y+12 ; 0x0c 1ce64: cd 8c ldd r12, Y+29 ; 0x1d 1ce66: de 8c ldd r13, Y+30 ; 0x1e 1ce68: ef 8c ldd r14, Y+31 ; 0x1f 1ce6a: f8 a0 ldd r15, Y+32 ; 0x20 1ce6c: 0c 8d ldd r16, Y+28 ; 0x1c 1ce6e: 69 89 ldd r22, Y+17 ; 0x11 1ce70: 7a 89 ldd r23, Y+18 ; 0x12 1ce72: 8a 8d ldd r24, Y+26 ; 0x1a 1ce74: 9b 8d ldd r25, Y+27 ; 0x1b 1ce76: 0f 94 b4 2c call 0x25968 ; 0x25968 1ce7a: 4b 01 movw r8, r22 1ce7c: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1ce7e: 2d 85 ldd r18, Y+13 ; 0x0d 1ce80: 3e 85 ldd r19, Y+14 ; 0x0e 1ce82: 4f 85 ldd r20, Y+15 ; 0x0f 1ce84: 58 89 ldd r21, Y+16 ; 0x10 1ce86: cd 8c ldd r12, Y+29 ; 0x1d 1ce88: de 8c ldd r13, Y+30 ; 0x1e 1ce8a: ef 8c ldd r14, Y+31 ; 0x1f 1ce8c: f8 a0 ldd r15, Y+32 ; 0x20 1ce8e: 0c 8d ldd r16, Y+28 ; 0x1c 1ce90: 69 89 ldd r22, Y+17 ; 0x11 1ce92: 7a 89 ldd r23, Y+18 ; 0x12 1ce94: 8a 8d ldd r24, Y+26 ; 0x1a 1ce96: 9b 8d ldd r25, Y+27 ; 0x1b 1ce98: 0f 94 b4 2c call 0x25968 ; 0x25968 1ce9c: 9b 01 movw r18, r22 1ce9e: ac 01 movw r20, r24 bool dir = (c2 < c1); 1cea0: 11 e0 ldi r17, 0x01 ; 1 1cea2: c5 01 movw r24, r10 1cea4: b4 01 movw r22, r8 1cea6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1ceaa: 18 16 cp r1, r24 1ceac: 0c f0 brlt .+2 ; 0x1ceb0 1ceae: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1ceb0: 01 e0 ldi r16, 0x01 ; 1 1ceb2: 01 27 eor r16, r17 1ceb4: 80 2f mov r24, r16 1ceb6: 90 e0 ldi r25, 0x00 ; 0 1ceb8: e1 2f mov r30, r17 1ceba: f0 e0 ldi r31, 0x00 ; 0 1cebc: ee 0f add r30, r30 1cebe: ff 1f adc r31, r31 1cec0: ee 0f add r30, r30 1cec2: ff 1f adc r31, r31 1cec4: 41 e0 ldi r20, 0x01 ; 1 1cec6: 50 e0 ldi r21, 0x00 ; 0 1cec8: 4c 0f add r20, r28 1ceca: 5d 1f adc r21, r29 1cecc: 4e 0f add r20, r30 1cece: 5f 1f adc r21, r31 1ced0: 8c 01 movw r16, r24 1ced2: 00 0f add r16, r16 1ced4: 11 1f adc r17, r17 1ced6: 00 0f add r16, r16 1ced8: 11 1f adc r17, r17 1ceda: a1 e0 ldi r26, 0x01 ; 1 1cedc: b0 e0 ldi r27, 0x00 ; 0 1cede: ac 0f add r26, r28 1cee0: bd 1f adc r27, r29 1cee2: 0a 0f add r16, r26 1cee4: 1b 1f adc r17, r27 1cee6: f8 01 movw r30, r16 1cee8: 38 96 adiw r30, 0x08 ; 8 1ceea: f8 8f std Y+24, r31 ; 0x18 1ceec: ef 8b std Y+23, r30 ; 0x17 1ceee: f8 01 movw r30, r16 1cef0: 80 85 ldd r24, Z+8 ; 0x08 1cef2: 91 85 ldd r25, Z+9 ; 0x09 1cef4: a2 85 ldd r26, Z+10 ; 0x0a 1cef6: b3 85 ldd r27, Z+11 ; 0x0b 1cef8: fa 01 movw r30, r20 1cefa: 80 83 st Z, r24 1cefc: 91 83 std Z+1, r25 ; 0x01 1cefe: a2 83 std Z+2, r26 ; 0x02 1cf00: 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]); 1cf02: 8d 80 ldd r8, Y+5 ; 0x05 1cf04: 9e 80 ldd r9, Y+6 ; 0x06 1cf06: af 80 ldd r10, Y+7 ; 0x07 1cf08: b8 84 ldd r11, Y+8 ; 0x08 1cf0a: c9 80 ldd r12, Y+1 ; 0x01 1cf0c: da 80 ldd r13, Y+2 ; 0x02 1cf0e: eb 80 ldd r14, Y+3 ; 0x03 1cf10: fc 80 ldd r15, Y+4 ; 0x04 1cf12: a7 01 movw r20, r14 1cf14: 96 01 movw r18, r12 1cf16: c5 01 movw r24, r10 1cf18: b4 01 movw r22, r8 1cf1a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cf1e: 2a e7 ldi r18, 0x7A ; 122 1cf20: 37 e3 ldi r19, 0x37 ; 55 1cf22: 4e e1 ldi r20, 0x1E ; 30 1cf24: 5f e3 ldi r21, 0x3F ; 63 1cf26: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cf2a: 2b 01 movw r4, r22 1cf2c: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1cf2e: ac 01 movw r20, r24 1cf30: 9b 01 movw r18, r22 1cf32: c7 01 movw r24, r14 1cf34: b6 01 movw r22, r12 1cf36: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1cf3a: 69 87 std Y+9, r22 ; 0x09 1cf3c: 7a 87 std Y+10, r23 ; 0x0a 1cf3e: 8b 87 std Y+11, r24 ; 0x0b 1cf40: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1cf42: a3 01 movw r20, r6 1cf44: 92 01 movw r18, r4 1cf46: c5 01 movw r24, r10 1cf48: b4 01 movw r22, r8 1cf4a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cf4e: 6d 87 std Y+13, r22 ; 0x0d 1cf50: 7e 87 std Y+14, r23 ; 0x0e 1cf52: 8f 87 std Y+15, r24 ; 0x0f 1cf54: 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]; 1cf56: d8 01 movw r26, r16 1cf58: 18 96 adiw r26, 0x08 ; 8 1cf5a: 4c 90 ld r4, X 1cf5c: ef 89 ldd r30, Y+23 ; 0x17 1cf5e: f8 8d ldd r31, Y+24 ; 0x18 1cf60: 51 80 ldd r5, Z+1 ; 0x01 1cf62: 62 80 ldd r6, Z+2 ; 0x02 1cf64: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1cf66: a5 01 movw r20, r10 1cf68: 94 01 movw r18, r8 1cf6a: c7 01 movw r24, r14 1cf6c: b6 01 movw r22, r12 1cf6e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1cf72: 24 2d mov r18, r4 1cf74: 35 2d mov r19, r5 1cf76: 46 2d mov r20, r6 1cf78: 57 2d mov r21, r7 1cf7a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1cf7e: 9f 77 andi r25, 0x7F ; 127 1cf80: 2c e0 ldi r18, 0x0C ; 12 1cf82: 31 e9 ldi r19, 0x91 ; 145 1cf84: 43 ec ldi r20, 0xC3 ; 195 1cf86: 5e e3 ldi r21, 0x3E ; 62 1cf88: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1cf8c: 6b 01 movw r12, r22 1cf8e: 7c 01 movw r14, r24 1cf90: 5b 01 movw r10, r22 1cf92: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1cf94: ff 92 push r15 1cf96: 8f 93 push r24 1cf98: df 92 push r13 1cf9a: 6f 93 push r22 1cf9c: 7f 92 push r7 1cf9e: 6f 92 push r6 1cfa0: 5f 92 push r5 1cfa2: 4f 92 push r4 1cfa4: 3f 92 push r3 1cfa6: 2f 92 push r2 1cfa8: 24 ee ldi r18, 0xE4 ; 228 1cfaa: 3e e8 ldi r19, 0x8E ; 142 1cfac: 3f 93 push r19 1cfae: 2f 93 push r18 1cfb0: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if(e < thr) { 1cfb4: 0f b6 in r0, 0x3f ; 63 1cfb6: f8 94 cli 1cfb8: de bf out 0x3e, r29 ; 62 1cfba: 0f be out 0x3f, r0 ; 63 1cfbc: cd bf out 0x3d, r28 ; 61 1cfbe: 2a e0 ldi r18, 0x0A ; 10 1cfc0: 37 ed ldi r19, 0xD7 ; 215 1cfc2: 43 e2 ldi r20, 0x23 ; 35 1cfc4: 5c e3 ldi r21, 0x3C ; 60 1cfc6: 6c 2d mov r22, r12 1cfc8: 7d 2d mov r23, r13 1cfca: 8e 2d mov r24, r14 1cfcc: 9f 2d mov r25, r15 1cfce: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1cfd2: 87 ff sbrs r24, 7 1cfd4: 42 c0 rjmp .+132 ; 0x1d05a if(x == min || x == max) { 1cfd6: 20 e0 ldi r18, 0x00 ; 0 1cfd8: 30 e0 ldi r19, 0x00 ; 0 1cfda: 40 ea ldi r20, 0xA0 ; 160 1cfdc: 50 e4 ldi r21, 0x40 ; 64 1cfde: 64 2d mov r22, r4 1cfe0: 75 2d mov r23, r5 1cfe2: 86 2d mov r24, r6 1cfe4: 97 2d mov r25, r7 1cfe6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1cfea: 88 23 and r24, r24 1cfec: f1 f1 breq .+124 ; 0x1d06a 1cfee: 24 2d mov r18, r4 1cff0: 35 2d mov r19, r5 1cff2: 46 2d mov r20, r6 1cff4: 57 2d mov r21, r7 1cff6: 6b 89 ldd r22, Y+19 ; 0x13 1cff8: 7c 89 ldd r23, Y+20 ; 0x14 1cffa: 8d 89 ldd r24, Y+21 ; 0x15 1cffc: 9e 89 ldd r25, Y+22 ; 0x16 1cffe: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1d002: 88 23 and r24, r24 1d004: 91 f1 breq .+100 ; 0x1d06a // real value likely outside of the search boundaries break; } *var = x; 1d006: 84 2d mov r24, r4 1d008: 95 2d mov r25, r5 1d00a: a6 2d mov r26, r6 1d00c: b7 2d mov r27, r7 1d00e: e9 89 ldd r30, Y+17 ; 0x11 1d010: fa 89 ldd r31, Y+18 ; 0x12 1d012: 80 83 st Z, r24 1d014: 91 83 std Z+1, r25 ; 0x01 1d016: a2 83 std Z+2, r26 ; 0x02 1d018: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d01a: 89 8d ldd r24, Y+25 ; 0x19 1d01c: 0f 94 66 32 call 0x264cc ; 0x264cc SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1d020: 6a 2d mov r22, r10 1d022: 7b 2d mov r23, r11 1d024: 80 2f mov r24, r16 1d026: 91 2f mov r25, r17 1d028: a4 96 adiw r28, 0x24 ; 36 1d02a: 0f b6 in r0, 0x3f ; 63 1d02c: f8 94 cli 1d02e: de bf out 0x3e, r29 ; 62 1d030: 0f be out 0x3f, r0 ; 63 1d032: cd bf out 0x3d, r28 ; 61 1d034: df 91 pop r29 1d036: cf 91 pop r28 1d038: 1f 91 pop r17 1d03a: 0f 91 pop r16 1d03c: ff 90 pop r15 1d03e: ef 90 pop r14 1d040: df 90 pop r13 1d042: cf 90 pop r12 1d044: bf 90 pop r11 1d046: af 90 pop r10 1d048: 9f 90 pop r9 1d04a: 8f 90 pop r8 1d04c: 7f 90 pop r7 1d04e: 6f 90 pop r6 1d050: 5f 90 pop r5 1d052: 4f 90 pop r4 1d054: 3f 90 pop r3 1d056: 2f 90 pop r2 1d058: 08 95 ret 1d05a: ff ef ldi r31, 0xFF ; 255 1d05c: 2f 1a sub r2, r31 1d05e: 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) { 1d060: 2e e1 ldi r18, 0x1E ; 30 1d062: 22 16 cp r2, r18 1d064: 31 04 cpc r3, r1 1d066: 09 f0 breq .+2 ; 0x1d06a 1d068: f9 ce rjmp .-526 ; 0x1ce5c thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1d06a: 85 ec ldi r24, 0xC5 ; 197 1d06c: 9e e8 ldi r25, 0x8E ; 142 1d06e: 0e 94 82 79 call 0xf304 ; 0xf304 *var = orig; 1d072: 89 a1 ldd r24, Y+33 ; 0x21 1d074: 9a a1 ldd r25, Y+34 ; 0x22 1d076: ab a1 ldd r26, Y+35 ; 0x23 1d078: bc a1 ldd r27, Y+36 ; 0x24 1d07a: e9 89 ldd r30, Y+17 ; 0x11 1d07c: fa 89 ldd r31, Y+18 ; 0x12 1d07e: 80 83 st Z, r24 1d080: 91 83 std Z+1, r25 ; 0x01 1d082: a2 83 std Z+2, r26 ; 0x02 1d084: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1d086: 89 8d ldd r24, Y+25 ; 0x19 1d088: 0f 94 66 32 call 0x264cc ; 0x264cc return NAN; 1d08c: a1 2c mov r10, r1 1d08e: b1 2c mov r11, r1 1d090: 00 ec ldi r16, 0xC0 ; 192 1d092: 1f e7 ldi r17, 0x7F ; 127 1d094: c5 cf rjmp .-118 ; 0x1d020 0001d096 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1d096: ef 92 push r14 1d098: ff 92 push r15 1d09a: 0f 93 push r16 1d09c: 1f 93 push r17 1d09e: cf 93 push r28 1d0a0: df 93 push r29 1d0a2: 00 d0 rcall .+0 ; 0x1d0a4 1d0a4: 1f 92 push r1 1d0a6: 1f 92 push r1 1d0a8: cd b7 in r28, 0x3d ; 61 1d0aa: de b7 in r29, 0x3e ; 62 1d0ac: 08 2f mov r16, r24 1d0ae: 16 2f mov r17, r22 1d0b0: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1d0b2: 0f 94 8b 88 call 0x31116 ; 0x31116 1d0b6: 88 23 and r24, r24 1d0b8: d9 f0 breq .+54 ; 0x1d0f0 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) { 1d0ba: 0b 30 cpi r16, 0x0B ; 11 1d0bc: 29 f1 breq .+74 ; 0x1d108 1d0be: 04 31 cpi r16, 0x14 ; 20 1d0c0: 31 f1 breq .+76 ; 0x1d10e /// @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()) { 1d0c2: 87 e5 ldi r24, 0x57 ; 87 1d0c4: e8 2e mov r14, r24 1d0c6: e9 82 std Y+1, r14 ; 0x01 1d0c8: 0a 83 std Y+2, r16 ; 0x02 1d0ca: 1b 83 std Y+3, r17 ; 0x03 1d0cc: fc 82 std Y+4, r15 ; 0x04 1d0ce: ce 01 movw r24, r28 1d0d0: 01 96 adiw r24, 0x01 ; 1 1d0d2: 0f 94 70 c5 call 0x38ae0 ; 0x38ae0 1d0d6: 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)); 1d0d8: 47 e5 ldi r20, 0x57 ; 87 1d0da: 50 2f mov r21, r16 1d0dc: 61 2f mov r22, r17 1d0de: 7f 2d mov r23, r15 1d0e0: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 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)); 1d0e4: 60 e0 ldi r22, 0x00 ; 0 1d0e6: 80 e0 ldi r24, 0x00 ; 0 1d0e8: 0f 94 7d ac call 0x358fa ; 0x358fa 1d0ec: 88 23 and r24, r24 1d0ee: 59 f3 breq .-42 ; 0x1d0c6 return true; } 1d0f0: 0f 90 pop r0 1d0f2: 0f 90 pop r0 1d0f4: 0f 90 pop r0 1d0f6: 0f 90 pop r0 1d0f8: 0f 90 pop r0 1d0fa: df 91 pop r29 1d0fc: cf 91 pop r28 1d0fe: 1f 91 pop r17 1d100: 0f 91 pop r16 1d102: ff 90 pop r15 1d104: ef 90 pop r14 1d106: 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); 1d108: 10 93 97 13 sts 0x1397, r17 ; 0x801397 1d10c: da cf rjmp .-76 ; 0x1d0c2 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1d10e: 10 93 98 13 sts 0x1398, r17 ; 0x801398 1d112: d7 cf rjmp .-82 ; 0x1d0c2 0001d114 : #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) 1d114: 82 30 cpi r24, 0x02 ; 2 1d116: 91 05 cpc r25, r1 1d118: 38 f0 brcs .+14 ; 0x1d128 // 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 1d11a: 88 0f add r24, r24 1d11c: 99 1f adc r25, r25 1d11e: 88 0f add r24, r24 1d120: 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, 1d122: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1d124: 01 97 sbiw r24, 0x01 ; 1 1d126: f1 f7 brne .-4 ; 0x1d124 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1d128: 08 95 ret 0001d12a : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1d12a: cf 93 push r28 1d12c: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d12e: 28 2f mov r18, r24 1d130: 30 e0 ldi r19, 0x00 ; 0 1d132: f9 01 movw r30, r18 1d134: ea 50 subi r30, 0x0A ; 10 1d136: f3 47 sbci r31, 0x73 ; 115 1d138: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d13a: f9 01 movw r30, r18 1d13c: e0 56 subi r30, 0x60 ; 96 1d13e: f3 47 sbci r31, 0x73 ; 115 1d140: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d142: f9 01 movw r30, r18 1d144: e6 5b subi r30, 0xB6 ; 182 1d146: f3 47 sbci r31, 0x73 ; 115 1d148: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1d14a: cc 23 and r28, r28 1d14c: a1 f0 breq .+40 ; 0x1d176 // 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); 1d14e: 81 11 cpse r24, r1 1d150: 0e 94 bd cc call 0x1997a ; 0x1997a if (*portInputRegister(port) & bit) return HIGH; 1d154: ec 2f mov r30, r28 1d156: f0 e0 ldi r31, 0x00 ; 0 1d158: ee 0f add r30, r30 1d15a: ff 1f adc r31, r31 1d15c: e0 5d subi r30, 0xD0 ; 208 1d15e: f3 47 sbci r31, 0x73 ; 115 1d160: a5 91 lpm r26, Z+ 1d162: b4 91 lpm r27, Z 1d164: ec 91 ld r30, X 1d166: ed 23 and r30, r29 1d168: 81 e0 ldi r24, 0x01 ; 1 1d16a: 90 e0 ldi r25, 0x00 ; 0 1d16c: 09 f4 brne .+2 ; 0x1d170 1d16e: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1d170: df 91 pop r29 1d172: cf 91 pop r28 1d174: 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; 1d176: 80 e0 ldi r24, 0x00 ; 0 1d178: 90 e0 ldi r25, 0x00 ; 0 1d17a: fa cf rjmp .-12 ; 0x1d170 0001d17c : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1d17c: 1f 93 push r17 1d17e: cf 93 push r28 1d180: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1d182: 28 2f mov r18, r24 1d184: 30 e0 ldi r19, 0x00 ; 0 1d186: f9 01 movw r30, r18 1d188: ea 50 subi r30, 0x0A ; 10 1d18a: f3 47 sbci r31, 0x73 ; 115 1d18c: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1d18e: f9 01 movw r30, r18 1d190: e0 56 subi r30, 0x60 ; 96 1d192: f3 47 sbci r31, 0x73 ; 115 1d194: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1d196: f9 01 movw r30, r18 1d198: e6 5b subi r30, 0xB6 ; 182 1d19a: f3 47 sbci r31, 0x73 ; 115 1d19c: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1d19e: cc 23 and r28, r28 1d1a0: a9 f0 breq .+42 ; 0x1d1cc 1d1a2: 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); 1d1a4: 81 11 cpse r24, r1 1d1a6: 0e 94 bd cc call 0x1997a ; 0x1997a out = portOutputRegister(port); 1d1aa: ec 2f mov r30, r28 1d1ac: f0 e0 ldi r31, 0x00 ; 0 1d1ae: ee 0f add r30, r30 1d1b0: ff 1f adc r31, r31 1d1b2: ea 5e subi r30, 0xEA ; 234 1d1b4: f3 47 sbci r31, 0x73 ; 115 1d1b6: a5 91 lpm r26, Z+ 1d1b8: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1d1ba: 8f b7 in r24, 0x3f ; 63 cli(); 1d1bc: f8 94 cli if (val == LOW) { *out &= ~bit; 1d1be: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1d1c0: 11 11 cpse r17, r1 1d1c2: 08 c0 rjmp .+16 ; 0x1d1d4 *out &= ~bit; 1d1c4: d0 95 com r29 1d1c6: de 23 and r29, r30 } else { *out |= bit; 1d1c8: dc 93 st X, r29 } SREG = oldSREG; 1d1ca: 8f bf out 0x3f, r24 ; 63 } 1d1cc: df 91 pop r29 1d1ce: cf 91 pop r28 1d1d0: 1f 91 pop r17 1d1d2: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1d1d4: de 2b or r29, r30 1d1d6: f8 cf rjmp .-16 ; 0x1d1c8 0001d1d8 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1d1d8: cf 93 push r28 1d1da: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1d1dc: 90 e0 ldi r25, 0x00 ; 0 1d1de: fc 01 movw r30, r24 1d1e0: e0 56 subi r30, 0x60 ; 96 1d1e2: f3 47 sbci r31, 0x73 ; 115 1d1e4: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1d1e6: 86 5b subi r24, 0xB6 ; 182 1d1e8: 93 47 sbci r25, 0x73 ; 115 1d1ea: fc 01 movw r30, r24 1d1ec: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1d1ee: 88 23 and r24, r24 1d1f0: d1 f0 breq .+52 ; 0x1d226 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1d1f2: 90 e0 ldi r25, 0x00 ; 0 1d1f4: 88 0f add r24, r24 1d1f6: 99 1f adc r25, r25 1d1f8: fc 01 movw r30, r24 1d1fa: e4 50 subi r30, 0x04 ; 4 1d1fc: f4 47 sbci r31, 0x74 ; 116 1d1fe: a5 91 lpm r26, Z+ 1d200: b4 91 lpm r27, Z out = portOutputRegister(port); 1d202: fc 01 movw r30, r24 1d204: ea 5e subi r30, 0xEA ; 234 1d206: f3 47 sbci r31, 0x73 ; 115 1d208: c5 91 lpm r28, Z+ 1d20a: d4 91 lpm r29, Z if (mode == INPUT) { 1d20c: 61 11 cpse r22, r1 1d20e: 0e c0 rjmp .+28 ; 0x1d22c uint8_t oldSREG = SREG; 1d210: 9f b7 in r25, 0x3f ; 63 cli(); 1d212: f8 94 cli *reg &= ~bit; 1d214: 8c 91 ld r24, X 1d216: e2 2f mov r30, r18 1d218: e0 95 com r30 1d21a: 8e 23 and r24, r30 1d21c: 8c 93 st X, r24 *out &= ~bit; 1d21e: 28 81 ld r18, Y 1d220: e2 23 and r30, r18 1d222: e8 83 st Y, r30 SREG = oldSREG; 1d224: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1d226: df 91 pop r29 1d228: cf 91 pop r28 1d22a: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1d22c: 8f b7 in r24, 0x3f ; 63 cli(); 1d22e: f8 94 cli *reg |= bit; 1d230: ec 91 ld r30, X 1d232: e2 2b or r30, r18 1d234: ec 93 st X, r30 SREG = oldSREG; 1d236: 8f bf out 0x3f, r24 ; 63 1d238: f6 cf rjmp .-20 ; 0x1d226 0001d23a : // 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) { 1d23a: 1f 93 push r17 1d23c: cf 93 push r28 1d23e: df 93 push r29 1d240: 18 2f mov r17, r24 1d242: 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); 1d244: 61 e0 ldi r22, 0x01 ; 1 1d246: 0e 94 ec e8 call 0x1d1d8 ; 0x1d1d8 if (val == 0) 1d24a: 20 97 sbiw r28, 0x00 ; 0 1d24c: 39 f4 brne .+14 ; 0x1d25c { digitalWrite(pin, LOW); 1d24e: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1d250: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1d252: df 91 pop r29 1d254: cf 91 pop r28 1d256: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1d258: 0c 94 be e8 jmp 0x1d17c ; 0x1d17c pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1d25c: cf 3f cpi r28, 0xFF ; 255 1d25e: d1 05 cpc r29, r1 1d260: 11 f4 brne .+4 ; 0x1d266 { digitalWrite(pin, HIGH); 1d262: 61 e0 ldi r22, 0x01 ; 1 1d264: f5 cf rjmp .-22 ; 0x1d250 } else { switch(digitalPinToTimer(pin)) 1d266: e1 2f mov r30, r17 1d268: f0 e0 ldi r31, 0x00 ; 0 1d26a: ea 50 subi r30, 0x0A ; 10 1d26c: f3 47 sbci r31, 0x73 ; 115 1d26e: e4 91 lpm r30, Z 1d270: e1 50 subi r30, 0x01 ; 1 1d272: e2 31 cpi r30, 0x12 ; 18 1d274: 08 f0 brcs .+2 ; 0x1d278 1d276: b3 c0 rjmp .+358 ; 0x1d3de 1d278: f0 e0 ldi r31, 0x00 ; 0 1d27a: 88 27 eor r24, r24 1d27c: ed 5b subi r30, 0xBD ; 189 1d27e: f6 41 sbci r31, 0x16 ; 22 1d280: 8f 4f sbci r24, 0xFF ; 255 1d282: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 1d286: 55 e9 ldi r21, 0x95 ; 149 1d288: 5d e9 ldi r21, 0x9D ; 157 1d28a: 62 e9 ldi r22, 0x92 ; 146 1d28c: 6c e9 ldi r22, 0x9C ; 156 1d28e: 76 e9 ldi r23, 0x96 ; 150 1d290: ef e9 ldi r30, 0x9F ; 159 1d292: 80 e9 ldi r24, 0x90 ; 144 1d294: 88 e9 ldi r24, 0x98 ; 152 1d296: 90 e9 ldi r25, 0x90 ; 144 1d298: 9a e9 ldi r25, 0x9A ; 154 1d29a: a4 e9 ldi r26, 0x94 ; 148 1d29c: ae e9 ldi r26, 0x9E ; 158 1d29e: bd e9 ldi r27, 0x9D ; 157 1d2a0: c7 e9 ldi r28, 0x97 ; 151 1d2a2: ef e9 ldi r30, 0x9F ; 159 1d2a4: d1 e9 ldi r29, 0x91 ; 145 1d2a6: db e9 ldi r29, 0x9B ; 155 1d2a8: e5 e9 ldi r30, 0x95 ; 149 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1d2aa: 84 b5 in r24, 0x24 ; 36 1d2ac: 80 68 ori r24, 0x80 ; 128 1d2ae: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1d2b0: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1d2b2: df 91 pop r29 1d2b4: cf 91 pop r28 1d2b6: 1f 91 pop r17 1d2b8: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1d2ba: 84 b5 in r24, 0x24 ; 36 1d2bc: 80 62 ori r24, 0x20 ; 32 1d2be: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1d2c0: c8 bd out 0x28, r28 ; 40 1d2c2: f7 cf rjmp .-18 ; 0x1d2b2 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1d2c4: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d2c8: 80 68 ori r24, 0x80 ; 128 1d2ca: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1d2ce: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1d2d2: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1d2d6: ed cf rjmp .-38 ; 0x1d2b2 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1d2d8: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d2dc: 80 62 ori r24, 0x20 ; 32 1d2de: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1d2e2: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1d2e6: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1d2ea: e3 cf rjmp .-58 ; 0x1d2b2 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1d2ec: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d2f0: 88 60 ori r24, 0x08 ; 8 1d2f2: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1d2f6: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1d2fa: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1d2fe: d9 cf rjmp .-78 ; 0x1d2b2 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1d300: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d304: 80 68 ori r24, 0x80 ; 128 1d306: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1d30a: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1d30e: d1 cf rjmp .-94 ; 0x1d2b2 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1d310: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d314: 80 62 ori r24, 0x20 ; 32 1d316: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1d31a: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1d31e: c9 cf rjmp .-110 ; 0x1d2b2 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1d320: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d324: 80 68 ori r24, 0x80 ; 128 1d326: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1d32a: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1d32e: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1d332: bf cf rjmp .-130 ; 0x1d2b2 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1d334: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d338: 80 62 ori r24, 0x20 ; 32 1d33a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1d33e: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1d342: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1d346: b5 cf rjmp .-150 ; 0x1d2b2 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1d348: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d34c: 88 60 ori r24, 0x08 ; 8 1d34e: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1d352: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1d356: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1d35a: ab cf rjmp .-170 ; 0x1d2b2 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1d35c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d360: 80 68 ori r24, 0x80 ; 128 1d362: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1d366: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d36a: 8f 7b andi r24, 0xBF ; 191 1d36c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1d370: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1d374: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1d378: 9c cf rjmp .-200 ; 0x1d2b2 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1d37a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d37e: 80 62 ori r24, 0x20 ; 32 1d380: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1d384: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1d388: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1d38c: 92 cf rjmp .-220 ; 0x1d2b2 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1d38e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d392: 88 60 ori r24, 0x08 ; 8 1d394: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1d398: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1d39c: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1d3a0: 88 cf rjmp .-240 ; 0x1d2b2 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1d3a2: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d3a6: 80 68 ori r24, 0x80 ; 128 1d3a8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1d3ac: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1d3b0: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1d3b4: 7e cf rjmp .-260 ; 0x1d2b2 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1d3b6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d3ba: 80 62 ori r24, 0x20 ; 32 1d3bc: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1d3c0: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1d3c4: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1d3c8: 74 cf rjmp .-280 ; 0x1d2b2 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1d3ca: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d3ce: 88 60 ori r24, 0x08 ; 8 1d3d0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1d3d4: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1d3d8: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1d3dc: 6a cf rjmp .-300 ; 0x1d2b2 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1d3de: c0 38 cpi r28, 0x80 ; 128 1d3e0: d1 05 cpc r29, r1 1d3e2: 0c f0 brlt .+2 ; 0x1d3e6 1d3e4: 3e cf rjmp .-388 ; 0x1d262 1d3e6: 33 cf rjmp .-410 ; 0x1d24e 0001d3e8 : } } /// 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){ 1d3e8: 4f 92 push r4 1d3ea: 5f 92 push r5 1d3ec: 6f 92 push r6 1d3ee: 7f 92 push r7 1d3f0: 8f 92 push r8 1d3f2: 9f 92 push r9 1d3f4: af 92 push r10 1d3f6: bf 92 push r11 1d3f8: cf 92 push r12 1d3fa: df 92 push r13 1d3fc: ef 92 push r14 1d3fe: ff 92 push r15 1d400: 0f 93 push r16 1d402: 1f 93 push r17 1d404: cf 93 push r28 1d406: 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 1d408: 86 b9 out 0x06, r24 ; 6 1d40a: fa 01 movw r30, r20 1d40c: e0 80 ld r14, Z 1d40e: 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){ 1d410: 16 16 cp r1, r22 1d412: 17 06 cpc r1, r23 1d414: b4 f4 brge .+44 ; 0x1d442 1d416: e2 16 cp r14, r18 1d418: f3 06 cpc r15, r19 1d41a: 99 f4 brne .+38 ; 0x1d442 delayMicroseconds(delay_us); 1d41c: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1d41e: df 91 pop r29 1d420: cf 91 pop r28 1d422: 1f 91 pop r17 1d424: 0f 91 pop r16 1d426: ff 90 pop r15 1d428: ef 90 pop r14 1d42a: df 90 pop r13 1d42c: cf 90 pop r12 1d42e: bf 90 pop r11 1d430: af 90 pop r10 1d432: 9f 90 pop r9 1d434: 8f 90 pop r8 1d436: 7f 90 pop r7 1d438: 6f 90 pop r6 1d43a: 5f 90 pop r5 1d43c: 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); 1d43e: 0c 94 8a e8 jmp 0x1d114 ; 0x1d114 1d442: 89 01 movw r16, r18 1d444: 6a 01 movw r12, r20 1d446: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1d448: b7 01 movw r22, r14 1d44a: 90 e0 ldi r25, 0x00 ; 0 1d44c: 80 e0 ldi r24, 0x00 ; 0 1d44e: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 1d452: 2d eb ldi r18, 0xBD ; 189 1d454: 37 e3 ldi r19, 0x37 ; 55 1d456: 46 e8 ldi r20, 0x86 ; 134 1d458: 55 e3 ldi r21, 0x35 ; 53 1d45a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1d45e: 4b 01 movw r8, r22 1d460: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1d462: be 01 movw r22, r28 1d464: 0d 2e mov r0, r29 1d466: 00 0c add r0, r0 1d468: 88 0b sbc r24, r24 1d46a: 99 0b sbc r25, r25 1d46c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1d470: a5 01 movw r20, r10 1d472: 94 01 movw r18, r8 1d474: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1d478: 2b 01 movw r4, r22 1d47a: 3c 01 movw r6, r24 1d47c: a5 01 movw r20, r10 1d47e: 94 01 movw r18, r8 1d480: 6a e0 ldi r22, 0x0A ; 10 1d482: 77 ed ldi r23, 0xD7 ; 215 1d484: 83 e2 ldi r24, 0x23 ; 35 1d486: 9c e3 ldi r25, 0x3C ; 60 1d488: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1d48c: 9b 01 movw r18, r22 1d48e: ac 01 movw r20, r24 1d490: c3 01 movw r24, r6 1d492: b2 01 movw r22, r4 1d494: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1d498: 4b 01 movw r8, r22 1d49a: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1d49c: 2a e0 ldi r18, 0x0A ; 10 1d49e: 37 ed ldi r19, 0xD7 ; 215 1d4a0: 43 e2 ldi r20, 0x23 ; 35 1d4a2: 5e e3 ldi r21, 0x3E ; 62 1d4a4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1d4a8: 18 16 cp r1, r24 1d4aa: dc f5 brge .+118 ; 0x1d522 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)); 1d4ac: a5 01 movw r20, r10 1d4ae: 94 01 movw r18, r8 1d4b0: 6a e0 ldi r22, 0x0A ; 10 1d4b2: 77 ed ldi r23, 0xD7 ; 215 1d4b4: 83 e2 ldi r24, 0x23 ; 35 1d4b6: 9c e3 ldi r25, 0x3C ; 60 1d4b8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1d4bc: 20 e0 ldi r18, 0x00 ; 0 1d4be: 34 e2 ldi r19, 0x24 ; 36 1d4c0: 44 e7 ldi r20, 0x74 ; 116 1d4c2: 59 e4 ldi r21, 0x49 ; 73 1d4c4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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); 1d4c8: 20 e0 ldi r18, 0x00 ; 0 1d4ca: 30 e0 ldi r19, 0x00 ; 0 1d4cc: 40 e0 ldi r20, 0x00 ; 0 1d4ce: 5f e3 ldi r21, 0x3F ; 63 1d4d0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1d4d4: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 1d4d8: 5b 01 movw r10, r22 1d4da: 60 17 cp r22, r16 1d4dc: 71 07 cpc r23, r17 1d4de: 08 f4 brcc .+2 ; 0x1d4e2 1d4e0: 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){ 1d4e2: ea 14 cp r14, r10 1d4e4: fb 04 cpc r15, r11 1d4e6: 31 f4 brne .+12 ; 0x1d4f4 1d4e8: 20 97 sbiw r28, 0x00 ; 0 1d4ea: 21 f0 breq .+8 ; 0x1d4f4 if (acc > 0) 1d4ec: fc f0 brlt .+62 ; 0x1d52c t1--; 1d4ee: f1 e0 ldi r31, 0x01 ; 1 1d4f0: af 1a sub r10, r31 1d4f2: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1d4f4: c5 01 movw r24, r10 1d4f6: 0e 94 8a e8 call 0x1d114 ; 0x1d114 delay_us = t1; 1d4fa: f6 01 movw r30, r12 1d4fc: b1 82 std Z+1, r11 ; 0x01 1d4fe: a0 82 st Z, r10 } 1d500: df 91 pop r29 1d502: cf 91 pop r28 1d504: 1f 91 pop r17 1d506: 0f 91 pop r16 1d508: ff 90 pop r15 1d50a: ef 90 pop r14 1d50c: df 90 pop r13 1d50e: cf 90 pop r12 1d510: bf 90 pop r11 1d512: af 90 pop r10 1d514: 9f 90 pop r9 1d516: 8f 90 pop r8 1d518: 7f 90 pop r7 1d51a: 6f 90 pop r6 1d51c: 5f 90 pop r5 1d51e: 4f 90 pop r4 1d520: 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 1d522: 80 e1 ldi r24, 0x10 ; 16 1d524: a8 2e mov r10, r24 1d526: 87 e2 ldi r24, 0x27 ; 39 1d528: b8 2e mov r11, r24 1d52a: db cf rjmp .-74 ; 0x1d4e2 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1d52c: 8f ef ldi r24, 0xFF ; 255 1d52e: a8 1a sub r10, r24 1d530: b8 0a sbc r11, r24 1d532: e0 cf rjmp .-64 ; 0x1d4f4 0001d534 : /// 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){ 1d534: 2f 92 push r2 1d536: 3f 92 push r3 1d538: 4f 92 push r4 1d53a: 5f 92 push r5 1d53c: 6f 92 push r6 1d53e: 7f 92 push r7 1d540: 8f 92 push r8 1d542: 9f 92 push r9 1d544: af 92 push r10 1d546: bf 92 push r11 1d548: cf 92 push r12 1d54a: df 92 push r13 1d54c: ef 92 push r14 1d54e: ff 92 push r15 1d550: 0f 93 push r16 1d552: 1f 93 push r17 1d554: cf 93 push r28 1d556: df 93 push r29 1d558: 00 d0 rcall .+0 ; 0x1d55a 1d55a: cd b7 in r28, 0x3d ; 61 1d55c: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1d55e: f9 01 movw r30, r18 1d560: e0 80 ld r14, Z 1d562: f1 80 ldd r15, Z+1 ; 0x01 1d564: e1 14 cp r14, r1 1d566: f1 04 cpc r15, r1 1d568: 09 f4 brne .+2 ; 0x1d56c 1d56a: 6b c0 rjmp .+214 ; 0x1d642 1d56c: 16 16 cp r1, r22 1d56e: 17 06 cpc r1, r23 1d570: 0c f0 brlt .+2 ; 0x1d574 1d572: 67 c0 rjmp .+206 ; 0x1d642 1d574: 19 01 movw r2, r18 1d576: 5b 83 std Y+3, r21 ; 0x03 1d578: 4a 83 std Y+2, r20 ; 0x02 1d57a: 6b 01 movw r12, r22 1d57c: 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)); 1d57e: fa 01 movw r30, r20 1d580: 00 81 ld r16, Z 1d582: 11 81 ldd r17, Z+1 ; 0x01 1d584: b8 01 movw r22, r16 1d586: 90 e0 ldi r25, 0x00 ; 0 1d588: 80 e0 ldi r24, 0x00 ; 0 1d58a: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 1d58e: 4b 01 movw r8, r22 1d590: 5c 01 movw r10, r24 1d592: b6 01 movw r22, r12 1d594: 0d 2c mov r0, r13 1d596: 00 0c add r0, r0 1d598: 88 0b sbc r24, r24 1d59a: 99 0b sbc r25, r25 1d59c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1d5a0: 2b 01 movw r4, r22 1d5a2: 3c 01 movw r6, r24 1d5a4: a5 01 movw r20, r10 1d5a6: 94 01 movw r18, r8 1d5a8: c5 01 movw r24, r10 1d5aa: b4 01 movw r22, r8 1d5ac: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1d5b0: 9b 01 movw r18, r22 1d5b2: ac 01 movw r20, r24 1d5b4: c3 01 movw r24, r6 1d5b6: b2 01 movw r22, r4 1d5b8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 1d5bc: 9b 01 movw r18, r22 1d5be: ac 01 movw r20, r24 1d5c0: 6a e0 ldi r22, 0x0A ; 10 1d5c2: 77 ed ldi r23, 0xD7 ; 215 1d5c4: 83 ea ldi r24, 0xA3 ; 163 1d5c6: 9b e3 ldi r25, 0x3B ; 59 1d5c8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__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); 1d5cc: 20 e0 ldi r18, 0x00 ; 0 1d5ce: 30 e0 ldi r19, 0x00 ; 0 1d5d0: 40 e0 ldi r20, 0x00 ; 0 1d5d2: 5f e3 ldi r21, 0x3F ; 63 1d5d4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1d5d8: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__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){ 1d5dc: 6e 15 cp r22, r14 1d5de: 7f 05 cpc r23, r15 1d5e0: 28 f5 brcc .+74 ; 0x1d62c 1d5e2: f9 81 ldd r31, Y+1 ; 0x01 1d5e4: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1d5e6: ea 81 ldd r30, Y+2 ; 0x02 1d5e8: fb 81 ldd r31, Y+3 ; 0x03 1d5ea: 80 81 ld r24, Z 1d5ec: 91 81 ldd r25, Z+1 ; 0x01 1d5ee: 0e 94 8a e8 call 0x1d114 ; 0x1d114 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1d5f2: f1 01 movw r30, r2 1d5f4: 80 81 ld r24, Z 1d5f6: 91 81 ldd r25, Z+1 ; 0x01 1d5f8: 01 97 sbiw r24, 0x01 ; 1 1d5fa: 91 83 std Z+1, r25 ; 0x01 1d5fc: 80 83 st Z, r24 return true; 1d5fe: 81 e0 ldi r24, 0x01 ; 1 } 1d600: 0f 90 pop r0 1d602: 0f 90 pop r0 1d604: 0f 90 pop r0 1d606: df 91 pop r29 1d608: cf 91 pop r28 1d60a: 1f 91 pop r17 1d60c: 0f 91 pop r16 1d60e: ff 90 pop r15 1d610: ef 90 pop r14 1d612: df 90 pop r13 1d614: cf 90 pop r12 1d616: bf 90 pop r11 1d618: af 90 pop r10 1d61a: 9f 90 pop r9 1d61c: 8f 90 pop r8 1d61e: 7f 90 pop r7 1d620: 6f 90 pop r6 1d622: 5f 90 pop r5 1d624: 4f 90 pop r4 1d626: 3f 90 pop r3 1d628: 2f 90 pop r2 1d62a: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1d62c: 66 27 eor r22, r22 1d62e: 77 27 eor r23, r23 1d630: 6c 19 sub r22, r12 1d632: 7d 09 sbc r23, r13 1d634: 98 01 movw r18, r16 1d636: 4a 81 ldd r20, Y+2 ; 0x02 1d638: 5b 81 ldd r21, Y+3 ; 0x03 1d63a: 89 81 ldd r24, Y+1 ; 0x01 1d63c: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 1d640: d8 cf rjmp .-80 ; 0x1d5f2 /// 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; 1d642: 80 e0 ldi r24, 0x00 ; 0 1d644: dd cf rjmp .-70 ; 0x1d600 0001d646 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1d646: 0f 93 push r16 1d648: 1f 93 push r17 1d64a: cf 93 push r28 1d64c: df 93 push r29 1d64e: 18 2f mov r17, r24 1d650: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d652: d1 e0 ldi r29, 0x01 ; 1 1d654: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1d656: 81 2f mov r24, r17 1d658: 8d 23 and r24, r29 1d65a: 29 f0 breq .+10 ; 0x1d666 sm4_set_dir(i, dir & mask); 1d65c: 60 2f mov r22, r16 1d65e: 6d 23 and r22, r29 1d660: 8c 2f mov r24, r28 1d662: 0f 94 23 52 call 0x2a446 ; 0x2a446 } } } 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) { 1d666: cf 5f subi r28, 0xFF ; 255 1d668: dd 0f add r29, r29 1d66a: c3 30 cpi r28, 0x03 ; 3 1d66c: a1 f7 brne .-24 ; 0x1d656 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1d66e: df 91 pop r29 1d670: cf 91 pop r28 1d672: 1f 91 pop r17 1d674: 0f 91 pop r16 1d676: 08 95 ret 0001d678 : //@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) { 1d678: 8f 92 push r8 1d67a: 9f 92 push r9 1d67c: af 92 push r10 1d67e: bf 92 push r11 1d680: cf 92 push r12 1d682: df 92 push r13 1d684: ef 92 push r14 1d686: ff 92 push r15 1d688: 30 e0 ldi r19, 0x00 ; 0 1d68a: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1d68c: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1d68e: 48 2f mov r20, r24 1d690: 49 23 and r20, r25 1d692: 19 f1 breq .+70 ; 0x1d6da count_position[i] += dir & mask ? -1L : 1L; 1d694: a9 01 movw r20, r18 1d696: 44 0f add r20, r20 1d698: 55 1f adc r21, r21 1d69a: 44 0f add r20, r20 1d69c: 55 1f adc r21, r21 1d69e: fa 01 movw r30, r20 1d6a0: ed 54 subi r30, 0x4D ; 77 1d6a2: f9 4f sbci r31, 0xF9 ; 249 1d6a4: c0 80 ld r12, Z 1d6a6: d1 80 ldd r13, Z+1 ; 0x01 1d6a8: e2 80 ldd r14, Z+2 ; 0x02 1d6aa: f3 80 ldd r15, Z+3 ; 0x03 1d6ac: 76 2f mov r23, r22 1d6ae: 79 23 and r23, r25 1d6b0: 81 2c mov r8, r1 1d6b2: 91 2c mov r9, r1 1d6b4: 54 01 movw r10, r8 1d6b6: 83 94 inc r8 1d6b8: 77 23 and r23, r23 1d6ba: 21 f0 breq .+8 ; 0x1d6c4 1d6bc: 88 24 eor r8, r8 1d6be: 8a 94 dec r8 1d6c0: 98 2c mov r9, r8 1d6c2: 54 01 movw r10, r8 1d6c4: c8 0c add r12, r8 1d6c6: d9 1c adc r13, r9 1d6c8: ea 1c adc r14, r10 1d6ca: fb 1c adc r15, r11 1d6cc: 4d 54 subi r20, 0x4D ; 77 1d6ce: 59 4f sbci r21, 0xF9 ; 249 1d6d0: fa 01 movw r30, r20 1d6d2: c0 82 st Z, r12 1d6d4: d1 82 std Z+1, r13 ; 0x01 1d6d6: e2 82 std Z+2, r14 ; 0x02 1d6d8: 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) { 1d6da: 99 0f add r25, r25 1d6dc: 2f 5f subi r18, 0xFF ; 255 1d6de: 3f 4f sbci r19, 0xFF ; 255 1d6e0: 23 30 cpi r18, 0x03 ; 3 1d6e2: 31 05 cpc r19, r1 1d6e4: a1 f6 brne .-88 ; 0x1d68e if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1d6e6: ff 90 pop r15 1d6e8: ef 90 pop r14 1d6ea: df 90 pop r13 1d6ec: cf 90 pop r12 1d6ee: bf 90 pop r11 1d6f0: af 90 pop r10 1d6f2: 9f 90 pop r9 1d6f4: 8f 90 pop r8 1d6f6: 08 95 ret 0001d6f8 : /// 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) { 1d6f8: 2f 92 push r2 1d6fa: 3f 92 push r3 1d6fc: 4f 92 push r4 1d6fe: 5f 92 push r5 1d700: 6f 92 push r6 1d702: 7f 92 push r7 1d704: 8f 92 push r8 1d706: 9f 92 push r9 1d708: af 92 push r10 1d70a: bf 92 push r11 1d70c: cf 92 push r12 1d70e: df 92 push r13 1d710: ef 92 push r14 1d712: ff 92 push r15 1d714: 0f 93 push r16 1d716: 1f 93 push r17 1d718: cf 93 push r28 1d71a: df 93 push r29 1d71c: 00 d0 rcall .+0 ; 0x1d71e 1d71e: 00 d0 rcall .+0 ; 0x1d720 1d720: cd b7 in r28, 0x3d ; 61 1d722: 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]; 1d724: c0 90 b3 06 lds r12, 0x06B3 ; 0x8006b3 1d728: d0 90 b4 06 lds r13, 0x06B4 ; 0x8006b4 1d72c: e0 90 b5 06 lds r14, 0x06B5 ; 0x8006b5 1d730: f0 90 b6 06 lds r15, 0x06B6 ; 0x8006b6 1d734: 7c 01 movw r14, r24 1d736: ec 18 sub r14, r12 1d738: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1d73a: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 1d73e: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 1d742: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 1d746: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 1d74a: 68 1b sub r22, r24 1d74c: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1d74e: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 1d752: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 1d756: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 1d75a: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 1d75e: fa 01 movw r30, r20 1d760: e8 1b sub r30, r24 1d762: f9 0b sbc r31, r25 1d764: fa 83 std Y+2, r31 ; 0x02 1d766: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1d768: fb 01 movw r30, r22 1d76a: ff 0f add r31, r31 1d76c: ee 0b sbc r30, r30 1d76e: ff 0f add r31, r31 1d770: fe 2f mov r31, r30 1d772: ee 1f adc r30, r30 1d774: e2 70 andi r30, 0x02 ; 2 1d776: 89 81 ldd r24, Y+1 ; 0x01 1d778: 9a 81 ldd r25, Y+2 ; 0x02 1d77a: 88 e0 ldi r24, 0x08 ; 8 1d77c: 98 02 muls r25, r24 1d77e: 81 2d mov r24, r1 1d780: 99 0b sbc r25, r25 1d782: 11 24 eor r1, r1 1d784: 84 70 andi r24, 0x04 ; 4 1d786: e8 2b or r30, r24 1d788: 8f 2d mov r24, r15 1d78a: 88 1f adc r24, r24 1d78c: 88 27 eor r24, r24 1d78e: 88 1f adc r24, r24 1d790: e8 2b or r30, r24 1d792: e0 93 ff 03 sts 0x03FF, r30 ; 0x8003ff asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1d796: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1d79a: 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; 1d79c: 8a e0 ldi r24, 0x0A ; 10 1d79e: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1d7a0: e0 fd sbrc r30, 0 1d7a2: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1d7a4: e1 fd sbrc r30, 1 1d7a6: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1d7a8: e2 fd sbrc r30, 2 1d7aa: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1d7ac: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1d7ae: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1d7b2: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1d7b4: 84 e2 ldi r24, 0x24 ; 36 1d7b6: 9d ec ldi r25, 0xCD ; 205 1d7b8: 01 11 cpse r16, r1 1d7ba: 02 c0 rjmp .+4 ; 0x1d7c0 1d7bc: 90 e0 ldi r25, 0x00 ; 0 1d7be: 80 e0 ldi r24, 0x00 ; 0 1d7c0: 90 93 89 06 sts 0x0689, r25 ; 0x800689 1d7c4: 80 93 88 06 sts 0x0688, r24 ; 0x800688 xyzcal_sm4_delay = delay_us; 1d7c8: 30 93 fe 03 sts 0x03FE, r19 ; 0x8003fe 1d7cc: 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; 1d7d0: 29 81 ldd r18, Y+1 ; 0x01 1d7d2: 3a 81 ldd r19, Y+2 ; 0x02 1d7d4: 3e 83 std Y+6, r19 ; 0x06 1d7d6: 2d 83 std Y+5, r18 ; 0x05 1d7d8: 37 ff sbrs r19, 7 1d7da: 05 c0 rjmp .+10 ; 0x1d7e6 1d7dc: 31 95 neg r19 1d7de: 21 95 neg r18 1d7e0: 31 09 sbc r19, r1 1d7e2: 3e 83 std Y+6, r19 ; 0x06 1d7e4: 2d 83 std Y+5, r18 ; 0x05 1d7e6: 8b 01 movw r16, r22 1d7e8: 77 ff sbrs r23, 7 1d7ea: 03 c0 rjmp .+6 ; 0x1d7f2 1d7ec: 11 95 neg r17 1d7ee: 01 95 neg r16 1d7f0: 11 09 sbc r17, r1 1d7f2: f7 fe sbrs r15, 7 1d7f4: 03 c0 rjmp .+6 ; 0x1d7fc 1d7f6: f1 94 neg r15 1d7f8: e1 94 neg r14 1d7fa: 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); 1d7fc: 98 01 movw r18, r16 1d7fe: d8 01 movw r26, r16 1d800: 0f 94 3b dd call 0x3ba76 ; 0x3ba76 <__mulhisi3> 1d804: 4b 01 movw r8, r22 1d806: 5c 01 movw r10, r24 1d808: 2d 81 ldd r18, Y+5 ; 0x05 1d80a: 3e 81 ldd r19, Y+6 ; 0x06 1d80c: d9 01 movw r26, r18 1d80e: 0f 94 3b dd call 0x3ba76 ; 0x3ba76 <__mulhisi3> 1d812: 86 0e add r8, r22 1d814: 97 1e adc r9, r23 1d816: a8 1e adc r10, r24 1d818: b9 1e adc r11, r25 1d81a: 97 01 movw r18, r14 1d81c: d7 01 movw r26, r14 1d81e: 0f 94 3b dd call 0x3ba76 ; 0x3ba76 <__mulhisi3> 1d822: 68 0d add r22, r8 1d824: 79 1d adc r23, r9 1d826: 8a 1d adc r24, r10 1d828: 9b 1d adc r25, r11 1d82a: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 1d82e: 0f 94 19 e1 call 0x3c232 ; 0x3c232 1d832: 20 e0 ldi r18, 0x00 ; 0 1d834: 30 e0 ldi r19, 0x00 ; 0 1d836: 40 e0 ldi r20, 0x00 ; 0 1d838: 5f e3 ldi r21, 0x3F ; 63 1d83a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1d83e: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 1d842: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1d844: 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; 1d846: 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; 1d848: 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; 1d84a: 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; 1d84c: 1c 82 std Y+4, r1 ; 0x04 1d84e: 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; 1d850: 31 2c mov r3, r1 1d852: 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; 1d854: 1a 82 std Y+2, r1 ; 0x02 1d856: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1d858: 61 14 cp r6, r1 1d85a: 71 04 cpc r7, r1 1d85c: 09 f4 brne .+2 ; 0x1d860 1d85e: 47 c0 rjmp .+142 ; 0x1d8ee if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1d860: e0 91 88 06 lds r30, 0x0688 ; 0x800688 1d864: f0 91 89 06 lds r31, 0x0689 ; 0x800689 1d868: 30 97 sbiw r30, 0x00 ; 0 1d86a: e9 f5 brne .+122 ; 0x1d8e6 uint8_t sm = 0; //step mask 1d86c: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1d86e: ec 14 cp r14, r12 1d870: fd 04 cpc r15, r13 1d872: 40 f0 brcs .+16 ; 0x1d884 sm |= 1; cx += dd; 1d874: c4 0c add r12, r4 1d876: d5 1c adc r13, r5 x++; 1d878: 89 81 ldd r24, Y+1 ; 0x01 1d87a: 9a 81 ldd r25, Y+2 ; 0x02 1d87c: 01 96 adiw r24, 0x01 ; 1 1d87e: 9a 83 std Y+2, r25 ; 0x02 1d880: 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; 1d882: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1d884: 0a 15 cp r16, r10 1d886: 1b 05 cpc r17, r11 1d888: 30 f0 brcs .+12 ; 0x1d896 sm |= 2; 1d88a: 82 60 ori r24, 0x02 ; 2 cy += dd; 1d88c: a4 0c add r10, r4 1d88e: b5 1c adc r11, r5 y++; 1d890: 9f ef ldi r25, 0xFF ; 255 1d892: 29 1a sub r2, r25 1d894: 39 0a sbc r3, r25 } if (cz <= dz){ 1d896: ed 81 ldd r30, Y+5 ; 0x05 1d898: fe 81 ldd r31, Y+6 ; 0x06 1d89a: e8 15 cp r30, r8 1d89c: f9 05 cpc r31, r9 1d89e: 48 f0 brcs .+18 ; 0x1d8b2 sm |= 4; 1d8a0: 84 60 ori r24, 0x04 ; 4 cz += dd; 1d8a2: 84 0c add r8, r4 1d8a4: 95 1c adc r9, r5 z++; 1d8a6: 2b 81 ldd r18, Y+3 ; 0x03 1d8a8: 3c 81 ldd r19, Y+4 ; 0x04 1d8aa: 2f 5f subi r18, 0xFF ; 255 1d8ac: 3f 4f sbci r19, 0xFF ; 255 1d8ae: 3c 83 std Y+4, r19 ; 0x04 1d8b0: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1d8b2: ce 18 sub r12, r14 1d8b4: df 08 sbc r13, r15 cy -= dy; 1d8b6: a0 1a sub r10, r16 1d8b8: b1 0a sbc r11, r17 cz -= dz; 1d8ba: ed 81 ldd r30, Y+5 ; 0x05 1d8bc: fe 81 ldd r31, Y+6 ; 0x06 1d8be: 8e 1a sub r8, r30 1d8c0: 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 1d8c2: 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); 1d8c4: e0 91 84 06 lds r30, 0x0684 ; 0x800684 1d8c8: f0 91 85 06 lds r31, 0x0685 ; 0x800685 1d8cc: 30 97 sbiw r30, 0x00 ; 0 1d8ce: d1 f1 breq .+116 ; 0x1d944 1d8d0: b2 01 movw r22, r4 1d8d2: c3 01 movw r24, r6 1d8d4: 19 95 eicall if (delay) delayMicroseconds(delay); 1d8d6: 00 97 sbiw r24, 0x00 ; 0 1d8d8: 11 f0 breq .+4 ; 0x1d8de 1d8da: 0e 94 8a e8 call 0x1d114 ; 0x1d114 nd--; 1d8de: f1 e0 ldi r31, 0x01 ; 1 1d8e0: 6f 1a sub r6, r31 1d8e2: 71 08 sbc r7, r1 1d8e4: b9 cf rjmp .-142 ; 0x1d858 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; 1d8e6: 19 95 eicall 1d8e8: 88 23 and r24, r24 1d8ea: 09 f4 brne .+2 ; 0x1d8ee 1d8ec: bf cf rjmp .-130 ; 0x1d86c 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) 1d8ee: e0 91 86 06 lds r30, 0x0686 ; 0x800686 1d8f2: f0 91 87 06 lds r31, 0x0687 ; 0x800687 1d8f6: 30 97 sbiw r30, 0x00 ; 0 1d8f8: 41 f0 breq .+16 ; 0x1d90a (*sm4_update_pos_cb)(x, y, z, 0); 1d8fa: 30 e0 ldi r19, 0x00 ; 0 1d8fc: 20 e0 ldi r18, 0x00 ; 0 1d8fe: 4b 81 ldd r20, Y+3 ; 0x03 1d900: 5c 81 ldd r21, Y+4 ; 0x04 1d902: b1 01 movw r22, r2 1d904: 89 81 ldd r24, Y+1 ; 0x01 1d906: 9a 81 ldd r25, Y+2 ; 0x02 1d908: 19 95 eicall 1d90a: 81 e0 ldi r24, 0x01 ; 1 1d90c: 67 28 or r6, r7 1d90e: 09 f4 brne .+2 ; 0x1d912 1d910: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1d912: 26 96 adiw r28, 0x06 ; 6 1d914: 0f b6 in r0, 0x3f ; 63 1d916: f8 94 cli 1d918: de bf out 0x3e, r29 ; 62 1d91a: 0f be out 0x3f, r0 ; 63 1d91c: cd bf out 0x3d, r28 ; 61 1d91e: df 91 pop r29 1d920: cf 91 pop r28 1d922: 1f 91 pop r17 1d924: 0f 91 pop r16 1d926: ff 90 pop r15 1d928: ef 90 pop r14 1d92a: df 90 pop r13 1d92c: cf 90 pop r12 1d92e: bf 90 pop r11 1d930: af 90 pop r10 1d932: 9f 90 pop r9 1d934: 8f 90 pop r8 1d936: 7f 90 pop r7 1d938: 6f 90 pop r6 1d93a: 5f 90 pop r5 1d93c: 4f 90 pop r4 1d93e: 3f 90 pop r3 1d940: 2f 90 pop r2 1d942: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1d944: 84 ef ldi r24, 0xF4 ; 244 1d946: 91 e0 ldi r25, 0x01 ; 1 1d948: c8 cf rjmp .-112 ; 0x1d8da 0001d94a : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1d94a: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1d94c: 0d b4 in r0, 0x2d ; 45 1d94e: 07 fe sbrs r0, 7 1d950: fd cf rjmp .-6 ; 0x1d94c return SPDR; 1d952: 8e b5 in r24, 0x2e ; 46 } 1d954: 08 95 ret 0001d956 : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1d956: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1d958: 85 e0 ldi r24, 0x05 ; 5 1d95a: 0e 94 a5 ec call 0x1d94a ; 0x1d94a uint8_t val = _SPI_RX(); // receive value 1d95e: 8f ef ldi r24, 0xFF ; 255 1d960: 0e 94 a5 ec call 0x1d94a ; 0x1d94a _CS_HIGH(); 1d964: 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) ; 1d966: 80 fd sbrc r24, 0 1d968: f6 cf rjmp .-20 ; 0x1d956 } 1d96a: 08 95 ret 0001d96c : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1d96c: 1f 93 push r17 1d96e: cf 93 push r28 1d970: df 93 push r29 1d972: ea 01 movw r28, r20 1d974: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1d976: 0e 94 a5 ec call 0x1d94a ; 0x1d94a _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1d97a: 81 2f mov r24, r17 1d97c: 0e 94 a5 ec call 0x1d94a ; 0x1d94a _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1d980: 8d 2f mov r24, r29 1d982: 0e 94 a5 ec call 0x1d94a ; 0x1d94a _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1d986: 8c 2f mov r24, r28 } 1d988: df 91 pop r29 1d98a: cf 91 pop r28 1d98c: 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 1d98e: 0c 94 a5 ec jmp 0x1d94a ; 0x1d94a 0001d992 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1d992: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1d994: 0e 94 b6 ec call 0x1d96c ; 0x1d96c _CS_HIGH(); 1d998: 45 9a sbi 0x08, 5 ; 8 } 1d99a: 08 95 ret 0001d99c : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1d99c: ef 92 push r14 1d99e: ff 92 push r15 1d9a0: 0f 93 push r16 1d9a2: 1f 93 push r17 1d9a4: cf 93 push r28 1d9a6: df 93 push r29 1d9a8: 7a 01 movw r14, r20 1d9aa: 89 01 movw r16, r18 _CS_LOW(); 1d9ac: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1d9ae: ab 01 movw r20, r22 1d9b0: bc 01 movw r22, r24 1d9b2: 82 e0 ldi r24, 0x02 ; 2 1d9b4: 0e 94 b6 ec call 0x1d96c ; 0x1d96c 1d9b8: e7 01 movw r28, r14 1d9ba: 0e 0d add r16, r14 1d9bc: 1f 1d adc r17, r15 while (cnt--) // send data 1d9be: c0 17 cp r28, r16 1d9c0: d1 07 cpc r29, r17 1d9c2: 41 f4 brne .+16 ; 0x1d9d4 _SPI_TX(*(data++)); _CS_HIGH(); 1d9c4: 45 9a sbi 0x08, 5 ; 8 } 1d9c6: df 91 pop r29 1d9c8: cf 91 pop r28 1d9ca: 1f 91 pop r17 1d9cc: 0f 91 pop r16 1d9ce: ff 90 pop r15 1d9d0: ef 90 pop r14 1d9d2: 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++)); 1d9d4: 89 91 ld r24, Y+ 1d9d6: 0e 94 a5 ec call 0x1d94a ; 0x1d94a 1d9da: f1 cf rjmp .-30 ; 0x1d9be 0001d9dc : _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) { 1d9dc: ef 92 push r14 1d9de: ff 92 push r15 1d9e0: 0f 93 push r16 1d9e2: 1f 93 push r17 1d9e4: cf 93 push r28 1d9e6: df 93 push r29 1d9e8: 7a 01 movw r14, r20 1d9ea: 89 01 movw r16, r18 _CS_LOW(); 1d9ec: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1d9ee: ab 01 movw r20, r22 1d9f0: bc 01 movw r22, r24 1d9f2: 83 e0 ldi r24, 0x03 ; 3 1d9f4: 0e 94 b6 ec call 0x1d96c ; 0x1d96c 1d9f8: e7 01 movw r28, r14 1d9fa: 0e 0d add r16, r14 1d9fc: 1f 1d adc r17, r15 while (cnt--) // receive data 1d9fe: c0 17 cp r28, r16 1da00: d1 07 cpc r29, r17 1da02: 41 f4 brne .+16 ; 0x1da14 *(data++) = _SPI_RX(); _CS_HIGH(); 1da04: 45 9a sbi 0x08, 5 ; 8 } 1da06: df 91 pop r29 1da08: cf 91 pop r28 1da0a: 1f 91 pop r17 1da0c: 0f 91 pop r16 1da0e: ff 90 pop r15 1da10: ef 90 pop r14 1da12: 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(); 1da14: 8f ef ldi r24, 0xFF ; 255 1da16: 0e 94 a5 ec call 0x1d94a ; 0x1d94a 1da1a: 89 93 st Y+, r24 1da1c: f0 cf rjmp .-32 ; 0x1d9fe 0001da1e : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1da1e: 0f 93 push r16 1da20: 1f 93 push r17 1da22: cf 93 push r28 1da24: df 93 push r29 1da26: 00 d0 rcall .+0 ; 0x1da28 1da28: 1f 92 push r1 1da2a: cd b7 in r28, 0x3d ; 61 1da2c: de b7 in r29, 0x3e ; 62 1da2e: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1da30: 8c e5 ldi r24, 0x5C ; 92 1da32: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1da34: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1da36: 24 e0 ldi r18, 0x04 ; 4 1da38: 30 e0 ldi r19, 0x00 ; 0 1da3a: ae 01 movw r20, r28 1da3c: 4f 5f subi r20, 0xFF ; 255 1da3e: 5f 4f sbci r21, 0xFF ; 255 1da40: 60 e0 ldi r22, 0x00 ; 0 1da42: 70 ed ldi r23, 0xD0 ; 208 1da44: 83 e0 ldi r24, 0x03 ; 3 1da46: 90 e0 ldi r25, 0x00 ; 0 1da48: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1da4c: 89 81 ldd r24, Y+1 ; 0x01 1da4e: 9a 81 ldd r25, Y+2 ; 0x02 1da50: ab 81 ldd r26, Y+3 ; 0x03 1da52: bc 81 ldd r27, Y+4 ; 0x04 1da54: 87 34 cpi r24, 0x47 ; 71 1da56: 95 45 sbci r25, 0x55 ; 85 1da58: a2 45 sbci r26, 0x52 ; 82 1da5a: b5 45 sbci r27, 0x55 ; 85 1da5c: 71 f4 brne .+28 ; 0x1da7a return false; if (reason) 1da5e: 01 15 cp r16, r1 1da60: 11 05 cpc r17, r1 1da62: 49 f0 breq .+18 ; 0x1da76 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1da64: 21 e0 ldi r18, 0x01 ; 1 1da66: 30 e0 ldi r19, 0x00 ; 0 1da68: a8 01 movw r20, r16 1da6a: 65 e0 ldi r22, 0x05 ; 5 1da6c: 70 ed ldi r23, 0xD0 ; 208 1da6e: 83 e0 ldi r24, 0x03 ; 3 1da70: 90 e0 ldi r25, 0x00 ; 0 1da72: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc (uint8_t*)reason, sizeof(*reason)); } return true; 1da76: 81 e0 ldi r24, 0x01 ; 1 1da78: 01 c0 rjmp .+2 ; 0x1da7c XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1da7a: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1da7c: 0f 90 pop r0 1da7e: 0f 90 pop r0 1da80: 0f 90 pop r0 1da82: 0f 90 pop r0 1da84: df 91 pop r29 1da86: cf 91 pop r28 1da88: 1f 91 pop r17 1da8a: 0f 91 pop r16 1da8c: 08 95 ret 0001da8e : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1da8e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1da90: 86 e0 ldi r24, 0x06 ; 6 1da92: 0e 94 a5 ec call 0x1d94a ; 0x1d94a _CS_HIGH(); 1da96: 45 9a sbi 0x08, 5 ; 8 } 1da98: 08 95 ret 0001da9a : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1da9a: 4f 92 push r4 1da9c: 5f 92 push r5 1da9e: 6f 92 push r6 1daa0: 7f 92 push r7 1daa2: 8f 92 push r8 1daa4: 9f 92 push r9 1daa6: af 92 push r10 1daa8: bf 92 push r11 1daaa: ef 92 push r14 1daac: ff 92 push r15 1daae: 0f 93 push r16 1dab0: 1f 93 push r17 1dab2: cf 93 push r28 1dab4: df 93 push r29 1dab6: 7c 01 movw r14, r24 1dab8: 4a 01 movw r8, r20 1daba: 5b 01 movw r10, r22 1dabc: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dabe: 8c e5 ldi r24, 0x5C ; 92 1dac0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dac2: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1dac4: 41 2c mov r4, r1 1dac6: 80 ed ldi r24, 0xD0 ; 208 1dac8: 58 2e mov r5, r24 1daca: 83 e0 ldi r24, 0x03 ; 3 1dacc: 68 2e mov r6, r24 1dace: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1dad0: 0e 94 47 ed call 0x1da8e ; 0x1da8e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1dad4: b3 01 movw r22, r6 1dad6: a2 01 movw r20, r4 1dad8: 80 e2 ldi r24, 0x20 ; 32 1dada: 0e 94 c9 ec call 0x1d992 ; 0x1d992 xflash_sector_erase(addr); xflash_wait_busy(); 1dade: 0e 94 ab ec call 0x1d956 ; 0x1d956 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1dae2: 80 e1 ldi r24, 0x10 ; 16 1dae4: 58 0e add r5, r24 1dae6: 61 1c adc r6, r1 1dae8: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1daea: 41 14 cp r4, r1 1daec: 51 04 cpc r5, r1 1daee: e4 e0 ldi r30, 0x04 ; 4 1daf0: 6e 06 cpc r6, r30 1daf2: 71 04 cpc r7, r1 1daf4: 69 f7 brne .-38 ; 0x1dad0 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1daf6: 8d b7 in r24, 0x3d ; 61 1daf8: 9e b7 in r25, 0x3e ; 62 1dafa: f7 01 movw r30, r14 1dafc: 93 87 std Z+11, r25 ; 0x0b 1dafe: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1db00: 00 d0 rcall .+0 ; 0x1db02 1db02: 8f 91 pop r24 1db04: 9f 91 pop r25 1db06: af 91 pop r26 hdr.pc = GETPC(); 1db08: b0 e0 ldi r27, 0x00 ; 0 1db0a: 86 83 std Z+6, r24 ; 0x06 1db0c: 97 83 std Z+7, r25 ; 0x07 1db0e: a0 87 std Z+8, r26 ; 0x08 1db10: 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(); 1db12: 0e 94 47 ed call 0x1da8e ; 0x1da8e xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1db16: 2c e0 ldi r18, 0x0C ; 12 1db18: 30 e0 ldi r19, 0x00 ; 0 1db1a: a7 01 movw r20, r14 1db1c: 60 e0 ldi r22, 0x00 ; 0 1db1e: 70 ed ldi r23, 0xD0 ; 208 1db20: 83 e0 ldi r24, 0x03 ; 3 1db22: 90 e0 ldi r25, 0x00 ; 0 1db24: 0e 94 ce ec call 0x1d99c ; 0x1d99c xflash_wait_busy(); 1db28: 0e 94 ab ec call 0x1d956 ; 0x1d956 void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1db2c: 0e 94 47 ed call 0x1da8e ; 0x1da8e _CS_LOW(); 1db30: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1db32: b5 01 movw r22, r10 1db34: a4 01 movw r20, r8 1db36: 82 e0 ldi r24, 0x02 ; 2 1db38: 0e 94 b6 ec call 0x1d96c ; 0x1d96c 1db3c: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1db3e: 21 96 adiw r28, 0x01 ; 1 1db40: 80 81 ld r24, Z 1db42: 0e 94 a5 ec call 0x1d94a ; 0x1d94a if(!--cnt || !(++addr & 0xFF)) 1db46: 01 50 subi r16, 0x01 ; 1 1db48: 11 09 sbc r17, r1 1db4a: 41 f0 breq .+16 ; 0x1db5c 1db4c: ff ef ldi r31, 0xFF ; 255 1db4e: 8f 1a sub r8, r31 1db50: 9f 0a sbc r9, r31 1db52: af 0a sbc r10, r31 1db54: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1db56: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1db58: 81 10 cpse r8, r1 1db5a: f1 cf rjmp .-30 ; 0x1db3e { // on a page boundary or end of write _CS_HIGH(); 1db5c: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1db5e: 0e 94 ab ec call 0x1d956 ; 0x1d956 _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1db62: 01 15 cp r16, r1 1db64: 11 05 cpc r17, r1 1db66: 11 f7 brne .-60 ; 0x1db2c // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1db68: df 91 pop r29 1db6a: cf 91 pop r28 1db6c: 1f 91 pop r17 1db6e: 0f 91 pop r16 1db70: ff 90 pop r15 1db72: ef 90 pop r14 1db74: bf 90 pop r11 1db76: af 90 pop r10 1db78: 9f 90 pop r9 1db7a: 8f 90 pop r8 1db7c: 7f 90 pop r7 1db7e: 6f 90 pop r6 1db80: 5f 90 pop r5 1db82: 4f 90 pop r4 1db84: 08 95 ret 0001db86 : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1db86: cf 93 push r28 1db88: df 93 push r29 1db8a: cd b7 in r28, 0x3d ; 61 1db8c: de b7 in r29, 0x3e ; 62 1db8e: 2c 97 sbiw r28, 0x0c ; 12 1db90: 0f b6 in r0, 0x3f ; 63 1db92: f8 94 cli 1db94: de bf out 0x3e, r29 ; 62 1db96: 0f be out 0x3f, r0 ; 63 1db98: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1db9a: 47 e4 ldi r20, 0x47 ; 71 1db9c: 55 e5 ldi r21, 0x55 ; 85 1db9e: 62 e5 ldi r22, 0x52 ; 82 1dba0: 75 e5 ldi r23, 0x55 ; 85 1dba2: 49 83 std Y+1, r20 ; 0x01 1dba4: 5a 83 std Y+2, r21 ; 0x02 1dba6: 6b 83 std Y+3, r22 ; 0x03 1dba8: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1dbaa: 91 e0 ldi r25, 0x01 ; 1 1dbac: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1dbae: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1dbb0: f8 94 cli 1dbb2: 88 e1 ldi r24, 0x18 ; 24 1dbb4: 9d e0 ldi r25, 0x0D ; 13 1dbb6: 0f b6 in r0, 0x3f ; 63 1dbb8: f8 94 cli 1dbba: a8 95 wdr 1dbbc: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1dbc0: 0f be out 0x3f, r0 ; 63 1dbc2: 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); 1dbc6: 00 e0 ldi r16, 0x00 ; 0 1dbc8: 12 e2 ldi r17, 0x22 ; 34 1dbca: 30 e0 ldi r19, 0x00 ; 0 1dbcc: 20 e0 ldi r18, 0x00 ; 0 1dbce: 40 e0 ldi r20, 0x00 ; 0 1dbd0: 51 ed ldi r21, 0xD1 ; 209 1dbd2: 63 e0 ldi r22, 0x03 ; 3 1dbd4: 70 e0 ldi r23, 0x00 ; 0 1dbd6: ce 01 movw r24, r28 1dbd8: 01 96 adiw r24, 0x01 ; 1 1dbda: 0e 94 4d ed call 0x1da9a ; 0x1da9a // force a reset even sooner softReset(); 1dbde: 0e 94 53 67 call 0xcea6 ; 0xcea6 0001dbe2 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1dbe2: 0f 93 push r16 1dbe4: 1f 93 push r17 1dbe6: cf 93 push r28 1dbe8: df 93 push r29 1dbea: cd b7 in r28, 0x3d ; 61 1dbec: de b7 in r29, 0x3e ; 62 1dbee: 2c 97 sbiw r28, 0x0c ; 12 1dbf0: 0f b6 in r0, 0x3f ; 63 1dbf2: f8 94 cli 1dbf4: de bf out 0x3e, r29 ; 62 1dbf6: 0f be out 0x3f, r0 ; 63 1dbf8: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1dbfa: 87 e4 ldi r24, 0x47 ; 71 1dbfc: 95 e5 ldi r25, 0x55 ; 85 1dbfe: a2 e5 ldi r26, 0x52 ; 82 1dc00: b5 e5 ldi r27, 0x55 ; 85 1dc02: 89 83 std Y+1, r24 ; 0x01 1dc04: 9a 83 std Y+2, r25 ; 0x02 1dc06: ab 83 std Y+3, r26 ; 0x03 1dc08: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1dc0a: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1dc0c: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1dc0e: 00 e0 ldi r16, 0x00 ; 0 1dc10: 10 e2 ldi r17, 0x20 ; 32 1dc12: 20 e0 ldi r18, 0x00 ; 0 1dc14: 32 e0 ldi r19, 0x02 ; 2 1dc16: 40 e0 ldi r20, 0x00 ; 0 1dc18: 53 ed ldi r21, 0xD3 ; 211 1dc1a: 63 e0 ldi r22, 0x03 ; 3 1dc1c: 70 e0 ldi r23, 0x00 ; 0 1dc1e: ce 01 movw r24, r28 1dc20: 01 96 adiw r24, 0x01 ; 1 1dc22: 0e 94 4d ed call 0x1da9a ; 0x1da9a (uint8_t*)RAMSTART, RAMSIZE); } 1dc26: 2c 96 adiw r28, 0x0c ; 12 1dc28: 0f b6 in r0, 0x3f ; 63 1dc2a: f8 94 cli 1dc2c: de bf out 0x3e, r29 ; 62 1dc2e: 0f be out 0x3f, r0 ; 63 1dc30: cd bf out 0x3d, r28 ; 61 1dc32: df 91 pop r29 1dc34: cf 91 pop r28 1dc36: 1f 91 pop r17 1dc38: 0f 91 pop r16 1dc3a: 08 95 ret 0001dc3c : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1dc3c: cf 93 push r28 _CS_HIGH(); 1dc3e: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1dc40: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1dc42: 8c e5 ldi r24, 0x5C ; 92 1dc44: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1dc46: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1dc48: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1dc4a: 80 e9 ldi r24, 0x90 ; 144 1dc4c: 0e 94 a5 ec call 0x1d94a ; 0x1d94a uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1dc50: 80 e0 ldi r24, 0x00 ; 0 1dc52: 0e 94 a5 ec call 0x1d94a ; 0x1d94a 1dc56: 80 e0 ldi r24, 0x00 ; 0 1dc58: 0e 94 a5 ec call 0x1d94a ; 0x1d94a 1dc5c: 80 e0 ldi r24, 0x00 ; 0 1dc5e: 0e 94 a5 ec call 0x1d94a ; 0x1d94a uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1dc62: 8f ef ldi r24, 0xFF ; 255 1dc64: 0e 94 a5 ec call 0x1d94a ; 0x1d94a 1dc68: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1dc6a: 8f ef ldi r24, 0xFF ; 255 1dc6c: 0e 94 a5 ec call 0x1d94a ; 0x1d94a 1dc70: 98 2f mov r25, r24 _CS_HIGH(); 1dc72: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1dc74: cf 3e cpi r28, 0xEF ; 239 1dc76: 11 f0 breq .+4 ; 0x1dc7c 1dc78: c8 3c cpi r28, 0xC8 ; 200 1dc7a: 19 f4 brne .+6 ; 0x1dc82 1dc7c: 81 e0 ldi r24, 0x01 ; 1 1dc7e: 91 31 cpi r25, 0x11 ; 17 1dc80: 09 f0 breq .+2 ; 0x1dc84 int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1dc82: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1dc84: cf 91 pop r28 1dc86: 08 95 ret 0001dc88 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1dc88: cf 93 push r28 1dc8a: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dc8c: 86 ea ldi r24, 0xA6 ; 166 1dc8e: 9c e0 ldi r25, 0x0C ; 12 1dc90: 0f 94 23 dc call 0x3b846 ; 0x3b846 status &= ~components; 1dc94: c0 95 com r28 1dc96: 6c 2f mov r22, r28 1dc98: 68 23 and r22, r24 1dc9a: 86 ea ldi r24, 0xA6 ; 166 1dc9c: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1dc9e: cf 91 pop r28 1dca0: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0001dca4 : } } } static void lcd_reset_sheet() { 1dca4: 1f 93 push r17 1dca6: cf 93 push r28 1dca8: df 93 push r29 1dcaa: 00 d0 rcall .+0 ; 0x1dcac 1dcac: 00 d0 rcall .+0 ; 0x1dcae 1dcae: 1f 92 push r1 1dcb0: 1f 92 push r1 1dcb2: cd b7 in r28, 0x3d ; 61 1dcb4: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1dcb6: be 01 movw r22, r28 1dcb8: 6f 5f subi r22, 0xFF ; 255 1dcba: 7f 4f sbci r23, 0xFF ; 255 1dcbc: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1dcc0: 0e 94 78 76 call 0xecf0 ; 0xecf0 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1dcc4: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1dcc8: 1b e0 ldi r17, 0x0B ; 11 1dcca: 81 9f mul r24, r17 1dccc: c0 01 movw r24, r0 1dcce: 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); 1dcd0: 6f ef ldi r22, 0xFF ; 255 1dcd2: 7f ef ldi r23, 0xFF ; 255 1dcd4: 80 5b subi r24, 0xB0 ; 176 1dcd6: 92 4f sbci r25, 0xF2 ; 242 1dcd8: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1dcdc: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1dce0: 61 9f mul r22, r17 1dce2: b0 01 movw r22, r0 1dce4: 11 24 eor r1, r1 1dce6: 67 5b subi r22, 0xB7 ; 183 1dce8: 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); 1dcea: 47 e0 ldi r20, 0x07 ; 7 1dcec: 50 e0 ldi r21, 0x00 ; 0 1dcee: ce 01 movw r24, r28 1dcf0: 01 96 adiw r24, 0x01 ; 1 1dcf2: 0f 94 37 dc call 0x3b86e ; 0x3b86e if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1dcf6: 81 ea ldi r24, 0xA1 ; 161 1dcf8: 9d e0 ldi r25, 0x0D ; 13 1dcfa: 0f 94 23 dc call 0x3b846 ; 0x3b846 1dcfe: 90 91 e2 03 lds r25, 0x03E2 ; 0x8003e2 1dd02: 89 13 cpse r24, r25 1dd04: 0a c0 rjmp .+20 ; 0x1dd1a { eeprom_switch_to_next_sheet(); 1dd06: 0e 94 6a 76 call 0xecd4 ; 0xecd4 if (-1 == eeprom_next_initialized_sheet(0)) 1dd0a: 80 e0 ldi r24, 0x00 ; 0 1dd0c: 0e 94 56 76 call 0xecac ; 0xecac 1dd10: 8f 3f cpi r24, 0xFF ; 255 1dd12: 19 f4 brne .+6 ; 0x1dd1a calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1dd14: 80 e1 ldi r24, 0x10 ; 16 1dd16: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 } menu_back(); 1dd1a: 0f 94 65 d4 call 0x3a8ca ; 0x3a8ca } 1dd1e: 28 96 adiw r28, 0x08 ; 8 1dd20: 0f b6 in r0, 0x3f ; 63 1dd22: f8 94 cli 1dd24: de bf out 0x3e, r29 ; 62 1dd26: 0f be out 0x3f, r0 ; 63 1dd28: cd bf out 0x3d, r28 ; 61 1dd2a: df 91 pop r29 1dd2c: cf 91 pop r28 1dd2e: 1f 91 pop r17 1dd30: 08 95 ret 0001dd32 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1dd32: cf 93 push r28 1dd34: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dd36: 86 ea ldi r24, 0xA6 ; 166 1dd38: 9c e0 ldi r25, 0x0C ; 12 1dd3a: 0f 94 23 dc call 0x3b846 ; 0x3b846 status |= components; 1dd3e: 68 2f mov r22, r24 1dd40: 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); 1dd42: 86 ea ldi r24, 0xA6 ; 166 1dd44: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1dd46: cf 91 pop r28 1dd48: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0001dd4c : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1dd4c: cf 93 push r28 1dd4e: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1dd50: 86 ea ldi r24, 0xA6 ; 166 1dd52: 9c e0 ldi r25, 0x0C ; 12 1dd54: 0f 94 23 dc call 0x3b846 ; 0x3b846 return ((status & components) == components); 1dd58: 98 2f mov r25, r24 1dd5a: 9c 23 and r25, r28 1dd5c: 81 e0 ldi r24, 0x01 ; 1 1dd5e: 9c 13 cpse r25, r28 1dd60: 80 e0 ldi r24, 0x00 ; 0 } 1dd62: cf 91 pop r28 1dd64: 08 95 ret 0001dd66 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1dd66: af 92 push r10 1dd68: bf 92 push r11 1dd6a: cf 92 push r12 1dd6c: df 92 push r13 1dd6e: ef 92 push r14 1dd70: ff 92 push r15 1dd72: 0f 93 push r16 1dd74: 1f 93 push r17 1dd76: cf 93 push r28 1dd78: df 93 push r29 1dd7a: 00 d0 rcall .+0 ; 0x1dd7c 1dd7c: 00 d0 rcall .+0 ; 0x1dd7e 1dd7e: 1f 92 push r1 1dd80: cd b7 in r28, 0x3d ; 61 1dd82: 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)) || 1dd84: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1dd88: 81 11 cpse r24, r1 1dd8a: 18 c0 rjmp .+48 ; 0x1ddbc 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))) || 1dd8c: 81 ea ldi r24, 0xA1 ; 161 1dd8e: 9d e0 ldi r25, 0x0D ; 13 1dd90: 0f 94 23 dc call 0x3b846 ; 0x3b846 1dd94: 18 2f mov r17, r24 1dd96: 0e 94 48 76 call 0xec90 ; 0xec90 1dd9a: 88 23 and r24, r24 1dd9c: 79 f0 breq .+30 ; 0x1ddbc (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1dd9e: 80 e1 ldi r24, 0x10 ; 16 1dda0: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 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))) || 1dda4: 88 23 and r24, r24 1dda6: 51 f0 breq .+20 ; 0x1ddbc (!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))))) 1dda8: 2b e0 ldi r18, 0x0B ; 11 1ddaa: 12 9f mul r17, r18 1ddac: c0 01 movw r24, r0 1ddae: 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 1ddb0: 80 5b subi r24, 0xB0 ; 176 1ddb2: 92 4f sbci r25, 0xF2 ; 242 1ddb4: 0f 94 31 dc call 0x3b862 ; 0x3b862 } 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)) || 1ddb8: 89 2b or r24, r25 1ddba: f1 f4 brne .+60 ; 0x1ddf8 (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) 1ddbc: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1ddc0: 88 23 and r24, r24 1ddc2: 71 f0 breq .+28 ; 0x1dde0 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1ddc4: 81 ea ldi r24, 0xA1 ; 161 1ddc6: 9d e0 ldi r25, 0x0D ; 13 1ddc8: 0f 94 23 dc call 0x3b846 ; 0x3b846 1ddcc: 2b e0 ldi r18, 0x0B ; 11 1ddce: 82 9f mul r24, r18 1ddd0: c0 01 movw r24, r0 1ddd2: 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); 1ddd4: 6f ef ldi r22, 0xFF ; 255 1ddd6: 7f ef ldi r23, 0xFF ; 255 1ddd8: 80 5b subi r24, 0xB0 ; 176 1ddda: 92 4f sbci r25, 0xF2 ; 242 1dddc: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca } // 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()); 1dde0: 0e 94 04 71 call 0xe208 ; 0xe208 1dde4: 21 e0 ldi r18, 0x01 ; 1 1dde6: 81 11 cpse r24, r1 1dde8: 20 e0 ldi r18, 0x00 ; 0 1ddea: 41 e0 ldi r20, 0x01 ; 1 1ddec: 70 e0 ldi r23, 0x00 ; 0 1ddee: 60 e0 ldi r22, 0x00 ; 0 1ddf0: 8c ed ldi r24, 0xDC ; 220 1ddf2: 94 ee ldi r25, 0xE4 ; 228 1ddf4: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e } if (lcd_encoder) { 1ddf8: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1ddfc: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1de00: 21 15 cp r18, r1 1de02: 31 05 cpc r19, r1 1de04: 59 f0 breq .+22 ; 0x1de1c menuData->reset = lcd_encoder > 0; 1de06: 81 e0 ldi r24, 0x01 ; 1 1de08: 12 16 cp r1, r18 1de0a: 13 06 cpc r1, r19 1de0c: 0c f0 brlt .+2 ; 0x1de10 1de0e: 80 e0 ldi r24, 0x00 ; 0 1de10: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 lcd_encoder = 0; // Reset 1de14: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1de18: 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)); 1de1c: 81 ea ldi r24, 0xA1 ; 161 1de1e: 9d e0 ldi r25, 0x0D ; 13 1de20: 0f 94 23 dc call 0x3b846 ; 0x3b846 1de24: 1b e0 ldi r17, 0x0B ; 11 1de26: 81 9f mul r24, r17 1de28: b0 01 movw r22, r0 1de2a: 11 24 eor r1, r1 1de2c: 67 5b subi r22, 0xB7 ; 183 1de2e: 72 4f sbci r23, 0xF2 ; 242 1de30: 47 e0 ldi r20, 0x07 ; 7 1de32: 50 e0 ldi r21, 0x00 ; 0 1de34: ce 01 movw r24, r28 1de36: 01 96 adiw r24, 0x01 ; 1 1de38: 7c 01 movw r14, r24 1de3a: 0f 94 13 dc call 0x3b826 ; 0x3b826 lcd_home(); 1de3e: 0e 94 13 6f call 0xde26 ; 0xde26 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]; 1de42: 81 ea ldi r24, 0xA1 ; 161 1de44: 9d e0 ldi r25, 0x0D ; 13 1de46: 0f 94 23 dc call 0x3b846 ; 0x3b846 1de4a: 81 9f mul r24, r17 1de4c: c0 01 movw r24, r0 1de4e: 11 24 eor r1, r1 1de50: 80 5b subi r24, 0xB0 ; 176 1de52: 92 4f sbci r25, 0xF2 ; 242 1de54: 0f 94 31 dc call 0x3b862 ; 0x3b862 1de58: bc 01 movw r22, r24 1de5a: 99 0f add r25, r25 1de5c: 88 0b sbc r24, r24 1de5e: 99 0b sbc r25, r25 1de60: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 1de64: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 1de68: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 1de6c: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 1de70: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 1de74: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 1de78: d6 2e mov r13, r22 1de7a: c7 2e mov r12, r23 1de7c: b8 2e mov r11, r24 1de7e: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1de80: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1de84: 0e e3 ldi r16, 0x3E ; 62 1de86: 10 e2 ldi r17, 0x20 ; 32 1de88: 81 11 cpse r24, r1 1de8a: 02 c0 rjmp .+4 ; 0x1de90 1de8c: 00 e2 ldi r16, 0x20 ; 32 1de8e: 1e e3 ldi r17, 0x3E ; 62 1de90: 8c e5 ldi r24, 0x5C ; 92 1de92: 9b e3 ldi r25, 0x3B ; 59 1de94: 0e 94 b3 72 call 0xe566 ; 0xe566 1de98: 1f 92 push r1 1de9a: 0f 93 push r16 1de9c: 1f 92 push r1 1de9e: 1f 93 push r17 1dea0: af 92 push r10 1dea2: bf 92 push r11 1dea4: cf 92 push r12 1dea6: df 92 push r13 1dea8: ff 92 push r15 1deaa: ef 92 push r14 1deac: 9f 93 push r25 1deae: 8f 93 push r24 1deb0: 0e 94 c0 6e call 0xdd80 ; 0xdd80 1deb4: 0f b6 in r0, 0x3f ; 63 1deb6: f8 94 cli 1deb8: de bf out 0x3e, r29 ; 62 1deba: 0f be out 0x3f, r0 ; 63 1debc: 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. } 1debe: 27 96 adiw r28, 0x07 ; 7 1dec0: 0f b6 in r0, 0x3f ; 63 1dec2: f8 94 cli 1dec4: de bf out 0x3e, r29 ; 62 1dec6: 0f be out 0x3f, r0 ; 63 1dec8: cd bf out 0x3d, r28 ; 61 1deca: df 91 pop r29 1decc: cf 91 pop r28 1dece: 1f 91 pop r17 1ded0: 0f 91 pop r16 1ded2: ff 90 pop r15 1ded4: ef 90 pop r14 1ded6: df 90 pop r13 1ded8: cf 90 pop r12 1deda: bf 90 pop r11 1dedc: af 90 pop r10 1dede: 08 95 ret 0001dee0 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1dee0: 60 91 e2 03 lds r22, 0x03E2 ; 0x8003e2 1dee4: 81 ea ldi r24, 0xA1 ; 161 1dee6: 9d e0 ldi r25, 0x0D ; 13 1dee8: 0f 94 47 dc call 0x3b88e ; 0x3b88e //! @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(); 1deec: 0c 94 b3 ee jmp 0x1dd66 ; 0x1dd66 0001def0 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1def0: 0f 93 push r16 1def2: 1f 93 push r17 1def4: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1def6: 0e 94 a0 cd call 0x19b40 ; 0x19b40 if (*str != '.') 1defa: fc 01 movw r30, r24 1defc: 20 81 ld r18, Z 1defe: 2e 32 cpi r18, 0x2E ; 46 1df00: 11 f0 breq .+4 ; 0x1df06 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 1df02: 80 e0 ldi r24, 0x00 ; 0 1df04: 34 c0 rjmp .+104 ; 0x1df6e // 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); 1df06: b8 01 movw r22, r16 1df08: 6e 5f subi r22, 0xFE ; 254 1df0a: 7f 4f sbci r23, 0xFF ; 255 1df0c: 01 96 adiw r24, 0x01 ; 1 1df0e: 0e 94 a0 cd call 0x19b40 ; 0x19b40 if (*str != '.') 1df12: fc 01 movw r30, r24 1df14: 20 81 ld r18, Z 1df16: 2e 32 cpi r18, 0x2E ; 46 1df18: a1 f7 brne .-24 ; 0x1df02 return false; ++str; } str = Number(str, version + 2); 1df1a: b8 01 movw r22, r16 1df1c: 6c 5f subi r22, 0xFC ; 252 1df1e: 7f 4f sbci r23, 0xFF ; 255 1df20: 01 96 adiw r24, 0x01 ; 1 1df22: 0e 94 a0 cd call 0x19b40 ; 0x19b40 version[3] = FIRMWARE_REVISION_RELEASED; 1df26: 20 e4 ldi r18, 0x40 ; 64 1df28: 30 e0 ldi r19, 0x00 ; 0 1df2a: f8 01 movw r30, r16 1df2c: 37 83 std Z+7, r19 ; 0x07 1df2e: 26 83 std Z+6, r18 ; 0x06 1df30: fc 01 movw r30, r24 1df32: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1df34: 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'; 1df36: 89 2f mov r24, r25 1df38: 8f 7d andi r24, 0xDF ; 223 1df3a: c1 f1 breq .+112 ; 0x1dfac 1df3c: 87 ef ldi r24, 0xF7 ; 247 1df3e: 89 0f add r24, r25 1df40: 82 30 cpi r24, 0x02 ; 2 1df42: a0 f1 brcs .+104 ; 0x1dfac 1df44: 9d 30 cpi r25, 0x0D ; 13 1df46: 91 f1 breq .+100 ; 0x1dfac 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 == '-'){ 1df48: 9d 32 cpi r25, 0x2D ; 45 1df4a: 99 f7 brne .-26 ; 0x1df32 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1df4c: 11 96 adiw r26, 0x01 ; 1 1df4e: 9c 91 ld r25, X 1df50: 92 34 cpi r25, 0x42 ; 66 1df52: e1 f0 breq .+56 ; 0x1df8c 1df54: 7c f4 brge .+30 ; 0x1df74 1df56: 91 34 cpi r25, 0x41 ; 65 1df58: a1 f6 brne .-88 ; 0x1df02 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); 1df5a: 0a 5f subi r16, 0xFA ; 250 1df5c: 1f 4f sbci r17, 0xFF ; 255 1df5e: 28 e0 ldi r18, 0x08 ; 8 1df60: 30 e0 ldi r19, 0x00 ; 0 1df62: 45 e0 ldi r20, 0x05 ; 5 1df64: 66 ef ldi r22, 0xF6 ; 246 1df66: 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); 1df68: cf 01 movw r24, r30 1df6a: 0e 94 0d cf call 0x19e1a ; 0x19e1a // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1df6e: 1f 91 pop r17 1df70: 0f 91 pop r16 1df72: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1df74: 94 34 cpi r25, 0x44 ; 68 1df76: 91 f0 breq .+36 ; 0x1df9c 1df78: 92 35 cpi r25, 0x52 ; 82 1df7a: 19 f6 brne .-122 ; 0x1df02 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); 1df7c: 0a 5f subi r16, 0xFA ; 250 1df7e: 1f 4f sbci r17, 0xFF ; 255 1df80: 20 e2 ldi r18, 0x20 ; 32 1df82: 30 e0 ldi r19, 0x00 ; 0 1df84: 42 e0 ldi r20, 0x02 ; 2 1df86: 6a ee ldi r22, 0xEA ; 234 1df88: 7b e8 ldi r23, 0x8B ; 139 1df8a: ee cf rjmp .-36 ; 0x1df68 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); 1df8c: 0a 5f subi r16, 0xFA ; 250 1df8e: 1f 4f sbci r17, 0xFF ; 255 1df90: 20 e1 ldi r18, 0x10 ; 16 1df92: 30 e0 ldi r19, 0x00 ; 0 1df94: 44 e0 ldi r20, 0x04 ; 4 1df96: 61 ef ldi r22, 0xF1 ; 241 1df98: 7b e8 ldi r23, 0x8B ; 139 1df9a: e6 cf rjmp .-52 ; 0x1df68 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); 1df9c: 0a 5f subi r16, 0xFA ; 250 1df9e: 1f 4f sbci r17, 0xFF ; 255 1dfa0: 30 e0 ldi r19, 0x00 ; 0 1dfa2: 20 e0 ldi r18, 0x00 ; 0 1dfa4: 43 e0 ldi r20, 0x03 ; 3 1dfa6: 6d ee ldi r22, 0xED ; 237 1dfa8: 7b e8 ldi r23, 0x8B ; 139 1dfaa: de cf rjmp .-68 ; 0x1df68 // 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; 1dfac: 81 e0 ldi r24, 0x01 ; 1 1dfae: df cf rjmp .-66 ; 0x1df6e 0001dfb0 : /// (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 ) 1dfb0: 84 e0 ldi r24, 0x04 ; 4 1dfb2: 9d e0 ldi r25, 0x0D ; 13 1dfb4: 0f 94 23 dc call 0x3b846 ; 0x3b846 && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1dfb8: 8a 32 cpi r24, 0x2A ; 42 1dfba: 39 f4 brne .+14 ; 0x1dfca 1dfbc: 8a e2 ldi r24, 0x2A ; 42 1dfbe: 9d e0 ldi r25, 0x0D ; 13 1dfc0: 0f 94 23 dc call 0x3b846 ; 0x3b846 1dfc4: 91 e0 ldi r25, 0x01 ; 1 1dfc6: 81 30 cpi r24, 0x01 ; 1 1dfc8: 09 f0 breq .+2 ; 0x1dfcc 1dfca: 90 e0 ldi r25, 0x00 ; 0 } 1dfcc: 89 2f mov r24, r25 1dfce: 08 95 ret 0001dfd0 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1dfd0: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1dfd4: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1dfd8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1dfdc: 84 30 cpi r24, 0x04 ; 4 1dfde: 70 f5 brcc .+92 ; 0x1e03c 1dfe0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 1dfe4: 8c eb ldi r24, 0xBC ; 188 1dfe6: 99 e4 ldi r25, 0x49 ; 73 1dfe8: 0e 94 b3 72 call 0xe566 ; 0xe566 1dfec: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 #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 1dff0: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 1dff4: 88 23 and r24, r24 1dff6: f9 f0 breq .+62 ; 0x1e036 1dff8: 89 ed ldi r24, 0xD9 ; 217 1dffa: 9c e5 ldi r25, 0x5C ; 92 1dffc: 0e 94 b3 72 call 0xe566 ; 0xe566 1e000: 22 e0 ldi r18, 0x02 ; 2 1e002: 4f e1 ldi r20, 0x1F ; 31 1e004: 50 ef ldi r21, 0xF0 ; 240 1e006: bc 01 movw r22, r24 1e008: 8c eb ldi r24, 0xBC ; 188 1e00a: 9b e6 ldi r25, 0x6B ; 107 1e00c: 0f 94 2c d3 call 0x3a658 ; 0x3a658 #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 1e010: 63 e4 ldi r22, 0x43 ; 67 1e012: 7f ec ldi r23, 0xCF ; 207 1e014: 89 ea ldi r24, 0xA9 ; 169 1e016: 9b e6 ldi r25, 0x6B ; 107 1e018: 0f 94 1a d1 call 0x3a234 ; 0x3a234 #endif //PRUSA_SN_SUPPORT MENU_END(); 1e01c: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 1e020: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e024: 8f 5f subi r24, 0xFF ; 255 1e026: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e02a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e02e: 8f 5f subi r24, 0xFF ; 255 1e030: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e034: d1 cf rjmp .-94 ; 0x1dfd8 #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 1e036: 83 ed ldi r24, 0xD3 ; 211 1e038: 9c e5 ldi r25, 0x5C ; 92 1e03a: e0 cf rjmp .-64 ; 0x1dffc #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(); } 1e03c: 08 95 ret 0001e03e : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 1e03e: 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(); 1e040: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 1e044: c1 e0 ldi r28, 0x01 ; 1 1e046: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 1e048: 6f ef ldi r22, 0xFF ; 255 1e04a: 09 f0 breq .+2 ; 0x1e04e 1e04c: 6a e2 ldi r22, 0x2A ; 42 1e04e: 84 e0 ldi r24, 0x04 ; 4 1e050: 9d e0 ldi r25, 0x0D ; 13 1e052: 0f 94 47 dc call 0x3b88e ; 0x3b88e 1 #else 0 #endif ) , enableECool(enableECool) { } 1e056: 8c 2f mov r24, r28 1e058: 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)); 1e05a: 82 70 andi r24, 0x02 ; 2 } 1e05c: 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)); 1e05e: 0d 94 67 26 jmp 0x24cce ; 0x24cce 0001e062 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 1e062: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 1e066: 81 11 cpse r24, r1 1e068: 3c c0 rjmp .+120 ; 0x1e0e2 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 1e06a: 81 e0 ldi r24, 0x01 ; 1 1e06c: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 1e070: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 1e074: 8f ef ldi r24, 0xFF ; 255 1e076: 9f e0 ldi r25, 0x0F ; 15 1e078: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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); 1e07c: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 1e080: 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()) 1e084: 98 17 cp r25, r24 1e086: 41 f0 breq .+16 ; 0x1e098 { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 1e088: 84 e1 ldi r24, 0x14 ; 20 1e08a: 9b e3 ldi r25, 0x3B ; 59 1e08c: 0e 94 b3 72 call 0xe566 ; 0xe566 1e090: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 1e094: 0f 94 ef 42 call 0x285de ; 0x285de } tmc2130_wait_standstill_xy(1000); 1e098: 0f 94 1f 88 call 0x3103e ; 0x3103e cli(); 1e09c: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 1e09e: 81 e0 ldi r24, 0x01 ; 1 1e0a0: 90 91 a4 03 lds r25, 0x03A4 ; 0x8003a4 1e0a4: 91 11 cpse r25, r1 1e0a6: 01 c0 rjmp .+2 ; 0x1e0aa 1e0a8: 80 e0 ldi r24, 0x00 ; 0 1e0aa: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c update_mode_profile(); 1e0ae: 0f 94 a8 63 call 0x2c750 ; 0x2c750 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(); 1e0b2: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 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) { } 1e0b6: 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())); 1e0b8: 82 70 andi r24, 0x02 ; 2 1e0ba: 0f 94 67 26 call 0x24cce ; 0x24cce // 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(); 1e0be: 0f 94 49 43 call 0x28692 ; 0x28692 sei(); 1e0c2: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 1e0c4: 89 e6 ldi r24, 0x69 ; 105 1e0c6: 9f e0 ldi r25, 0x0F ; 15 1e0c8: 0f 94 23 dc call 0x3b846 ; 0x3b846 1e0cc: 88 23 and r24, r24 1e0ce: 61 f0 breq .+24 ; 0x1e0e8 1e0d0: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 1e0d4: 88 23 and r24, r24 1e0d6: 41 f0 breq .+16 ; 0x1e0e8 menu_submenu(lcd_crash_mode_info2); 1e0d8: 60 e0 ldi r22, 0x00 ; 0 1e0da: 85 e4 ldi r24, 0x45 ; 69 1e0dc: 9f ed ldi r25, 0xDF ; 223 1e0de: 0d 94 0a d3 jmp 0x3a614 ; 0x3a614 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; 1e0e2: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 1e0e6: c4 cf rjmp .-120 ; 0x1e070 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 1e0e8: 08 95 ret 0001e0ea : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 1e0ea: df 92 push r13 1e0ec: ef 92 push r14 1e0ee: ff 92 push r15 1e0f0: 0f 93 push r16 1e0f2: 1f 93 push r17 1e0f4: cf 93 push r28 1e0f6: df 93 push r29 MENU_BEGIN(); 1e0f8: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1e0fc: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1e100: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e104: 84 30 cpi r24, 0x04 ; 4 1e106: 08 f0 brcs .+2 ; 0x1e10a 1e108: 66 c0 rjmp .+204 ; 0x1e1d6 1e10a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1e10e: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 1e112: 88 23 and r24, r24 1e114: e9 f0 breq .+58 ; 0x1e150 1e116: 09 ef ldi r16, 0xF9 ; 249 1e118: 14 e0 ldi r17, 0x04 ; 4 1e11a: c7 ef ldi r28, 0xF7 ; 247 1e11c: 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) { 1e11e: f8 01 movw r30, r16 1e120: 80 81 ld r24, Z 1e122: 8e 31 cpi r24, 0x1E ; 30 1e124: 08 f4 brcc .+2 ; 0x1e128 tmc2130_wave_fac[axis] = 0; 1e126: 10 82 st Z, r1 1e128: f8 01 movw r30, r16 1e12a: 61 91 ld r22, Z+ 1e12c: 8f 01 movw r16, r30 1e12e: ce 01 movw r24, r28 1e130: 0f 94 47 dc call 0x3b88e ; 0x3b88e 1e134: 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++) { 1e136: c3 3f cpi r28, 0xF3 ; 243 1e138: fe e0 ldi r31, 0x0E ; 14 1e13a: df 07 cpc r29, r31 1e13c: 81 f7 brne .-32 ; 0x1e11e 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(); 1e13e: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 1e142: e8 94 clt 1e144: d0 f8 bld r13, 0 1e146: 80 fb bst r24, 0 1e148: 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())); 1e14a: 8d 2d mov r24, r13 1e14c: 0f 94 67 26 call 0x24cce ; 0x24cce { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1e150: 86 e4 ldi r24, 0x46 ; 70 1e152: 98 e4 ldi r25, 0x48 ; 72 1e154: 0e 94 b3 72 call 0xe566 ; 0xe566 1e158: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 #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); 1e15c: 8c e6 ldi r24, 0x6C ; 108 1e15e: 93 e4 ldi r25, 0x43 ; 67 1e160: 0e 94 b3 72 call 0xe566 ; 0xe566 1e164: f1 2c mov r15, r1 1e166: e1 2c mov r14, r1 1e168: 08 ec ldi r16, 0xC8 ; 200 1e16a: 10 e0 ldi r17, 0x00 ; 0 1e16c: 2d e1 ldi r18, 0x1D ; 29 1e16e: 30 e0 ldi r19, 0x00 ; 0 1e170: 48 e0 ldi r20, 0x08 ; 8 1e172: 69 ef ldi r22, 0xF9 ; 249 1e174: 74 e0 ldi r23, 0x04 ; 4 1e176: 0f 94 ed d1 call 0x3a3da ; 0x3a3da 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); 1e17a: 80 e6 ldi r24, 0x60 ; 96 1e17c: 93 e4 ldi r25, 0x43 ; 67 1e17e: 0e 94 b3 72 call 0xe566 ; 0xe566 1e182: 2d e1 ldi r18, 0x1D ; 29 1e184: 30 e0 ldi r19, 0x00 ; 0 1e186: 48 e0 ldi r20, 0x08 ; 8 1e188: 6a ef ldi r22, 0xFA ; 250 1e18a: 74 e0 ldi r23, 0x04 ; 4 1e18c: 0f 94 ed d1 call 0x3a3da ; 0x3a3da 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); 1e190: 84 e5 ldi r24, 0x54 ; 84 1e192: 93 e4 ldi r25, 0x43 ; 67 1e194: 0e 94 b3 72 call 0xe566 ; 0xe566 1e198: 2d e1 ldi r18, 0x1D ; 29 1e19a: 30 e0 ldi r19, 0x00 ; 0 1e19c: 48 e0 ldi r20, 0x08 ; 8 1e19e: 6b ef ldi r22, 0xFB ; 251 1e1a0: 74 e0 ldi r23, 0x04 ; 4 1e1a2: 0f 94 ed d1 call 0x3a3da ; 0x3a3da #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); 1e1a6: 88 e4 ldi r24, 0x48 ; 72 1e1a8: 93 e4 ldi r25, 0x43 ; 67 1e1aa: 0e 94 b3 72 call 0xe566 ; 0xe566 1e1ae: 2d e1 ldi r18, 0x1D ; 29 1e1b0: 30 e0 ldi r19, 0x00 ; 0 1e1b2: 48 e0 ldi r20, 0x08 ; 8 1e1b4: 6c ef ldi r22, 0xFC ; 252 1e1b6: 74 e0 ldi r23, 0x04 ; 4 1e1b8: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_END(); 1e1bc: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 1e1c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e1c4: 8f 5f subi r24, 0xFF ; 255 1e1c6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e1ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e1ce: 8f 5f subi r24, 0xFF ; 255 1e1d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e1d4: 95 cf rjmp .-214 ; 0x1e100 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(); } 1e1d6: df 91 pop r29 1e1d8: cf 91 pop r28 1e1da: 1f 91 pop r17 1e1dc: 0f 91 pop r16 1e1de: ff 90 pop r15 1e1e0: ef 90 pop r14 1e1e2: df 90 pop r13 1e1e4: 08 95 ret 0001e1e6 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e1e6: 44 e1 ldi r20, 0x14 ; 20 1e1e8: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1e1ea: 66 23 and r22, r22 1e1ec: 89 f0 breq .+34 ; 0x1e210 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1e1ee: bc 01 movw r22, r24 1e1f0: 8f e1 ldi r24, 0x1F ; 31 1e1f2: 95 e0 ldi r25, 0x05 ; 5 1e1f4: 0f 94 10 da call 0x3b420 ; 0x3b420 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1e1f8: 10 92 33 05 sts 0x0533, r1 ; 0x800533 <_ZL18lcd_status_message.lto_priv.453+0x14> lcd_status_message_idx = 0; // Print message from beginning 1e1fc: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1e200: 85 e8 ldi r24, 0x85 ; 133 1e202: 9b e6 ldi r25, 0x6B ; 107 1e204: 0e 94 82 79 call 0xf304 ; 0xf304 // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1e208: 81 e0 ldi r24, 0x01 ; 1 1e20a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e20e: 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); 1e210: bc 01 movw r22, r24 1e212: 8f e1 ldi r24, 0x1F ; 31 1e214: 95 e0 ldi r25, 0x05 ; 5 1e216: 0f 94 a3 e2 call 0x3c546 ; 0x3c546 1e21a: ee cf rjmp .-36 ; 0x1e1f8 0001e21c : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1e21c: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 1e220: 89 17 cp r24, r25 1e222: 80 f4 brcc .+32 ; 0x1e244 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1e224: 91 30 cpi r25, 0x01 ; 1 1e226: 61 f4 brne .+24 ; 0x1e240 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1e228: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452> 1e22c: 88 23 and r24, r24 1e22e: 51 f0 breq .+20 ; 0x1e244 1e230: 40 e2 ldi r20, 0x20 ; 32 1e232: 5e e4 ldi r21, 0x4E ; 78 1e234: 60 e0 ldi r22, 0x00 ; 0 1e236: 70 e0 ldi r23, 0x00 ; 0 1e238: 84 e3 ldi r24, 0x34 ; 52 1e23a: 95 e0 ldi r25, 0x05 ; 5 1e23c: 0d 94 37 2a jmp 0x2546e ; 0x2546e ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1e240: 80 e0 ldi r24, 0x00 ; 0 1e242: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1e244: 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; } 1e246: 08 95 ret 0001e248 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1e248: ef 92 push r14 1e24a: ff 92 push r15 1e24c: 1f 93 push r17 1e24e: cf 93 push r28 1e250: df 93 push r29 1e252: ec 01 movw r28, r24 1e254: 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)) { 1e256: 86 2f mov r24, r22 1e258: 0e 94 0e f1 call 0x1e21c ; 0x1e21c 1e25c: 88 23 and r24, r24 1e25e: e9 f0 breq .+58 ; 0x1e29a bool same = !(progmem? strcmp_P(lcd_status_message, message): 1e260: be 01 movw r22, r28 1e262: 8f e1 ldi r24, 0x1F ; 31 1e264: 95 e0 ldi r25, 0x05 ; 5 1e266: 0f 94 d1 d9 call 0x3b3a2 ; 0x3b3a2 1e26a: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1e26c: 84 e3 ldi r24, 0x34 ; 52 1e26e: 95 e0 ldi r25, 0x05 ; 5 1e270: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> lcd_status_message_level = severity; 1e274: 10 93 d5 03 sts 0x03D5, r17 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> custom_message_type = CustomMsg::Status; 1e278: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 custom_message_state = 0; 1e27c: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 if (!same) { 1e280: ef 28 or r14, r15 1e282: 59 f0 breq .+22 ; 0x1e29a // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1e284: 61 e0 ldi r22, 0x01 ; 1 1e286: ce 01 movw r24, r28 1e288: 0e 94 f3 f0 call 0x1e1e6 ; 0x1e1e6 } 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 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(); 1e296: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1e29a: df 91 pop r29 1e29c: cf 91 pop r28 1e29e: 1f 91 pop r17 1e2a0: ff 90 pop r15 1e2a2: ef 90 pop r14 1e2a4: 08 95 ret 0001e2a6 : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 1e2a6: cf 93 push r28 1e2a8: df 93 push r29 1e2aa: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e2ac: 80 e0 ldi r24, 0x00 ; 0 1e2ae: 0e 94 0e f1 call 0x1e21c ; 0x1e21c 1e2b2: 88 23 and r24, r24 1e2b4: 21 f0 breq .+8 ; 0x1e2be lcd_updatestatus(message); 1e2b6: 60 e0 ldi r22, 0x00 ; 0 1e2b8: ce 01 movw r24, r28 1e2ba: 0e 94 f3 f0 call 0x1e1e6 ; 0x1e1e6 SERIAL_ECHOLN(message); 1e2be: ce 01 movw r24, r28 } 1e2c0: df 91 pop r29 1e2c2: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 1e2c4: 0d 94 07 d6 jmp 0x3ac0e ; 0x3ac0e 0001e2c8 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1e2c8: cf 93 push r28 1e2ca: df 93 push r29 1e2cc: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e2ce: 80 e0 ldi r24, 0x00 ; 0 1e2d0: 0e 94 0e f1 call 0x1e21c ; 0x1e21c 1e2d4: 88 23 and r24, r24 1e2d6: 31 f0 breq .+12 ; 0x1e2e4 lcd_updatestatus(message, true); 1e2d8: 61 e0 ldi r22, 0x01 ; 1 1e2da: ce 01 movw r24, r28 } 1e2dc: df 91 pop r29 1e2de: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1e2e0: 0c 94 f3 f0 jmp 0x1e1e6 ; 0x1e1e6 } 1e2e4: df 91 pop r29 1e2e6: cf 91 pop r28 1e2e8: 08 95 ret 0001e2ea : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1e2ea: 2f 92 push r2 1e2ec: 3f 92 push r3 1e2ee: 4f 92 push r4 1e2f0: 5f 92 push r5 1e2f2: 6f 92 push r6 1e2f4: 7f 92 push r7 1e2f6: 8f 92 push r8 1e2f8: 9f 92 push r9 1e2fa: af 92 push r10 1e2fc: bf 92 push r11 1e2fe: cf 92 push r12 1e300: df 92 push r13 1e302: ef 92 push r14 1e304: ff 92 push r15 1e306: 0f 93 push r16 1e308: 1f 93 push r17 1e30a: cf 93 push r28 1e30c: df 93 push r29 1e30e: cd b7 in r28, 0x3d ; 61 1e310: de b7 in r29, 0x3e ; 62 1e312: 2d 97 sbiw r28, 0x0d ; 13 1e314: 0f b6 in r0, 0x3f ; 63 1e316: f8 94 cli 1e318: de bf out 0x3e, r29 ; 62 1e31a: 0f be out 0x3f, r0 ; 63 1e31c: 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) 1e31e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1e322: 81 30 cpi r24, 0x01 ; 1 1e324: 31 f1 breq .+76 ; 0x1e372 1e326: 30 f0 brcs .+12 ; 0x1e334 1e328: 82 30 cpi r24, 0x02 ; 2 1e32a: 09 f4 brne .+2 ; 0x1e32e 1e32c: 7d c2 rjmp .+1274 ; 0x1e828 { _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. 1e32e: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 1e332: fe c0 rjmp .+508 ; 0x1e530 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1e334: 80 91 df 14 lds r24, 0x14DF ; 0x8014df 1e338: 88 23 and r24, r24 1e33a: 49 f0 breq .+18 ; 0x1e34e { card.presort_flag = false; 1e33c: 10 92 df 14 sts 0x14DF, r1 ; 0x8014df lcd_update_enabled = false; 1e340: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 1e344: 0f 94 99 7c call 0x2f932 ; 0x2f932 lcd_update_enabled = true; 1e348: 81 e0 ldi r24, 0x01 ; 1 1e34a: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 1e34e: 0f 94 db 79 call 0x2f3b6 ; 0x2f3b6 1e352: 90 93 b1 03 sts 0x03B1, r25 ; 0x8003b1 1e356: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1e35a: 89 e0 ldi r24, 0x09 ; 9 1e35c: 9f e0 ldi r25, 0x0F ; 15 1e35e: 0f 94 23 dc call 0x3b846 ; 0x3b846 1e362: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->menuState = _standard; 1e366: 81 e0 ldi r24, 0x01 ; 1 1e368: 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. 1e36c: 8f ef ldi r24, 0xFF ; 255 1e36e: 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. 1e372: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 1e376: 81 11 cpse r24, r1 1e378: 07 c0 rjmp .+14 ; 0x1e388 { _md->lcd_scrollTimer.start(); 1e37a: 84 eb ldi r24, 0xB4 ; 180 1e37c: 93 e0 ldi r25, 0x03 ; 3 1e37e: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> lcd_draw_update = 1; 1e382: 81 e0 ldi r24, 0x01 ; 1 1e384: 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. 1e388: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e38c: 81 11 cpse r24, r1 1e38e: 21 c0 rjmp .+66 ; 0x1e3d2 1e390: 64 ef ldi r22, 0xF4 ; 244 1e392: 71 e0 ldi r23, 0x01 ; 1 1e394: 84 eb ldi r24, 0xB4 ; 180 1e396: 93 e0 ldi r25, 0x03 ; 3 1e398: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 1e39c: 88 23 and r24, r24 1e39e: a1 f0 breq .+40 ; 0x1e3c8 1e3a0: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 1e3a4: 8f 3f cpi r24, 0xFF ; 255 1e3a6: 81 f0 breq .+32 ; 0x1e3c8 { _md->menuState = _scrolling; 1e3a8: 82 e0 ldi r24, 0x02 ; 2 1e3aa: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->offset = 0; 1e3ae: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->scrollPointer = NULL; 1e3b2: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad 1e3b6: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac _md->lcd_scrollTimer.start(); 1e3ba: 84 eb ldi r24, 0xB4 ; 180 1e3bc: 93 e0 ldi r25, 0x03 ; 3 1e3be: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1e3c2: 81 e0 ldi r24, 0x01 ; 1 1e3c4: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 1e3c8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e3cc: 88 23 and r24, r24 1e3ce: 09 f4 brne .+2 ; 0x1e3d2 1e3d0: ab c0 rjmp .+342 ; 0x1e528 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. 1e3d2: 8f ef ldi r24, 0xFF ; 255 1e3d4: 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(); 1e3d8: 84 eb ldi r24, 0xB4 ; 180 1e3da: 93 e0 ldi r25, 0x03 ; 3 1e3dc: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> MENU_BEGIN(); 1e3e0: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 1e3e4: 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); 1e3e8: ce 01 movw r24, r28 1e3ea: 01 96 adiw r24, 0x01 ; 1 1e3ec: 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); 1e3ee: f5 ef ldi r31, 0xF5 ; 245 1e3f0: 2f 2e mov r2, r31 1e3f2: f0 e7 ldi r31, 0x70 ; 112 1e3f4: 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(); 1e3f6: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e3fa: 84 30 cpi r24, 0x04 ; 4 1e3fc: 08 f0 brcs .+2 ; 0x1e400 1e3fe: 98 c0 rjmp .+304 ; 0x1e530 1e400: 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 1e404: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1e408: 88 23 and r24, r24 1e40a: 09 f4 brne .+2 ; 0x1e40e 1e40c: aa c0 rjmp .+340 ; 0x1e562 1e40e: 88 ea ldi r24, 0xA8 ; 168 1e410: 98 e4 ldi r25, 0x48 ; 72 1e412: 0e 94 b3 72 call 0xe566 ; 0xe566 1e416: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 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;}; 1e41a: 62 e9 ldi r22, 0x92 ; 146 1e41c: 74 e1 ldi r23, 0x14 ; 20 1e41e: 8b e3 ldi r24, 0x3B ; 59 1e420: 95 e1 ldi r25, 0x15 ; 21 1e422: 0f 94 80 58 call 0x2b100 ; 0x2b100 card.getWorkDirName(); if (card.filename[0] == '/') 1e426: 80 91 92 14 lds r24, 0x1492 ; 0x801492 1e42a: 8f 32 cpi r24, 0x2F ; 47 1e42c: 09 f0 breq .+2 ; 0x1e430 1e42e: 9c c0 rjmp .+312 ; 0x1e568 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1e430: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1e434: 88 23 and r24, r24 1e436: 41 f0 breq .+16 ; 0x1e448 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1e438: 8d e9 ldi r24, 0x9D ; 157 1e43a: 98 e4 ldi r25, 0x48 ; 72 1e43c: 0e 94 b3 72 call 0xe566 ; 0xe566 1e440: 63 ed ldi r22, 0xD3 ; 211 1e442: 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. 1e444: 0f 94 1a d1 call 0x3a234 ; 0x3a234 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1e448: c0 90 b0 03 lds r12, 0x03B0 ; 0x8003b0 1e44c: 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; 1e450: 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. 1e452: 91 e0 ldi r25, 0x01 ; 1 1e454: c9 1a sub r12, r25 1e456: d1 08 sbc r13, r1 1e458: 08 f4 brcc .+2 ; 0x1e45c 1e45a: d9 c1 rjmp .+946 ; 0x1e80e { if (menu_item == menu_line) //If the file is on the screen. 1e45c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1e460: 90 91 14 05 lds r25, 0x0514 ; 0x800514 1e464: 89 13 cpse r24, r25 1e466: cf c1 rjmp .+926 ; 0x1e806 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1e468: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 1e46c: c6 01 movw r24, r12 1e46e: 0f 94 07 85 call 0x30a0e ; 0x30a0e #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1e472: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1e476: 90 e0 ldi r25, 0x00 ; 0 1e478: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e47c: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e480: 10 91 dc 14 lds r17, 0x14DC ; 0x8014dc 1e484: 82 17 cp r24, r18 1e486: 93 07 cpc r25, r19 1e488: 51 f4 brne .+20 ; 0x1e49e { _md->selectedFileID = i; 1e48a: d0 92 af 03 sts 0x03AF, r13 ; 0x8003af 1e48e: c0 92 ae 03 sts 0x03AE, r12 ; 0x8003ae _md->isDir = card.filenameIsDir; 1e492: 10 93 ab 03 sts 0x03AB, r17 ; 0x8003ab _md->row = menu_row; 1e496: 40 91 12 05 lds r20, 0x0512 ; 0x800512 1e49a: 40 93 b2 03 sts 0x03B2, r20 ; 0x8003b2 1e49e: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 1e4a2: 11 23 and r17, r17 1e4a4: 09 f4 brne .+2 ; 0x1e4a8 1e4a6: 65 c0 rjmp .+202 ; 0x1e572 #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) 1e4a8: 44 23 and r20, r20 1e4aa: e9 f0 breq .+58 ; 0x1e4e6 { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e4ac: 40 91 a7 14 lds r20, 0x14A7 ; 0x8014a7 1e4b0: e2 e9 ldi r30, 0x92 ; 146 1e4b2: ae 2e mov r10, r30 1e4b4: e4 e1 ldi r30, 0x14 ; 20 1e4b6: be 2e mov r11, r30 1e4b8: 44 23 and r20, r20 1e4ba: 21 f0 breq .+8 ; 0x1e4c4 1e4bc: 77 ea ldi r23, 0xA7 ; 167 1e4be: a7 2e mov r10, r23 1e4c0: 74 e1 ldi r23, 0x14 ; 20 1e4c2: b7 2e mov r11, r23 1e4c4: 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)?'>':' '); 1e4c8: 4e e3 ldi r20, 0x3E ; 62 1e4ca: 82 17 cp r24, r18 1e4cc: 93 07 cpc r25, r19 1e4ce: 09 f0 breq .+2 ; 0x1e4d2 1e4d0: 40 e2 ldi r20, 0x20 ; 32 1e4d2: 80 e0 ldi r24, 0x00 ; 0 1e4d4: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_putc(LCD_STR_FOLDER[0]); 1e4d8: 85 e8 ldi r24, 0x85 ; 133 1e4da: 0e 94 d6 6e call 0xddac ; 0xddac lcd_print_pad(longFilename, len); 1e4de: 62 e1 ldi r22, 0x12 ; 18 1e4e0: c5 01 movw r24, r10 1e4e2: 0e 94 d6 70 call 0xe1ac ; 0xe1ac 1e4e6: 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)) 1e4ea: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e4ee: 99 23 and r25, r25 1e4f0: 09 f4 brne .+2 ; 0x1e4f4 1e4f2: 89 c1 rjmp .+786 ; 0x1e806 1e4f4: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e4f8: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e4fc: 82 17 cp r24, r18 1e4fe: 13 06 cpc r1, r19 1e500: 09 f0 breq .+2 ; 0x1e504 1e502: 81 c1 rjmp .+770 ; 0x1e806 { lcd_update_enabled = false; 1e504: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1e508: 61 e0 ldi r22, 0x01 ; 1 1e50a: 82 e9 ldi r24, 0x92 ; 146 1e50c: 94 e1 ldi r25, 0x14 ; 20 1e50e: 0f 94 1b 7e call 0x2fc36 ; 0x2fc36 lcd_encoder = 0; 1e512: 10 92 71 06 sts 0x0671, r1 ; 0x800671 1e516: 10 92 70 06 sts 0x0670, r1 ; 0x800670 menu_data_reset(); //Forces reloading of cached variables. 1e51a: 0f 94 bf d1 call 0x3a37e ; 0x3a37e } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1e51e: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 1e522: 0f 94 83 d0 call 0x3a106 ; 0x3a106 1e526: 95 cf rjmp .-214 ; 0x1e452 _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()) 1e528: 0e 94 04 71 call 0xe208 ; 0xe208 1e52c: 81 11 cpse r24, r1 1e52e: 51 cf rjmp .-350 ; 0x1e3d2 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1e530: 2d 96 adiw r28, 0x0d ; 13 1e532: 0f b6 in r0, 0x3f ; 63 1e534: f8 94 cli 1e536: de bf out 0x3e, r29 ; 62 1e538: 0f be out 0x3f, r0 ; 63 1e53a: cd bf out 0x3d, r28 ; 61 1e53c: df 91 pop r29 1e53e: cf 91 pop r28 1e540: 1f 91 pop r17 1e542: 0f 91 pop r16 1e544: ff 90 pop r15 1e546: ef 90 pop r14 1e548: df 90 pop r13 1e54a: cf 90 pop r12 1e54c: bf 90 pop r11 1e54e: af 90 pop r10 1e550: 9f 90 pop r9 1e552: 8f 90 pop r8 1e554: 7f 90 pop r7 1e556: 6f 90 pop r6 1e558: 5f 90 pop r5 1e55a: 4f 90 pop r4 1e55c: 3f 90 pop r3 1e55e: 2f 90 pop r2 1e560: 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 1e562: 8c eb ldi r24, 0xBC ; 188 1e564: 99 e4 ldi r25, 0x49 ; 73 1e566: 55 cf rjmp .-342 ; 0x1e412 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. 1e568: 6d ed ldi r22, 0xDD ; 221 1e56a: 7f ed ldi r23, 0xDF ; 223 1e56c: 86 e4 ldi r24, 0x46 ; 70 1e56e: 9a e8 ldi r25, 0x8A ; 138 1e570: 69 cf rjmp .-302 ; 0x1e444 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1e572: 44 23 and r20, r20 1e574: d1 f0 breq .+52 ; 0x1e5aa { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1e576: 40 91 a7 14 lds r20, 0x14A7 ; 0x8014a7 1e57a: 62 e9 ldi r22, 0x92 ; 146 1e57c: a6 2e mov r10, r22 1e57e: 64 e1 ldi r22, 0x14 ; 20 1e580: b6 2e mov r11, r22 1e582: 44 23 and r20, r20 1e584: 21 f0 breq .+8 ; 0x1e58e 1e586: 57 ea ldi r21, 0xA7 ; 167 1e588: a5 2e mov r10, r21 1e58a: 54 e1 ldi r21, 0x14 ; 20 1e58c: b5 2e mov r11, r21 1e58e: 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)?'>':' '); 1e592: 4e e3 ldi r20, 0x3E ; 62 1e594: 82 17 cp r24, r18 1e596: 93 07 cpc r25, r19 1e598: 09 f0 breq .+2 ; 0x1e59c 1e59a: 40 e2 ldi r20, 0x20 ; 32 1e59c: 80 e0 ldi r24, 0x00 ; 0 1e59e: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_print_pad(longFilename, len); 1e5a2: 63 e1 ldi r22, 0x13 ; 19 1e5a4: c5 01 movw r24, r10 1e5a6: 0e 94 d6 70 call 0xe1ac ; 0xe1ac 1e5aa: 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)) 1e5ae: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1e5b2: 99 23 and r25, r25 1e5b4: 09 f4 brne .+2 ; 0x1e5b8 1e5b6: 27 c1 rjmp .+590 ; 0x1e806 1e5b8: 20 91 70 06 lds r18, 0x0670 ; 0x800670 1e5bc: 30 91 71 06 lds r19, 0x0671 ; 0x800671 1e5c0: 82 17 cp r24, r18 1e5c2: 13 06 cpc r1, r19 1e5c4: 09 f0 breq .+2 ; 0x1e5c8 1e5c6: 1f c1 rjmp .+574 ; 0x1e806 { lcd_update_enabled = false; 1e5c8: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1e5cc: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1e5d0: 81 11 cpse r24, r1 1e5d2: a5 cf rjmp .-182 ; 0x1e51e // 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); 1e5d4: 62 e9 ldi r22, 0x92 ; 146 1e5d6: 74 e1 ldi r23, 0x14 ; 20 1e5d8: c7 01 movw r24, r14 1e5da: 0f 94 8e e2 call 0x3c51c ; 0x3c51c 1e5de: 47 01 movw r8, r14 1e5e0: 45 e9 ldi r20, 0x95 ; 149 1e5e2: a4 2e mov r10, r20 1e5e4: 4f e0 ldi r20, 0x0F ; 15 1e5e6: 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] == '.') { 1e5e8: f4 01 movw r30, r8 1e5ea: 61 91 ld r22, Z+ 1e5ec: 4f 01 movw r8, r30 1e5ee: 66 23 and r22, r22 1e5f0: 19 f0 breq .+6 ; 0x1e5f8 1e5f2: 6e 32 cpi r22, 0x2E ; 46 1e5f4: 09 f0 breq .+2 ; 0x1e5f8 1e5f6: 4b c0 rjmp .+150 ; 0x1e68e 1e5f8: 60 e0 ldi r22, 0x00 ; 0 1e5fa: c5 01 movw r24, r10 1e5fc: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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, '.'); 1e600: 6e e2 ldi r22, 0x2E ; 46 1e602: 70 e0 ldi r23, 0x00 ; 0 1e604: c7 01 movw r24, r14 1e606: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 1e60a: 3c 01 movw r6, r24 if (extension_ptr) { 1e60c: 89 2b or r24, r25 1e60e: 19 f0 breq .+6 ; 0x1e616 extension_ptr++; // skip the '.' 1e610: 8f ef ldi r24, 0xFF ; 255 1e612: 68 1a sub r6, r24 1e614: 78 0a sbc r7, r24 1e616: 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); 1e618: 31 e9 ldi r19, 0x91 ; 145 1e61a: a3 2e mov r10, r19 1e61c: 3c e0 ldi r19, 0x0C ; 12 1e61e: 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') { 1e620: 61 14 cp r6, r1 1e622: 71 04 cpc r7, r1 1e624: 21 f0 breq .+8 ; 0x1e62e 1e626: f4 01 movw r30, r8 1e628: 60 81 ld r22, Z 1e62a: 61 11 cpse r22, r1 1e62c: 01 c0 rjmp .+2 ; 0x1e630 1e62e: 60 e0 ldi r22, 0x00 ; 0 1e630: c5 01 movw r24, r10 1e632: 0f 94 47 dc call 0x3b88e ; 0x3b88e 1e636: ff ef ldi r31, 0xFF ; 255 1e638: af 1a sub r10, r31 1e63a: bf 0a sbc r11, r31 1e63c: 2f ef ldi r18, 0xFF ; 255 1e63e: 82 1a sub r8, r18 1e640: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1e642: 84 e9 ldi r24, 0x94 ; 148 1e644: a8 16 cp r10, r24 1e646: 8c e0 ldi r24, 0x0C ; 12 1e648: b8 06 cpc r11, r24 1e64a: 51 f7 brne .-44 ; 0x1e620 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1e64c: 60 90 30 16 lds r6, 0x1630 ; 0x801630 1e650: 66 2d mov r22, r6 1e652: 8a e5 ldi r24, 0x5A ; 90 1e654: 9f e0 ldi r25, 0x0F ; 15 1e656: 0f 94 47 dc call 0x3b88e ; 0x3b88e 1e65a: 8e e8 ldi r24, 0x8E ; 142 1e65c: 94 e1 ldi r25, 0x14 ; 20 1e65e: 2a e0 ldi r18, 0x0A ; 10 1e660: a2 2e mov r10, r18 1e662: 2f e0 ldi r18, 0x0F ; 15 1e664: 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++) { 1e666: 71 2c mov r7, r1 1e668: 4c 01 movw r8, r24 1e66a: e9 e0 ldi r30, 0x09 ; 9 1e66c: 8e 0e add r8, r30 1e66e: 91 1c adc r9, r1 1e670: 76 14 cp r7, r6 1e672: d1 f0 breq .+52 ; 0x1e6a8 #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); 1e674: 48 e0 ldi r20, 0x08 ; 8 1e676: 50 e0 ldi r21, 0x00 ; 0 1e678: b5 01 movw r22, r10 1e67a: 8e 5a subi r24, 0xAE ; 174 1e67c: 9f 4f sbci r25, 0xFF ; 255 1e67e: 0f 94 37 dc call 0x3b86e ; 0x3b86e 1e682: 73 94 inc r7 1e684: f8 e0 ldi r31, 0x08 ; 8 1e686: af 0e add r10, r31 1e688: b1 1c adc r11, r1 1e68a: c4 01 movw r24, r8 1e68c: ed cf rjmp .-38 ; 0x1e668 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e68e: c5 01 movw r24, r10 1e690: 0f 94 47 dc call 0x3b88e ; 0x3b88e 1e694: ff ef ldi r31, 0xFF ; 255 1e696: af 1a sub r10, r31 1e698: 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++) { 1e69a: 2d e9 ldi r18, 0x9D ; 157 1e69c: a2 16 cp r10, r18 1e69e: 2f e0 ldi r18, 0x0F ; 15 1e6a0: b2 06 cpc r11, r18 1e6a2: 09 f0 breq .+2 ; 0x1e6a6 1e6a4: a1 cf rjmp .-190 ; 0x1e5e8 1e6a6: ac cf rjmp .-168 ; 0x1e600 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1e6a8: 61 e0 ldi r22, 0x01 ; 1 1e6aa: c7 01 movw r24, r14 1e6ac: 0f 94 52 7f call 0x2fea4 ; 0x2fea4 } uint32_t CardReader::getFileSize() { return filesize; 1e6b0: 40 90 9d 17 lds r4, 0x179D ; 0x80179d 1e6b4: 50 90 9e 17 lds r5, 0x179E ; 0x80179e 1e6b8: 60 90 9f 17 lds r6, 0x179F ; 0x80179f 1e6bc: 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); 1e6c0: 94 2d mov r25, r4 1e6c2: 85 2d mov r24, r5 1e6c4: 21 e0 ldi r18, 0x01 ; 1 1e6c6: 42 16 cp r4, r18 1e6c8: 28 e7 ldi r18, 0x78 ; 120 1e6ca: 52 06 cpc r5, r18 1e6cc: 61 04 cpc r6, r1 1e6ce: 71 04 cpc r7, r1 1e6d0: 10 f0 brcs .+4 ; 0x1e6d6 1e6d2: 90 e0 ldi r25, 0x00 ; 0 1e6d4: 88 e7 ldi r24, 0x78 ; 120 1e6d6: a9 2e mov r10, r25 1e6d8: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1e6da: 81 e0 ldi r24, 0x01 ; 1 1e6dc: 48 16 cp r4, r24 1e6de: 88 e7 ldi r24, 0x78 ; 120 1e6e0: 58 06 cpc r5, r24 1e6e2: 61 04 cpc r6, r1 1e6e4: 71 04 cpc r7, r1 1e6e6: 08 f4 brcc .+2 ; 0x1e6ea 1e6e8: 5d c0 rjmp .+186 ; 0x1e7a4 startPos = filesize - END_FILE_SECTION; 1e6ea: 98 e7 ldi r25, 0x78 ; 120 1e6ec: 59 1a sub r5, r25 1e6ee: 61 08 sbc r6, r1 1e6f0: 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);}; 1e6f2: 40 92 a4 17 sts 0x17A4, r4 ; 0x8017a4 1e6f6: 50 92 a5 17 sts 0x17A5, r5 ; 0x8017a5 1e6fa: 60 92 a6 17 sts 0x17A6, r6 ; 0x8017a6 1e6fe: 70 92 a7 17 sts 0x17A7, r7 ; 0x8017a7 1e702: c3 01 movw r24, r6 1e704: b2 01 movw r22, r4 1e706: 0f 94 a3 75 call 0x2eb46 ; 0x2eb46 card.setIndex(startPos); } cmdqueue_reset(); 1e70a: 0e 94 4b 7f call 0xfe96 ; 0xfe96 cmdqueue_serial_disabled = true; 1e70e: 00 93 a6 03 sts 0x03A6, r16 ; 0x8003a6 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1e712: 89 e6 ldi r24, 0x69 ; 105 1e714: 98 e4 ldi r25, 0x48 ; 72 1e716: 0e 94 b3 72 call 0xe566 ; 0xe566 1e71a: bc 01 movw r22, r24 1e71c: c5 01 movw r24, r10 1e71e: 0f 94 ff cf call 0x39ffe ; 0x39ffe 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; } 1e722: 80 91 a4 17 lds r24, 0x17A4 ; 0x8017a4 1e726: 90 91 a5 17 lds r25, 0x17A5 ; 0x8017a5 1e72a: a0 91 a6 17 lds r26, 0x17A6 ; 0x8017a6 1e72e: b0 91 a7 17 lds r27, 0x17A7 ; 0x8017a7 while (!card.eof() && !result) { 1e732: 40 91 9d 17 lds r20, 0x179D ; 0x80179d 1e736: 50 91 9e 17 lds r21, 0x179E ; 0x80179e 1e73a: 60 91 9f 17 lds r22, 0x179F ; 0x80179f 1e73e: 70 91 a0 17 lds r23, 0x17A0 ; 0x8017a0 1e742: 84 17 cp r24, r20 1e744: 95 07 cpc r25, r21 1e746: a6 07 cpc r26, r22 1e748: b7 07 cpc r27, r23 1e74a: 80 f5 brcc .+96 ; 0x1e7ac 1e74c: 11 11 cpse r17, r1 1e74e: 2e c0 rjmp .+92 ; 0x1e7ac 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); }; 1e750: 20 91 23 17 lds r18, 0x1723 ; 0x801723 1e754: 21 11 cpse r18, r1 1e756: 03 c0 rjmp .+6 ; 0x1e75e 1e758: 80 e0 ldi r24, 0x00 ; 0 1e75a: 90 e0 ldi r25, 0x00 ; 0 1e75c: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1e75e: 84 19 sub r24, r4 1e760: 95 09 sbc r25, r5 1e762: 0f 94 d0 cf call 0x39fa0 ; 0x39fa0 card.sdprinting = true; 1e766: 00 93 90 14 sts 0x1490, r16 ; 0x801490 get_command(); 1e76a: 0e 94 27 83 call 0x1064e ; 0x1064e #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1e76e: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 1e772: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 1e776: 89 2b or r24, r25 1e778: a1 f2 breq .-88 ; 0x1e722 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1e77a: 87 ed ldi r24, 0xD7 ; 215 1e77c: 9b e6 ldi r25, 0x6B ; 107 1e77e: 0e 94 2d 68 call 0xd05a ; 0xd05a 1e782: 81 11 cpse r24, r1 1e784: 05 c0 rjmp .+10 ; 0x1e790 1e786: 81 e4 ldi r24, 0x41 ; 65 1e788: 9a e8 ldi r25, 0x8A ; 138 1e78a: 0e 94 2d 68 call 0xd05a ; 0xd05a 1e78e: 81 11 cpse r24, r1 1e790: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1e792: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 1e796: 81 11 cpse r24, r1 1e798: 02 c0 rjmp .+4 ; 0x1e79e cmdqueue_pop_front(); 1e79a: 0e 94 c3 76 call 0xed86 ; 0xed86 cmdbuffer_front_already_processed = false; 1e79e: 10 92 a2 10 sts 0x10A2, r1 ; 0x8010a2 1e7a2: e5 cf rjmp .-54 ; 0x1e76e 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; 1e7a4: 41 2c mov r4, r1 1e7a6: 51 2c mov r5, r1 1e7a8: 32 01 movw r6, r4 1e7aa: af cf rjmp .-162 ; 0x1e70a // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1e7ac: 0f 94 f1 cf call 0x39fe2 ; 0x39fe2 cmdqueue_serial_disabled = false; 1e7b0: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 card.printingHasFinished(); 1e7b4: 0f 94 8a 80 call 0x30114 ; 0x30114 lcd_setstatuspgm(MSG_WELCOME); 1e7b8: 83 e7 ldi r24, 0x73 ; 115 1e7ba: 90 e7 ldi r25, 0x70 ; 112 1e7bc: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 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)) { 1e7c0: 11 23 and r17, r17 1e7c2: 91 f0 breq .+36 ; 0x1e7e8 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); 1e7c4: ff 92 push r15 1e7c6: ef 92 push r14 1e7c8: 3f 92 push r3 1e7ca: 2f 92 push r2 1e7cc: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommand_P(MSG_M24); 1e7d0: 61 e0 ldi r22, 0x01 ; 1 1e7d2: 81 ef ldi r24, 0xF1 ; 241 1e7d4: 90 e7 ldi r25, 0x70 ; 112 1e7d6: 0e 94 27 88 call 0x1104e ; 0x1104e 1e7da: 0f 90 pop r0 1e7dc: 0f 90 pop r0 1e7de: 0f 90 pop r0 1e7e0: 0f 90 pop r0 } lcd_return_to_status(); 1e7e2: 0f 94 ad 1e call 0x23d5a ; 0x23d5a 1e7e6: 9b ce rjmp .-714 ; 0x1e51e 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); 1e7e8: 89 e7 ldi r24, 0x79 ; 121 1e7ea: 98 e4 ldi r25, 0x48 ; 72 1e7ec: 0e 94 b3 72 call 0xe566 ; 0xe566 1e7f0: 41 e0 ldi r20, 0x01 ; 1 1e7f2: 60 e0 ldi r22, 0x00 ; 0 1e7f4: 0f 94 47 4f call 0x29e8e ; 0x29e8e 1e7f8: 18 2f mov r17, r24 lcd_update_enable(true); 1e7fa: 81 e0 ldi r24, 0x01 ; 1 1e7fc: 0e 94 2c 6f call 0xde58 ; 0xde58 } if (result) { 1e800: 11 23 and r17, r17 1e802: 01 f3 breq .-64 ; 0x1e7c4 1e804: ee cf rjmp .-36 ; 0x1e7e2 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1e806: 8f 5f subi r24, 0xFF ; 255 1e808: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1e80c: 22 ce rjmp .-956 ; 0x1e452 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1e80e: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 _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(); 1e812: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1e816: 8f 5f subi r24, 0xFF ; 255 1e818: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1e81c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1e820: 8f 5f subi r24, 0xFF ; 255 1e822: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1e826: e7 cd rjmp .-1074 ; 0x1e3f6 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. 1e828: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1e82c: 11 e0 ldi r17, 0x01 ; 1 1e82e: 81 11 cpse r24, r1 1e830: 05 c0 rjmp .+10 ; 0x1e83c 1e832: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1e836: 81 11 cpse r24, r1 1e838: 01 c0 rjmp .+2 ; 0x1e83c 1e83a: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1e83c: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1e840: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1e844: 89 2b or r24, r25 1e846: 91 f4 brne .+36 ; 0x1e86c { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1e848: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 1e84c: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 1e850: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 1e854: 0f 94 07 85 call 0x30a0e ; 0x30a0e #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1e858: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 1e85c: 81 11 cpse r24, r1 1e85e: 46 c0 rjmp .+140 ; 0x1e8ec 1e860: 82 e9 ldi r24, 0x92 ; 146 1e862: 94 e1 ldi r25, 0x14 ; 20 1e864: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 1e868: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac } if (rewindFlag) 1e86c: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1e86e: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1e872: 6c e2 ldi r22, 0x2C ; 44 1e874: 71 e0 ldi r23, 0x01 ; 1 1e876: 84 eb ldi r24, 0xB4 ; 180 1e878: 93 e0 ldi r25, 0x03 ; 3 1e87a: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 1e87e: 81 11 cpse r24, r1 1e880: 03 c0 rjmp .+6 ; 0x1e888 1e882: 11 23 and r17, r17 1e884: 09 f4 brne .+2 ; 0x1e888 1e886: 54 ce rjmp .-856 ; 0x1e530 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1e888: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1e88c: 02 e1 ldi r16, 0x12 ; 18 1e88e: 81 11 cpse r24, r1 1e890: 01 c0 rjmp .+2 ; 0x1e894 1e892: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1e894: 4e e3 ldi r20, 0x3E ; 62 1e896: 60 91 b2 03 lds r22, 0x03B2 ; 0x8003b2 1e89a: 80 e0 ldi r24, 0x00 ; 0 1e89c: 0e 94 07 6f call 0xde0e ; 0xde0e if (_md->isDir) 1e8a0: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1e8a4: 88 23 and r24, r24 1e8a6: 19 f0 breq .+6 ; 0x1e8ae } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1e8a8: 85 e8 ldi r24, 0x85 ; 133 1e8aa: 0e 94 96 6f call 0xdf2c ; 0xdf2c lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1e8ae: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 1e8b2: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 1e8b6: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 1e8ba: 60 2f mov r22, r16 1e8bc: 82 0f add r24, r18 1e8be: 91 1d adc r25, r1 1e8c0: 0e 94 d6 70 call 0xe1ac ; 0xe1ac 1e8c4: 81 11 cpse r24, r1 1e8c6: 15 c0 rjmp .+42 ; 0x1e8f2 { _md->lcd_scrollTimer.start(); 1e8c8: 84 eb ldi r24, 0xB4 ; 180 1e8ca: 93 e0 ldi r25, 0x03 ; 3 1e8cc: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> _md->offset++; 1e8d0: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1e8d4: 8f 5f subi r24, 0xFF ; 255 1e8d6: 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. 1e8da: 11 23 and r17, r17 1e8dc: 09 f4 brne .+2 ; 0x1e8e0 1e8de: 28 ce rjmp .-944 ; 0x1e530 1e8e0: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1e8e4: 81 e0 ldi r24, 0x01 ; 1 1e8e6: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 1e8ea: 22 ce rjmp .-956 ; 0x1e530 #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; 1e8ec: 87 ea ldi r24, 0xA7 ; 167 1e8ee: 94 e1 ldi r25, 0x14 ; 20 1e8f0: b9 cf rjmp .-142 ; 0x1e864 1e8f2: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 1e8f6: f1 cf rjmp .-30 ; 0x1e8da 0001e8f8 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1e8f8: 61 e0 ldi r22, 0x01 ; 1 1e8fa: 8c ee ldi r24, 0xEC ; 236 1e8fc: 90 e7 ldi r25, 0x70 ; 112 1e8fe: 0e 94 27 88 call 0x1104e ; 0x1104e custom_message_type = CustomMsg::FilamentLoading; //just print status message 1e902: 82 e0 ldi r24, 0x02 ; 2 1e904: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1e908: 8b e5 ldi r24, 0x5B ; 91 1e90a: 93 e5 ldi r25, 0x53 ; 83 1e90c: 0e 94 b3 72 call 0xe566 ; 0xe566 1e910: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 lcd_return_to_status(); 1e914: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_draw_update = 3; 1e918: 83 e0 ldi r24, 0x03 ; 3 1e91a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 1e91e: 08 95 ret 0001e920 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1e920: cf 93 push r28 1e922: df 93 push r29 1e924: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1e926: 80 e0 ldi r24, 0x00 ; 0 1e928: 0e 94 0e f1 call 0x1e21c ; 0x1e21c 1e92c: 88 23 and r24, r24 1e92e: 31 f0 breq .+12 ; 0x1e93c lcd_updatestatus(message); 1e930: 60 e0 ldi r22, 0x00 ; 0 1e932: ce 01 movw r24, r28 } 1e934: df 91 pop r29 1e936: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1e938: 0c 94 f3 f0 jmp 0x1e1e6 ; 0x1e1e6 } 1e93c: df 91 pop r29 1e93e: cf 91 pop r28 1e940: 08 95 ret 0001e942 : 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) { 1e942: cf 93 push r28 1e944: df 93 push r29 1e946: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1e948: 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) { 1e94a: 66 23 and r22, r22 1e94c: d9 f1 breq .+118 ; 0x1e9c4 1e94e: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1e950: 0f 94 1f 2f call 0x25e3e ; 0x25e3e cancel_heatup = true; 1e954: 81 e0 ldi r24, 0x01 ; 1 1e956: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> heating_status = HeatingStatus::NO_HEATING; 1e95a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Clear any saved printing state cancel_saved_printing(); 1e95e: 0e 94 b4 64 call 0xc968 ; 0xc968 // Abort the planner planner_abort_hard(); 1e962: 0f 94 ca c1 call 0x38394 ; 0x38394 // Reset the queue cmdqueue_reset(); 1e966: 0e 94 4b 7f call 0xfe96 ; 0xfe96 cmdqueue_serial_disabled = false; 1e96a: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 1e96e: 0f 94 49 43 call 0x28692 ; 0x28692 CRITICAL_SECTION_END; 1e972: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1e974: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 print_job_timer.stop(); 1e978: 0f 94 b8 42 call 0x28570 ; 0x28570 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1e97c: 80 91 23 17 lds r24, 0x1723 ; 0x801723 1e980: 88 23 and r24, r24 1e982: 71 f0 breq .+28 ; 0x1e9a0 // Reset the sd status card.sdprinting = false; 1e984: 10 92 90 14 sts 0x1490, r1 ; 0x801490 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 1e988: 80 e2 ldi r24, 0x20 ; 32 1e98a: 97 e1 ldi r25, 0x17 ; 23 1e98c: 0f 94 42 58 call 0x2b084 ; 0x2b084 file.close(); 1e990: 80 e2 ldi r24, 0x20 ; 32 1e992: 97 e1 ldi r25, 0x17 ; 23 1e994: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee saving = false; 1e998: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 1e99c: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1e9a0: 8a e3 ldi r24, 0x3A ; 58 1e9a2: 9b e6 ldi r25, 0x6B ; 107 1e9a4: 0e 94 82 79 call 0xf304 ; 0xf304 #ifdef MESH_BED_LEVELING mbl.active = false; 1e9a8: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 #endif if (interactive) { 1e9ac: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1e9ae: 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; 1e9b2: 81 e0 ldi r24, 0x01 ; 1 1e9b4: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1e9b8: 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(); } 1e9bc: df 91 pop r29 1e9be: 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(); 1e9c0: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a } void ConditionalStop() { CRITICAL_SECTION_START; 1e9c4: 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; 1e9c6: 81 e0 ldi r24, 0x01 ; 1 1e9c8: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> heating_status = HeatingStatus::NO_HEATING; 1e9cc: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Clear any saved printing state cancel_saved_printing(); 1e9d0: 0e 94 b4 64 call 0xc968 ; 0xc968 // Abort the planner planner_abort_hard(); 1e9d4: 0f 94 ca c1 call 0x38394 ; 0x38394 // Reset the queue cmdqueue_reset(); 1e9d8: 0e 94 4b 7f call 0xfe96 ; 0xfe96 cmdqueue_serial_disabled = false; 1e9dc: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 1e9e0: 0f 94 49 43 call 0x28692 ; 0x28692 CRITICAL_SECTION_END; 1e9e4: df bf out 0x3f, r29 ; 63 1e9e6: ca cf rjmp .-108 ; 0x1e97c 0001e9e8 : } void lcd_print_stop() { print_stop(true); 1e9e8: 60 e0 ldi r22, 0x00 ; 0 1e9ea: 81 e0 ldi r24, 0x01 ; 1 1e9ec: 0c 94 a1 f4 jmp 0x1e942 ; 0x1e942 0001e9f0 : 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' 1e9f0: 41 30 cpi r20, 0x01 ; 1 1e9f2: 41 f4 brne .+16 ; 0x1ea04 if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1e9f4: 40 e0 ldi r20, 0x00 ; 0 1e9f6: 61 e0 ldi r22, 0x01 ; 1 1e9f8: 0f 94 47 4f call 0x29e8e ; 0x29e8e 1e9fc: 81 30 cpi r24, 0x01 ; 1 1e9fe: 41 f4 brne .+16 ; 0x1ea10 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1ea00: 0c 94 f4 f4 jmp 0x1e9e8 ; 0x1e9e8 { 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 1ea04: 42 30 cpi r20, 0x02 ; 2 1ea06: 21 f4 brne .+8 ; 0x1ea10 lcd_show_fullscreen_message_and_wait_P(strict); 1ea08: cb 01 movw r24, r22 1ea0a: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 1ea0e: f8 cf rjmp .-16 ; 0x1ea00 lcd_print_stop(); } } 1ea10: 08 95 ret 0001ea12 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1ea12: 0f 93 push r16 1ea14: 1f 93 push r17 1ea16: 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)) { 1ea18: 8c ea ldi r24, 0xAC ; 172 1ea1a: 9c e0 ldi r25, 0x0C ; 12 1ea1c: 0f 94 23 dc call 0x3b846 ; 0x3b846 1ea20: 81 11 cpse r24, r1 1ea22: 23 c0 rjmp .+70 ; 0x1ea6a goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1ea24: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ea28: 88 23 and r24, r24 1ea2a: f9 f0 breq .+62 ; 0x1ea6a 1ea2c: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 1ea30: 81 11 cpse r24, r1 1ea32: 1b c0 rjmp .+54 ; 0x1ea6a if (oCheckFilament == ClCheckMode::_None) { 1ea34: c0 91 e7 04 lds r28, 0x04E7 ; 0x8004e7 1ea38: cc 23 and r28, r28 1ea3a: b9 f0 breq .+46 ; 0x1ea6a goto done; } render_M862_warnings( 1ea3c: 8c e0 ldi r24, 0x0C ; 12 1ea3e: 9b e4 ldi r25, 0x4B ; 75 1ea40: 0e 94 b3 72 call 0xe566 ; 0xe566 1ea44: 8c 01 movw r16, r24 1ea46: 83 ee ldi r24, 0xE3 ; 227 1ea48: 9a e4 ldi r25, 0x4A ; 74 1ea4a: 0e 94 b3 72 call 0xe566 ; 0xe566 1ea4e: 4c 2f mov r20, r28 1ea50: b8 01 movw r22, r16 1ea52: 0e 94 f8 f4 call 0x1e9f0 ; 0x1e9f0 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1ea56: 81 e0 ldi r24, 0x01 ; 1 1ea58: 90 91 b4 0d lds r25, 0x0DB4 ; 0x800db4 1ea5c: 91 30 cpi r25, 0x01 ; 1 1ea5e: 09 f4 brne .+2 ; 0x1ea62 1ea60: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1ea62: cf 91 pop r28 1ea64: 1f 91 pop r17 1ea66: 0f 91 pop r16 1ea68: 08 95 ret return false; } } done: return true; 1ea6a: 81 e0 ldi r24, 0x01 ; 1 1ea6c: fa cf rjmp .-12 ; 0x1ea62 0001ea6e : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1ea6e: 1f 93 push r17 1ea70: cf 93 push r28 1ea72: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1ea74: 10 91 ec 04 lds r17, 0x04EC ; 0x8004ec 1ea78: 11 23 and r17, r17 1ea7a: f9 f0 breq .+62 ; 0x1eaba 1ea7c: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1ea7e: 85 ea ldi r24, 0xA5 ; 165 1ea80: 9d e0 ldi r25, 0x0D ; 13 1ea82: 0f 94 31 dc call 0x3b862 ; 0x3b862 if (nDiameter == nDiameter_um) 1ea86: 8c 17 cp r24, r28 1ea88: 9d 07 cpc r25, r29 1ea8a: b9 f0 breq .+46 ; 0x1eaba // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1ea8c: 83 e8 ldi r24, 0x83 ; 131 1ea8e: 9a e4 ldi r25, 0x4A ; 74 1ea90: 0e 94 b3 72 call 0xe566 ; 0xe566 1ea94: ec 01 movw r28, r24 1ea96: 8e e4 ldi r24, 0x4E ; 78 1ea98: 9a e4 ldi r25, 0x4A ; 74 1ea9a: 0e 94 b3 72 call 0xe566 ; 0xe566 1ea9e: 41 2f mov r20, r17 1eaa0: be 01 movw r22, r28 1eaa2: 0e 94 f8 f4 call 0x1e9f0 ; 0x1e9f0 ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1eaa6: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc menu_submenu(lcd_hw_setup_menu); 1eaaa: 60 e0 ldi r22, 0x00 ; 0 1eaac: 81 ec ldi r24, 0xC1 ; 193 1eaae: 91 ed ldi r25, 0xD1 ; 209 } } 1eab0: df 91 pop r29 1eab2: cf 91 pop r28 1eab4: 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); 1eab6: 0d 94 0a d3 jmp 0x3a614 ; 0x3a614 } } 1eaba: df 91 pop r29 1eabc: cf 91 pop r28 1eabe: 1f 91 pop r17 1eac0: 08 95 ret 0001eac2 : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1eac2: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1eac6: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 #endif manage_heater(); 1eaca: 0d 94 63 38 jmp 0x270c6 ; 0x270c6 0001eace : { (void)lcd_selftest(); } bool lcd_selftest() { 1eace: cf 92 push r12 1ead0: df 92 push r13 1ead2: ef 92 push r14 1ead4: ff 92 push r15 1ead6: 0f 93 push r16 1ead8: 1f 93 push r17 1eada: cf 93 push r28 1eadc: df 93 push r29 1eade: 00 d0 rcall .+0 ; 0x1eae0 1eae0: 1f 92 push r1 1eae2: cd b7 in r28, 0x3d ; 61 1eae4: 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(); 1eae6: 0f 94 1f 2f call 0x25e3e ; 0x25e3e uint8_t fanSpeedBckp = fanSpeed; 1eaea: d0 90 e7 03 lds r13, 0x03E7 ; 0x8003e7 fanSpeed = 255; 1eaee: 8f ef ldi r24, 0xFF ; 255 1eaf0: 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)); 1eaf4: 8a e6 ldi r24, 0x6A ; 106 1eaf6: e8 2e mov r14, r24 1eaf8: 8a e8 ldi r24, 0x8A ; 138 1eafa: 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()); 1eafc: 04 e6 ldi r16, 0x64 ; 100 1eafe: 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)) { 1eb00: 20 e0 ldi r18, 0x00 ; 0 1eb02: 30 e0 ldi r19, 0x00 ; 0 1eb04: 48 e4 ldi r20, 0x48 ; 72 1eb06: 52 e4 ldi r21, 0x42 ; 66 1eb08: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1eb0c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1eb10: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1eb14: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1eb18: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1eb1c: 18 16 cp r1, r24 1eb1e: 8c f0 brlt .+34 ; 0x1eb42 1eb20: 20 e0 ldi r18, 0x00 ; 0 1eb22: 30 e0 ldi r19, 0x00 ; 0 1eb24: 48 e4 ldi r20, 0x48 ; 72 1eb26: 52 e4 ldi r21, 0x42 ; 66 1eb28: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1eb2c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1eb30: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1eb34: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1eb38: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1eb3c: 18 16 cp r1, r24 1eb3e: 0c f0 brlt .+2 ; 0x1eb42 1eb40: 42 c0 rjmp .+132 ; 0x1ebc6 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1eb42: 8f ea ldi r24, 0xAF ; 175 1eb44: 98 e4 ldi r25, 0x48 ; 72 1eb46: 0e 94 b3 72 call 0xe566 ; 0xe566 1eb4a: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1eb4e: 42 e8 ldi r20, 0x82 ; 130 1eb50: 64 e0 ldi r22, 0x04 ; 4 1eb52: 80 e0 ldi r24, 0x00 ; 0 1eb54: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1eb58: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 1eb5c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 1eb60: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 1eb64: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 1eb68: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1eb6c: 7f 93 push r23 1eb6e: 6f 93 push r22 1eb70: ff 92 push r15 1eb72: ef 92 push r14 1eb74: 0e 94 c0 6e call 0xdd80 ; 0xdd80 lcd_putc(LCD_STR_DEGREE[0]); 1eb78: 81 e8 ldi r24, 0x81 ; 129 1eb7a: 0e 94 d6 6e call 0xddac ; 0xddac lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1eb7e: 40 e8 ldi r20, 0x80 ; 128 1eb80: 64 e0 ldi r22, 0x04 ; 4 1eb82: 89 e0 ldi r24, 0x09 ; 9 1eb84: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1eb88: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 1eb8c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 1eb90: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 1eb94: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 1eb98: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 1eb9c: 7f 93 push r23 1eb9e: 6f 93 push r22 1eba0: 1f 93 push r17 1eba2: 0f 93 push r16 1eba4: 0e 94 c0 6e call 0xdd80 ; 0xdd80 lcd_putc(LCD_STR_DEGREE[0]); 1eba8: 81 e8 ldi r24, 0x81 ; 129 1ebaa: 0e 94 d6 6e call 0xddac ; 0xddac delay_keep_alive(1000); 1ebae: 88 ee ldi r24, 0xE8 ; 232 1ebb0: 93 e0 ldi r25, 0x03 ; 3 1ebb2: 0e 94 eb 8c call 0x119d6 ; 0x119d6 serialecho_temperatures(); 1ebb6: 0e 94 65 77 call 0xeeca ; 0xeeca 1ebba: 0f b6 in r0, 0x3f ; 63 1ebbc: f8 94 cli 1ebbe: de bf out 0x3e, r29 ; 62 1ebc0: 0f be out 0x3f, r0 ; 63 1ebc2: cd bf out 0x3d, r28 ; 61 1ebc4: 9d cf rjmp .-198 ; 0x1eb00 } fanSpeed = fanSpeedBckp; 1ebc6: d0 92 e7 03 sts 0x03E7, r13 ; 0x8003e7 lcd_update_enable(true); 1ebca: 81 e0 ldi r24, 0x01 ; 1 1ebcc: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1ebd0: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1ebd4: 82 ee ldi r24, 0xE2 ; 226 1ebd6: 98 e4 ldi r25, 0x48 ; 72 1ebd8: 0e 94 b3 72 call 0xe566 ; 0xe566 1ebdc: ac 01 movw r20, r24 1ebde: 60 e0 ldi r22, 0x00 ; 0 1ebe0: 80 e0 ldi r24, 0x00 ; 0 1ebe2: 0e 94 fb 6e call 0xddf6 ; 0xddf6 #ifdef TMC2130 FORCE_HIGH_POWER_START; 1ebe6: 81 e0 ldi r24, 0x01 ; 1 1ebe8: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #endif // TMC2130 FORCE_BL_ON_START; 1ebec: 81 e0 ldi r24, 0x01 ; 1 1ebee: 0e 94 50 8a call 0x114a0 ; 0x114a0 _delay(2000); 1ebf2: 60 ed ldi r22, 0xD0 ; 208 1ebf4: 77 e0 ldi r23, 0x07 ; 7 1ebf6: 80 e0 ldi r24, 0x00 ; 0 1ebf8: 90 e0 ldi r25, 0x00 ; 0 1ebfa: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 KEEPALIVE_STATE(IN_HANDLER); 1ebfe: 82 e0 ldi r24, 0x02 ; 2 1ec00: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1ec04: 00 ed ldi r16, 0xD0 ; 208 1ec06: 17 e0 ldi r17, 0x07 ; 7 1ec08: 21 e0 ldi r18, 0x01 ; 1 1ec0a: 43 e0 ldi r20, 0x03 ; 3 1ec0c: 60 e0 ldi r22, 0x00 ; 0 1ec0e: 80 e0 ldi r24, 0x00 ; 0 1ec10: 0e 94 80 da call 0x1b500 ; 0x1b500 1ec14: 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 1ec16: 83 e0 ldi r24, 0x03 ; 3 1ec18: 0e 94 62 75 call 0xeac4 ; 0xeac4 lcd_selftest_setfan(0); // print fan off 1ec1c: 80 e0 ldi r24, 0x00 ; 0 1ec1e: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 lcd_selftest_measure_fans(2, 18, 2); 1ec22: 62 e0 ldi r22, 0x02 ; 2 1ec24: 82 e0 ldi r24, 0x02 ; 2 1ec26: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 setExtruderAutoFanState(0); // hotend fan off 1ec2a: 80 e0 ldi r24, 0x00 ; 0 1ec2c: 0e 94 62 75 call 0xeac4 ; 0xeac4 if (fan_speed[0] < failThr) { 1ec30: c0 90 c9 03 lds r12, 0x03C9 ; 0x8003c9 1ec34: d0 90 ca 03 lds r13, 0x03CA ; 0x8003ca 1ec38: 94 e1 ldi r25, 0x14 ; 20 1ec3a: c9 16 cp r12, r25 1ec3c: d1 04 cpc r13, r1 1ec3e: 5c f1 brlt .+86 ; 0x1ec96 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1ec40: 21 e0 ldi r18, 0x01 ; 1 1ec42: 43 e0 ldi r20, 0x03 ; 3 1ec44: 6f 2d mov r22, r15 1ec46: 81 e0 ldi r24, 0x01 ; 1 1ec48: 0e 94 80 da call 0x1b500 ; 0x1b500 1ec4c: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 1ec4e: 8f ef ldi r24, 0xFF ; 255 1ec50: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 lcd_selftest_measure_fans(5, 18, 3); 1ec54: 63 e0 ldi r22, 0x03 ; 3 1ec56: 85 e0 ldi r24, 0x05 ; 5 1ec58: 0f 94 f0 a0 call 0x341e0 ; 0x341e0 lcd_selftest_setfan(0); 1ec5c: 80 e0 ldi r24, 0x00 ; 0 1ec5e: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 if (fan_speed[1] < failThr) { 1ec62: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 1ec66: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc 1ec6a: 84 31 cpi r24, 0x14 ; 20 1ec6c: 91 05 cpc r25, r1 1ec6e: cc f4 brge .+50 ; 0x1eca2 #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 1ec70: 69 ef ldi r22, 0xF9 ; 249 1ec72: 72 e0 ldi r23, 0x02 ; 2 1ec74: 85 e0 ldi r24, 0x05 ; 5 1ec76: 0f 94 75 9f call 0x33eea ; 0x33eea } } if (_swapped_fan) { 1ec7a: 96 e4 ldi r25, 0x46 ; 70 1ec7c: c9 16 cp r12, r25 1ec7e: d1 04 cpc r13, r1 1ec80: 9c f4 brge .+38 ; 0x1eca8 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1ec82: 08 e8 ldi r16, 0x88 ; 136 1ec84: 13 e1 ldi r17, 0x13 ; 19 1ec86: 21 e0 ldi r18, 0x01 ; 1 1ec88: 43 e0 ldi r20, 0x03 ; 3 1ec8a: 6f 2d mov r22, r15 1ec8c: 8d e0 ldi r24, 0x0D ; 13 1ec8e: 0e 94 80 da call 0x1b500 ; 0x1b500 1ec92: e1 2c mov r14, r1 1ec94: 49 c1 rjmp .+658 ; 0x1ef28 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1ec96: 69 ef ldi r22, 0xF9 ; 249 1ec98: 72 e0 ldi r23, 0x02 ; 2 1ec9a: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ec9c: 0f 94 75 9f call 0x33eea ; 0x33eea 1eca0: f0 cf rjmp .-32 ; 0x1ec82 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 1eca2: 86 34 cpi r24, 0x46 ; 70 1eca4: 91 05 cpc r25, r1 1eca6: 54 f4 brge .+20 ; 0x1ecbc } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1eca8: 60 e0 ldi r22, 0x00 ; 0 1ecaa: 81 e0 ldi r24, 0x01 ; 1 1ecac: 0f 94 62 a0 call 0x340c4 ; 0x340c4 if (_result) { 1ecb0: 81 11 cpse r24, r1 1ecb2: 68 c1 rjmp .+720 ; 0x1ef84 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1ecb4: 69 ef ldi r22, 0xF9 ; 249 1ecb6: 72 e0 ldi r23, 0x02 ; 2 1ecb8: 89 e0 ldi r24, 0x09 ; 9 1ecba: f0 cf rjmp .-32 ; 0x1ec9c { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1ecbc: 86 e4 ldi r24, 0x46 ; 70 1ecbe: c8 16 cp r12, r24 1ecc0: d1 04 cpc r13, r1 1ecc2: 94 f7 brge .-28 ; 0x1eca8 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1ecc4: 00 ed ldi r16, 0xD0 ; 208 1ecc6: 17 e0 ldi r17, 0x07 ; 7 1ecc8: 21 e0 ldi r18, 0x01 ; 1 1ecca: 43 e0 ldi r20, 0x03 ; 3 1eccc: 6f 2d mov r22, r15 1ecce: 82 e0 ldi r24, 0x02 ; 2 1ecd0: 0e 94 80 da call 0x1b500 ; 0x1b500 1ecd4: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 1ecd6: 1c 9b sbis 0x03, 4 ; 3 1ecd8: 18 c0 rjmp .+48 ; 0x1ed0a { #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; 1ecda: 1c 9b sbis 0x03, 4 ; 3 1ecdc: 16 c0 rjmp .+44 ; 0x1ed0a 1ecde: 20 e0 ldi r18, 0x00 ; 0 1ece0: 30 e0 ldi r19, 0x00 ; 0 1ece2: 40 e2 ldi r20, 0x20 ; 32 1ece4: 51 e4 ldi r21, 0x41 ; 65 1ece6: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 1ecea: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 1ecee: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 1ecf2: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 1ecf6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1ecfa: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 1ecfe: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 1ed02: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 1ed06: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ed0a: 60 e0 ldi r22, 0x00 ; 0 1ed0c: 70 e0 ldi r23, 0x00 ; 0 1ed0e: 84 e3 ldi r24, 0x34 ; 52 1ed10: 92 e4 ldi r25, 0x42 ; 66 1ed12: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1ed16: 0f 94 ef 42 call 0x285de ; 0x285de if ( 1ed1a: 1c 9b sbis 0x03, 4 ; 3 1ed1c: 3d c1 rjmp .+634 ; 0x1ef98 ((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] = ""; 1ed1e: 1a 82 std Y+2, r1 ; 0x02 1ed20: 19 82 std Y+1, r1 ; 0x01 1ed22: 1c 82 std Y+4, r1 ; 0x04 1ed24: 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"); 1ed26: 1c 9b sbis 0x03, 4 ; 3 1ed28: 06 c0 rjmp .+12 ; 0x1ed36 1ed2a: 65 ee ldi r22, 0xE5 ; 229 1ed2c: 72 e0 ldi r23, 0x02 ; 2 1ed2e: ce 01 movw r24, r28 1ed30: 01 96 adiw r24, 0x01 ; 1 1ed32: 0f 94 6f e2 call 0x3c4de ; 0x3c4de lcd_selftest_error(TestError::Endstops, _error, ""); 1ed36: be 01 movw r22, r28 1ed38: 6f 5f subi r22, 0xFF ; 255 1ed3a: 7f 4f sbci r23, 0xFF ; 255 1ed3c: 82 e0 ldi r24, 0x02 ; 2 1ed3e: 0f 94 75 9f call 0x33eea ; 0x33eea ((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; 1ed42: 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(); 1ed44: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 1ed48: 81 e0 ldi r24, 0x01 ; 1 1ed4a: 0e 94 b6 8a call 0x1156c ; 0x1156c { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1ed4e: 11 23 and r17, r17 1ed50: 09 f4 brne .+2 ; 0x1ed54 1ed52: 97 cf rjmp .-210 ; 0x1ec82 { //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); 1ed54: 00 ed ldi r16, 0xD0 ; 208 1ed56: 17 e0 ldi r17, 0x07 ; 7 1ed58: 21 e0 ldi r18, 0x01 ; 1 1ed5a: 43 e0 ldi r20, 0x03 ; 3 1ed5c: 6f 2d mov r22, r15 1ed5e: 84 e0 ldi r24, 0x04 ; 4 1ed60: 0e 94 80 da call 0x1b500 ; 0x1b500 1ed64: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 1ed66: 80 e0 ldi r24, 0x00 ; 0 1ed68: 0e 94 3a dd call 0x1ba74 ; 0x1ba74 } if (_result) 1ed6c: 88 23 and r24, r24 1ed6e: 09 f4 brne .+2 ; 0x1ed72 1ed70: 88 cf rjmp .-240 ; 0x1ec82 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1ed72: 10 e0 ldi r17, 0x00 ; 0 1ed74: 00 e0 ldi r16, 0x00 ; 0 1ed76: 21 e0 ldi r18, 0x01 ; 1 1ed78: 43 e0 ldi r20, 0x03 ; 3 1ed7a: 6f 2d mov r22, r15 1ed7c: 84 e0 ldi r24, 0x04 ; 4 1ed7e: 0e 94 80 da call 0x1b500 ; 0x1b500 } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1ed82: 0c ed ldi r16, 0xDC ; 220 1ed84: 15 e0 ldi r17, 0x05 ; 5 1ed86: 21 e0 ldi r18, 0x01 ; 1 1ed88: 43 e0 ldi r20, 0x03 ; 3 1ed8a: 68 2f mov r22, r24 1ed8c: 85 e0 ldi r24, 0x05 ; 5 1ed8e: 0e 94 80 da call 0x1b500 ; 0x1b500 1ed92: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 1ed94: 81 e0 ldi r24, 0x01 ; 1 1ed96: 0e 94 3a dd call 0x1ba74 ; 0x1ba74 #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 1ed9a: 88 23 and r24, r24 1ed9c: 09 f4 brne .+2 ; 0x1eda0 1ed9e: 71 cf rjmp .-286 ; 0x1ec82 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1eda0: 10 e0 ldi r17, 0x00 ; 0 1eda2: 00 e0 ldi r16, 0x00 ; 0 1eda4: 21 e0 ldi r18, 0x01 ; 1 1eda6: 43 e0 ldi r20, 0x03 ; 3 1eda8: 6f 2d mov r22, r15 1edaa: 86 e0 ldi r24, 0x06 ; 6 1edac: 0e 94 80 da call 0x1b500 ; 0x1b500 1edb0: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 1edb2: 0f 94 b0 25 call 0x24b60 ; 0x24b60 1edb6: 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); 1edba: e8 ee ldi r30, 0xE8 ; 232 1edbc: f5 ea ldi r31, 0xA5 ; 165 1edbe: 85 91 lpm r24, Z+ 1edc0: 95 91 lpm r25, Z+ 1edc2: a5 91 lpm r26, Z+ 1edc4: b4 91 lpm r27, Z 1edc6: 80 93 92 06 sts 0x0692, r24 ; 0x800692 1edca: 90 93 93 06 sts 0x0693, r25 ; 0x800693 1edce: a0 93 94 06 sts 0x0694, r26 ; 0x800694 1edd2: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1edd6: ec ee ldi r30, 0xEC ; 236 1edd8: f5 ea ldi r31, 0xA5 ; 165 1edda: 65 91 lpm r22, Z+ 1eddc: 75 91 lpm r23, Z+ 1edde: 85 91 lpm r24, Z+ 1ede0: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 1ede2: 20 e0 ldi r18, 0x00 ; 0 1ede4: 30 e0 ldi r19, 0x00 ; 0 1ede6: 40 e8 ldi r20, 0x80 ; 128 1ede8: 50 e4 ldi r21, 0x40 ; 64 1edea: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1edee: 60 93 96 06 sts 0x0696, r22 ; 0x800696 1edf2: 70 93 97 06 sts 0x0697, r23 ; 0x800697 1edf6: 80 93 98 06 sts 0x0698, r24 ; 0x800698 1edfa: 90 93 99 06 sts 0x0699, r25 ; 0x800699 #endif //TMC2130 raise_z(10); 1edfe: 60 e0 ldi r22, 0x00 ; 0 1ee00: 70 e0 ldi r23, 0x00 ; 0 1ee02: 80 e2 ldi r24, 0x20 ; 32 1ee04: 91 e4 ldi r25, 0x41 ; 65 1ee06: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 set_destination_to_current(); 1ee0a: 0e 94 41 68 call 0xd082 ; 0xd082 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1ee0e: 0c ed ldi r16, 0xDC ; 220 1ee10: 15 e0 ldi r17, 0x05 ; 5 1ee12: 21 e0 ldi r18, 0x01 ; 1 1ee14: 43 e0 ldi r20, 0x03 ; 3 1ee16: 6f 2d mov r22, r15 1ee18: 86 e0 ldi r24, 0x06 ; 6 1ee1a: 0e 94 80 da call 0x1b500 ; 0x1b500 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 1ee1e: 50 e0 ldi r21, 0x00 ; 0 1ee20: 40 e0 ldi r20, 0x00 ; 0 1ee22: 61 e0 ldi r22, 0x01 ; 1 1ee24: 82 e0 ldi r24, 0x02 ; 2 1ee26: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 #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); 1ee2a: 60 e0 ldi r22, 0x00 ; 0 1ee2c: 70 e0 ldi r23, 0x00 ; 0 1ee2e: 80 ea ldi r24, 0xA0 ; 160 1ee30: 91 e4 ldi r25, 0x41 ; 65 1ee32: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 } #ifdef TMC2130 if (_result) { raise_z(10); 1ee36: 60 e0 ldi r22, 0x00 ; 0 1ee38: 70 e0 ldi r23, 0x00 ; 0 1ee3a: 80 e2 ldi r24, 0x20 ; 32 1ee3c: 91 e4 ldi r25, 0x41 ; 65 1ee3e: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 1ee42: 10 e0 ldi r17, 0x00 ; 0 1ee44: 00 e0 ldi r16, 0x00 ; 0 1ee46: 21 e0 ldi r18, 0x01 ; 1 1ee48: 42 e0 ldi r20, 0x02 ; 2 1ee4a: 60 e0 ldi r22, 0x00 ; 0 1ee4c: 8e e0 ldi r24, 0x0E ; 14 1ee4e: 0e 94 80 da call 0x1b500 ; 0x1b500 bool bres = tmc2130_home_calibrate(X_AXIS); 1ee52: 80 e0 ldi r24, 0x00 ; 0 1ee54: 0f 94 a2 22 call 0x24544 ; 0x24544 1ee58: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 1ee5a: 21 e0 ldi r18, 0x01 ; 1 1ee5c: 42 e0 ldi r20, 0x02 ; 2 1ee5e: 61 e0 ldi r22, 0x01 ; 1 1ee60: 8e e0 ldi r24, 0x0E ; 14 1ee62: 0e 94 80 da call 0x1b500 ; 0x1b500 bres &= tmc2130_home_calibrate(Y_AXIS); 1ee66: 81 e0 ldi r24, 0x01 ; 1 1ee68: 0f 94 a2 22 call 0x24544 ; 0x24544 1ee6c: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 1ee6e: 21 e0 ldi r18, 0x01 ; 1 1ee70: 42 e0 ldi r20, 0x02 ; 2 1ee72: 62 e0 ldi r22, 0x02 ; 2 1ee74: 8e e0 ldi r24, 0x0E ; 14 1ee76: 0e 94 80 da call 0x1b500 ; 0x1b500 1ee7a: f8 2e mov r15, r24 if (bres) 1ee7c: ee 20 and r14, r14 1ee7e: 09 f4 brne .+2 ; 0x1ee82 1ee80: 00 cf rjmp .-512 ; 0x1ec82 1ee82: 61 e0 ldi r22, 0x01 ; 1 1ee84: 88 ef ldi r24, 0xF8 ; 248 1ee86: 9e e0 ldi r25, 0x0E ; 14 1ee88: 0f 94 47 dc call 0x3b88e ; 0x3b88e } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1ee8c: 00 ed ldi r16, 0xD0 ; 208 1ee8e: 17 e0 ldi r17, 0x07 ; 7 1ee90: 21 e0 ldi r18, 0x01 ; 1 1ee92: 43 e0 ldi r20, 0x03 ; 3 1ee94: 6f 2d mov r22, r15 1ee96: 87 e0 ldi r24, 0x07 ; 7 1ee98: 0e 94 80 da call 0x1b500 ; 0x1b500 1ee9c: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1ee9e: 81 e0 ldi r24, 0x01 ; 1 1eea0: 0e 94 1a dc call 0x1b834 ; 0x1b834 } if (_result) 1eea4: 88 23 and r24, r24 1eea6: 09 f4 brne .+2 ; 0x1eeaa 1eea8: ec ce rjmp .-552 ; 0x1ec82 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1eeaa: 08 ee ldi r16, 0xE8 ; 232 1eeac: 13 e0 ldi r17, 0x03 ; 3 1eeae: 21 e0 ldi r18, 0x01 ; 1 1eeb0: 43 e0 ldi r20, 0x03 ; 3 1eeb2: 6f 2d mov r22, r15 1eeb4: 88 e0 ldi r24, 0x08 ; 8 1eeb6: 0e 94 80 da call 0x1b500 ; 0x1b500 1eeba: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1eebc: 80 e0 ldi r24, 0x00 ; 0 1eebe: 0e 94 1a dc call 0x1b834 ; 0x1b834 1eec2: e8 2e mov r14, r24 } if (_result) 1eec4: 88 23 and r24, r24 1eec6: 09 f4 brne .+2 ; 0x1eeca 1eec8: dc ce rjmp .-584 ; 0x1ec82 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1eeca: 00 ed ldi r16, 0xD0 ; 208 1eecc: 17 e0 ldi r17, 0x07 ; 7 1eece: 21 e0 ldi r18, 0x01 ; 1 1eed0: 43 e0 ldi r20, 0x03 ; 3 1eed2: 6f 2d mov r22, r15 1eed4: 89 e0 ldi r24, 0x09 ; 9 1eed6: 0e 94 80 da call 0x1b500 ; 0x1b500 } } 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 1eeda: 21 e0 ldi r18, 0x01 ; 1 1eedc: 43 e0 ldi r20, 0x03 ; 3 1eede: 68 2f mov r22, r24 1eee0: 8a e0 ldi r24, 0x0A ; 10 1eee2: 0e 94 80 da call 0x1b500 ; 0x1b500 1eee6: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1eee8: 0f 94 40 7b call 0x2f680 ; 0x2f680 if (fsensor.isError()) 1eeec: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1eef0: 83 30 cpi r24, 0x03 ; 3 1eef2: 29 f4 brne .+10 ; 0x1eefe { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1eef4: 69 ef ldi r22, 0xF9 ; 249 1eef6: 72 e0 ldi r23, 0x02 ; 2 1eef8: 8a e0 ldi r24, 0x0A ; 10 1eefa: 0f 94 75 9f call 0x33eea ; 0x33eea #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) 1eefe: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 1ef02: 83 30 cpi r24, 0x03 ; 3 1ef04: 09 f4 brne .+2 ; 0x1ef08 1ef06: bd ce rjmp .-646 ; 0x1ec82 { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1ef08: 00 ed ldi r16, 0xD0 ; 208 1ef0a: 17 e0 ldi r17, 0x07 ; 7 1ef0c: 21 e0 ldi r18, 0x01 ; 1 1ef0e: 43 e0 ldi r20, 0x03 ; 3 1ef10: 6f 2d mov r22, r15 1ef12: 8b e0 ldi r24, 0x0B ; 11 1ef14: 0e 94 80 da call 0x1b500 ; 0x1b500 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1ef18: 08 e8 ldi r16, 0x88 ; 136 1ef1a: 13 e1 ldi r17, 0x13 ; 19 1ef1c: 21 e0 ldi r18, 0x01 ; 1 1ef1e: 43 e0 ldi r20, 0x03 ; 3 1ef20: 68 2f mov r22, r24 1ef22: 8c e0 ldi r24, 0x0C ; 12 1ef24: 0e 94 80 da call 0x1b500 ; 0x1b500 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1ef28: 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); 1ef2c: 61 e0 ldi r22, 0x01 ; 1 1ef2e: 87 ed ldi r24, 0xD7 ; 215 1ef30: 9b e6 ldi r25, 0x6B ; 107 1ef32: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_update_enable(true); 1ef36: 81 e0 ldi r24, 0x01 ; 1 1ef38: 0e 94 2c 6f call 0xde58 ; 0xde58 if (_result) 1ef3c: ee 20 and r14, r14 1ef3e: 71 f1 breq .+92 ; 0x1ef9c { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1ef40: 81 e0 ldi r24, 0x01 ; 1 1ef42: 0e 94 99 ee call 0x1dd32 ; 0x1dd32 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1ef46: 84 ed ldi r24, 0xD4 ; 212 1ef48: 98 e4 ldi r25, 0x48 ; 72 1ef4a: 0e 94 b3 72 call 0xe566 ; 0xe566 1ef4e: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 lcd_return_to_status(); 1ef52: 0f 94 ad 1e call 0x23d5a ; 0x23d5a else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 1ef56: 80 e0 ldi r24, 0x00 ; 0 1ef58: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #endif // TMC2130 FORCE_BL_ON_END; 1ef5c: 80 e0 ldi r24, 0x00 ; 0 1ef5e: 0e 94 50 8a call 0x114a0 ; 0x114a0 KEEPALIVE_STATE(NOT_BUSY); 1ef62: 81 e0 ldi r24, 0x01 ; 1 1ef64: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return(_result); } 1ef68: 8e 2d mov r24, r14 1ef6a: 0f 90 pop r0 1ef6c: 0f 90 pop r0 1ef6e: 0f 90 pop r0 1ef70: 0f 90 pop r0 1ef72: df 91 pop r29 1ef74: cf 91 pop r28 1ef76: 1f 91 pop r17 1ef78: 0f 91 pop r16 1ef7a: ff 90 pop r15 1ef7c: ef 90 pop r14 1ef7e: df 90 pop r13 1ef80: cf 90 pop r12 1ef82: 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); 1ef84: 61 e0 ldi r22, 0x01 ; 1 1ef86: 80 e0 ldi r24, 0x00 ; 0 1ef88: 0f 94 62 a0 call 0x340c4 ; 0x340c4 if (!_result){ 1ef8c: 81 11 cpse r24, r1 1ef8e: 9a ce rjmp .-716 ; 0x1ecc4 lcd_selftest_error(TestError::PrintFan, "", ""); 1ef90: 69 ef ldi r22, 0xF9 ; 249 1ef92: 72 e0 ldi r23, 0x02 ; 2 1ef94: 85 e0 ldi r24, 0x05 ; 5 1ef96: 82 ce rjmp .-764 ; 0x1ec9c #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1ef98: 11 e0 ldi r17, 0x01 ; 1 1ef9a: d4 ce rjmp .-600 ; 0x1ed44 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1ef9c: 87 ea ldi r24, 0xA7 ; 167 1ef9e: 96 e5 ldi r25, 0x56 ; 86 1efa0: 0e 94 b3 72 call 0xe566 ; 0xe566 1efa4: 62 e0 ldi r22, 0x02 ; 2 1efa6: 0e 94 24 f1 call 0x1e248 ; 0x1e248 1efaa: d5 cf rjmp .-86 ; 0x1ef56 0001efac : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1efac: 0c 94 67 f5 jmp 0x1eace ; 0x1eace 0001efb0 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1efb0: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1efb4: 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; 1efb8: 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() 1efbc: 81 11 cpse r24, r1 1efbe: 32 c0 rjmp .+100 ; 0x1f024 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1efc0: 80 91 38 02 lds r24, 0x0238 ; 0x800238 1efc4: 81 11 cpse r24, r1 1efc6: 02 c0 rjmp .+4 ; 0x1efcc #endif ) { return false; // abort if error persists } return true; 1efc8: 81 e0 ldi r24, 0x01 ; 1 1efca: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 1efcc: 8f ef ldi r24, 0xFF ; 255 1efce: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 setExtruderAutoFanState(3); //force enables the hotend fan 1efd2: 83 e0 ldi r24, 0x03 ; 3 1efd4: 0e 94 62 75 call 0xeac4 ; 0xeac4 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1efd8: 0f 94 53 29 call 0x252a6 ; 0x252a6 1efdc: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 1efe0: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 1efe4: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 1efe8: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 fan_measuring = true; 1efec: 81 e0 ldi r24, 0x01 ; 1 1efee: 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) 1eff2: 68 ee ldi r22, 0xE8 ; 232 1eff4: 73 e0 ldi r23, 0x03 ; 3 1eff6: 80 e0 ldi r24, 0x00 ; 0 1eff8: 90 e0 ldi r25, 0x00 ; 0 1effa: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 manage_heater(); 1effe: 0f 94 63 38 call 0x270c6 ; 0x270c6 setExtruderAutoFanState(1); //releases lock on the hotend fan 1f002: 81 e0 ldi r24, 0x01 ; 1 1f004: 0e 94 62 75 call 0xeac4 ; 0xeac4 lcd_selftest_setfan(0); 1f008: 80 e0 ldi r24, 0x00 ; 0 1f00a: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 1f00e: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1f012: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1f016: 45 97 sbiw r24, 0x15 ; 21 1f018: 3c f4 brge .+14 ; 0x1f028 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1f01a: 62 e0 ldi r22, 0x02 ; 2 1f01c: 82 ee ldi r24, 0xE2 ; 226 1f01e: 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); 1f020: 0e 94 24 f1 call 0x1e248 ; 0x1e248 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1f024: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1f026: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 1f028: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 1f02c: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc 1f030: 45 97 sbiw r24, 0x15 ; 21 1f032: 54 f6 brge .-108 ; 0x1efc8 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 1f034: 62 e0 ldi r22, 0x02 ; 2 1f036: 8e ec ldi r24, 0xCE ; 206 1f038: 9a e6 ldi r25, 0x6A ; 106 1f03a: f2 cf rjmp .-28 ; 0x1f020 0001f03c : //! @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; 1f03c: 0e 94 d8 f7 call 0x1efb0 ; 0x1efb0 1f040: 88 23 and r24, r24 1f042: 51 f1 breq .+84 ; 0x1f098 cmdqueue_serial_disabled = false; 1f044: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1f048: 8b e5 ldi r24, 0x5B ; 91 1f04a: 93 e5 ldi r25, 0x53 ; 83 1f04c: 0e 94 b3 72 call 0xe566 ; 0xe566 1f050: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 st_synchronize(); 1f054: 0f 94 ef 42 call 0x285de ; 0x285de custom_message_type = CustomMsg::Resuming; 1f058: 88 e0 ldi r24, 0x08 ; 8 1f05a: 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(); 1f05e: 0e 94 e8 74 call 0xe9d0 ; 0xe9d0 setExtruderAutoFanState(1); 1f062: 81 e0 ldi r24, 0x01 ; 1 1f064: 0e 94 62 75 call 0xeac4 ; 0xeac4 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1f068: 10 92 11 05 sts 0x0511, r1 ; 0x800511 restore_print_from_ram_and_continue(default_retraction); 1f06c: 60 e0 ldi r22, 0x00 ; 0 1f06e: 70 e0 ldi r23, 0x00 ; 0 1f070: 80 e8 ldi r24, 0x80 ; 128 1f072: 9f e3 ldi r25, 0x3F ; 63 1f074: 0e 94 4b 68 call 0xd096 ; 0xd096 did_pause_print = false; 1f078: 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(); 1f07c: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 1f080: 82 30 cpi r24, 0x02 ; 2 1f082: 11 f4 brne .+4 ; 0x1f088 1f084: 0f 94 94 42 call 0x28528 ; 0x28528 refresh_cmd_timeout(); 1f088: 0e 94 ca 66 call 0xcd94 ; 0xcd94 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1f08c: 87 ef ldi r24, 0xF7 ; 247 1f08e: 9a e6 ldi r25, 0x6A ; 106 1f090: 0e 94 82 79 call 0xf304 ; 0xf304 custom_message_type = CustomMsg::Status; 1f094: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } 1f098: 08 95 ret 0001f09a : //! @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; 1f09a: 0e 94 d8 f7 call 0x1efb0 ; 0x1efb0 1f09e: 88 23 and r24, r24 1f0a0: 21 f0 breq .+8 ; 0x1f0aa // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1f0a2: 88 e0 ldi r24, 0x08 ; 8 1f0a4: 9b e6 ldi r25, 0x6B ; 107 1f0a6: 0c 94 82 79 jmp 0xf304 ; 0xf304 } 1f0aa: 08 95 ret 0001f0ac : } /// @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) { 1f0ac: cf 92 push r12 1f0ae: df 92 push r13 1f0b0: ef 92 push r14 1f0b2: ff 92 push r15 1f0b4: cf 93 push r28 1f0b6: 6b 01 movw r12, r22 1f0b8: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1f0ba: 82 e0 ldi r24, 0x02 ; 2 1f0bc: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1f0c0: 8e ef ldi r24, 0xFE ; 254 1f0c2: 92 e5 ldi r25, 0x52 ; 82 1f0c4: 0e 94 b3 72 call 0xe566 ; 0xe566 1f0c8: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 FSensorBlockRunout fsBlockRunout; 1f0cc: 0f 94 b5 86 call 0x30d6a ; 0x30d6a current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1f0d0: 20 e0 ldi r18, 0x00 ; 0 1f0d2: 30 e0 ldi r19, 0x00 ; 0 1f0d4: 44 e3 ldi r20, 0x34 ; 52 1f0d6: 52 e4 ldi r21, 0x42 ; 66 1f0d8: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f0dc: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f0e0: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f0e4: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f0e8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1f0ec: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f0f0: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f0f4: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f0f8: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1f0fc: 6a e0 ldi r22, 0x0A ; 10 1f0fe: 77 e5 ldi r23, 0x57 ; 87 1f100: 8d ea ldi r24, 0xAD ; 173 1f102: 92 e4 ldi r25, 0x42 ; 66 1f104: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1f108: 0f 94 ef 42 call 0x285de ; 0x285de current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1f10c: 20 e0 ldi r18, 0x00 ; 0 1f10e: 30 e0 ldi r19, 0x00 ; 0 1f110: 4c e0 ldi r20, 0x0C ; 12 1f112: 52 e4 ldi r21, 0x42 ; 66 1f114: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f118: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f11c: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f120: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f124: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 1f128: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f12c: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f130: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f134: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1f138: 69 e2 ldi r22, 0x29 ; 41 1f13a: 7c e5 ldi r23, 0x5C ; 92 1f13c: 85 e8 ldi r24, 0x85 ; 133 1f13e: 91 e4 ldi r25, 0x41 ; 65 1f140: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1f144: 0f 94 ef 42 call 0x285de ; 0x285de // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1f148: 20 e0 ldi r18, 0x00 ; 0 1f14a: 30 e0 ldi r19, 0x00 ; 0 1f14c: a9 01 movw r20, r18 1f14e: c7 01 movw r24, r14 1f150: b6 01 movw r22, r12 1f152: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1f156: 88 23 and r24, r24 1f158: e1 f0 breq .+56 ; 0x1f192 { current_position[E_AXIS] += unloadLength; 1f15a: a7 01 movw r20, r14 1f15c: 96 01 movw r18, r12 1f15e: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 1f162: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 1f166: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 1f16a: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 1f16e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 1f172: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 1f176: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 1f17a: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 1f17e: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1f182: 60 e0 ldi r22, 0x00 ; 0 1f184: 70 e0 ldi r23, 0x00 ; 0 1f186: 80 e2 ldi r24, 0x20 ; 32 1f188: 91 e4 ldi r25, 0x41 ; 65 1f18a: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 1f18e: 0f 94 ef 42 call 0x285de ; 0x285de } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1f192: 88 ec ldi r24, 0xC8 ; 200 1f194: 95 e4 ldi r25, 0x45 ; 69 1f196: 0e 94 b3 72 call 0xe566 ; 0xe566 1f19a: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 //disable extruder steppers so filament can be removed disable_e0(); 1f19e: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1f1a0: 64 e6 ldi r22, 0x64 ; 100 1f1a2: 70 e0 ldi r23, 0x00 ; 0 1f1a4: 80 e0 ldi r24, 0x00 ; 0 1f1a6: 90 e0 ldi r25, 0x00 ; 0 1f1a8: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1f1ac: 82 e0 ldi r24, 0x02 ; 2 1f1ae: 0f 94 0e 4e call 0x29c1c ; 0x29c1c 1f1b2: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1f1b4: 0e 94 04 71 call 0xe208 ; 0xe208 1f1b8: 81 11 cpse r24, r1 1f1ba: 07 c0 rjmp .+14 ; 0x1f1ca 1f1bc: c1 50 subi r28, 0x01 ; 1 1f1be: 29 f0 breq .+10 ; 0x1f1ca delay_keep_alive(100); 1f1c0: 84 e6 ldi r24, 0x64 ; 100 1f1c2: 90 e0 ldi r25, 0x00 ; 0 1f1c4: 0e 94 eb 8c call 0x119d6 ; 0x119d6 1f1c8: f5 cf rjmp .-22 ; 0x1f1b4 counterBeep++; } st_synchronize(); 1f1ca: 0f 94 ef 42 call 0x285de ; 0x285de while (lcd_clicked()) delay_keep_alive(100); 1f1ce: 0e 94 04 71 call 0xe208 ; 0xe208 1f1d2: 88 23 and r24, r24 1f1d4: 29 f0 breq .+10 ; 0x1f1e0 1f1d6: 84 e6 ldi r24, 0x64 ; 100 1f1d8: 90 e0 ldi r25, 0x00 ; 0 1f1da: 0e 94 eb 8c call 0x119d6 ; 0x119d6 1f1de: f7 cf rjmp .-18 ; 0x1f1ce lcd_update_enable(true); 1f1e0: 81 e0 ldi r24, 0x01 ; 1 1f1e2: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_setstatuspgm(MSG_WELCOME); 1f1e6: 83 e7 ldi r24, 0x73 ; 115 1f1e8: 90 e7 ldi r25, 0x70 ; 112 1f1ea: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 custom_message_type = CustomMsg::Status; 1f1ee: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 clearFilamentAction(); 1f1f2: 0f 94 9a 20 call 0x24134 ; 0x24134 } 1f1f6: cf 91 pop r28 1f1f8: ff 90 pop r15 1f1fa: ef 90 pop r14 1f1fc: df 90 pop r13 1f1fe: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f200: 0d 94 f9 7a jmp 0x2f5f2 ; 0x2f5f2 0001f204 : //! ---------------------- | ---------------- //! 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) { 1f204: af 92 push r10 1f206: bf 92 push r11 1f208: cf 92 push r12 1f20a: df 92 push r13 1f20c: ef 92 push r14 1f20e: ff 92 push r15 1f210: 0f 93 push r16 1f212: 1f 93 push r17 1f214: cf 93 push r28 1f216: 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); 1f218: 88 23 and r24, r24 1f21a: 29 f0 breq .+10 ; 0x1f226 1f21c: 61 e0 ldi r22, 0x01 ; 1 1f21e: 8f e5 ldi r24, 0x5F ; 95 1f220: 9f e0 ldi r25, 0x0F ; 15 1f222: 0f 94 47 dc call 0x3b88e ; 0x3b88e FORCE_BL_ON_START; 1f226: 81 e0 ldi r24, 0x01 ; 1 1f228: 0e 94 50 8a call 0x114a0 ; 0x114a0 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1f22c: 87 ed ldi r24, 0xD7 ; 215 1f22e: e8 2e mov r14, r24 1f230: 89 e8 ldi r24, 0x89 ; 137 1f232: 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; 1f234: 97 ed ldi r25, 0xD7 ; 215 1f236: c9 2e mov r12, r25 1f238: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f23a: 2c e3 ldi r18, 0x3C ; 60 1f23c: a2 2e mov r10, r18 1f23e: b1 2c mov r11, r1 1f240: 0c 2f mov r16, r28 1f242: 10 e0 ldi r17, 0x00 ; 0 1f244: 1f 92 push r1 1f246: cf 93 push r28 1f248: ff 92 push r15 1f24a: ef 92 push r14 1f24c: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca switch (state) { 1f250: 0f 90 pop r0 1f252: 0f 90 pop r0 1f254: 0f 90 pop r0 1f256: 0f 90 pop r0 1f258: cf 30 cpi r28, 0x0F ; 15 1f25a: a0 f7 brcc .-24 ; 0x1f244 1f25c: f8 01 movw r30, r16 1f25e: 88 27 eor r24, r24 1f260: eb 5c subi r30, 0xCB ; 203 1f262: f6 40 sbci r31, 0x06 ; 6 1f264: 8f 4f sbci r24, 0xFF ; 255 1f266: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 1f26a: 44 f9 bld r20, 4 1f26c: 94 f9 bld r25, 4 1f26e: ba f9 .word 0xf9ba ; ???? 1f270: c6 f9 bld r28, 6 1f272: d0 f9 bld r29, 0 1f274: 0a fa .word 0xfa0a ; ???? 1f276: 16 fa bst r1, 6 1f278: 30 fa bst r3, 0 1f27a: 47 fa bst r4, 7 1f27c: 41 fa bst r4, 1 1f27e: 4b fa .word 0xfa4b ; ???? 1f280: 59 fa .word 0xfa59 ; ???? 1f282: 62 fa bst r6, 2 1f284: 76 fa bst r7, 6 1f286: 76 fa bst r7, 6 // 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; 1f288: 10 92 a9 0d sts 0x0DA9, r1 ; 0x800da9 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1f28c: 8f e5 ldi r24, 0x5F ; 95 1f28e: 9f e0 ldi r25, 0x0F ; 15 1f290: 0f 94 23 dc call 0x3b846 ; 0x3b846 1f294: 82 30 cpi r24, 0x02 ; 2 1f296: 39 f4 brne .+14 ; 0x1f2a6 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1f298: 83 ea ldi r24, 0xA3 ; 163 1f29a: 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)); 1f29c: 0e 94 b3 72 call 0xe566 ; 0xe566 1f2a0: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 1f2a4: 0f c0 rjmp .+30 ; 0x1f2c4 // 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); 1f2a6: 8e e3 ldi r24, 0x3E ; 62 1f2a8: 92 e4 ldi r25, 0x42 ; 66 1f2aa: 0e 94 b3 72 call 0xe566 ; 0xe566 1f2ae: 40 e0 ldi r20, 0x00 ; 0 1f2b0: 60 e0 ldi r22, 0x00 ; 0 1f2b2: 0f 94 47 4f call 0x29e8e ; 0x29e8e if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f2b6: 81 11 cpse r24, r1 1f2b8: 07 c0 rjmp .+14 ; 0x1f2c8 1f2ba: 61 e0 ldi r22, 0x01 ; 1 1f2bc: 8f e5 ldi r24, 0x5F ; 95 1f2be: 9f e0 ldi r25, 0x0F ; 15 1f2c0: 0f 94 47 dc call 0x3b88e ; 0x3b88e state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1f2c4: c1 e0 ldi r28, 0x01 ; 1 1f2c6: bc cf rjmp .-136 ; 0x1f240 1f2c8: 60 e0 ldi r22, 0x00 ; 0 1f2ca: 8f e5 ldi r24, 0x5F ; 95 1f2cc: 9f e0 ldi r25, 0x0F ; 15 1f2ce: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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); 1f2d2: 10 e0 ldi r17, 0x00 ; 0 1f2d4: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 1f2d6: 80 e0 ldi r24, 0x00 ; 0 1f2d8: 0e 94 50 8a call 0x114a0 ; 0x114a0 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 1f2dc: 1f 93 push r17 1f2de: 0f 93 push r16 1f2e0: 8c e7 ldi r24, 0x7C ; 124 1f2e2: 9a e6 ldi r25, 0x6A ; 106 1f2e4: 9f 93 push r25 1f2e6: 8f 93 push r24 1f2e8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca switch (state) { 1f2ec: 0f 90 pop r0 1f2ee: 0f 90 pop r0 1f2f0: 0f 90 pop r0 1f2f2: 0f 90 pop r0 1f2f4: cd 30 cpi r28, 0x0D ; 13 1f2f6: 09 f4 brne .+2 ; 0x1f2fa 1f2f8: ff c0 rjmp .+510 ; 0x1f4f8 1f2fa: ce 30 cpi r28, 0x0E ; 14 1f2fc: 09 f4 brne .+2 ; 0x1f300 1f2fe: 11 c1 rjmp .+546 ; 0x1f522 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1f300: 8d e5 ldi r24, 0x5D ; 93 1f302: 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) { 1f304: cc 23 and r28, r28 1f306: 09 f4 brne .+2 ; 0x1f30a 1f308: 0e c1 rjmp .+540 ; 0x1f526 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1f30a: 81 e0 ldi r24, 0x01 ; 1 1f30c: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_update(2); 1f310: 82 e0 ldi r24, 0x02 ; 2 } 1f312: cf 91 pop r28 1f314: 1f 91 pop r17 1f316: 0f 91 pop r16 1f318: ff 90 pop r15 1f31a: ef 90 pop r14 1f31c: df 90 pop r13 1f31e: cf 90 pop r12 1f320: bf 90 pop r11 1f322: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1f324: 0c 94 ae 6e jmp 0xdd5c ; 0xdd5c lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f328: 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)) { 1f32c: 81 e0 ldi r24, 0x01 ; 1 1f32e: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c state = S::Selftest; 1f332: 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)) { 1f334: 88 23 and r24, r24 1f336: 09 f4 brne .+2 ; 0x1f33a 1f338: 83 cf rjmp .-250 ; 0x1f240 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1f33a: 82 e0 ldi r24, 0x02 ; 2 1f33c: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1f340: 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)) { 1f342: 88 23 and r24, r24 1f344: 09 f4 brne .+2 ; 0x1f348 1f346: 7c cf rjmp .-264 ; 0x1f240 // 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)) { 1f348: 84 e0 ldi r24, 0x04 ; 4 1f34a: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c state = S::Z; 1f34e: 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)) { 1f350: 88 23 and r24, r24 1f352: 09 f4 brne .+2 ; 0x1f356 1f354: 75 cf rjmp .-278 ; 0x1f240 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 1f356: 88 e0 ldi r24, 0x08 ; 8 1f358: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c state = S::ThermalModel; 1f35c: 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)) { 1f35e: 88 23 and r24, r24 1f360: 09 f4 brne .+2 ; 0x1f364 1f362: 6e cf rjmp .-292 ; 0x1f240 state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 1f364: 80 e1 ldi r24, 0x10 ; 16 1f366: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1f36a: 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)) { 1f36c: 81 11 cpse r24, r1 1f36e: 68 cf rjmp .-304 ; 0x1f240 state = S::IsFil; 1f370: c6 e0 ldi r28, 0x06 ; 6 1f372: 66 cf rjmp .-308 ; 0x1f240 // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1f374: 85 ef ldi r24, 0xF5 ; 245 1f376: 91 e4 ldi r25, 0x41 ; 65 1f378: 0e 94 b3 72 call 0xe566 ; 0xe566 1f37c: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 wizard_event = lcd_selftest(); 1f380: 0e 94 67 f5 call 0x1eace ; 0x1eace 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); 1f384: 81 11 cpse r24, r1 1f386: 9e cf rjmp .-196 ; 0x1f2c4 } 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); 1f388: ce e0 ldi r28, 0x0E ; 14 1f38a: 5a cf rjmp .-332 ; 0x1f240 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1f38c: 87 eb ldi r24, 0xB7 ; 183 1f38e: 91 e4 ldi r25, 0x41 ; 65 1f390: 0e 94 b3 72 call 0xe566 ; 0xe566 1f394: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 wizard_event = gcode_M45(false, 0); 1f398: 80 e0 ldi r24, 0x00 ; 0 1f39a: 0f 94 ac 8d call 0x31b58 ; 0x31b58 1f39e: f2 cf rjmp .-28 ; 0x1f384 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1f3a0: 8f e8 ldi r24, 0x8F ; 143 1f3a2: 91 e4 ldi r25, 0x41 ; 65 1f3a4: 0e 94 b3 72 call 0xe566 ; 0xe566 1f3a8: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1f3ac: 81 e6 ldi r24, 0x61 ; 97 1f3ae: 91 e4 ldi r25, 0x41 ; 65 1f3b0: 0e 94 b3 72 call 0xe566 ; 0xe566 1f3b4: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1f3b8: 81 e4 ldi r24, 0x41 ; 65 1f3ba: 91 e4 ldi r25, 0x41 ; 65 1f3bc: 0e 94 b3 72 call 0xe566 ; 0xe566 1f3c0: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 wizard_event = gcode_M45(true, 0); 1f3c4: 81 e0 ldi r24, 0x01 ; 1 1f3c6: 0f 94 ac 8d call 0x31b58 ; 0x31b58 if (!wizard_event) { 1f3ca: 88 23 and r24, r24 1f3cc: e9 f2 breq .-70 ; 0x1f388 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1f3ce: 60 e0 ldi r22, 0x00 ; 0 1f3d0: 70 e0 ldi r23, 0x00 ; 0 1f3d2: 88 ed ldi r24, 0xD8 ; 216 1f3d4: 91 e4 ldi r25, 0x41 ; 65 1f3d6: 0e 94 67 6e call 0xdcce ; 0xdcce if(!MMU2::mmu2.Enabled()) { 1f3da: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 1f3de: 81 30 cpi r24, 0x01 ; 1 1f3e0: 09 f4 brne .+2 ; 0x1f3e4 1f3e2: 70 cf rjmp .-288 ; 0x1f2c4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1f3e4: d0 92 b7 0d sts 0x0DB7, r13 ; 0x800db7 1f3e8: 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)); 1f3ec: 8c e1 ldi r24, 0x1C ; 28 1f3ee: 91 e4 ldi r25, 0x41 ; 65 1f3f0: 0e 94 b3 72 call 0xe566 ; 0xe566 1f3f4: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 wait_preheat(); 1f3f8: 0e 94 5c e2 call 0x1c4b8 ; 0x1c4b8 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1f3fc: 60 e0 ldi r22, 0x00 ; 0 1f3fe: 70 e0 ldi r23, 0x00 ; 0 1f400: cb 01 movw r24, r22 1f402: 0e 94 56 f8 call 0x1f0ac ; 0x1f0ac lcd_wizard_load(); // load filament 1f406: 0e 94 e3 ce call 0x19dc6 ; 0x19dc6 1f40a: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 1f40e: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 1f412: 58 cf rjmp .-336 ; 0x1f2c4 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 1f414: 8c ed ldi r24, 0xDC ; 220 1f416: 90 e4 ldi r25, 0x40 ; 64 1f418: 0e 94 b3 72 call 0xe566 ; 0xe566 1f41c: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 lcd_commands_type = LcdCommands::ThermalModel; 1f420: 85 e0 ldi r24, 0x05 ; 5 1f422: 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); 1f426: 05 e0 ldi r16, 0x05 ; 5 1f428: 10 e0 ldi r17, 0x00 ; 0 1f42a: 55 cf rjmp .-342 ; 0x1f2d6 1f42c: d0 92 b7 0d sts 0x0DB7, r13 ; 0x800db7 1f430: c0 92 b6 0d sts 0x0DB6, r12 ; 0x800db6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f434: b0 92 73 06 sts 0x0673, r11 ; 0x800673 1f438: 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); 1f43c: 86 ec ldi r24, 0xC6 ; 198 1f43e: 90 e4 ldi r25, 0x40 ; 64 1f440: 0e 94 b3 72 call 0xe566 ; 0xe566 1f444: 41 e0 ldi r20, 0x01 ; 1 1f446: 60 e0 ldi r22, 0x00 ; 0 1f448: 0f 94 47 4f call 0x29e8e ; 0x29e8e if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1f44c: 88 23 and r24, r24 1f44e: 09 f1 breq .+66 ; 0x1f492 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1f450: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba else state = S::Preheat; 1f454: 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; 1f456: 81 30 cpi r24, 0x01 ; 1 1f458: 09 f0 breq .+2 ; 0x1f45c 1f45a: f2 ce rjmp .-540 ; 0x1f240 1f45c: c8 e0 ldi r28, 0x08 ; 8 1f45e: f0 ce rjmp .-544 ; 0x1f240 else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1f460: 20 e0 ldi r18, 0x00 ; 0 1f462: 41 e0 ldi r20, 0x01 ; 1 1f464: 70 e0 ldi r23, 0x00 ; 0 1f466: 60 e0 ldi r22, 0x00 ; 0 1f468: 82 ed ldi r24, 0xD2 ; 210 1f46a: 9a e3 ldi r25, 0x3A ; 58 1f46c: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1f470: 85 e8 ldi r24, 0x85 ; 133 1f472: 90 e4 ldi r25, 0x40 ; 64 1f474: 0e 94 b3 72 call 0xe566 ; 0xe566 1f478: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 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); 1f47c: 07 e0 ldi r16, 0x07 ; 7 1f47e: 10 e0 ldi r17, 0x00 ; 0 1f480: 2a cf rjmp .-428 ; 0x1f2d6 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(); 1f482: 0e 94 5c e2 call 0x1c4b8 ; 0x1c4b8 lcd_wizard_load(); 1f486: 0e 94 e3 ce call 0x19dc6 ; 0x19dc6 state = S::Lay1CalHot; 1f48a: cb e0 ldi r28, 0x0B ; 11 1f48c: d9 ce rjmp .-590 ; 0x1f240 break; case S::LoadFilCold: lcd_wizard_load(); 1f48e: 0e 94 e3 ce call 0x19dc6 ; 0x19dc6 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; 1f492: ca e0 ldi r28, 0x0A ; 10 1f494: d5 ce rjmp .-598 ; 0x1f240 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1f496: 81 e0 ldi r24, 0x01 ; 1 1f498: 0e 94 c5 ce call 0x19d8a ; 0x19d8a menu_goto(lcd_v2_calibration, 0, true); 1f49c: 20 e0 ldi r18, 0x00 ; 0 1f49e: 41 e0 ldi r20, 0x01 ; 1 1f4a0: 70 e0 ldi r23, 0x00 ; 0 1f4a2: 60 e0 ldi r22, 0x00 ; 0 1f4a4: 8c ed ldi r24, 0xDC ; 220 1f4a6: 94 ee ldi r25, 0xE4 ; 228 1f4a8: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e 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); 1f4ac: 0a e0 ldi r16, 0x0A ; 10 1f4ae: 10 e0 ldi r17, 0x00 ; 0 1f4b0: 12 cf rjmp .-476 ; 0x1f2d6 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); 1f4b2: 80 e0 ldi r24, 0x00 ; 0 1f4b4: 0e 94 c5 ce call 0x19d8a ; 0x19d8a lcd_commands_type = LcdCommands::Layer1Cal; 1f4b8: 84 e0 ldi r24, 0x04 ; 4 1f4ba: 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); 1f4be: 0b e0 ldi r16, 0x0B ; 11 1f4c0: 10 e0 ldi r17, 0x00 ; 0 1f4c2: 09 cf rjmp .-494 ; 0x1f2d6 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); 1f4c4: 82 e3 ldi r24, 0x32 ; 50 1f4c6: 90 e4 ldi r25, 0x40 ; 64 1f4c8: 0e 94 b3 72 call 0xe566 ; 0xe566 1f4cc: 41 e0 ldi r20, 0x01 ; 1 1f4ce: 60 e0 ldi r22, 0x00 ; 0 1f4d0: 0f 94 47 4f call 0x29e8e ; 0x29e8e if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1f4d4: 81 11 cpse r24, r1 1f4d6: 07 c0 rjmp .+14 ; 0x1f4e6 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1f4d8: 82 e0 ldi r24, 0x02 ; 2 1f4da: 90 e4 ldi r25, 0x40 ; 64 1f4dc: 0e 94 b3 72 call 0xe566 ; 0xe566 1f4e0: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 1f4e4: d6 cf rjmp .-84 ; 0x1f492 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1f4e6: 8c e9 ldi r24, 0x9C ; 156 1f4e8: 9f e3 ldi r25, 0x3F ; 63 1f4ea: d8 ce rjmp .-592 ; 0x1f29c 1f4ec: 60 e0 ldi r22, 0x00 ; 0 1f4ee: 8f e5 ldi r24, 0x5F ; 95 1f4f0: 9f e0 ldi r25, 0x0F ; 15 1f4f2: 0f 94 47 dc call 0x3b88e ; 0x3b88e 1f4f6: ef ce rjmp .-546 ; 0x1f2d6 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1f4f8: 8e e3 ldi r24, 0x3E ; 62 1f4fa: 9f e3 ldi r25, 0x3F ; 63 1f4fc: 0e 94 b3 72 call 0xe566 ; 0xe566 1f500: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1f502: 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); 1f506: 83 e7 ldi r24, 0x73 ; 115 1f508: 90 e7 ldi r25, 0x70 ; 112 1f50a: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 lcd_return_to_status(); 1f50e: 0f 94 ad 1e call 0x23d5a ; 0x23d5a default: // exiting for later re-entry break; } if (msg) { 1f512: 01 15 cp r16, r1 1f514: 11 05 cpc r17, r1 1f516: 09 f4 brne .+2 ; 0x1f51a 1f518: f8 ce rjmp .-528 ; 0x1f30a lcd_show_fullscreen_message_and_wait_P(msg); 1f51a: c8 01 movw r24, r16 1f51c: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 1f520: f4 ce rjmp .-536 ; 0x1f30a lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1f522: 8c ed ldi r24, 0xDC ; 220 1f524: 9e e3 ldi r25, 0x3E ; 62 1f526: 0e 94 b3 72 call 0xe566 ; 0xe566 1f52a: 8c 01 movw r16, r24 1f52c: f2 cf rjmp .-28 ; 0x1f512 0001f52e
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f52e: cf 93 push r28 1f530: df 93 push r29 1f532: cd b7 in r28, 0x3d ; 61 1f534: de b7 in r29, 0x3e ; 62 1f536: 67 97 sbiw r28, 0x17 ; 23 1f538: 0f b6 in r0, 0x3f ; 63 1f53a: f8 94 cli 1f53c: de bf out 0x3e, r29 ; 62 1f53e: 0f be out 0x3f, r0 ; 63 1f540: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f542: 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); 1f544: 84 b5 in r24, 0x24 ; 36 1f546: 82 60 ori r24, 0x02 ; 2 1f548: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f54a: 84 b5 in r24, 0x24 ; 36 1f54c: 81 60 ori r24, 0x01 ; 1 1f54e: 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); 1f550: 85 b5 in r24, 0x25 ; 37 1f552: 82 60 ori r24, 0x02 ; 2 1f554: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f556: 85 b5 in r24, 0x25 ; 37 1f558: 81 60 ori r24, 0x01 ; 1 1f55a: 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); 1f55c: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f560: 81 60 ori r24, 0x01 ; 1 1f562: 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; 1f566: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f56a: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f56e: 82 60 ori r24, 0x02 ; 2 1f570: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f574: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f578: 81 60 ori r24, 0x01 ; 1 1f57a: 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); 1f57e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f582: 81 60 ori r24, 0x01 ; 1 1f584: 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); 1f588: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f58c: 84 60 ori r24, 0x04 ; 4 1f58e: 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); 1f592: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f596: 81 60 ori r24, 0x01 ; 1 1f598: 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 1f59c: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f5a0: 82 60 ori r24, 0x02 ; 2 1f5a2: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f5a6: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f5aa: 81 60 ori r24, 0x01 ; 1 1f5ac: 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 1f5b0: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f5b4: 81 60 ori r24, 0x01 ; 1 1f5b6: 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 1f5ba: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f5be: 82 60 ori r24, 0x02 ; 2 1f5c0: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f5c4: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f5c8: 81 60 ori r24, 0x01 ; 1 1f5ca: 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 1f5ce: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f5d2: 81 60 ori r24, 0x01 ; 1 1f5d4: 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 1f5d8: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f5dc: 82 60 ori r24, 0x02 ; 2 1f5de: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f5e2: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f5e6: 81 60 ori r24, 0x01 ; 1 1f5e8: 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 1f5ec: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f5f0: 81 60 ori r24, 0x01 ; 1 1f5f2: 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); 1f5f6: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f5fa: 84 60 ori r24, 0x04 ; 4 1f5fc: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f600: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f604: 82 60 ori r24, 0x02 ; 2 1f606: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f60a: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f60e: 81 60 ori r24, 0x01 ; 1 1f610: 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); 1f614: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f618: 80 68 ori r24, 0x80 ; 128 1f61a: 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; 1f61e: 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) { 1f622: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f624: f8 94 cli wdt_reset(); 1f626: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f628: 84 b7 in r24, 0x34 ; 52 1f62a: 87 7f andi r24, 0xF7 ; 247 1f62c: 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" ); 1f62e: 0f b6 in r0, 0x3f ; 63 1f630: f8 94 cli 1f632: a8 95 wdr 1f634: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f638: 88 61 ori r24, 0x18 ; 24 1f63a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f63e: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f642: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f644: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f646: 9f b7 in r25, 0x3f ; 63 1f648: 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 1f64a: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f64e: 84 e0 ldi r24, 0x04 ; 4 1f650: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f658: 81 60 ori r24, 0x01 ; 1 1f65a: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f662: 8d 7f andi r24, 0xFD ; 253 1f664: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f66c: 8b 7f andi r24, 0xFB ; 251 1f66e: 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; 1f672: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f676: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f678: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f67a: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f67c: 6a e0 ldi r22, 0x0A ; 10 1f67e: 70 e0 ldi r23, 0x00 ; 0 1f680: 80 e0 ldi r24, 0x00 ; 0 1f682: 90 e0 ldi r25, 0x00 ; 0 1f684: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 backlightSupport = !READ(LCD_BL_PIN); 1f688: 9c b1 in r25, 0x0c ; 12 1f68a: 81 e0 ldi r24, 0x01 ; 1 1f68c: 29 2f mov r18, r25 1f68e: 28 70 andi r18, 0x08 ; 8 1f690: 93 fd sbrc r25, 3 1f692: 80 e0 ldi r24, 0x00 ; 0 1f694: 80 93 02 04 sts 0x0402, r24 ; 0x800402 if (!backlightSupport) return; 1f698: 21 11 cpse r18, r1 1f69a: 22 c0 rjmp .+68 ; 0x1f6e0 //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f69c: 62 e0 ldi r22, 0x02 ; 2 1f69e: 82 e3 ldi r24, 0x32 ; 50 1f6a0: 9d e0 ldi r25, 0x0D ; 13 1f6a2: 0e 94 10 76 call 0xec20 ; 0xec20 1f6a6: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, 130); 1f6aa: 62 e8 ldi r22, 0x82 ; 130 1f6ac: 84 e3 ldi r24, 0x34 ; 52 1f6ae: 9d e0 ldi r25, 0x0D ; 13 1f6b0: 0e 94 10 76 call 0xec20 ; 0xec20 1f6b4: 80 93 01 04 sts 0x0401, r24 ; 0x800401 backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, 50); 1f6b8: 62 e3 ldi r22, 0x32 ; 50 1f6ba: 83 e3 ldi r24, 0x33 ; 51 1f6bc: 9d e0 ldi r25, 0x0D ; 13 1f6be: 0e 94 10 76 call 0xec20 ; 0xec20 1f6c2: 80 93 00 04 sts 0x0400, r24 ; 0x800400 backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, 10); // in seconds 1f6c6: 6a e0 ldi r22, 0x0A ; 10 1f6c8: 70 e0 ldi r23, 0x00 ; 0 1f6ca: 80 e3 ldi r24, 0x30 ; 48 1f6cc: 9d e0 ldi r25, 0x0D ; 13 1f6ce: 0e 94 f8 75 call 0xebf0 ; 0xebf0 1f6d2: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f6d6: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f6da: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f6dc: 0e 94 69 8a call 0x114d2 ; 0x114d2 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f6e0: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f6e2: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f6e4: 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); 1f6e6: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f6e8: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f6ea: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f6ee: 80 68 ori r24, 0x80 ; 128 1f6f0: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f6f4: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f6f6: 80 91 11 04 lds r24, 0x0411 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.549> 1f6fa: 88 60 ori r24, 0x08 ; 8 1f6fc: 80 93 11 04 sts 0x0411, r24 ; 0x800411 <_ZL19lcd_displayfunction.lto_priv.549> 1f700: 2f ef ldi r18, 0xFF ; 255 1f702: 30 e7 ldi r19, 0x70 ; 112 1f704: 82 e0 ldi r24, 0x02 ; 2 1f706: 21 50 subi r18, 0x01 ; 1 1f708: 30 40 sbci r19, 0x00 ; 0 1f70a: 80 40 sbci r24, 0x00 ; 0 1f70c: e1 f7 brne .-8 ; 0x1f706 1f70e: 00 c0 rjmp .+0 ; 0x1f710 1f710: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f712: 81 e0 ldi r24, 0x01 ; 1 1f714: 0e 94 52 6f call 0xdea4 ; 0xdea4 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f718: 8a ef ldi r24, 0xFA ; 250 1f71a: 90 e7 ldi r25, 0x70 ; 112 1f71c: 90 93 0c 04 sts 0x040C, r25 ; 0x80040c <_lcdout+0x9> 1f720: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_lcdout+0x8> 1f724: 10 92 0e 04 sts 0x040E, r1 ; 0x80040e <_lcdout+0xb> 1f728: 10 92 0d 04 sts 0x040D, r1 ; 0x80040d <_lcdout+0xa> 1f72c: 12 e0 ldi r17, 0x02 ; 2 1f72e: 10 93 06 04 sts 0x0406, r17 ; 0x800406 <_lcdout+0x3> 1f732: 10 92 10 04 sts 0x0410, r1 ; 0x800410 <_lcdout+0xd> 1f736: 10 92 0f 04 sts 0x040F, r1 ; 0x80040f <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f73a: 0e 94 93 6f call 0xdf26 ; 0xdf26 lcd_longpress_func = menu_lcd_longpress_func; 1f73e: 86 e5 ldi r24, 0x56 ; 86 1f740: 94 ed ldi r25, 0xD4 ; 212 1f742: 90 93 18 04 sts 0x0418, r25 ; 0x800418 1f746: 80 93 17 04 sts 0x0417, r24 ; 0x800417 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f74a: 80 e8 ldi r24, 0x80 ; 128 1f74c: 9a e3 ldi r25, 0x3A ; 58 1f74e: 90 93 16 04 sts 0x0416, r25 ; 0x800416 1f752: 80 93 15 04 sts 0x0415, r24 ; 0x800415 menu_menu = lcd_status_screen; 1f756: 88 e1 ldi r24, 0x18 ; 24 1f758: 99 e3 ldi r25, 0x39 ; 57 1f75a: 90 93 14 04 sts 0x0414, r25 ; 0x800414 1f75e: 80 93 13 04 sts 0x0413, r24 ; 0x800413 SET_INPUT(BTN_EN1); 1f762: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f766: 8b 7f andi r24, 0xFB ; 251 1f768: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f76c: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f770: 8d 7f andi r24, 0xFD ; 253 1f772: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f776: 9f b7 in r25, 0x3f ; 63 1f778: f8 94 cli 1f77a: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f77e: 84 60 ori r24, 0x04 ; 4 1f780: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f784: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f786: 9f b7 in r25, 0x3f ; 63 1f788: f8 94 cli 1f78a: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f78e: 82 60 ori r24, 0x02 ; 2 1f790: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f794: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f796: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f79a: 8f 7b andi r24, 0xBF ; 191 1f79c: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f7a0: 9f b7 in r25, 0x3f ; 63 1f7a2: f8 94 cli 1f7a4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f7a8: 80 64 ori r24, 0x40 ; 64 1f7aa: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f7ae: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f7b0: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f7b4: 8e 7f andi r24, 0xFE ; 254 1f7b6: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f7ba: 9f b7 in r25, 0x3f ; 63 1f7bc: f8 94 cli 1f7be: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f7c2: 81 60 ori r24, 0x01 ; 1 1f7c4: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f7c8: 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); 1f7ca: af e9 ldi r26, 0x9F ; 159 1f7cc: bf e0 ldi r27, 0x0F ; 15 1f7ce: 11 97 sbiw r26, 0x01 ; 1 1f7d0: f1 f7 brne .-4 ; 0x1f7ce 1f7d2: 00 c0 rjmp .+0 ; 0x1f7d4 1f7d4: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f7d6: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f7da: 80 95 com r24 1f7dc: 81 70 andi r24, 0x01 ; 1 1f7de: 80 93 12 04 sts 0x0412, r24 ; 0x800412 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f7e2: 44 e1 ldi r20, 0x14 ; 20 1f7e4: 50 e0 ldi r21, 0x00 ; 0 1f7e6: 63 e7 ldi r22, 0x73 ; 115 1f7e8: 70 e7 ldi r23, 0x70 ; 112 1f7ea: 8f e1 ldi r24, 0x1F ; 31 1f7ec: 95 e0 ldi r25, 0x05 ; 5 1f7ee: 0f 94 10 da call 0x3b420 ; 0x3b420 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f7f2: 0f 94 d5 c2 call 0x385aa ; 0x385aa } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f7f6: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f7fa: 8c e4 ldi r24, 0x4C ; 76 1f7fc: 9d e8 ldi r25, 0x8D ; 141 1f7fe: 9f 93 push r25 1f800: 8f 93 push r24 1f802: 83 e5 ldi r24, 0x53 ; 83 1f804: 9d e8 ldi r25, 0x8D ; 141 1f806: 9f 93 push r25 1f808: 8f 93 push r24 1f80a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f80e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f812: 84 60 ori r24, 0x04 ; 4 1f814: 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)); 1f818: 60 e0 ldi r22, 0x00 ; 0 1f81a: 87 ed ldi r24, 0xD7 ; 215 1f81c: 9e e0 ldi r25, 0x0E ; 14 1f81e: 0e 94 10 76 call 0xec20 ; 0xec20 1f822: 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); 1f826: 60 e0 ldi r22, 0x00 ; 0 1f828: 88 e0 ldi r24, 0x08 ; 8 1f82a: 9f e0 ldi r25, 0x0F ; 15 1f82c: 0e 94 10 76 call 0xec20 ; 0xec20 1f830: 80 93 39 05 sts 0x0539, r24 ; 0x800539 MYSERIAL.begin(BAUDRATE); 1f834: 0e 94 8c cc call 0x19918 ; 0x19918 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f838: 82 e5 ldi r24, 0x52 ; 82 1f83a: 97 e7 ldi r25, 0x77 ; 119 1f83c: 90 93 06 05 sts 0x0506, r25 ; 0x800506 <_uartout+0x9> 1f840: 80 93 05 05 sts 0x0505, r24 ; 0x800505 <_uartout+0x8> 1f844: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xb> 1f848: 10 92 07 05 sts 0x0507, r1 ; 0x800507 <_uartout+0xa> 1f84c: 10 93 00 05 sts 0x0500, r17 ; 0x800500 <_uartout+0x3> 1f850: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xd> 1f854: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xc> stdout = uartout; 1f858: 8d ef ldi r24, 0xFD ; 253 1f85a: 94 e0 ldi r25, 0x04 ; 4 1f85c: 90 93 1d 18 sts 0x181D, r25 ; 0x80181d <__iob+0x3> 1f860: 80 93 1c 18 sts 0x181C, r24 ; 0x80181c <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f864: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c 1f868: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f86a: 0f 90 pop r0 1f86c: 0f 90 pop r0 1f86e: 0f 90 pop r0 1f870: 0f 90 pop r0 1f872: 8e 01 movw r16, r28 1f874: 0f 5f subi r16, 0xFF ; 255 1f876: 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; 1f878: aa 24 eor r10, r10 1f87a: a3 94 inc r10 if (xflash_success) 1f87c: 88 23 and r24, r24 1f87e: 09 f4 brne .+2 ; 0x1f882 1f880: d8 c0 rjmp .+432 ; 0x1fa32 { optiboot_status = optiboot_xflash_enter(); 1f882: 0f 94 e3 c2 call 0x385c6 ; 0x385c6 1f886: 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)) 1f888: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dc> 1f88c: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7dd> 1f890: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7de> 1f894: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7df> 1f898: 8a 3a cpi r24, 0xAA ; 170 1f89a: 95 45 sbci r25, 0x55 ; 85 1f89c: aa 4a sbci r26, 0xAA ; 170 1f89e: b5 45 sbci r27, 0x55 ; 85 1f8a0: 09 f0 breq .+2 ; 0x1f8a4 1f8a2: bf c0 rjmp .+382 ; 0x1fa22 1f8a4: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 1f8a8: 87 ff sbrs r24, 7 1f8aa: bb c0 rjmp .+374 ; 0x1fa22 { uint8_t lang = boot_reserved >> 3; 1f8ac: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7da> 1f8b0: 98 2c mov r9, r8 1f8b2: 96 94 lsr r9 1f8b4: 96 94 lsr r9 1f8b6: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f8b8: f8 2d mov r31, r8 1f8ba: f7 70 andi r31, 0x07 ; 7 1f8bc: 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 1f8be: 99 20 and r9, r9 1f8c0: 09 f4 brne .+2 ; 0x1f8c4 1f8c2: af c0 rjmp .+350 ; 0x1fa22 #ifdef XFLASH if (lang == LANG_ID_SEC) 1f8c4: 21 e0 ldi r18, 0x01 ; 1 1f8c6: 92 12 cpse r9, r18 1f8c8: 24 c0 rjmp .+72 ; 0x1f912 { 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 1f8ca: 40 e1 ldi r20, 0x10 ; 16 1f8cc: 50 e0 ldi r21, 0x00 ; 0 1f8ce: 60 e0 ldi r22, 0x00 ; 0 1f8d0: 71 e0 ldi r23, 0x01 ; 1 1f8d2: c8 01 movw r24, r16 1f8d4: 0f 94 bd d9 call 0x3b37a ; 0x3b37a if (offset) *offset = ui; 1f8d8: 60 e0 ldi r22, 0x00 ; 0 1f8da: 71 e0 ldi r23, 0x01 ; 1 1f8dc: 6b 01 movw r12, r22 1f8de: f1 2c mov r15, r1 1f8e0: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f8e2: 89 81 ldd r24, Y+1 ; 0x01 1f8e4: 9a 81 ldd r25, Y+2 ; 0x02 1f8e6: ab 81 ldd r26, Y+3 ; 0x03 1f8e8: bc 81 ldd r27, Y+4 ; 0x04 1f8ea: 85 3a cpi r24, 0xA5 ; 165 1f8ec: 9a 45 sbci r25, 0x5A ; 90 1f8ee: a4 4b sbci r26, 0xB4 ; 180 1f8f0: bb 44 sbci r27, 0x4B ; 75 1f8f2: 09 f0 breq .+2 ; 0x1f8f6 1f8f4: 96 c0 rjmp .+300 ; 0x1fa22 { lcd_puts_at_P(1,0,PSTR("Language update")); 1f8f6: 41 e8 ldi r20, 0x81 ; 129 1f8f8: 5d e8 ldi r21, 0x8D ; 141 1f8fa: 60 e0 ldi r22, 0x00 ; 0 1f8fc: 81 e0 ldi r24, 0x01 ; 1 1f8fe: 0e 94 fb 6e call 0xddf6 ; 0xddf6 for (uint8_t i = 0; i < state; i++) 1f902: 91 2c mov r9, r1 1f904: 89 14 cp r8, r9 1f906: 39 f1 breq .+78 ; 0x1f956 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f908: 8e e2 ldi r24, 0x2E ; 46 1f90a: 0e 94 96 6f call 0xdf2c ; 0xdf2c 1f90e: 93 94 inc r9 1f910: f9 cf rjmp .-14 ; 0x1f904 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f912: 8c e5 ldi r24, 0x5C ; 92 1f914: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f916: 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; 1f918: c1 2c mov r12, r1 1f91a: d1 2c mov r13, r1 1f91c: 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 1f91e: 20 e1 ldi r18, 0x10 ; 16 1f920: 30 e0 ldi r19, 0x00 ; 0 1f922: a8 01 movw r20, r16 1f924: c7 01 movw r24, r14 1f926: b6 01 movw r22, r12 1f928: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc if (header->magic != LANG_MAGIC) break; //break if not valid 1f92c: 89 81 ldd r24, Y+1 ; 0x01 1f92e: 9a 81 ldd r25, Y+2 ; 0x02 1f930: ab 81 ldd r26, Y+3 ; 0x03 1f932: bc 81 ldd r27, Y+4 ; 0x04 1f934: 85 3a cpi r24, 0xA5 ; 165 1f936: 9a 45 sbci r25, 0x5A ; 90 1f938: a4 4b sbci r26, 0xB4 ; 180 1f93a: bb 44 sbci r27, 0x4B ; 75 1f93c: 09 f0 breq .+2 ; 0x1f940 1f93e: 71 c0 rjmp .+226 ; 0x1fa22 if (offset) *offset = addr; if (--lang == 0) return 1; 1f940: f2 e0 ldi r31, 0x02 ; 2 1f942: 9f 16 cp r9, r31 1f944: c1 f2 breq .-80 ; 0x1f8f6 addr += header->size; //calc address of next table 1f946: 8d 81 ldd r24, Y+5 ; 0x05 1f948: 9e 81 ldd r25, Y+6 ; 0x06 1f94a: c8 0e add r12, r24 1f94c: d9 1e adc r13, r25 1f94e: e1 1c adc r14, r1 1f950: f1 1c adc r15, r1 1f952: 9a 94 dec r9 1f954: e4 cf rjmp .-56 ; 0x1f91e lcd_print('.'); _delay(100); 1f956: 64 e6 ldi r22, 0x64 ; 100 1f958: 70 e0 ldi r23, 0x00 ; 0 1f95a: 80 e0 ldi r24, 0x00 ; 0 1f95c: 90 e0 ldi r25, 0x00 ; 0 1f95e: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f962: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7da> 1f966: 88 7f andi r24, 0xF8 ; 248 1f968: 91 e0 ldi r25, 0x01 ; 1 1f96a: 98 0d add r25, r8 1f96c: 97 70 andi r25, 0x07 ; 7 1f96e: 89 2b or r24, r25 1f970: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7da> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f974: 91 2c mov r9, r1 1f976: 98 2c mov r9, r8 1f978: 88 24 eor r8, r8 1f97a: 92 94 swap r9 1f97c: 80 ef ldi r24, 0xF0 ; 240 1f97e: 98 22 and r9, r24 1f980: 8d 81 ldd r24, Y+5 ; 0x05 1f982: 9e 81 ldd r25, Y+6 ; 0x06 1f984: 88 16 cp r8, r24 1f986: 99 06 cpc r9, r25 1f988: 08 f0 brcs .+2 ; 0x1f98c 1f98a: 46 c0 rjmp .+140 ; 0x1fa18 { cli(); 1f98c: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f98e: 0d 81 ldd r16, Y+5 ; 0x05 1f990: 1e 81 ldd r17, Y+6 ; 0x06 1f992: 08 19 sub r16, r8 1f994: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f996: 01 30 cpi r16, 0x01 ; 1 1f998: 20 e1 ldi r18, 0x10 ; 16 1f99a: 12 07 cpc r17, r18 1f99c: 10 f0 brcs .+4 ; 0x1f9a2 1f99e: 00 e0 ldi r16, 0x00 ; 0 1f9a0: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f9a2: c7 01 movw r24, r14 1f9a4: b6 01 movw r22, r12 1f9a6: 68 0d add r22, r8 1f9a8: 79 1d adc r23, r9 1f9aa: 81 1d adc r24, r1 1f9ac: 91 1d adc r25, r1 1f9ae: 98 01 movw r18, r16 1f9b0: 40 e0 ldi r20, 0x00 ; 0 1f9b2: 58 e0 ldi r21, 0x08 ; 8 1f9b4: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f9b8: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f9ba: 8a ea ldi r24, 0xAA ; 170 1f9bc: 95 e5 ldi r25, 0x55 ; 85 1f9be: dc 01 movw r26, r24 1f9c0: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7dc> 1f9c4: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7dd> 1f9c8: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7de> 1f9cc: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7df> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f9d0: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 1f9d4: 83 60 ori r24, 0x03 ; 3 1f9d6: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7db> boot_copy_size = (uint16_t)size; 1f9da: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7d9> 1f9de: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7d8> boot_src_addr = (uint32_t)rptr; 1f9e2: 80 e0 ldi r24, 0x00 ; 0 1f9e4: 98 e0 ldi r25, 0x08 ; 8 1f9e6: a0 e0 ldi r26, 0x00 ; 0 1f9e8: b0 e0 ldi r27, 0x00 ; 0 1f9ea: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d0> 1f9ee: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7d1> 1f9f2: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7d2> 1f9f6: 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); 1f9fa: c4 01 movw r24, r8 1f9fc: 80 50 subi r24, 0x00 ; 0 1f9fe: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1fa00: b0 e0 ldi r27, 0x00 ; 0 1fa02: a0 e0 ldi r26, 0x00 ; 0 1fa04: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7d4> 1fa08: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7d5> 1fa0c: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7d6> 1fa10: 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(); 1fa14: 0e 94 53 67 call 0xcea6 ; 0xcea6 1fa18: 61 e0 ldi r22, 0x01 ; 1 1fa1a: 8e ef ldi r24, 0xFE ; 254 1fa1c: 9f e0 ldi r25, 0x0F ; 15 1fa1e: 0f 94 47 dc call 0x3b88e ; 0x3b88e //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1fa22: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 1fa26: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 1fa2a: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 1fa2e: 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(); 1fa32: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1fa36: 88 23 and r24, r24 1fa38: 51 f0 breq .+20 ; 0x1fa4e //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1fa3a: 64 e2 ldi r22, 0x24 ; 36 1fa3c: 86 e6 ldi r24, 0x66 ; 102 1fa3e: 92 e0 ldi r25, 0x02 ; 2 1fa40: 0e 94 0d 68 call 0xd01a ; 0xd01a currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1fa44: 64 e2 ldi r22, 0x24 ; 36 1fa46: 86 e6 ldi r24, 0x66 ; 102 1fa48: 92 e0 ldi r25, 0x02 ; 2 1fa4a: 0e 94 05 68 call 0xd00a ; 0xd00a #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); 1fa4e: 44 e1 ldi r20, 0x14 ; 20 1fa50: 50 e0 ldi r21, 0x00 ; 0 1fa52: 65 e1 ldi r22, 0x15 ; 21 1fa54: 7d e0 ldi r23, 0x0D ; 13 1fa56: c8 01 movw r24, r16 1fa58: 0f 94 13 dc call 0x3b826 ; 0x3b826 if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1fa5c: 8c 89 ldd r24, Y+20 ; 0x14 1fa5e: 81 11 cpse r24, r1 1fa60: 0a c0 rjmp .+20 ; 0x1fa76 1fa62: 44 e0 ldi r20, 0x04 ; 4 1fa64: 50 e0 ldi r21, 0x00 ; 0 1fa66: 63 e8 ldi r22, 0x83 ; 131 1fa68: 7e e8 ldi r23, 0x8E ; 142 1fa6a: c8 01 movw r24, r16 1fa6c: 0f 94 02 da call 0x3b404 ; 0x3b404 1fa70: 89 2b or r24, r25 1fa72: 09 f4 brne .+2 ; 0x1fa76 1fa74: 51 c0 rjmp .+162 ; 0x1fb18 * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1fa76: e0 90 39 05 lds r14, 0x0539 ; 0x800539 uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1fa7a: 1d 8a std Y+21, r1 ; 0x15 1fa7c: 1f 8a std Y+23, r1 ; 0x17 1fa7e: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1fa80: 10 92 39 05 sts 0x0539, r1 ; 0x800539 timeout.start(); 1fa84: ce 01 movw r24, r28 1fa86: 45 96 adiw r24, 0x15 ; 21 1fa88: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1fa8c: 62 e3 ldi r22, 0x32 ; 50 1fa8e: 70 e0 ldi r23, 0x00 ; 0 1fa90: 80 e0 ldi r24, 0x00 ; 0 1fa92: 90 e0 ldi r25, 0x00 ; 0 1fa94: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 // 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; 1fa98: 80 91 9b 04 lds r24, 0x049B ; 0x80049b 1fa9c: 90 91 9c 04 lds r25, 0x049C ; 0x80049c 1faa0: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 1faa4: 80 93 99 04 sts 0x0499, r24 ; 0x800499 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1faa8: 86 e9 ldi r24, 0x96 ; 150 1faaa: 9d e8 ldi r25, 0x8D ; 141 1faac: 0e 94 82 79 call 0xf304 ; 0xf304 1fab0: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1fab2: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1fab4: 33 e1 ldi r19, 0x13 ; 19 1fab6: f3 16 cp r15, r19 1fab8: a1 f0 breq .+40 ; 0x1fae2 { if (timeout.expired(250u)) 1faba: 6a ef ldi r22, 0xFA ; 250 1fabc: 70 e0 ldi r23, 0x00 ; 0 1fabe: ce 01 movw r24, r28 1fac0: 45 96 adiw r24, 0x15 ; 21 1fac2: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 1fac6: 81 11 cpse r24, r1 1fac8: c1 c0 rjmp .+386 ; 0x1fc4c goto exit; if (MYSERIAL.available() > 0) 1faca: 0e 94 10 77 call 0xee20 ; 0xee20 1face: 18 16 cp r1, r24 1fad0: 19 06 cpc r1, r25 1fad2: 84 f7 brge .-32 ; 0x1fab4 { SN[rxIndex] = MYSERIAL.read(); 1fad4: 0f 94 0b d6 call 0x3ac16 ; 0x3ac16 1fad8: d6 01 movw r26, r12 1fada: 8d 93 st X+, r24 1fadc: 6d 01 movw r12, r26 rxIndex++; 1fade: f3 94 inc r15 1fae0: e9 cf rjmp .-46 ; 0x1fab4 } } SN[rxIndex] = 0; 1fae2: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1fae4: 44 e0 ldi r20, 0x04 ; 4 1fae6: 50 e0 ldi r21, 0x00 ; 0 1fae8: 61 e9 ldi r22, 0x91 ; 145 1faea: 7d e8 ldi r23, 0x8D ; 141 1faec: c8 01 movw r24, r16 1faee: 0f 94 02 da call 0x3b404 ; 0x3b404 ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1faf2: 89 2b or r24, r25 1faf4: 59 f6 brne .-106 ; 0x1fa8c 1faf6: 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; 1faf8: 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)) 1fafc: 88 23 and r24, r24 1fafe: 09 f4 brne .+2 ; 0x1fb02 1fb00: a7 c0 rjmp .+334 ; 0x1fc50 #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); 1fb02: 44 e1 ldi r20, 0x14 ; 20 1fb04: 50 e0 ldi r21, 0x00 ; 0 1fb06: 65 e1 ldi r22, 0x15 ; 21 1fb08: 7d e0 ldi r23, 0x0D ; 13 1fb0a: c8 01 movw r24, r16 1fb0c: 0f 94 37 dc call 0x3b86e ; 0x3b86e { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1fb10: 88 e7 ldi r24, 0x78 ; 120 1fb12: 9e e8 ldi r25, 0x8E ; 142 } else puts_P(PSTR("SN update failed")); 1fb14: 0f 94 0c db call 0x3b618 ; 0x3b618 #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1fb18: a1 10 cpse r10, r1 1fb1a: 04 c0 rjmp .+8 ; 0x1fb24 1fb1c: 80 91 39 05 lds r24, 0x0539 ; 0x800539 1fb20: 88 23 and r24, r24 1fb22: 21 f0 breq .+8 ; 0x1fb2c SERIAL_PROTOCOLLNPGM("start"); 1fb24: 81 e6 ldi r24, 0x61 ; 97 1fb26: 9e e8 ldi r25, 0x8E ; 142 1fb28: 0e 94 82 79 call 0xf304 ; 0xf304 #endif SERIAL_ECHO_START; 1fb2c: 80 ed ldi r24, 0xD0 ; 208 1fb2e: 9b ea ldi r25, 0xAB ; 171 1fb30: 0e 94 57 77 call 0xeeae ; 0xeeae puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1fb34: 8a e4 ldi r24, 0x4A ; 74 1fb36: 9e e8 ldi r25, 0x8E ; 142 1fb38: 0f 94 0c db call 0x3b618 ; 0x3b618 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1fb3c: 60 e0 ldi r22, 0x00 ; 0 1fb3e: 8c ea ldi r24, 0xAC ; 172 1fb40: 9c e0 ldi r25, 0x0C ; 12 1fb42: 0e 94 10 76 call 0xec20 ; 0xec20 1fb46: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1fb48: 0e 94 95 e3 call 0x1c72a ; 0x1c72a } MMU2::mmu2.Status(); 1fb4c: 0f 94 ea 74 call 0x2e9d4 ; 0x2e9d4 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1fb50: 89 e9 ldi r24, 0x99 ; 153 1fb52: 9d e8 ldi r25, 0x8D ; 141 1fb54: 0e 94 57 77 call 0xeeae ; 0xeeae uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1fb58: 62 e0 ldi r22, 0x02 ; 2 1fb5a: 86 ed ldi r24, 0xD6 ; 214 1fb5c: 9e e0 ldi r25, 0x0E ; 14 1fb5e: 0e 94 10 76 call 0xec20 ; 0xec20 if (status == (uint8_t)EEPROM::Enabled) 1fb62: 81 30 cpi r24, 0x01 ; 1 1fb64: 09 f0 breq .+2 ; 0x1fb68 1fb66: 77 c0 rjmp .+238 ; 0x1fc56 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1fb68: 8b ed ldi r24, 0xDB ; 219 1fb6a: 9c e5 ldi r25, 0x5C ; 92 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1fb6c: 0e 94 82 79 call 0xf304 ; 0xf304 #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1fb70: 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); 1fb72: f0 fe sbrs r15, 0 1fb74: 04 c0 rjmp .+8 ; 0x1fb7e 1fb76: 8b e8 ldi r24, 0x8B ; 139 1fb78: 9d e6 ldi r25, 0x6D ; 109 1fb7a: 0f 94 0c db call 0x3b618 ; 0x3b618 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1fb7e: f1 fe sbrs r15, 1 1fb80: 04 c0 rjmp .+8 ; 0x1fb8a 1fb82: 8b e7 ldi r24, 0x7B ; 123 1fb84: 9d e6 ldi r25, 0x6D ; 109 1fb86: 0f 94 0c db call 0x3b618 ; 0x3b618 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1fb8a: f2 fe sbrs r15, 2 1fb8c: 04 c0 rjmp .+8 ; 0x1fb96 1fb8e: 8a e6 ldi r24, 0x6A ; 106 1fb90: 9d e6 ldi r25, 0x6D ; 109 1fb92: 0f 94 0c db call 0x3b618 ; 0x3b618 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1fb96: f3 fe sbrs r15, 3 1fb98: 04 c0 rjmp .+8 ; 0x1fba2 1fb9a: 8a e5 ldi r24, 0x5A ; 90 1fb9c: 9d e6 ldi r25, 0x6D ; 109 1fb9e: 0f 94 0c db call 0x3b618 ; 0x3b618 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1fba2: f5 fe sbrs r15, 5 1fba4: 04 c0 rjmp .+8 ; 0x1fbae 1fba6: 8a e4 ldi r24, 0x4A ; 74 1fba8: 9d e6 ldi r25, 0x6D ; 109 1fbaa: 0f 94 0c db call 0x3b618 ; 0x3b618 MCUSR = 0; 1fbae: 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; 1fbb0: 80 ed ldi r24, 0xD0 ; 208 1fbb2: 9b ea ldi r25, 0xAB ; 171 1fbb4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1fbb8: 8a e3 ldi r24, 0x3A ; 58 1fbba: 9d e6 ldi r25, 0x6D ; 109 1fbbc: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fbc0: 86 e3 ldi r24, 0x36 ; 54 1fbc2: 9e e8 ldi r25, 0x8E ; 142 1fbc4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fbc8: 8e e2 ldi r24, 0x2E ; 46 1fbca: 9d e6 ldi r25, 0x6D ; 109 1fbcc: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fbd0: 8e e2 ldi r24, 0x2E ; 46 1fbd2: 9e e8 ldi r25, 0x8E ; 142 1fbd4: 0e 94 82 79 call 0xf304 ; 0xf304 #endif #endif SERIAL_ECHO_START; 1fbd8: 80 ed ldi r24, 0xD0 ; 208 1fbda: 9b ea ldi r25, 0xAB ; 171 1fbdc: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fbe0: 8f e1 ldi r24, 0x1F ; 31 1fbe2: 9d e6 ldi r25, 0x6D ; 109 1fbe4: 0e 94 57 77 call 0xeeae ; 0xeeae /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fbe8: 80 91 16 18 lds r24, 0x1816 ; 0x801816 <__brkval> 1fbec: 90 91 17 18 lds r25, 0x1817 ; 0x801817 <__brkval+0x1> 1fbf0: 00 97 sbiw r24, 0x00 ; 0 1fbf2: a1 f1 breq .+104 ; 0x1fc5c 1fbf4: 08 1b sub r16, r24 1fbf6: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fbf8: b8 01 movw r22, r16 1fbfa: 11 0f add r17, r17 1fbfc: 88 0b sbc r24, r24 1fbfe: 99 0b sbc r25, r25 1fc00: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1fc04: 88 e0 ldi r24, 0x08 ; 8 1fc06: 9d e6 ldi r25, 0x6D ; 109 1fc08: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1fc0c: 80 ee ldi r24, 0xE0 ; 224 1fc0e: 96 e0 ldi r25, 0x06 ; 6 1fc10: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 #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); 1fc14: 6c e2 ldi r22, 0x2C ; 44 1fc16: 71 e0 ldi r23, 0x01 ; 1 1fc18: 8e ee ldi r24, 0xEE ; 238 1fc1a: 9e e0 ldi r25, 0x0E ; 14 1fc1c: 0e 94 f8 75 call 0xebf0 ; 0xebf0 1fc20: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fc22: 66 e3 ldi r22, 0x36 ; 54 1fc24: 71 e0 ldi r23, 0x01 ; 1 1fc26: 8c ee ldi r24, 0xEC ; 236 1fc28: 9e e0 ldi r25, 0x0E ; 14 1fc2a: 0e 94 f8 75 call 0xebf0 ; 0xebf0 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1fc2e: 0c 32 cpi r16, 0x2C ; 44 1fc30: 11 40 sbci r17, 0x01 ; 1 1fc32: 11 f0 breq .+4 ; 0x1fc38 1fc34: 0d 94 12 06 jmp 0x20c24 ; 0x20c24 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fc38: 01 e0 ldi r16, 0x01 ; 1 1fc3a: 86 33 cpi r24, 0x36 ; 54 1fc3c: 91 40 sbci r25, 0x01 ; 1 1fc3e: 09 f4 brne .+2 ; 0x1fc42 1fc40: 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(); 1fc42: 0e 94 b3 93 call 0x12766 ; 0x12766 1fc46: f8 2e mov r15, r24 1fc48: 0d 94 1a 06 jmp 0x20c34 ; 0x20c34 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1fc4c: 80 e0 ldi r24, 0x00 ; 0 1fc4e: 54 cf rjmp .-344 ; 0x1faf8 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1fc50: 87 e6 ldi r24, 0x67 ; 103 1fc52: 9e e8 ldi r25, 0x8E ; 142 1fc54: 5f cf rjmp .-322 ; 0x1fb14 1fc56: 85 ed ldi r24, 0xD5 ; 213 1fc58: 9c e5 ldi r25, 0x5C ; 92 1fc5a: 88 cf rjmp .-240 ; 0x1fb6c 1fc5c: 00 52 subi r16, 0x20 ; 32 1fc5e: 18 41 sbci r17, 0x18 ; 24 1fc60: cb cf rjmp .-106 ; 0x1fbf8 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1fc62: 81 e3 ldi r24, 0x31 ; 49 1fc64: 91 e0 ldi r25, 0x01 ; 1 1fc66: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.470+0x1> 1fc6a: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.470> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fc6e: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 1fc72: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc76: 0f 94 23 a1 call 0x34246 ; 0x34246 1fc7a: 20 e0 ldi r18, 0x00 ; 0 1fc7c: 30 e8 ldi r19, 0x80 ; 128 1fc7e: 48 e9 ldi r20, 0x98 ; 152 1fc80: 53 e4 ldi r21, 0x43 ; 67 1fc82: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1fc86: 18 16 cp r1, r24 1fc88: 54 f4 brge .+20 ; 0x1fc9e #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fc8a: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 1fc8e: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc92: 40 96 adiw r24, 0x10 ; 16 1fc94: 90 93 a2 04 sts 0x04A2, r25 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 1fc98: 80 93 a1 04 sts 0x04A1, r24 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 1fc9c: e8 cf rjmp .-48 ; 0x1fc6e #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fc9e: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fca2: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fca6: 0f 94 bd 34 call 0x2697a ; 0x2697a 1fcaa: 20 e0 ldi r18, 0x00 ; 0 1fcac: 30 e0 ldi r19, 0x00 ; 0 1fcae: 40 e2 ldi r20, 0x20 ; 32 1fcb0: 51 e4 ldi r21, 0x41 ; 65 1fcb2: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1fcb6: 87 ff sbrs r24, 7 1fcb8: 0a c0 rjmp .+20 ; 0x1fcce #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fcba: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fcbe: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fcc2: 40 97 sbiw r24, 0x10 ; 16 1fcc4: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 1fcc8: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 1fccc: e8 cf rjmp .-48 ; 0x1fc9e #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fcce: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 1fcd2: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fcd6: 0f 94 bd 34 call 0x2697a ; 0x2697a 1fcda: 20 e0 ldi r18, 0x00 ; 0 1fcdc: 30 e0 ldi r19, 0x00 ; 0 1fcde: 4a ef ldi r20, 0xFA ; 250 1fce0: 52 e4 ldi r21, 0x42 ; 66 1fce2: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1fce6: 18 16 cp r1, r24 1fce8: 54 f4 brge .+20 ; 0x1fcfe #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fcea: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 1fcee: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fcf2: 40 96 adiw r24, 0x10 ; 16 1fcf4: 90 93 a0 04 sts 0x04A0, r25 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 1fcf8: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 1fcfc: e8 cf rjmp .-48 ; 0x1fcce #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1fcfe: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fd02: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fd06: 0f 94 28 34 call 0x26850 ; 0x26850 1fd0a: 20 e0 ldi r18, 0x00 ; 0 1fd0c: 30 e0 ldi r19, 0x00 ; 0 1fd0e: 40 ef ldi r20, 0xF0 ; 240 1fd10: 51 ec ldi r21, 0xC1 ; 193 1fd12: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 1fd16: 87 ff sbrs r24, 7 1fd18: 0a c0 rjmp .+20 ; 0x1fd2e #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fd1a: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fd1e: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fd22: 40 97 sbiw r24, 0x10 ; 16 1fd24: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 1fd28: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 1fd2c: e8 cf rjmp .-48 ; 0x1fcfe #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fd2e: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd32: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd36: 0f 94 28 34 call 0x26850 ; 0x26850 1fd3a: 20 e0 ldi r18, 0x00 ; 0 1fd3c: 30 e0 ldi r19, 0x00 ; 0 1fd3e: 40 ea ldi r20, 0xA0 ; 160 1fd40: 52 e4 ldi r21, 0x42 ; 66 1fd42: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 1fd46: 18 16 cp r1, r24 1fd48: 54 f4 brge .+20 ; 0x1fd5e #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fd4a: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd4e: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd52: 40 96 adiw r24, 0x10 ; 16 1fd54: 90 93 9e 04 sts 0x049E, r25 ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 1fd58: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 1fd5c: e8 cf rjmp .-48 ; 0x1fd2e #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fd5e: 9f b7 in r25, 0x3f ; 63 1fd60: f8 94 cli TCNT0 = 0; 1fd62: 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; 1fd64: 8f ef ldi r24, 0xFF ; 255 1fd66: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fd68: 83 e3 ldi r24, 0x33 ; 51 1fd6a: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fd6c: 12 e0 ldi r17, 0x02 ; 2 1fd6e: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fd70: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fd74: 81 60 ori r24, 0x01 ; 1 1fd76: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fd7a: 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; 1fd7c: 80 e8 ldi r24, 0x80 ; 128 1fd7e: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fd82: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fd86: 84 60 ori r24, 0x04 ; 4 1fd88: 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; 1fd8c: 2f b7 in r18, 0x3f ; 63 1fd8e: f8 94 cli SET_OUTPUT(BEEPER); 1fd90: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fd94: 84 60 ori r24, 0x04 ; 4 1fd96: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fd9a: 9f b7 in r25, 0x3f ; 63 1fd9c: f8 94 cli 1fd9e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fda2: 8b 7f andi r24, 0xFB ; 251 1fda4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fda8: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fdaa: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fdae: 80 62 ori r24, 0x20 ; 32 1fdb0: 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); 1fdb4: 81 e0 ldi r24, 0x01 ; 1 1fdb6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fdba: 85 e1 ldi r24, 0x15 ; 21 1fdbc: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fdc0: 8f ef ldi r24, 0xFF ; 255 1fdc2: 90 e0 ldi r25, 0x00 ; 0 1fdc4: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fdc8: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fdcc: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fdd0: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fdd4: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fdd8: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fddc: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fde0: 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")); 1fde2: 87 ea ldi r24, 0xA7 ; 167 1fde4: 9d e8 ldi r25, 0x8D ; 141 1fde6: 0f 94 0c db call 0x3b618 ; 0x3b618 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fdea: 8f e5 ldi r24, 0x5F ; 95 1fdec: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fdf0: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fdf4: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fdf8: 80 64 ori r24, 0x40 ; 64 1fdfa: 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); 1fdfe: 8f e9 ldi r24, 0x9F ; 159 1fe00: 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(); 1fe04: 0e 94 de 8d call 0x11bbc ; 0x11bbc // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fe08: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fe0a: f8 94 cli // CTC TCCRxB &= ~(1< 1fe10: 8f 7e andi r24, 0xEF ; 239 1fe12: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fe1a: 88 60 ori r24, 0x08 ; 8 1fe1c: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fe24: 8d 7f andi r24, 0xFD ; 253 1fe26: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fe2e: 8e 7f andi r24, 0xFE ; 254 1fe30: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fe38: 8f 73 andi r24, 0x3F ; 63 1fe3a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fe42: 8f 7c andi r24, 0xCF ; 207 1fe44: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fe4c: 84 60 ori r24, 0x04 ; 4 1fe4e: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fe56: 8d 7f andi r24, 0xFD ; 253 1fe58: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fe60: 8e 7f andi r24, 0xFE ; 254 1fe62: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fe66: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fe6a: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fe6e: 2b ee ldi r18, 0xEB ; 235 1fe70: 31 e4 ldi r19, 0x41 ; 65 1fe72: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fe76: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fe7a: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fe7c: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fe80: 82 60 ori r24, 0x02 ; 2 1fe82: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fe86: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fe88: 10 92 a5 0d sts 0x0DA5, r1 ; 0x800da5 block_buffer_tail = 0; 1fe8c: 10 92 a6 0d sts 0x0DA6, r1 ; 0x800da6 memset(position, 0, sizeof(position)); // clear position 1fe90: 80 e1 ldi r24, 0x10 ; 16 1fe92: e3 ea ldi r30, 0xA3 ; 163 1fe94: f6 e0 ldi r31, 0x06 ; 6 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 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fea0: ed ec ldi r30, 0xCD ; 205 1fea2: f4 e0 ldi r31, 0x04 ; 4 1fea4: df 01 movw r26, r30 1fea6: 28 2f mov r18, r24 1fea8: 1d 92 st X+, r1 1feaa: 2a 95 dec r18 1feac: e9 f7 brne .-6 ; 0x1fea8 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1feae: ed eb ldi r30, 0xBD ; 189 1feb0: f4 e0 ldi r31, 0x04 ; 4 1feb2: df 01 movw r26, r30 1feb4: 1d 92 st X+, r1 1feb6: 8a 95 dec r24 1feb8: e9 f7 brne .-6 ; 0x1feb4 previous_nominal_speed = 0.0; 1feba: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 1febe: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 1fec2: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 1fec6: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> plan_reset_next_e_queue = false; 1feca: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = false; 1fece: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fed2: 84 e0 ldi r24, 0x04 ; 4 1fed4: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be if (!READ(BTN_ENC)) 1fed8: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fedc: 86 fd sbrc r24, 6 1fede: ca c0 rjmp .+404 ; 0x20074 1fee0: bf ef ldi r27, 0xFF ; 255 1fee2: e3 ed ldi r30, 0xD3 ; 211 1fee4: f0 e3 ldi r31, 0x30 ; 48 1fee6: b1 50 subi r27, 0x01 ; 1 1fee8: e0 40 sbci r30, 0x00 ; 0 1feea: f0 40 sbci r31, 0x00 ; 0 1feec: e1 f7 brne .-8 ; 0x1fee6 1feee: 00 c0 rjmp .+0 ; 0x1fef0 1fef0: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fef2: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fef6: 86 fd sbrc r24, 6 1fef8: bd c0 rjmp .+378 ; 0x20074 { lcd_clear(); 1fefa: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_P(PSTR("Factory RESET")); 1fefe: 81 e0 ldi r24, 0x01 ; 1 1ff00: 9e e8 ldi r25, 0x8E ; 142 1ff02: 0e 94 d2 6e call 0xdda4 ; 0xdda4 SET_OUTPUT(BEEPER); 1ff06: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1ff0a: 84 60 ori r24, 0x04 ; 4 1ff0c: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1ff10: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1ff14: 82 30 cpi r24, 0x02 ; 2 1ff16: 41 f0 breq .+16 ; 0x1ff28 WRITE(BEEPER, HIGH); 1ff18: 9f b7 in r25, 0x3f ; 63 1ff1a: f8 94 cli 1ff1c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff20: 84 60 ori r24, 0x04 ; 4 1ff22: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff26: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1ff28: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1ff2c: 86 ff sbrs r24, 6 1ff2e: fc cf rjmp .-8 ; 0x1ff28 WRITE(BEEPER, LOW); 1ff30: 9f b7 in r25, 0x3f ; 63 1ff32: f8 94 cli 1ff34: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff38: 8b 7f andi r24, 0xFB ; 251 1ff3a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1ff3e: 9f bf out 0x3f, r25 ; 63 1ff40: 2f ef ldi r18, 0xFF ; 255 1ff42: 37 ea ldi r19, 0xA7 ; 167 1ff44: 81 e6 ldi r24, 0x61 ; 97 1ff46: 21 50 subi r18, 0x01 ; 1 1ff48: 30 40 sbci r19, 0x00 ; 0 1ff4a: 80 40 sbci r24, 0x00 ; 0 1ff4c: e1 f7 brne .-8 ; 0x1ff46 1ff4e: 00 c0 rjmp .+0 ; 0x1ff50 1ff50: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1ff52: 87 ee ldi r24, 0xE7 ; 231 1ff54: 9d e8 ldi r25, 0x8D ; 141 1ff56: 9a 83 std Y+2, r25 ; 0x02 1ff58: 89 83 std Y+1, r24 ; 0x01 1ff5a: 8c ed ldi r24, 0xDC ; 220 1ff5c: 9d e8 ldi r25, 0x8D ; 141 1ff5e: 9c 83 std Y+4, r25 ; 0x04 1ff60: 8b 83 std Y+3, r24 ; 0x03 1ff62: 8e ec ldi r24, 0xCE ; 206 1ff64: 9d e8 ldi r25, 0x8D ; 141 1ff66: 9e 83 std Y+6, r25 ; 0x06 1ff68: 8d 83 std Y+5, r24 ; 0x05 1ff6a: 81 ec ldi r24, 0xC1 ; 193 1ff6c: 9d e8 ldi r25, 0x8D ; 141 1ff6e: 98 87 std Y+8, r25 ; 0x08 1ff70: 8f 83 std Y+7, r24 ; 0x07 1ff72: 88 eb ldi r24, 0xB8 ; 184 1ff74: 9d e8 ldi r25, 0x8D ; 141 1ff76: 9a 87 std Y+10, r25 ; 0x0a 1ff78: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1ff7a: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_putc_at(0, 0, '>'); 1ff7e: 4e e3 ldi r20, 0x3E ; 62 1ff80: 60 e0 ldi r22, 0x00 ; 0 1ff82: 80 e0 ldi r24, 0x00 ; 0 1ff84: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_consume_click(); 1ff88: 0e 94 ff 70 call 0xe1fe ; 0xe1fe } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1ff8c: 10 e0 ldi r17, 0x00 ; 0 1ff8e: d1 2c mov r13, r1 1ff90: 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]); 1ff92: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1ff96: f6 01 movw r30, r12 1ff98: e8 0f add r30, r24 1ff9a: f1 1d adc r31, r1 1ff9c: 87 fd sbrc r24, 7 1ff9e: fa 95 dec r31 1ffa0: ee 0f add r30, r30 1ffa2: ff 1f adc r31, r31 1ffa4: a1 e0 ldi r26, 0x01 ; 1 1ffa6: b0 e0 ldi r27, 0x00 ; 0 1ffa8: ac 0f add r26, r28 1ffaa: bd 1f adc r27, r29 1ffac: ea 0f add r30, r26 1ffae: fb 1f adc r31, r27 1ffb0: 40 81 ld r20, Z 1ffb2: 51 81 ldd r21, Z+1 ; 0x01 1ffb4: 6c 2d mov r22, r12 1ffb6: 81 e0 ldi r24, 0x01 ; 1 1ffb8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 1ffbc: bf ef ldi r27, 0xFF ; 255 1ffbe: cb 1a sub r12, r27 1ffc0: 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++) { 1ffc2: e4 e0 ldi r30, 0x04 ; 4 1ffc4: ce 16 cp r12, r30 1ffc6: d1 04 cpc r13, r1 1ffc8: 21 f7 brne .-56 ; 0x1ff92 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1ffca: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 1ffce: 81 e0 ldi r24, 0x01 ; 1 1ffd0: 0e 94 b6 8a call 0x1156c ; 0x1156c if (lcd_encoder) { 1ffd4: 80 91 70 06 lds r24, 0x0670 ; 0x800670 1ffd8: 90 91 71 06 lds r25, 0x0671 ; 0x800671 1ffdc: 00 97 sbiw r24, 0x00 ; 0 1ffde: 71 f1 breq .+92 ; 0x2003c if (lcd_encoder < 0) { 1ffe0: 97 ff sbrs r25, 7 1ffe2: 12 c0 rjmp .+36 ; 0x20008 cursor_pos--; 1ffe4: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1ffe6: 14 30 cpi r17, 0x04 ; 4 1ffe8: 0c f4 brge .+2 ; 0x1ffec 1ffea: a6 c0 rjmp .+332 ; 0x20138 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1ffec: 87 e0 ldi r24, 0x07 ; 7 1ffee: 0f 94 0e 4e call 0x29c1c ; 0x29c1c if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1fff2: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fff6: 18 16 cp r1, r24 1fff8: 2c f0 brlt .+10 ; 0x20004 first++; 1fffa: 8f 5f subi r24, 0xFF ; 255 1fffc: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 20000: 0e 94 1a 6f call 0xde34 ; 0xde34 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 20004: 13 e0 ldi r17, 0x03 ; 3 20006: 03 c0 rjmp .+6 ; 0x2000e if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 20008: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 2000a: 14 30 cpi r17, 0x04 ; 4 2000c: 78 f7 brcc .-34 ; 0x1ffec if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 2000e: 40 eb ldi r20, 0xB0 ; 176 20010: 5d e8 ldi r21, 0x8D ; 141 20012: 60 e0 ldi r22, 0x00 ; 0 20014: 80 e0 ldi r24, 0x00 ; 0 20016: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(0, cursor_pos); 2001a: 61 2f mov r22, r17 2001c: 80 e0 ldi r24, 0x00 ; 0 2001e: 0e 94 e7 6e call 0xddce ; 0xddce lcd_putc('>'); 20022: 8e e3 ldi r24, 0x3E ; 62 20024: 0e 94 d6 6e call 0xddac ; 0xddac lcd_encoder = 0; 20028: 10 92 71 06 sts 0x0671, r1 ; 0x800671 2002c: 10 92 70 06 sts 0x0670, r1 ; 0x800670 _delay(100); 20030: 64 e6 ldi r22, 0x64 ; 100 20032: 70 e0 ldi r23, 0x00 ; 0 20034: 80 e0 ldi r24, 0x00 ; 0 20036: 90 e0 ldi r25, 0x00 ; 0 20038: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 } if (lcd_clicked()) { 2003c: 0e 94 04 71 call 0xe208 ; 0xe208 20040: 88 23 and r24, r24 20042: 09 f4 brne .+2 ; 0x20046 20044: a4 cf rjmp .-184 ; 0x1ff8e return(cursor_pos + first); 20046: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 2004a: 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(); 2004c: 0e 94 1a 6f call 0xde34 ; 0xde34 Sound_MakeCustom(100,0,false); 20050: 40 e0 ldi r20, 0x00 ; 0 20052: 70 e0 ldi r23, 0x00 ; 0 20054: 60 e0 ldi r22, 0x00 ; 0 20056: 84 e6 ldi r24, 0x64 ; 100 20058: 90 e0 ldi r25, 0x00 ; 0 2005a: 0f 94 4d 51 call 0x2a29a ; 0x2a29a switch (level) { 2005e: 12 30 cpi r17, 0x02 ; 2 20060: 09 f4 brne .+2 ; 0x20064 20062: a0 c0 rjmp .+320 ; 0x201a4 20064: 08 f0 brcs .+2 ; 0x20068 20066: 79 c0 rjmp .+242 ; 0x2015a 20068: 11 23 and r17, r17 2006a: 09 f4 brne .+2 ; 0x2006e 2006c: 93 c0 rjmp .+294 ; 0x20194 2006e: 11 30 cpi r17, 0x01 ; 1 20070: 09 f4 brne .+2 ; 0x20074 20072: 93 c0 rjmp .+294 ; 0x2019a case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 20074: 82 e0 ldi r24, 0x02 ; 2 20076: 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); 2007a: 60 e0 ldi r22, 0x00 ; 0 2007c: 8f ef ldi r24, 0xFF ; 255 2007e: 9f e0 ldi r25, 0x0F ; 15 20080: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 20084: 61 e0 ldi r22, 0x01 ; 1 20086: 8f e5 ldi r24, 0x5F ; 95 20088: 9f e0 ldi r25, 0x0F ; 15 2008a: 0e 94 10 76 call 0xec20 ; 0xec20 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 2008e: 8f ef ldi r24, 0xFF ; 255 20090: 9f e0 ldi r25, 0x0F ; 15 20092: 0f 94 23 dc call 0x3b846 ; 0x3b846 20096: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 20098: 8f 3f cpi r24, 0xFF ; 255 2009a: 09 f4 brne .+2 ; 0x2009e 2009c: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 2009e: 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); 200a2: 61 e0 ldi r22, 0x01 ; 1 200a4: 89 e6 ldi r24, 0x69 ; 105 200a6: 9f e0 ldi r25, 0x0F ; 15 200a8: 0e 94 10 76 call 0xec20 ; 0xec20 200ac: 91 e0 ldi r25, 0x01 ; 1 200ae: 81 11 cpse r24, r1 200b0: 01 c0 rjmp .+2 ; 0x200b4 200b2: 90 e0 ldi r25, 0x00 ; 0 200b4: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 200b8: 88 23 and r24, r24 200ba: 09 f4 brne .+2 ; 0x200be 200bc: a5 c0 rjmp .+330 ; 0x20208 puts_P(_N("CrashDetect ENABLED!")); 200be: 83 ef ldi r24, 0xF3 ; 243 200c0: 9c e6 ldi r25, 0x6C ; 108 } else { puts_P(_N("CrashDetect DISABLED")); 200c2: 0f 94 0c db call 0x3b618 ; 0x3b618 } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 200c6: 87 ef ldi r24, 0xF7 ; 247 200c8: 9e e0 ldi r25, 0x0E ; 14 200ca: 0f 94 23 dc call 0x3b846 ; 0x3b846 200ce: c8 2e mov r12, r24 200d0: 80 93 f9 04 sts 0x04F9, r24 ; 0x8004f9 tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 200d4: 86 ef ldi r24, 0xF6 ; 246 200d6: 9e e0 ldi r25, 0x0E ; 14 200d8: 0f 94 23 dc call 0x3b846 ; 0x3b846 200dc: d8 2e mov r13, r24 200de: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 200e2: 85 ef ldi r24, 0xF5 ; 245 200e4: 9e e0 ldi r25, 0x0E ; 14 200e6: 0f 94 23 dc call 0x3b846 ; 0x3b846 200ea: e8 2e mov r14, r24 200ec: 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); 200f0: 84 ef ldi r24, 0xF4 ; 244 200f2: 9e e0 ldi r25, 0x0E ; 14 200f4: 0f 94 23 dc call 0x3b846 ; 0x3b846 200f8: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 200fc: 2f ef ldi r18, 0xFF ; 255 200fe: c2 12 cpse r12, r18 20100: 02 c0 rjmp .+4 ; 0x20106 20102: 10 92 f9 04 sts 0x04F9, r1 ; 0x8004f9 if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 20106: 3f ef ldi r19, 0xFF ; 255 20108: d3 12 cpse r13, r19 2010a: 02 c0 rjmp .+4 ; 0x20110 2010c: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 20110: 9f ef ldi r25, 0xFF ; 255 20112: e9 12 cpse r14, r25 20114: 02 c0 rjmp .+4 ; 0x2011a 20116: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 2011a: 8f 3f cpi r24, 0xFF ; 255 2011c: 11 f4 brne .+4 ; 0x20122 2011e: 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]); 20122: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 20126: 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--; 20128: 28 e0 ldi r18, 0x08 ; 8 2012a: 96 95 lsr r25 2012c: 87 95 ror r24 2012e: 00 97 sbiw r24, 0x00 ; 0 20130: 09 f4 brne .+2 ; 0x20134 20132: 6d c0 rjmp .+218 ; 0x2020e 20134: 21 50 subi r18, 0x01 ; 1 20136: f9 cf rjmp .-14 ; 0x2012a first++; lcd_clear(); } } if (cursor_pos < 0) { 20138: 1f 3f cpi r17, 0xFF ; 255 2013a: 09 f0 breq .+2 ; 0x2013e 2013c: 68 cf rjmp .-304 ; 0x2000e cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 2013e: 87 e0 ldi r24, 0x07 ; 7 20140: 0f 94 0e 4e call 0x29c1c ; 0x29c1c if (first > 0) { 20144: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 20148: 18 16 cp r1, r24 2014a: 2c f4 brge .+10 ; 0x20156 first--; 2014c: 81 50 subi r24, 0x01 ; 1 2014e: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 20152: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 20156: 10 e0 ldi r17, 0x00 ; 0 20158: 5a cf rjmp .-332 ; 0x2000e // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 2015a: 13 30 cpi r17, 0x03 ; 3 2015c: 29 f1 breq .+74 ; 0x201a8 2015e: 14 30 cpi r17, 0x04 ; 4 20160: 09 f0 breq .+2 ; 0x20164 20162: 88 cf rjmp .-240 ; 0x20074 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 20164: 60 ef ldi r22, 0xF0 ; 240 20166: 7d e8 ldi r23, 0x8D ; 141 20168: 80 e0 ldi r24, 0x00 ; 0 2016a: 90 e1 ldi r25, 0x10 ; 16 2016c: 0f 94 ff cf call 0x39ffe ; 0x39ffe // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20170: 10 e0 ldi r17, 0x00 ; 0 20172: 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); 20174: 6f ef ldi r22, 0xFF ; 255 20176: c8 01 movw r24, r16 20178: 0f 94 47 dc call 0x3b88e ; 0x3b88e eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 2017c: c8 01 movw r24, r16 2017e: 0f 94 d0 cf call 0x39fa0 ; 0x39fa0 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 20182: 0f 5f subi r16, 0xFF ; 255 20184: 1f 4f sbci r17, 0xFF ; 255 20186: 01 15 cp r16, r1 20188: f0 e1 ldi r31, 0x10 ; 16 2018a: 1f 07 cpc r17, r31 2018c: 99 f7 brne .-26 ; 0x20174 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 2018e: 0f 94 f1 cf call 0x39fe2 ; 0x39fe2 20192: 40 cc rjmp .-1920 ; 0x1fa14 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 20194: 0e 94 33 71 call 0xe266 ; 0xe266 20198: 6d cf rjmp .-294 ; 0x20074 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 2019a: 0e 94 18 67 call 0xce30 ; 0xce30 lcd_menu_statistics(); 2019e: 0f 94 dc 3e call 0x27db8 ; 0x27db8 201a2: 68 cf rjmp .-304 ; 0x20074 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 201a4: 0e 94 18 67 call 0xce30 ; 0xce30 // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 201a8: 0e 94 33 71 call 0xe266 ; 0xe266 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 201ac: 84 e0 ldi r24, 0x04 ; 4 201ae: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 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); 201b2: 62 e0 ldi r22, 0x02 ; 2 201b4: 8f e5 ldi r24, 0x5F ; 95 201b6: 9f e0 ldi r25, 0x0F ; 15 201b8: 0f 94 6b dc call 0x3b8d6 ; 0x3b8d6 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 201bc: 81 e0 ldi r24, 0x01 ; 1 201be: 0e 94 d6 74 call 0xe9ac ; 0xe9ac fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 201c2: 11 e0 ldi r17, 0x01 ; 1 201c4: 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); 201c8: 61 e0 ldi r22, 0x01 ; 1 201ca: 87 e0 ldi r24, 0x07 ; 7 201cc: 9f e0 ldi r25, 0x0F ; 15 201ce: 0f 94 47 dc call 0x3b88e ; 0x3b88e eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 201d2: 10 93 ac 17 sts 0x17AC, r17 ; 0x8017ac 201d6: 61 e0 ldi r22, 0x01 ; 1 201d8: 85 ed ldi r24, 0xD5 ; 213 201da: 9e e0 ldi r25, 0x0E ; 14 201dc: 0f 94 47 dc call 0x3b88e ; 0x3b88e return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 201e0: 10 93 b8 17 sts 0x17B8, r17 ; 0x8017b8 oldPos = pat9125_y; 201e4: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 201e8: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 201ec: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 201f0: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 resetStepCount(); 201f4: 0f 94 f1 7a call 0x2f5e2 ; 0x2f5e2 jamErrCnt = 0; 201f8: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf 201fc: 61 e0 ldi r22, 0x01 ; 1 201fe: 8d ea ldi r24, 0xAD ; 173 20200: 9c e0 ldi r25, 0x0C ; 12 20202: 0f 94 47 dc call 0x3b88e ; 0x3b88e 20206: 36 cf rjmp .-404 ; 0x20074 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")); 20208: 8e ed ldi r24, 0xDE ; 222 2020a: 9c e6 ldi r25, 0x6C ; 108 2020c: 5a cf rjmp .-332 ; 0x200c2 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]); 2020e: 20 93 f5 04 sts 0x04F5, r18 ; 0x8004f5 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 20212: 80 91 7b 0e lds r24, 0x0E7B ; 0x800e7b 20216: 90 e0 ldi r25, 0x00 ; 0 20218: 28 e0 ldi r18, 0x08 ; 8 2021a: 96 95 lsr r25 2021c: 87 95 ror r24 2021e: 00 97 sbiw r24, 0x00 ; 0 20220: 11 f0 breq .+4 ; 0x20226 20222: 21 50 subi r18, 0x01 ; 1 20224: fa cf rjmp .-12 ; 0x2021a 20226: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 2022a: 80 91 7c 0e lds r24, 0x0E7C ; 0x800e7c 2022e: 90 e0 ldi r25, 0x00 ; 0 20230: 28 e0 ldi r18, 0x08 ; 8 20232: 96 95 lsr r25 20234: 87 95 ror r24 20236: 00 97 sbiw r24, 0x00 ; 0 20238: 11 f0 breq .+4 ; 0x2023e 2023a: 21 50 subi r18, 0x01 ; 1 2023c: fa cf rjmp .-12 ; 0x20232 2023e: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 20242: 80 91 7d 0e lds r24, 0x0E7D ; 0x800e7d 20246: 90 e0 ldi r25, 0x00 ; 0 20248: 28 e0 ldi r18, 0x08 ; 8 2024a: 96 95 lsr r25 2024c: 87 95 ror r24 2024e: 00 97 sbiw r24, 0x00 ; 0 20250: 11 f0 breq .+4 ; 0x20256 20252: 21 50 subi r18, 0x01 ; 1 20254: fa cf rjmp .-12 ; 0x2024a 20256: 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(); 2025a: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 2025e: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 20260: 82 70 andi r24, 0x02 ; 2 20262: 0f 94 67 26 call 0x24cce ; 0x24cce microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 20266: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2026a: 81 60 ori r24, 0x01 ; 1 2026c: 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); 20270: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20274: 82 60 ori r24, 0x02 ; 2 20276: 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); 2027a: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2027e: 84 60 ori r24, 0x04 ; 4 20280: 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); 20284: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20288: 80 64 ori r24, 0x40 ; 64 2028a: 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); 2028e: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 20290: 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); 20292: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 20294: 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); 20296: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 20298: 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); 2029a: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 2029c: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 2029e: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 202a0: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 202a2: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 202a4: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 202a6: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 202a8: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 202aa: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 202ae: 8b 7f andi r24, 0xFB ; 251 202b0: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 202b4: 9f b7 in r25, 0x3f ; 63 202b6: f8 94 cli 202b8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202bc: 84 60 ori r24, 0x04 ; 4 202be: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202c2: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 202c4: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 202c8: 8f 77 andi r24, 0x7F ; 127 202ca: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 202ce: 9f b7 in r25, 0x3f ; 63 202d0: f8 94 cli 202d2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202d6: 80 68 ori r24, 0x80 ; 128 202d8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 202dc: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 202de: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 202e0: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 202e2: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 202e4: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 202e6: 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(); 202e8: 17 9a sbi 0x02, 7 ; 2 202ea: 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); 202ee: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 202f0: 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(); 202f2: 16 9a sbi 0x02, 6 ; 2 202f4: 10 92 90 06 sts 0x0690, r1 ; 0x800690 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 202f8: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 202fa: 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); 202fc: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 202fe: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 20300: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 20306: 8f 7e andi r24, 0xEF ; 239 20308: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 20310: 88 60 ori r24, 0x08 ; 8 20312: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 2031a: 8d 7f andi r24, 0xFD ; 253 2031c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 20324: 8e 7f andi r24, 0xFE ; 254 20326: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 2032e: 8f 73 andi r24, 0x3F ; 63 20330: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 20338: 8f 7c andi r24, 0xCF ; 207 2033a: 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< 20342: 88 7f andi r24, 0xF8 ; 248 20344: 82 60 ori r24, 0x02 ; 2 20346: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 2034a: 80 e0 ldi r24, 0x00 ; 0 2034c: 90 e4 ldi r25, 0x40 ; 64 2034e: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 20352: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 20356: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2035a: 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; 2035e: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 20362: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> nextAdvanceISR = ADV_NEVER; 20366: 8f ef ldi r24, 0xFF ; 255 20368: 9f ef ldi r25, 0xFF ; 255 2036a: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2036e: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> main_Rate = ADV_NEVER; 20372: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 20376: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> current_adv_steps = 0; 2037a: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 2037e: 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; 20382: 81 e0 ldi r24, 0x01 ; 1 20384: 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(); 20388: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2038c: 82 60 ori r24, 0x02 ; 2 2038e: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 20392: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 20394: 81 e0 ldi r24, 0x01 ; 1 20396: 11 11 cpse r17, r1 20398: 01 c0 rjmp .+2 ; 0x2039c 2039a: 80 e0 ldi r24, 0x00 ; 0 2039c: 80 93 8c 06 sts 0x068C, r24 ; 0x80068c update_mode_profile(); 203a0: 0f 94 a8 63 call 0x2c750 ; 0x2c750 203a4: 0e 94 d8 ef call 0x1dfb0 ; 0x1dfb0 203a8: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 203aa: 82 70 andi r24, 0x02 ; 2 203ac: 0f 94 67 26 call 0x24cce ; 0x24cce setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 203b0: 0f 94 04 ce call 0x39c08 ; 0x39c08 // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 203b4: 82 e9 ldi r24, 0x92 ; 146 203b6: 96 e0 ldi r25, 0x06 ; 6 203b8: 0e 94 d0 6b call 0xd7a0 ; 0xd7a0 plan_set_position_curposXYZE(); 203bc: 0f 94 10 bf call 0x37e20 ; 0x37e20 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 203c0: b1 10 cpse r11, r1 203c2: 08 c0 rjmp .+16 ; 0x203d4 } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 203c4: 8b e3 ldi r24, 0x3B ; 59 203c6: 9c e6 ldi r25, 0x6C ; 108 203c8: 0f 94 0c db call 0x3b618 ; 0x3b618 lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 203cc: 8f ee ldi r24, 0xEF ; 239 203ce: 9b e6 ldi r25, 0x6B ; 107 203d0: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 203d4: 84 e9 ldi r24, 0x94 ; 148 203d6: 9c e0 ldi r25, 0x0C ; 12 203d8: 0f 94 23 dc call 0x3b846 ; 0x3b846 203dc: 82 34 cpi r24, 0x42 ; 66 203de: 59 f4 brne .+22 ; 0x203f6 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); 203e0: 6f ef ldi r22, 0xFF ; 255 203e2: 84 e9 ldi r24, 0x94 ; 148 203e4: 9c e0 ldi r25, 0x0C ; 12 203e6: 0f 94 6b dc call 0x3b8d6 ; 0x3b8d6 // 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); 203ea: 85 e9 ldi r24, 0x95 ; 149 203ec: 9c e0 ldi r25, 0x0C ; 12 203ee: 0f 94 31 dc call 0x3b862 ; 0x3b862 lcd_show_fullscreen_message_and_wait_P(kill_msg); 203f2: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 203f6: 0f 94 40 7b call 0x2f680 ; 0x2f680 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 203fa: 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); 203fc: 8b eb ldi r24, 0xBB ; 187 203fe: 9f e0 ldi r25, 0x0F ; 15 20400: 0f 94 23 dc call 0x3b846 ; 0x3b846 20404: 91 e0 ldi r25, 0x01 ; 1 20406: 81 30 cpi r24, 0x01 ; 1 20408: 09 f0 breq .+2 ; 0x2040c 2040a: 90 e0 ldi r25, 0x00 ; 0 2040c: 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(); 20410: 81 e0 ldi r24, 0x01 ; 1 20412: 0f 94 c9 80 call 0x30192 ; 0x30192 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 20416: 60 e0 ldi r22, 0x00 ; 0 20418: 84 e6 ldi r24, 0x64 ; 100 2041a: 9f e0 ldi r25, 0x0F ; 15 2041c: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 20420: 60 e0 ldi r22, 0x00 ; 0 20422: 86 e6 ldi r24, 0x66 ; 102 20424: 9f e0 ldi r25, 0x0F ; 15 20426: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 2042a: 60 e0 ldi r22, 0x00 ; 0 2042c: 88 e6 ldi r24, 0x68 ; 104 2042e: 9f e0 ldi r25, 0x0F ; 15 20430: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 20434: 60 e0 ldi r22, 0x00 ; 0 20436: 85 e6 ldi r24, 0x65 ; 101 20438: 9f e0 ldi r25, 0x0F ; 15 2043a: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 2043e: 70 e0 ldi r23, 0x00 ; 0 20440: 60 e0 ldi r22, 0x00 ; 0 20442: 8f ef ldi r24, 0xFF ; 255 20444: 9e e0 ldi r25, 0x0E ; 14 20446: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 2044a: 70 e0 ldi r23, 0x00 ; 0 2044c: 60 e0 ldi r22, 0x00 ; 0 2044e: 85 e0 ldi r24, 0x05 ; 5 20450: 9f e0 ldi r25, 0x0F ; 15 20452: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 20456: 70 e0 ldi r23, 0x00 ; 0 20458: 60 e0 ldi r22, 0x00 ; 0 2045a: 83 e0 ldi r24, 0x03 ; 3 2045c: 9f e0 ldi r25, 0x0F ; 15 2045e: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 20462: 70 e0 ldi r23, 0x00 ; 0 20464: 60 e0 ldi r22, 0x00 ; 0 20466: 81 e0 ldi r24, 0x01 ; 1 20468: 9f e0 ldi r25, 0x0F ; 15 2046a: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 2046e: 70 e0 ldi r23, 0x00 ; 0 20470: 60 e0 ldi r22, 0x00 ; 0 20472: 83 ed ldi r24, 0xD3 ; 211 20474: 9e e0 ldi r25, 0x0E ; 14 20476: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 2047a: 70 e0 ldi r23, 0x00 ; 0 2047c: 60 e0 ldi r22, 0x00 ; 0 2047e: 80 ed ldi r24, 0xD0 ; 208 20480: 9e e0 ldi r25, 0x0E ; 14 20482: 0e 94 f8 75 call 0xebf0 ; 0xebf0 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 20486: 60 e0 ldi r22, 0x00 ; 0 20488: 82 ed ldi r24, 0xD2 ; 210 2048a: 9e e0 ldi r25, 0x0E ; 14 2048c: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 20490: 60 e0 ldi r22, 0x00 ; 0 20492: 8f ec ldi r24, 0xCF ; 207 20494: 9e e0 ldi r25, 0x0E ; 14 20496: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 2049a: 88 ea ldi r24, 0xA8 ; 168 2049c: 9c e0 ldi r25, 0x0C ; 12 2049e: 0f 94 64 7a call 0x2f4c8 ; 0x2f4c8 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 204a2: 81 ea ldi r24, 0xA1 ; 161 204a4: 9d e0 ldi r25, 0x0D ; 13 204a6: 0f 94 23 dc call 0x3b846 ; 0x3b846 204aa: 8f 3f cpi r24, 0xFF ; 255 204ac: 71 f4 brne .+28 ; 0x204ca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 204ae: 60 e0 ldi r22, 0x00 ; 0 204b0: 81 ea ldi r24, 0xA1 ; 161 204b2: 9d e0 ldi r25, 0x0D ; 13 204b4: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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); 204b8: 88 ef ldi r24, 0xF8 ; 248 204ba: 9f e0 ldi r25, 0x0F ; 15 204bc: 0f 94 31 dc call 0x3b862 ; 0x3b862 eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 204c0: bc 01 movw r22, r24 204c2: 80 e5 ldi r24, 0x50 ; 80 204c4: 9d e0 ldi r25, 0x0D ; 13 204c6: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 204ca: 39 e4 ldi r19, 0x49 ; 73 204cc: c3 2e mov r12, r19 204ce: 3d e0 ldi r19, 0x0D ; 13 204d0: d3 2e mov r13, r19 204d2: 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); 204d4: be 01 movw r22, r28 204d6: 6f 5f subi r22, 0xFF ; 255 204d8: 7f 4f sbci r23, 0xFF ; 255 204da: 81 2f mov r24, r17 204dc: 0e 94 78 76 call 0xecf0 ; 0xecf0 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 204e0: ae 01 movw r20, r28 204e2: 4f 5f subi r20, 0xFF ; 255 204e4: 5f 4f sbci r21, 0xFF ; 255 204e6: 67 e0 ldi r22, 0x07 ; 7 204e8: 70 e0 ldi r23, 0x00 ; 0 204ea: c6 01 movw r24, r12 204ec: 0e 94 d9 75 call 0xebb2 ; 0xebb2 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++) { 204f0: 1f 5f subi r17, 0xFF ; 255 204f2: ab e0 ldi r26, 0x0B ; 11 204f4: ca 0e add r12, r26 204f6: d1 1c adc r13, r1 204f8: 18 30 cpi r17, 0x08 ; 8 204fa: 61 f7 brne .-40 ; 0x204d4 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)))) 204fc: 81 ea ldi r24, 0xA1 ; 161 204fe: 9d e0 ldi r25, 0x0D ; 13 20500: 0f 94 23 dc call 0x3b846 ; 0x3b846 20504: 0e 94 48 76 call 0xec90 ; 0xec90 20508: 81 11 cpse r24, r1 2050a: 02 c0 rjmp .+4 ; 0x20510 { eeprom_switch_to_next_sheet(); 2050c: 0e 94 6a 76 call 0xecd4 ; 0xecd4 } check_babystep(); 20510: 0e 94 86 79 call 0xf30c ; 0xf30c // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 20514: 80 e8 ldi r24, 0x80 ; 128 20516: 9c e0 ldi r25, 0x0C ; 12 20518: 0f 94 23 dc call 0x3b846 ; 0x3b846 2051c: 8f 3f cpi r24, 0xFF ; 255 2051e: 41 f4 brne .+16 ; 0x20530 #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); 20520: 40 e1 ldi r20, 0x10 ; 16 20522: 50 e0 ldi r21, 0x00 ; 0 20524: 60 e8 ldi r22, 0x80 ; 128 20526: 7c e0 ldi r23, 0x0C ; 12 20528: 87 ee ldi r24, 0xE7 ; 231 2052a: 92 e0 ldi r25, 0x02 ; 2 2052c: 0f 94 37 dc call 0x3b86e ; 0x3b86e #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); 20530: 85 e0 ldi r24, 0x05 ; 5 20532: 9d e0 ldi r25, 0x0D ; 13 20534: 0f 94 64 7a call 0x2f4c8 ; 0x2f4c8 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 20538: 8d ee ldi r24, 0xED ; 237 2053a: 9f e0 ldi r25, 0x0F ; 15 2053c: 0f 94 64 7a call 0x2f4c8 ; 0x2f4c8 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 20540: 81 ef ldi r24, 0xF1 ; 241 20542: 9f e0 ldi r25, 0x0F ; 15 20544: 0f 94 64 7a call 0x2f4c8 ; 0x2f4c8 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 20548: 60 e0 ldi r22, 0x00 ; 0 2054a: 8e ec ldi r24, 0xCE ; 206 2054c: 9e e0 ldi r25, 0x0E ; 14 2054e: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 20552: 61 e0 ldi r22, 0x01 ; 1 20554: 87 ea ldi r24, 0xA7 ; 167 20556: 9c e0 ldi r25, 0x0C ; 12 20558: 0e 94 10 76 call 0xec20 ; 0xec20 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 2055c: 8e ef ldi r24, 0xFE ; 254 2055e: 9f e0 ldi r25, 0x0F ; 15 20560: 0f 94 23 dc call 0x3b846 ; 0x3b846 20564: 0e 94 3b 72 call 0xe476 ; 0xe476 20568: 81 11 cpse r24, r1 2056a: 02 c0 rjmp .+4 ; 0x20570 lcd_language(); 2056c: 0e 94 56 da call 0x1b4ac ; 0x1b4ac lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 20570: 60 e0 ldi r22, 0x00 ; 0 20572: 8f ea ldi r24, 0xAF ; 175 20574: 9f e0 ldi r25, 0x0F ; 15 20576: 0e 94 10 76 call 0xec20 ; 0xec20 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 2057a: 86 ea ldi r24, 0xA6 ; 166 2057c: 9f e0 ldi r25, 0x0F ; 15 2057e: 0f 94 23 dc call 0x3b846 ; 0x3b846 20582: 8f 3f cpi r24, 0xFF ; 255 20584: d9 f4 brne .+54 ; 0x205bc if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20586: 61 e0 ldi r22, 0x01 ; 1 20588: 86 ea ldi r24, 0xA6 ; 166 2058a: 9f e0 ldi r25, 0x0F ; 15 2058c: 0f 94 47 dc call 0x3b88e ; 0x3b88e 20590: 20 eb ldi r18, 0xB0 ; 176 20592: c2 2e mov r12, r18 20594: 2f e0 ldi r18, 0x0F ; 15 20596: 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); 20598: 70 e0 ldi r23, 0x00 ; 0 2059a: 60 e0 ldi r22, 0x00 ; 0 2059c: c6 01 movw r24, r12 2059e: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 205a2: b2 e0 ldi r27, 0x02 ; 2 205a4: cb 0e add r12, r27 205a6: 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++) { 205a8: ea eb ldi r30, 0xBA ; 186 205aa: ce 16 cp r12, r30 205ac: ef e0 ldi r30, 0x0F ; 15 205ae: de 06 cpc r13, r30 205b0: 99 f7 brne .-26 ; 0x20598 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 205b2: 60 e0 ldi r22, 0x00 ; 0 205b4: 8f ea ldi r24, 0xAF ; 175 205b6: 9f e0 ldi r25, 0x0F ; 15 205b8: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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); 205bc: 60 e0 ldi r22, 0x00 ; 0 205be: 85 ea ldi r24, 0xA5 ; 165 205c0: 9f e0 ldi r25, 0x0F ; 15 205c2: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 205c6: 60 e0 ldi r22, 0x00 ; 0 205c8: 8f e7 ldi r24, 0x7F ; 127 205ca: 9c e0 ldi r25, 0x0C ; 12 205cc: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 205d0: 60 e0 ldi r22, 0x00 ; 0 205d2: 89 e0 ldi r24, 0x09 ; 9 205d4: 9f e0 ldi r25, 0x0F ; 15 205d6: 0e 94 10 76 call 0xec20 ; 0xec20 } 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); 205da: 61 e0 ldi r22, 0x01 ; 1 205dc: 8c ea ldi r24, 0xAC ; 172 205de: 9d e0 ldi r25, 0x0D ; 13 205e0: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 205e4: 63 e0 ldi r22, 0x03 ; 3 205e6: 8b ea ldi r24, 0xAB ; 171 205e8: 9d e0 ldi r25, 0x0D ; 13 205ea: 0e 94 10 76 call 0xec20 ; 0xec20 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 205ee: 63 e0 ldi r22, 0x03 ; 3 205f0: 8a ea ldi r24, 0xAA ; 170 205f2: 9d e0 ldi r25, 0x0D ; 13 205f4: 0e 94 10 76 call 0xec20 ; 0xec20 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 205f8: 61 e0 ldi r22, 0x01 ; 1 205fa: 89 ea ldi r24, 0xA9 ; 169 205fc: 9d e0 ldi r25, 0x0D ; 13 205fe: 0e 94 10 76 call 0xec20 ; 0xec20 #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 20602: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 20604: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 20606: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 2060a: 8f 7b andi r24, 0xBF ; 191 2060c: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 20610: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20614: 80 68 ori r24, 0x80 ; 128 20616: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 2061a: 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); 2061c: 84 e0 ldi r24, 0x04 ; 4 2061e: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be return false; } #ifdef FSENSOR_PROBING bool PAT9125_sensor::probeOtherType() { SET_INPUT(IR_SENSOR_PIN); // input mode 20622: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 20626: 8e 7f andi r24, 0xFE ; 254 20628: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 2062c: 9f b7 in r25, 0x3f ; 63 2062e: f8 94 cli 20630: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20634: 81 60 ori r24, 0x01 ; 1 20636: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2063a: 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); 2063c: 8f e8 ldi r24, 0x8F ; 143 2063e: 91 e0 ldi r25, 0x01 ; 1 20640: 01 97 sbiw r24, 0x01 ; 1 20642: f1 f7 brne .-4 ; 0x20640 20644: 00 c0 rjmp .+0 ; 0x20646 20646: 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); 20648: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> WRITE(IR_SENSOR_PIN, 0); // no pullup 2064c: 2f b7 in r18, 0x3f ; 63 2064e: f8 94 cli 20650: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20654: 8e 7f andi r24, 0xFE ; 254 20656: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2065a: 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()) { 2065c: 90 fd sbrc r25, 0 2065e: 06 c0 rjmp .+12 ; 0x2066c lcd_show_fullscreen_message_and_wait_P(_T(MSG_FW_MK3_DETECTED)); 20660: 8c e3 ldi r24, 0x3C ; 60 20662: 9b e4 ldi r25, 0x4B ; 75 20664: 0e 94 b3 72 call 0xe566 ; 0xe566 20668: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 2066c: 02 30 cpi r16, 0x02 ; 2 2066e: 81 f0 breq .+32 ; 0x20690 20670: 03 30 cpi r16, 0x03 ; 3 20672: 09 f4 brne .+2 ; 0x20676 20674: 37 c1 rjmp .+622 ; 0x208e4 20676: 01 30 cpi r16, 0x01 ; 1 20678: b9 f4 brne .+46 ; 0x206a8 //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)); 2067a: 8e e6 ldi r24, 0x6E ; 110 2067c: 9d e4 ldi r25, 0x4D ; 77 2067e: 0e 94 b3 72 call 0xe566 ; 0xe566 20682: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 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); 20686: 66 e3 ldi r22, 0x36 ; 54 20688: 71 e0 ldi r23, 0x01 ; 1 2068a: 8c ee ldi r24, 0xEC ; 236 2068c: 9e e0 ldi r25, 0x0E ; 14 2068e: 0a c0 rjmp .+20 ; 0x206a4 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 20690: 8d e4 ldi r24, 0x4D ; 77 20692: 9d e4 ldi r25, 0x4D ; 77 20694: 0e 94 b3 72 call 0xe566 ; 0xe566 20698: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 2069c: 6c e2 ldi r22, 0x2C ; 44 2069e: 71 e0 ldi r23, 0x01 ; 1 206a0: 8e ee ldi r24, 0xEE ; 238 206a2: 9e e0 ldi r25, 0x0E ; 14 206a4: 0f 94 81 dc call 0x3b902 ; 0x3b902 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 206a8: f1 10 cpse r15, r1 206aa: 08 c0 rjmp .+16 ; 0x206bc 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 206ac: 86 ed ldi r24, 0xD6 ; 214 206ae: 9c e4 ldi r25, 0x4C ; 76 206b0: 0e 94 b3 72 call 0xe566 ; 0xe566 206b4: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 Config_StoreSettings(); 206b8: 0e 94 ab 82 call 0x10556 ; 0x10556 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 206bc: 80 e8 ldi r24, 0x80 ; 128 206be: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 206c2: 88 23 and r24, r24 206c4: c9 f0 breq .+50 ; 0x206f8 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 206c6: 87 ef ldi r24, 0xF7 ; 247 206c8: 9f e0 ldi r25, 0x0F ; 15 206ca: 0f 94 23 dc call 0x3b846 ; 0x3b846 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 206ce: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 206d0: 81 30 cpi r24, 0x01 ; 1 206d2: 71 f4 brne .+28 ; 0x206f0 // 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)) { 206d4: 86 e2 ldi r24, 0x26 ; 38 206d6: 9e e8 ldi r25, 0x8E ; 142 206d8: 0e 94 43 d0 call 0x1a086 ; 0x1a086 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); 206dc: 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)) { 206de: 88 23 and r24, r24 206e0: 39 f0 breq .+14 ; 0x206f0 // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 206e2: 84 e9 ldi r24, 0x94 ; 148 206e4: 9c e4 ldi r25, 0x4C ; 76 206e6: 0e 94 b3 72 call 0xe566 ; 0xe566 206ea: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 206ee: 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); 206f0: 86 ea ldi r24, 0xA6 ; 166 206f2: 9c e0 ldi r25, 0x0C ; 12 206f4: 0f 94 47 dc call 0x3b88e ; 0x3b88e } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 206f8: 8e e1 ldi r24, 0x1E ; 30 206fa: 9e e8 ldi r25, 0x8E ; 142 206fc: 0e 94 43 d0 call 0x1a086 ; 0x1a086 20700: f8 2e mov r15, r24 20702: 88 23 and r24, r24 20704: 31 f0 breq .+12 ; 0x20712 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 20706: 8f e1 ldi r24, 0x1F ; 31 20708: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 2070c: 91 e0 ldi r25, 0x01 ; 1 2070e: f8 2e mov r15, r24 20710: 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; 20712: 10 e0 ldi r17, 0x00 ; 0 20714: 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)); 20716: f8 01 movw r30, r16 20718: e1 5f subi r30, 0xF1 ; 241 2071a: f1 47 sbci r31, 0x71 ; 113 2071c: 64 91 lpm r22, Z 2071e: c8 01 movw r24, r16 20720: 0f 94 47 dc call 0x3b88e ; 0x3b88e 20724: 0f 5f subi r16, 0xFF ; 255 20726: 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){ 20728: 0a 30 cpi r16, 0x0A ; 10 2072a: 11 05 cpc r17, r1 2072c: a1 f7 brne .-24 ; 0x20716 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])); 2072e: ee e1 ldi r30, 0x1E ; 30 20730: fe e8 ldi r31, 0x8E ; 142 20732: 65 91 lpm r22, Z+ 20734: 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); 20736: 8a e0 ldi r24, 0x0A ; 10 20738: 90 e0 ldi r25, 0x00 ; 0 2073a: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 2073e: e0 e2 ldi r30, 0x20 ; 32 20740: fe e8 ldi r31, 0x8E ; 142 20742: 65 91 lpm r22, Z+ 20744: 74 91 lpm r23, Z 20746: 8c e0 ldi r24, 0x0C ; 12 20748: 90 e0 ldi r25, 0x00 ; 0 2074a: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 2074e: e2 e2 ldi r30, 0x22 ; 34 20750: fe e8 ldi r31, 0x8E ; 142 20752: 65 91 lpm r22, Z+ 20754: 74 91 lpm r23, Z 20756: 8e e0 ldi r24, 0x0E ; 14 20758: 90 e0 ldi r25, 0x00 ; 0 2075a: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca // 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])); 2075e: e4 e2 ldi r30, 0x24 ; 36 20760: fe e8 ldi r31, 0x8E ; 142 20762: 65 91 lpm r22, Z+ 20764: 74 91 lpm r23, Z 20766: 80 e1 ldi r24, 0x10 ; 16 20768: 90 e0 ldi r25, 0x00 ; 0 2076a: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 2076e: 8f e5 ldi r24, 0x5F ; 95 20770: 9f e0 ldi r25, 0x0F ; 15 20772: 0f 94 23 dc call 0x3b846 ; 0x3b846 20776: 88 23 and r24, r24 20778: 09 f4 brne .+2 ; 0x2077c 2077a: c1 c0 rjmp .+386 ; 0x208fe // first time run of wizard or service prep lcd_wizard(WizState::Run); 2077c: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 2077e: 0e 94 02 f9 call 0x1f204 ; 0x1f204 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 20782: 83 e0 ldi r24, 0x03 ; 3 20784: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 20788: 81 e0 ldi r24, 0x01 ; 1 2078a: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 2078e: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_update(2); 20792: 82 e0 ldi r24, 0x02 ; 2 20794: 0e 94 ae 6e call 0xdd5c ; 0xdd5c #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 20798: 60 e0 ldi r22, 0x00 ; 0 2079a: 8e ef ldi r24, 0xFE ; 254 2079c: 9e e0 ldi r25, 0x0E ; 14 2079e: 0e 94 10 76 call 0xec20 ; 0xec20 207a2: 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); 207a6: 60 e3 ldi r22, 0x30 ; 48 207a8: 8d ef ldi r24, 0xFD ; 253 207aa: 9e e0 ldi r25, 0x0E ; 14 207ac: 0e 94 10 76 call 0xec20 ; 0xec20 207b0: 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); 207b4: 60 e3 ldi r22, 0x30 ; 48 207b6: 8c ef ldi r24, 0xFC ; 252 207b8: 9e e0 ldi r25, 0x0E ; 14 207ba: 0e 94 10 76 call 0xec20 ; 0xec20 207be: 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); 207c2: 60 e0 ldi r22, 0x00 ; 0 207c4: 8b ef ldi r24, 0xFB ; 251 207c6: 9e e0 ldi r25, 0x0E ; 14 207c8: 0e 94 10 76 call 0xec20 ; 0xec20 207cc: 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); 207d0: 60 e3 ldi r22, 0x30 ; 48 207d2: 8a ef ldi r24, 0xFA ; 250 207d4: 9e e0 ldi r25, 0x0E ; 14 207d6: 0e 94 10 76 call 0xec20 ; 0xec20 207da: 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); 207de: 60 e3 ldi r22, 0x30 ; 48 207e0: 89 ef ldi r24, 0xF9 ; 249 207e2: 9e e0 ldi r25, 0x0E ; 14 207e4: 0e 94 10 76 call 0xec20 ; 0xec20 207e8: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 207ec: 60 e0 ldi r22, 0x00 ; 0 207ee: 88 ef ldi r24, 0xF8 ; 248 207f0: 9e e0 ldi r25, 0x0E ; 14 207f2: 0e 94 10 76 call 0xec20 ; 0xec20 207f6: 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)) 207fa: ce 01 movw r24, r28 207fc: 01 96 adiw r24, 0x01 ; 1 207fe: 0e 94 0f ed call 0x1da1e ; 0x1da1e 20802: 88 23 and r24, r24 20804: 89 f0 breq .+34 ; 0x20828 { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 20806: 86 ec ldi r24, 0xC6 ; 198 20808: 9c e6 ldi r25, 0x6C ; 108 2080a: 0f 94 0c db call 0x3b618 ; 0x3b618 #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 2080e: 89 81 ldd r24, Y+1 ; 0x01 20810: 88 23 and r24, r24 20812: 51 f0 breq .+20 ; 0x20828 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 20814: 83 e0 ldi r24, 0x03 ; 3 20816: 9d e0 ldi r25, 0x0D ; 13 20818: 0f 94 23 dc call 0x3b846 ; 0x3b846 { // 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 && 2081c: 8f 3f cpi r24, 0xFF ; 255 2081e: 21 f0 breq .+8 ; 0x20828 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 20820: 82 e5 ldi r24, 0x52 ; 82 20822: 9c e6 ldi r25, 0x6C ; 108 20824: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20828: 6f ef ldi r22, 0xFF ; 255 2082a: 83 e0 ldi r24, 0x03 ; 3 2082c: 9d e0 ldi r25, 0x0D ; 13 2082e: 0f 94 47 dc call 0x3b88e ; 0x3b88e // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 20832: 0e 94 82 67 call 0xcf04 ; 0xcf04 20836: 88 23 and r24, r24 20838: d9 f1 breq .+118 ; 0x208b0 manage_heater(); // Update temperatures 2083a: 0f 94 63 38 call 0x270c6 ; 0x270c6 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 2083e: 8c e8 ldi r24, 0x8C ; 140 20840: 9f e0 ldi r25, 0x0F ; 15 20842: 0f 94 23 dc call 0x3b846 ; 0x3b846 20846: 08 2f mov r16, r24 20848: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 2084c: 80 90 ee 04 lds r8, 0x04EE ; 0x8004ee 20850: 90 90 ef 04 lds r9, 0x04EF ; 0x8004ef 20854: a0 90 f0 04 lds r10, 0x04F0 ; 0x8004f0 20858: 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)); 2085c: 8b e8 ldi r24, 0x8B ; 139 2085e: 9f e0 ldi r25, 0x0F ; 15 20860: 0f 94 23 dc call 0x3b846 ; 0x3b846 20864: 68 2f mov r22, r24 20866: 70 e0 ldi r23, 0x00 ; 0 20868: 90 e0 ldi r25, 0x00 ; 0 2086a: 80 e0 ldi r24, 0x00 ; 0 2086c: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 20870: 20 e0 ldi r18, 0x00 ; 0 20872: 30 e0 ldi r19, 0x00 ; 0 20874: 40 ea ldi r20, 0xA0 ; 160 20876: 50 e4 ldi r21, 0x40 ; 64 20878: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2087c: 6b 01 movw r12, r22 2087e: 7c 01 movw r14, r24 20880: 11 e0 ldi r17, 0x01 ; 1 20882: ac 01 movw r20, r24 20884: 9b 01 movw r18, r22 20886: c5 01 movw r24, r10 20888: b4 01 movw r22, r8 2088a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2088e: 18 16 cp r1, r24 20890: 0c f0 brlt .+2 ; 0x20894 20892: 10 e0 ldi r17, 0x00 ; 0 20894: 10 93 ed 04 sts 0x04ED, r17 ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.531> if (uvlo_auto_recovery_ready){ 20898: a7 01 movw r20, r14 2089a: 96 01 movw r18, r12 2089c: c5 01 movw r24, r10 2089e: b4 01 movw r22, r8 208a0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 208a4: 18 16 cp r1, r24 208a6: 0c f0 brlt .+2 ; 0x208aa 208a8: 58 c0 rjmp .+176 ; 0x2095a #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 208aa: 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); 208ac: 0f 94 07 5c call 0x2b80e ; 0x2b80e printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 208b0: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 208b2: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 208b4: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 208b8: 81 60 ori r24, 0x01 ; 1 208ba: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 208be: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 208c2: 8d 7f andi r24, 0xFD ; 253 208c4: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 208c8: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 208ca: 64 99 sbic 0x0c, 4 ; 12 208cc: 57 c0 rjmp .+174 ; 0x2097c 208ce: 0e 94 82 67 call 0xcf04 ; 0xcf04 208d2: 88 23 and r24, r24 208d4: 09 f4 brne .+2 ; 0x208d8 208d6: 52 c0 rjmp .+164 ; 0x2097c { SERIAL_ECHOLNRPGM(MSG_INT4); 208d8: 89 e1 ldi r24, 0x19 ; 25 208da: 9e e8 ldi r25, 0x8E ; 142 208dc: 0e 94 82 79 call 0xf304 ; 0xf304 uvlo_drain_reset(); 208e0: 0f 94 23 5f call 0x2be46 ; 0x2be46 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)); 208e4: 82 e1 ldi r24, 0x12 ; 18 208e6: 9d e4 ldi r25, 0x4D ; 77 208e8: 0e 94 b3 72 call 0xe566 ; 0xe566 208ec: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 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); 208f0: 6c e2 ldi r22, 0x2C ; 44 208f2: 71 e0 ldi r23, 0x01 ; 1 208f4: 8e ee ldi r24, 0xEE ; 238 208f6: 9e e0 ldi r25, 0x0E ; 14 208f8: 0f 94 81 dc call 0x3b902 ; 0x3b902 208fc: c4 ce rjmp .-632 ; 0x20686 // 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); 208fe: 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) { 20900: f1 10 cpse r15, r1 20902: 3d cf rjmp .-390 ; 0x2077e // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 20904: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 20908: 81 11 cpse r24, r1 2090a: 07 c0 rjmp .+14 ; 0x2091a // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 2090c: 84 e2 ldi r24, 0x24 ; 36 2090e: 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)); 20910: 0e 94 b3 72 call 0xe566 ; 0xe566 20914: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 20918: 34 cf rjmp .-408 ; 0x20782 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)) { 2091a: 84 e0 ldi r24, 0x04 ; 4 2091c: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 20920: 81 11 cpse r24, r1 20922: 03 c0 rjmp .+6 ; 0x2092a // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 20924: 8c ea ldi r24, 0xAC ; 172 20926: 9b e4 ldi r25, 0x4B ; 75 20928: f3 cf rjmp .-26 ; 0x20910 } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 2092a: 80 e1 ldi r24, 0x10 ; 16 2092c: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 20930: 81 11 cpse r24, r1 20932: 06 c0 rjmp .+12 ; 0x20940 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 20934: 84 e4 ldi r24, 0x44 ; 68 20936: 9a e5 ldi r25, 0x5A ; 90 20938: 0e 94 b3 72 call 0xe566 ; 0xe566 2093c: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 20940: 88 e0 ldi r24, 0x08 ; 8 20942: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 20946: 81 11 cpse r24, r1 20948: 1c cf rjmp .-456 ; 0x20782 2094a: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 2094e: 88 23 and r24, r24 20950: 09 f4 brne .+2 ; 0x20954 20952: 17 cf rjmp .-466 ; 0x20782 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 20954: 88 e8 ldi r24, 0x88 ; 136 20956: 9b e4 ldi r25, 0x4B ; 75 20958: db cf rjmp .-74 ; 0x20910 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) { 2095a: 01 30 cpi r16, 0x01 ; 1 2095c: 11 f4 brne .+4 ; 0x20962 recover_print(0); 2095e: 80 e0 ldi r24, 0x00 ; 0 20960: a5 cf rjmp .-182 ; 0x208ac } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 20962: 84 e6 ldi r24, 0x64 ; 100 20964: 9b e4 ldi r25, 0x4B ; 75 20966: 0e 94 b3 72 call 0xe566 ; 0xe566 2096a: 41 e0 ldi r20, 0x01 ; 1 2096c: 60 e0 ldi r22, 0x00 ; 0 2096e: 0f 94 47 4f call 0x29e8e ; 0x29e8e if ( btn == LCD_LEFT_BUTTON_CHOICE) { 20972: 88 23 and r24, r24 20974: a1 f3 breq .-24 ; 0x2095e recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 20976: 0e 94 b4 64 call 0xc968 ; 0xc968 2097a: 9a cf rjmp .-204 ; 0x208b0 ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 2097c: 61 e0 ldi r22, 0x01 ; 1 2097e: 88 ea ldi r24, 0xA8 ; 168 20980: 9d e0 ldi r25, 0x0D ; 13 20982: 0e 94 10 76 call 0xec20 ; 0xec20 20986: 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); 2098a: 68 e2 ldi r22, 0x28 ; 40 2098c: 87 ea ldi r24, 0xA7 ; 167 2098e: 9d e0 ldi r25, 0x0D ; 13 20990: 0e 94 10 76 call 0xec20 ; 0xec20 20994: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 20998: 60 e9 ldi r22, 0x90 ; 144 2099a: 71 e0 ldi r23, 0x01 ; 1 2099c: 85 ea ldi r24, 0xA5 ; 165 2099e: 9d e0 ldi r25, 0x0D ; 13 209a0: 0e 94 f8 75 call 0xebf0 ; 0xebf0 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 209a4: 61 e0 ldi r22, 0x01 ; 1 209a6: 84 ea ldi r24, 0xA4 ; 164 209a8: 9d e0 ldi r25, 0x0D ; 13 209aa: 0e 94 10 76 call 0xec20 ; 0xec20 209ae: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 209b2: 61 e0 ldi r22, 0x01 ; 1 209b4: 83 ea ldi r24, 0xA3 ; 163 209b6: 9d e0 ldi r25, 0x0D ; 13 209b8: 0e 94 10 76 call 0xec20 ; 0xec20 209bc: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 209c0: 61 e0 ldi r22, 0x01 ; 1 209c2: 82 ea ldi r24, 0xA2 ; 162 209c4: 9d e0 ldi r25, 0x0D ; 13 209c6: 0e 94 10 76 call 0xec20 ; 0xec20 209ca: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 209ce: 61 e0 ldi r22, 0x01 ; 1 209d0: 80 e2 ldi r24, 0x20 ; 32 209d2: 9c e0 ldi r25, 0x0C ; 12 209d4: 0e 94 10 76 call 0xec20 ; 0xec20 209d8: 80 93 e7 04 sts 0x04E7, r24 ; 0x8004e7 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 209dc: 81 e0 ldi r24, 0x01 ; 1 209de: 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" ); 209e2: 88 e1 ldi r24, 0x18 ; 24 209e4: 98 e2 ldi r25, 0x28 ; 40 209e6: 0f b6 in r0, 0x3f ; 63 209e8: f8 94 cli 209ea: a8 95 wdr 209ec: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 209f0: 0f be out 0x3f, r0 ; 63 209f2: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 209f6: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 209fa: 80 64 ori r24, 0x40 ; 64 209fc: 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; 20a00: 85 e0 ldi r24, 0x05 ; 5 20a02: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 20a04: 00 e0 ldi r16, 0x00 ; 0 20a06: 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); 20a08: cc 24 eor r12, r12 20a0a: 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); 20a0c: 94 e0 ldi r25, 0x04 ; 4 20a0e: 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; 20a10: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac if(Stopped) { 20a14: 80 91 11 05 lds r24, 0x0511 ; 0x800511 20a18: 88 23 and r24, r24 20a1a: 09 f4 brne .+2 ; 0x20a1e 20a1c: c4 c0 rjmp .+392 ; 0x20ba6 // 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); 20a1e: 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. 20a22: 0e 94 8c 67 call 0xcf18 ; 0xcf18 20a26: 88 23 and r24, r24 20a28: 09 f4 brne .+2 ; 0x20a2c 20a2a: c0 c0 rjmp .+384 ; 0x20bac 20a2c: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 20a30: 81 30 cpi r24, 0x01 ; 1 20a32: 09 f0 breq .+2 ; 0x20a36 20a34: bb c0 rjmp .+374 ; 0x20bac usb_timer.start(); 20a36: 8e e0 ldi r24, 0x0E ; 14 20a38: 95 e0 ldi r25, 0x05 ; 5 20a3a: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> } else #endif { get_command(); 20a3e: 0e 94 27 83 call 0x1064e ; 0x1064e // 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) 20a42: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> 20a46: 88 23 and r24, r24 20a48: 89 f0 breq .+34 ; 0x20a6c return; if(autostart_atmillis.expired(5000)) 20a4a: 68 e8 ldi r22, 0x88 ; 136 20a4c: 73 e1 ldi r23, 0x13 ; 19 20a4e: 81 ea ldi r24, 0xA1 ; 161 20a50: 97 e1 ldi r25, 0x17 ; 23 20a52: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 20a56: 81 11 cpse r24, r1 20a58: 09 c0 rjmp .+18 ; 0x20a6c return; } autostart_stilltocheck = false; 20a5a: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.551> if(!mounted) 20a5e: 80 91 91 14 lds r24, 0x1491 ; 0x801491 20a62: 88 23 and r24, r24 20a64: 09 f4 brne .+2 ; 0x20a68 20a66: ae c0 rjmp .+348 ; 0x20bc4 20a68: 0f 94 be 75 call 0x2eb7c ; 0x2eb7c #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 20a6c: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20a70: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20a74: 89 2b or r24, r25 20a76: 09 f4 brne .+2 ; 0x20a7a 20a78: 61 c0 rjmp .+194 ; 0x20b3c { cmdbuffer_front_already_processed = false; 20a7a: 10 92 a2 10 sts 0x10A2, r1 ; 0x8010a2 #ifdef SDSUPPORT if(card.saving) 20a7e: 80 91 8e 14 lds r24, 0x148E ; 0x80148e 20a82: 88 23 and r24, r24 20a84: d1 f1 breq .+116 ; 0x20afa { // 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) { 20a86: 80 91 92 12 lds r24, 0x1292 ; 0x801292 20a8a: 90 91 93 12 lds r25, 0x1293 ; 0x801293 20a8e: dc 01 movw r26, r24 20a90: a8 55 subi r26, 0x58 ; 88 20a92: bf 4e sbci r27, 0xEF ; 239 20a94: 7d 01 movw r14, r26 20a96: 69 eb ldi r22, 0xB9 ; 185 20a98: 7e e8 ldi r23, 0x8E ; 142 20a9a: cd 01 movw r24, r26 20a9c: 0f 94 2a da call 0x3b454 ; 0x3b454 20aa0: 89 2b or r24, r25 20aa2: 09 f0 breq .+2 ; 0x20aa6 20aa4: 9c c0 rjmp .+312 ; 0x20bde else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 20aa6: 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)); 20aaa: f7 01 movw r30, r14 20aac: 01 90 ld r0, Z+ 20aae: 00 20 and r0, r0 20ab0: e9 f7 brne .-6 ; 0x20aac 20ab2: 31 97 sbiw r30, 0x01 ; 1 20ab4: bf 01 movw r22, r30 20ab6: 6e 19 sub r22, r14 20ab8: 7f 09 sbc r23, r15 20aba: c7 01 movw r24, r14 20abc: 0f 94 67 83 call 0x306ce ; 0x306ce 20ac0: 62 e0 ldi r22, 0x02 ; 2 20ac2: 70 e0 ldi r23, 0x00 ; 0 20ac4: 87 ef ldi r24, 0xF7 ; 247 20ac6: 92 e0 ldi r25, 0x02 ; 2 20ac8: 0f 94 67 83 call 0x306ce ; 0x306ce file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20acc: 80 91 20 17 lds r24, 0x1720 ; 0x801720 20ad0: 88 23 and r24, r24 20ad2: 41 f0 breq .+16 ; 0x20ae4 { SERIAL_ERROR_START; 20ad4: 88 ea ldi r24, 0xA8 ; 168 20ad6: 9b ea ldi r25, 0xAB ; 171 20ad8: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20adc: 83 e9 ldi r24, 0x93 ; 147 20ade: 9d e6 ldi r25, 0x6D ; 109 20ae0: 0e 94 82 79 call 0xf304 ; 0xf304 card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20ae4: 80 91 8f 14 lds r24, 0x148F ; 0x80148f 20ae8: 88 23 and r24, r24 20aea: 09 f4 brne .+2 ; 0x20aee 20aec: 73 c0 rjmp .+230 ; 0x20bd4 */ void process_commands() { if (!buflen) return; //empty command 20aee: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20af2: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20af6: 89 2b or r24, r25 20af8: 11 f0 breq .+4 ; 0x20afe 20afa: 0e 94 82 95 call 0x12b04 ; 0x12b04 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20afe: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 20b02: 81 11 cpse r24, r1 20b04: 19 c0 rjmp .+50 ; 0x20b38 20b06: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 20b0a: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 20b0e: 89 2b or r24, r25 20b10: 99 f0 breq .+38 ; 0x20b38 { // 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; 20b12: e0 91 92 12 lds r30, 0x1292 ; 0x801292 20b16: f0 91 93 12 lds r31, 0x1293 ; 0x801293 20b1a: eb 55 subi r30, 0x5B ; 91 20b1c: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20b1e: 80 81 ld r24, Z 20b20: 82 30 cpi r24, 0x02 ; 2 20b22: 09 f0 breq .+2 ; 0x20b26 20b24: 6b c0 rjmp .+214 ; 0x20bfc { // 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(); 20b26: 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; 20b28: 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); 20b2a: 81 81 ldd r24, Z+1 ; 0x01 20b2c: 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); 20b2e: 0f 94 4d 63 call 0x2c69a ; 0x2c69a sei(); 20b32: 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(); 20b34: 0e 94 c3 76 call 0xed86 ; 0xed86 } host_keepalive(); 20b38: 0e 94 ae 7f call 0xff5c ; 0xff5c } } //check heater every n milliseconds manage_heater(); 20b3c: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(printingIsPaused()); 20b40: 0e 94 8c 67 call 0xcf18 ; 0xcf18 20b44: 0e 94 b6 8a call 0x1156c ; 0x1156c //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20b48: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> 20b4c: 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; 20b4e: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> checkHitEndstops(); lcd_update(0); 20b52: 80 e0 ldi r24, 0x00 ; 0 20b54: 0e 94 ae 6e call 0xdd5c ; 0xdd5c #ifdef TMC2130 tmc2130_check_overtemp(); 20b58: 0f 94 ee 29 call 0x253dc ; 0x253dc if (tmc2130_sg_crash) 20b5c: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 20b60: 88 23 and r24, r24 20b62: 79 f0 breq .+30 ; 0x20b82 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20b64: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d // crashdet_stop_and_save_print(); switch (crash) 20b68: 82 30 cpi r24, 0x02 ; 2 20b6a: 09 f4 brne .+2 ; 0x20b6e 20b6c: 53 c0 rjmp .+166 ; 0x20c14 20b6e: 83 30 cpi r24, 0x03 ; 3 20b70: 09 f4 brne .+2 ; 0x20b74 20b72: 54 c0 rjmp .+168 ; 0x20c1c 20b74: 81 30 cpi r24, 0x01 ; 1 20b76: 29 f4 brne .+10 ; 0x20b82 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20b78: 61 e0 ldi r22, 0x01 ; 1 20b7a: 89 ea ldi r24, 0xA9 ; 169 20b7c: 9e e8 ldi r25, 0x8E ; 142 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20b7e: 0e 94 27 88 call 0x1104e ; 0x1104e 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) { 20b82: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 20b86: 81 11 cpse r24, r1 20b88: 07 c0 rjmp .+14 ; 0x20b98 return; } avoidRecursion = true; 20b8a: c0 92 0c 05 sts 0x050C, r12 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> mmu_loop_inner(true); 20b8e: 81 e0 ldi r24, 0x01 ; 1 20b90: 0f 94 09 a7 call 0x34e12 ; 0x34e12 avoidRecursion = false; 20b94: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.540> 20b98: 01 15 cp r16, r1 20b9a: 11 05 cpc r17, r1 20b9c: 09 f4 brne .+2 ; 0x20ba0 20b9e: 38 cf rjmp .-400 ; 0x20a10 20ba0: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20ba4: 35 cf rjmp .-406 ; 0x20a10 // 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); 20ba6: c0 92 be 02 sts 0x02BE, r12 ; 0x8002be 20baa: 3b cf rjmp .-394 ; 0x20a22 } 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. 20bac: 60 e1 ldi r22, 0x10 ; 16 20bae: 77 e2 ldi r23, 0x27 ; 39 20bb0: 8e e0 ldi r24, 0x0E ; 14 20bb2: 95 e0 ldi r25, 0x05 ; 5 20bb4: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 20bb8: 88 23 and r24, r24 20bba: 09 f4 brne .+2 ; 0x20bbe 20bbc: 40 cf rjmp .-384 ; 0x20a3e 20bbe: b0 92 b8 0d sts 0x0DB8, r11 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 20bc2: 3d cf rjmp .-390 ; 0x20a3e return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20bc4: 81 e0 ldi r24, 0x01 ; 1 20bc6: 0f 94 c9 80 call 0x30192 ; 0x30192 if(!mounted) //fail 20bca: 80 91 91 14 lds r24, 0x1491 ; 0x801491 20bce: 81 11 cpse r24, r1 20bd0: 4b cf rjmp .-362 ; 0x20a68 20bd2: 4c cf rjmp .-360 ; 0x20a6c 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); 20bd4: 8b eb ldi r24, 0xBB ; 187 20bd6: 9d e6 ldi r25, 0x6D ; 109 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20bd8: 0e 94 82 79 call 0xf304 ; 0xf304 20bdc: 90 cf rjmp .-224 ; 0x20afe lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20bde: 80 e2 ldi r24, 0x20 ; 32 20be0: 97 e1 ldi r25, 0x17 ; 23 20be2: 0f 94 42 58 call 0x2b084 ; 0x2b084 file.close(); 20be6: 80 e2 ldi r24, 0x20 ; 32 20be8: 97 e1 ldi r25, 0x17 ; 23 20bea: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee saving = false; 20bee: 10 92 8e 14 sts 0x148E, r1 ; 0x80148e logging = false; 20bf2: 10 92 8f 14 sts 0x148F, r1 ; 0x80148f 20bf6: 89 ea ldi r24, 0xA9 ; 169 20bf8: 9d e6 ldi r25, 0x6D ; 109 20bfa: ee cf rjmp .-36 ; 0x20bd8 // 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){ 20bfc: 86 30 cpi r24, 0x06 ; 6 20bfe: 09 f0 breq .+2 ; 0x20c02 20c00: 99 cf rjmp .-206 ; 0x20b34 20c02: 80 91 90 14 lds r24, 0x1490 ; 0x801490 20c06: 81 11 cpse r24, r1 20c08: 95 cf rjmp .-214 ; 0x20b34 cli(); 20c0a: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20c0c: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20c0e: 81 e0 ldi r24, 0x01 ; 1 20c10: 90 e0 ldi r25, 0x00 ; 0 20c12: 8d cf rjmp .-230 ; 0x20b2e 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; 20c14: 61 e0 ldi r22, 0x01 ; 1 20c16: 89 e9 ldi r24, 0x99 ; 153 20c18: 9e e8 ldi r25, 0x8E ; 142 20c1a: b1 cf rjmp .-158 ; 0x20b7e case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20c1c: 61 e0 ldi r22, 0x01 ; 1 20c1e: 88 e8 ldi r24, 0x88 ; 136 20c20: 9e e8 ldi r25, 0x8E ; 142 20c22: ad cf rjmp .-166 ; 0x20b7e { 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; 20c24: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20c26: 86 33 cpi r24, 0x36 ; 54 20c28: 91 40 sbci r25, 0x01 ; 1 20c2a: 09 f0 breq .+2 ; 0x20c2e 20c2c: 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(); 20c2e: 0e 94 93 82 call 0x10526 ; 0x10526 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; 20c32: 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; 20c34: 82 ea ldi r24, 0xA2 ; 162 20c36: 92 ea ldi r25, 0xA2 ; 162 20c38: a0 e0 ldi r26, 0x00 ; 0 20c3a: b0 e0 ldi r27, 0x00 ; 0 20c3c: 80 93 40 18 sts 0x1840, r24 ; 0x801840 <__bss_end+0x20> 20c40: 90 93 41 18 sts 0x1841, r25 ; 0x801841 <__bss_end+0x21> 20c44: a0 93 42 18 sts 0x1842, r26 ; 0x801842 <__bss_end+0x22> 20c48: 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; 20c4c: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.468> 20c50: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.468+0x1> 20c54: 10 92 b5 04 sts 0x04B5, r1 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.468+0x2> 20c58: 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; 20c5c: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 20c60: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 20c64: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 20c68: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 20c6c: 60 e0 ldi r22, 0x00 ; 0 20c6e: 70 e0 ldi r23, 0x00 ; 0 20c70: 8f e7 ldi r24, 0x7F ; 127 20c72: 93 e4 ldi r25, 0x43 ; 67 20c74: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 20c78: 60 93 af 04 sts 0x04AF, r22 ; 0x8004af <_ZL14iState_sum_max.lto_priv.469> 20c7c: 70 93 b0 04 sts 0x04B0, r23 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x1> 20c80: 80 93 b1 04 sts 0x04B1, r24 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x2> 20c84: 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; 20c88: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.466> 20c8c: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.466+0x1> 20c90: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.466+0x2> 20c94: 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; 20c98: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 20c9c: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 20ca0: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 20ca4: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 20ca8: 60 e0 ldi r22, 0x00 ; 0 20caa: 70 e0 ldi r23, 0x00 ; 0 20cac: 8f e7 ldi r24, 0x7F ; 127 20cae: 93 e4 ldi r25, 0x43 ; 67 20cb0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 20cb4: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467> 20cb8: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 20cbc: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 20cc0: 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); 20cc4: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20cc6: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20cc8: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20ccc: 88 60 ori r24, 0x08 ; 8 20cce: 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)); 20cd2: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 20cd6: 90 e0 ldi r25, 0x00 ; 0 20cd8: b4 e0 ldi r27, 0x04 ; 4 20cda: 95 95 asr r25 20cdc: 87 95 ror r24 20cde: ba 95 dec r27 20ce0: e1 f7 brne .-8 ; 0x20cda 20ce2: 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; 20ce6: 8a e0 ldi r24, 0x0A ; 10 20ce8: 90 e0 ldi r25, 0x00 ; 0 20cea: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL8minttemp.lto_priv.461+0x1> 20cee: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL8minttemp.lto_priv.461> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20cf2: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20cf6: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20cfa: 0f 94 23 a1 call 0x34246 ; 0x34246 20cfe: 20 e0 ldi r18, 0x00 ; 0 20d00: 30 e0 ldi r19, 0x00 ; 0 20d02: 40 e2 ldi r20, 0x20 ; 32 20d04: 51 e4 ldi r21, 0x41 ; 65 20d06: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 20d0a: 87 fd sbrc r24, 7 20d0c: 02 c0 rjmp .+4 ; 0x20d12 20d0e: 0c 94 31 fe jmp 0x1fc62 ; 0x1fc62 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20d12: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20d16: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20d1a: 40 97 sbiw r24, 0x10 ; 16 20d1c: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 20d20: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 20d24: e6 cf rjmp .-52 ; 0x20cf2 00020d26 : } } void lcd_print_stop_finish(); void lcd_commands() 20d26: 2f 92 push r2 20d28: 3f 92 push r3 20d2a: 4f 92 push r4 20d2c: 5f 92 push r5 20d2e: 6f 92 push r6 20d30: 7f 92 push r7 20d32: 8f 92 push r8 20d34: 9f 92 push r9 20d36: af 92 push r10 20d38: bf 92 push r11 20d3a: cf 92 push r12 20d3c: df 92 push r13 20d3e: ef 92 push r14 20d40: ff 92 push r15 20d42: 0f 93 push r16 20d44: 1f 93 push r17 20d46: cf 93 push r28 20d48: df 93 push r29 20d4a: 00 d0 rcall .+0 ; 0x20d4c 20d4c: 1f 92 push r1 20d4e: 1f 92 push r1 20d50: cd b7 in r28, 0x3d ; 61 20d52: 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) 20d54: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20d58: 81 30 cpi r24, 0x01 ; 1 20d5a: 09 f0 breq .+2 ; 0x20d5e 20d5c: 61 c0 rjmp .+194 ; 0x20e20 20d5e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 20d62: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && !homing_flag) 20d66: 98 13 cpse r25, r24 20d68: 5b c0 rjmp .+182 ; 0x20e20 20d6a: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 20d6e: 81 11 cpse r24, r1 20d70: 57 c0 rjmp .+174 ; 0x20e20 { custom_message_type = CustomMsg::Status; 20d72: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 20d76: 8e e3 ldi r24, 0x3E ; 62 20d78: 9a e4 ldi r25, 0x4A ; 74 20d7a: 0e 94 b3 72 call 0xe566 ; 0xe566 20d7e: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 lcd_commands_type = LcdCommands::Idle; 20d82: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 20d86: 82 e0 ldi r24, 0x02 ; 2 20d88: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20d8c: 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(); 20d90: 0f 94 b8 42 call 0x28570 ; 0x28570 save_statistics(); 20d94: 0e 94 26 66 call 0xcc4c ; 0xcc4c // lift Z raise_z(10); 20d98: 60 e0 ldi r22, 0x00 ; 0 20d9a: 70 e0 ldi r23, 0x00 ; 0 20d9c: 80 e2 ldi r24, 0x20 ; 32 20d9e: 91 e4 ldi r25, 0x41 ; 65 20da0: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20da4: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20da8: 88 23 and r24, r24 20daa: 21 f1 breq .+72 ; 0x20df4 20dac: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20db0: 88 23 and r24, r24 20db2: 01 f1 breq .+64 ; 0x20df4 current_position[X_AXIS] = X_CANCEL_POS; 20db4: 80 e0 ldi r24, 0x00 ; 0 20db6: 90 e0 ldi r25, 0x00 ; 0 20db8: a8 e4 ldi r26, 0x48 ; 72 20dba: b2 e4 ldi r27, 0x42 ; 66 20dbc: 80 93 92 06 sts 0x0692, r24 ; 0x800692 20dc0: 90 93 93 06 sts 0x0693, r25 ; 0x800693 20dc4: a0 93 94 06 sts 0x0694, r26 ; 0x800694 20dc8: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = Y_CANCEL_POS; 20dcc: 80 e0 ldi r24, 0x00 ; 0 20dce: 90 e0 ldi r25, 0x00 ; 0 20dd0: ae e3 ldi r26, 0x3E ; 62 20dd2: b3 e4 ldi r27, 0x43 ; 67 20dd4: 80 93 96 06 sts 0x0696, r24 ; 0x800696 20dd8: 90 93 97 06 sts 0x0697, r25 ; 0x800697 20ddc: a0 93 98 06 sts 0x0698, r26 ; 0x800698 20de0: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 20de4: 60 e0 ldi r22, 0x00 ; 0 20de6: 70 e0 ldi r23, 0x00 ; 0 20de8: 84 e3 ldi r24, 0x34 ; 52 20dea: 92 e4 ldi r25, 0x42 ; 66 20dec: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 20df0: 0f 94 ef 42 call 0x285de ; 0x285de temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 20df4: 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()) { 20df8: 88 23 and r24, r24 20dfa: 09 f4 brne .+2 ; 0x20dfe 20dfc: c9 c0 rjmp .+402 ; 0x20f90 // time to stop the error beep WRITE(BEEPER, LOW); 20dfe: 9f b7 in r25, 0x3f ; 63 20e00: f8 94 cli 20e02: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20e06: 8b 7f andi r24, 0xFB ; 251 20e08: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20e0c: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 20e0e: 0f 94 34 2f call 0x25e68 ; 0x25e68 finishAndDisableSteppers(); //M84 20e12: 0e 94 6f 82 call 0x104de ; 0x104de axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 20e16: 88 e0 ldi r24, 0x08 ; 8 20e18: 80 93 e5 03 sts 0x03E5, r24 ; 0x8003e5 did_pause_print = false; // Clear pause state in case the print was aborted while paused 20e1c: 10 92 e4 03 sts 0x03E4, r1 ; 0x8003e4 lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 20e20: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20e24: 82 30 cpi r24, 0x02 ; 2 20e26: 09 f0 breq .+2 ; 0x20e2a 20e28: 6a c0 rjmp .+212 ; 0x20efe 20e2a: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 20e2e: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && !homing_flag) 20e32: 98 13 cpse r25, r24 20e34: 64 c0 rjmp .+200 ; 0x20efe 20e36: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 20e3a: 81 11 cpse r24, r1 20e3c: 60 c0 rjmp .+192 ; 0x20efe { if (custom_message_type != CustomMsg::M117) 20e3e: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 20e42: 87 30 cpi r24, 0x07 ; 7 20e44: 41 f0 breq .+16 ; 0x20e56 { custom_message_type = CustomMsg::Status; 20e46: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 20e4a: 8f e2 ldi r24, 0x2F ; 47 20e4c: 9a e4 ldi r25, 0x4A ; 74 20e4e: 0e 94 b3 72 call 0xe566 ; 0xe566 20e52: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 } lcd_commands_type = LcdCommands::Idle; 20e56: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 20e5a: 82 e0 ldi r24, 0x02 ; 2 20e5c: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 20e60: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 20e64: 0f 94 ef 42 call 0x285de ; 0x285de // Stop heaters heating_status = HeatingStatus::NO_HEATING; 20e68: 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; 20e6c: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 20e70: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 20e74: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 20e78: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 20e7c: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 20e80: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 20e84: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 20e88: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 20e8c: 88 23 and r24, r24 20e8e: 51 f1 breq .+84 ; 0x20ee4 20e90: 80 91 90 06 lds r24, 0x0690 ; 0x800690 20e94: 88 23 and r24, r24 20e96: 31 f1 breq .+76 ; 0x20ee4 current_position[X_AXIS] = pause_position[X_AXIS]; 20e98: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.481> 20e9c: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.481+0x1> 20ea0: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.481+0x2> 20ea4: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.481+0x3> 20ea8: 80 93 92 06 sts 0x0692, r24 ; 0x800692 20eac: 90 93 93 06 sts 0x0693, r25 ; 0x800693 20eb0: a0 93 94 06 sts 0x0694, r26 ; 0x800694 20eb4: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pause_position[Y_AXIS]; 20eb8: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.481+0x4> 20ebc: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.481+0x5> 20ec0: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.481+0x6> 20ec4: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.481+0x7> 20ec8: 80 93 96 06 sts 0x0696, r24 ; 0x800696 20ecc: 90 93 97 06 sts 0x0697, r25 ; 0x800697 20ed0: a0 93 98 06 sts 0x0698, r26 ; 0x800698 20ed4: b0 93 99 06 sts 0x0699, r27 ; 0x800699 plan_buffer_line_curposXYZE(50); 20ed8: 60 e0 ldi r22, 0x00 ; 0 20eda: 70 e0 ldi r23, 0x00 ; 0 20edc: 88 e4 ldi r24, 0x48 ; 72 20ede: 92 e4 ldi r25, 0x42 ; 66 20ee0: 0f 94 50 c0 call 0x380a0 ; 0x380a0 20ee4: 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()) { 20ee8: 88 23 and r24, r24 20eea: 09 f4 brne .+2 ; 0x20eee 20eec: 7b c0 rjmp .+246 ; 0x20fe4 // time to stop the error beep WRITE(BEEPER, LOW); 20eee: 9f b7 in r25, 0x3f ; 63 20ef0: f8 94 cli 20ef2: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20ef6: 8b 7f andi r24, 0xFB ; 251 20ef8: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20efc: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 20efe: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 20f02: 84 30 cpi r24, 0x04 ; 4 20f04: 09 f0 breq .+2 ; 0x20f08 20f06: ad c0 rjmp .+346 ; 0x21062 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 20f08: 85 ea ldi r24, 0xA5 ; 165 20f0a: 9d e0 ldi r25, 0x0D ; 13 20f0c: 0f 94 31 dc call 0x3b862 ; 0x3b862 20f10: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 20f14: 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) 20f18: 32 13 cpse r19, r18 20f1a: 7c c1 rjmp .+760 ; 0x21214 20f1c: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 20f20: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 20f24: 23 2b or r18, r19 20f26: 09 f0 breq .+2 ; 0x20f2a 20f28: 75 c1 rjmp .+746 ; 0x21214 20f2a: 20 91 a9 0d lds r18, 0x0DA9 ; 0x800da9 20f2e: 29 83 std Y+1, r18 ; 0x01 20f30: 21 11 cpse r18, r1 20f32: 70 c1 rjmp .+736 ; 0x21214 { if (lcd_commands_step == 0) 20f34: 20 91 fb 03 lds r18, 0x03FB ; 0x8003fb 20f38: 21 11 cpse r18, r1 20f3a: 57 c0 rjmp .+174 ; 0x20fea lcd_commands_step = 12; 20f3c: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 20f3e: 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; 20f42: 44 96 adiw r24, 0x14 ; 20 20f44: bc 01 movw r22, r24 20f46: 90 e0 ldi r25, 0x00 ; 0 20f48: 80 e0 ldi r24, 0x00 ; 0 20f4a: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 20f4e: 20 e0 ldi r18, 0x00 ; 0 20f50: 30 e0 ldi r19, 0x00 ; 0 20f52: 4a e7 ldi r20, 0x7A ; 122 20f54: 54 e4 ldi r21, 0x44 ; 68 20f56: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 20f5a: 6b 01 movw r12, r22 20f5c: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 20f5e: e0 91 fb 03 lds r30, 0x03FB ; 0x8003fb 20f62: e1 50 subi r30, 0x01 ; 1 20f64: ec 30 cpi r30, 0x0C ; 12 20f66: 08 f0 brcs .+2 ; 0x20f6a 20f68: 7c c0 rjmp .+248 ; 0x21062 20f6a: f0 e0 ldi r31, 0x00 ; 0 20f6c: 88 27 eor r24, r24 20f6e: e4 54 subi r30, 0x44 ; 68 20f70: f8 4f sbci r31, 0xF8 ; 248 20f72: 8e 4f sbci r24, 0xFE ; 254 20f74: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 20f78: 02 3a cpi r16, 0xA2 ; 162 20f7a: 2e 3a cpi r18, 0xAE ; 174 20f7c: 3e 39 cpi r19, 0x9E ; 158 20f7e: ce 39 cpi r28, 0x9E ; 158 20f80: 3e 3a cpi r19, 0xAE ; 174 20f82: ce 3a cpi r28, 0xAE ; 174 20f84: 90 39 cpi r25, 0x90 ; 144 20f86: f8 3a cpi r31, 0xA8 ; 168 20f88: 46 39 cpi r20, 0x96 ; 150 20f8a: 12 3b cpi r17, 0xB2 ; 178 20f8c: 26 3a cpi r18, 0xA6 ; 166 20f8e: 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; 20f90: 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(); 20f94: 0e 94 e8 74 call 0xe9d0 ; 0xe9d0 setExtruderAutoFanState(1); 20f98: 81 e0 ldi r24, 0x01 ; 1 20f9a: 0e 94 62 75 call 0xeac4 ; 0xeac4 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 20f9e: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 20fa2: 81 30 cpi r24, 0x01 ; 1 20fa4: 09 f0 breq .+2 ; 0x20fa8 20fa6: 33 cf rjmp .-410 ; 0x20e0e fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 20fa8: 80 91 90 13 lds r24, 0x1390 ; 0x801390 20fac: 88 23 and r24, r24 20fae: 09 f4 brne .+2 ; 0x20fb2 20fb0: 2e cf rjmp .-420 ; 0x20e0e #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 20fb2: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 20fb6: 82 30 cpi r24, 0x02 ; 2 20fb8: 09 f4 brne .+2 ; 0x20fbc 20fba: 29 cf rjmp .-430 ; 0x20e0e #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()) 20fbc: 0e 94 8c 67 call 0xcf18 ; 0xcf18 20fc0: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 20fc2: 0e 94 d0 64 call 0xc9a0 ; 0xc9a0 } // 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) { 20fc6: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 20fca: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 20fce: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 20fd2: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 20fd6: 28 17 cp r18, r24 20fd8: 39 07 cpc r19, r25 20fda: 0c f4 brge .+2 ; 0x20fde 20fdc: 18 cf rjmp .-464 ; 0x20e0e MMU2::mmu2.unload(); // M702 20fde: 0f 94 44 ad call 0x35a88 ; 0x35a88 20fe2: 15 cf rjmp .-470 ; 0x20e0e } else { // Turn off the print fan fanSpeed = 0; 20fe4: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 20fe8: 8a cf rjmp .-236 ; 0x20efe if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 20fea: 21 50 subi r18, 0x01 ; 1 20fec: a8 cf rjmp .-176 ; 0x20f3e preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 20fee: 65 e0 ldi r22, 0x05 ; 5 20ff0: 82 e5 ldi r24, 0x52 ; 82 20ff2: 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]))); 20ff4: 0e 94 a6 88 call 0x1114c ; 0x1114c 20ff8: 34 c0 rjmp .+104 ; 0x21062 //! @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()) 20ffa: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 20ffe: 81 30 cpi r24, 0x01 ; 1 21000: 69 f5 brne .+90 ; 0x2105c { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 21002: 30 91 fa 03 lds r19, 0x03FA ; 0x8003fa 21006: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 21008: 61 e0 ldi r22, 0x01 ; 1 2100a: 80 ee ldi r24, 0xE0 ; 224 2100c: 9b e6 ldi r25, 0x6B ; 107 2100e: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommand_P(PSTR("G1 Y-3 F1000")); 21012: 61 e0 ldi r22, 0x01 ; 1 21014: 85 e4 ldi r24, 0x45 ; 69 21016: 9b e8 ldi r25, 0x8B ; 139 21018: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommand_P(PSTR("G1 Z0.4 F1000")); 2101c: 61 e0 ldi r22, 0x01 ; 1 2101e: 87 e3 ldi r24, 0x37 ; 55 21020: 9b e8 ldi r25, 0x8B ; 139 21022: 0e 94 27 88 call 0x1104e ; 0x1104e uint8_t currentTool = MMU2::mmu2.get_current_tool(); 21026: 0f 94 c0 74 call 0x2e980 ; 0x2e980 if(currentTool == filament ){ 2102a: 9b 81 ldd r25, Y+3 ; 0x03 2102c: 98 17 cp r25, r24 2102e: b1 f0 breq .+44 ; 0x2105c // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 21030: 8f 3f cpi r24, 0xFF ; 255 21032: 29 f0 breq .+10 ; 0x2103e // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 21034: 61 e0 ldi r22, 0x01 ; 1 21036: 8b ed ldi r24, 0xDB ; 219 21038: 9b e6 ldi r25, 0x6B ; 107 2103a: 0e 94 27 88 call 0x1104e ; 0x1104e } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 2103e: 1f 92 push r1 21040: 2b 81 ldd r18, Y+3 ; 0x03 21042: 2f 93 push r18 21044: 83 e3 ldi r24, 0x33 ; 51 21046: 9b e8 ldi r25, 0x8B ; 139 21048: 9f 93 push r25 2104a: 8f 93 push r24 2104c: 0e 94 bd 88 call 0x1117a ; 0x1117a 21050: 0f 90 pop r0 21052: 0f 90 pop r0 21054: 0f 90 pop r0 21056: 0f 90 pop r0 return true; 21058: 31 e0 ldi r19, 0x01 ; 1 2105a: 39 83 std Y+1, r19 ; 0x01 2105c: 89 81 ldd r24, Y+1 ; 0x01 2105e: 80 93 f9 03 sts 0x03F9, r24 ; 0x8003f9 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21062: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21066: 83 30 cpi r24, 0x03 ; 3 21068: 09 f0 breq .+2 ; 0x2106c 2106a: d4 c0 rjmp .+424 ; 0x21214 if (lcd_commands_step == 0) { 2106c: 90 91 fb 03 lds r25, 0x03FB ; 0x8003fb 21070: 91 11 cpse r25, r1 21072: 09 c0 rjmp .+18 ; 0x21086 custom_message_type = CustomMsg::PidCal; 21074: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 custom_message_state = 1; 21078: 91 e0 ldi r25, 0x01 ; 1 2107a: 90 93 f7 03 sts 0x03F7, r25 ; 0x8003f7 lcd_draw_update = 3; 2107e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21082: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 21086: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 2108a: 83 30 cpi r24, 0x03 ; 3 2108c: 19 f5 brne .+70 ; 0x210d4 2108e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21092: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 21096: 98 13 cpse r25, r24 21098: 1d c0 rjmp .+58 ; 0x210d4 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 2109a: 0f 94 1f 2f call 0x25e3e ; 0x25e3e pid_tuning_finished = false; 2109e: 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); 210a2: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 210a6: 8f 93 push r24 210a8: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 210ac: 8f 93 push r24 210ae: 8d ed ldi r24, 0xDD ; 221 210b0: 9b e8 ldi r25, 0x8B ; 139 210b2: 9f 93 push r25 210b4: 8f 93 push r24 210b6: 0e 94 bd 88 call 0x1117a ; 0x1117a lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 210ba: 84 e2 ldi r24, 0x24 ; 36 210bc: 9a e4 ldi r25, 0x4A ; 74 210be: 0e 94 b3 72 call 0xe566 ; 0xe566 210c2: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 lcd_commands_step = 2; 210c6: 82 e0 ldi r24, 0x02 ; 2 210c8: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 210cc: 0f 90 pop r0 210ce: 0f 90 pop r0 210d0: 0f 90 pop r0 210d2: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 210d4: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 210d8: 82 30 cpi r24, 0x02 ; 2 210da: 09 f0 breq .+2 ; 0x210de 210dc: 7c c0 rjmp .+248 ; 0x211d6 210de: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 210e2: 88 23 and r24, r24 210e4: 09 f4 brne .+2 ; 0x210e8 210e6: 77 c0 rjmp .+238 ; 0x211d6 custom_message_state = 0; 210e8: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 210ec: 80 e1 ldi r24, 0x10 ; 16 210ee: 9a e4 ldi r25, 0x4A ; 74 210f0: 0e 94 b3 72 call 0xe566 ; 0xe566 210f4: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 210f8: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 210fc: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 21100: 30 91 f3 03 lds r19, 0x03F3 ; 0x8003f3 <_Kp> 21104: 39 83 std Y+1, r19 ; 0x01 21106: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 <_Kp+0x1> 2110a: 8b 83 std Y+3, r24 ; 0x03 2110c: 10 91 f5 03 lds r17, 0x03F5 ; 0x8003f5 <_Kp+0x2> 21110: 00 91 f6 03 lds r16, 0x03F6 ; 0x8003f6 <_Kp+0x3> 21114: 20 e0 ldi r18, 0x00 ; 0 21116: 30 e0 ldi r19, 0x00 ; 0 21118: a9 01 movw r20, r18 2111a: b9 81 ldd r27, Y+1 ; 0x01 2111c: f8 01 movw r30, r16 2111e: 6b 2f mov r22, r27 21120: 78 2f mov r23, r24 21122: 8f 2f mov r24, r31 21124: 9e 2f mov r25, r30 21126: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2112a: 81 11 cpse r24, r1 2112c: 1f c0 rjmp .+62 ; 0x2116c 2112e: 20 e0 ldi r18, 0x00 ; 0 21130: 30 e0 ldi r19, 0x00 ; 0 21132: a9 01 movw r20, r18 21134: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Ki> 21138: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Ki+0x1> 2113c: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 21140: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Ki+0x3> 21144: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 21148: 81 11 cpse r24, r1 2114a: 10 c0 rjmp .+32 ; 0x2116c 2114c: 20 e0 ldi r18, 0x00 ; 0 2114e: 30 e0 ldi r19, 0x00 ; 0 21150: a9 01 movw r20, r18 21152: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Kd> 21156: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Kd+0x1> 2115a: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 2115e: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Kd+0x3> 21162: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 21166: 88 23 and r24, r24 21168: 09 f4 brne .+2 ; 0x2116c 2116a: 5a c2 rjmp .+1204 ; 0x21620 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 2116c: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Kd+0x3> 21170: 8f 93 push r24 21172: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 21176: 8f 93 push r24 21178: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Kd+0x1> 2117c: 8f 93 push r24 2117e: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Kd> 21182: 8f 93 push r24 21184: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 <_Ki+0x3> 21188: 8f 93 push r24 2118a: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 2118e: 8f 93 push r24 21190: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 <_Ki+0x1> 21194: 8f 93 push r24 21196: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_Ki> 2119a: 8f 93 push r24 2119c: 0f 93 push r16 2119e: 1f 93 push r17 211a0: 9b 81 ldd r25, Y+3 ; 0x03 211a2: 9f 93 push r25 211a4: 29 81 ldd r18, Y+1 ; 0x01 211a6: 2f 93 push r18 211a8: 86 ec ldi r24, 0xC6 ; 198 211aa: 9b e8 ldi r25, 0x8B ; 139 211ac: 9f 93 push r25 211ae: 8f 93 push r24 211b0: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommand_P(MSG_M500); 211b4: 61 e0 ldi r22, 0x01 ; 1 211b6: 8a ee ldi r24, 0xEA ; 234 211b8: 9b e6 ldi r25, 0x6B ; 107 211ba: 0e 94 27 88 call 0x1104e ; 0x1104e 211be: 0f b6 in r0, 0x3f ; 63 211c0: f8 94 cli 211c2: de bf out 0x3e, r29 ; 62 211c4: 0f be out 0x3f, r0 ; 63 211c6: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 211c8: 88 ee ldi r24, 0xE8 ; 232 211ca: 93 e0 ldi r25, 0x03 ; 3 211cc: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> lcd_commands_step = 1; 211d0: 81 e0 ldi r24, 0x01 ; 1 211d2: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 211d6: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 211da: 81 30 cpi r24, 0x01 ; 1 211dc: d9 f4 brne .+54 ; 0x21214 211de: 60 ed ldi r22, 0xD0 ; 208 211e0: 77 e0 ldi r23, 0x07 ; 7 211e2: 88 ee ldi r24, 0xE8 ; 232 211e4: 93 e0 ldi r25, 0x03 ; 3 211e6: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 211ea: 88 23 and r24, r24 211ec: 99 f0 breq .+38 ; 0x21214 lcd_setstatuspgm(MSG_WELCOME); 211ee: 83 e7 ldi r24, 0x73 ; 115 211f0: 90 e7 ldi r25, 0x70 ; 112 211f2: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 custom_message_type = CustomMsg::Status; 211f6: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 pid_temp = DEFAULT_PID_TEMP; 211fa: 82 ed ldi r24, 0xD2 ; 210 211fc: 90 e0 ldi r25, 0x00 ; 0 211fe: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 21202: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.441> lcd_commands_step = 0; 21206: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 2120a: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 2120e: 82 e0 ldi r24, 0x02 ; 2 21210: 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()) 21214: 90 91 b4 0d lds r25, 0x0DB4 ; 0x800db4 21218: 95 30 cpi r25, 0x05 ; 5 2121a: a1 f4 brne .+40 ; 0x21244 2121c: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 21220: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 21224: 23 2b or r18, r19 21226: 09 f0 breq .+2 ; 0x2122a 21228: 4b c2 rjmp .+1174 ; 0x216c0 { switch (lcd_commands_step) 2122a: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 2122e: 82 30 cpi r24, 0x02 ; 2 21230: 09 f4 brne .+2 ; 0x21234 21232: 1f c2 rjmp .+1086 ; 0x21672 21234: 08 f0 brcs .+2 ; 0x21238 21236: f9 c1 rjmp .+1010 ; 0x2162a 21238: 88 23 and r24, r24 2123a: 09 f4 brne .+2 ; 0x2123e 2123c: 0a c2 rjmp .+1044 ; 0x21652 2123e: 81 30 cpi r24, 0x01 ; 1 21240: 09 f4 brne .+2 ; 0x21244 21242: 22 c2 rjmp .+1092 ; 0x21688 break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21244: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21248: 86 30 cpi r24, 0x06 ; 6 2124a: 09 f0 breq .+2 ; 0x2124e 2124c: 39 c2 rjmp .+1138 ; 0x216c0 2124e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21252: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21256: 98 13 cpse r25, r24 21258: 33 c2 rjmp .+1126 ; 0x216c0 2125a: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 2125e: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 21262: 89 2b or r24, r25 21264: 09 f0 breq .+2 ; 0x21268 21266: 2c c2 rjmp .+1112 ; 0x216c0 21268: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2126c: 81 11 cpse r24, r1 2126e: 28 c2 rjmp .+1104 ; 0x216c0 #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) 21270: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 21274: 81 30 cpi r24, 0x01 ; 1 21276: 09 f4 brne .+2 ; 0x2127a 21278: 4e c2 rjmp .+1180 ; 0x21716 2127a: 08 f4 brcc .+2 ; 0x2127e 2127c: 1e c2 rjmp .+1084 ; 0x216ba 2127e: 82 30 cpi r24, 0x02 ; 2 21280: 09 f4 brne .+2 ; 0x21284 21282: 36 c2 rjmp .+1132 ; 0x216f0 21284: 83 30 cpi r24, 0x03 ; 3 21286: 09 f0 breq .+2 ; 0x2128a 21288: 1b c2 rjmp .+1078 ; 0x216c0 #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 2128a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 2128e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 21292: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 21296: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2129a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2129e: 69 32 cpi r22, 0x29 ; 41 212a0: 71 05 cpc r23, r1 212a2: 7c f0 brlt .+30 ; 0x212c2 fanSpeed = 255; //turn on fan 212a4: 9f ef ldi r25, 0xFF ; 255 212a6: 90 93 e7 03 sts 0x03E7, r25 ; 0x8003e7 disable_heater(); 212aa: 0f 94 1f 2f call 0x25e3e ; 0x25e3e uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_COOLDOWN), true, LCD_LEFT_BUTTON_CHOICE); 212ae: 8c ee ldi r24, 0xEC ; 236 212b0: 99 e4 ldi r25, 0x49 ; 73 212b2: 0e 94 b3 72 call 0xe566 ; 0xe566 212b6: 40 e0 ldi r20, 0x00 ; 0 212b8: 61 e0 ldi r22, 0x01 ; 1 212ba: 0f 94 47 4f call 0x29e8e ; 0x29e8e if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 212be: 81 30 cpi r24, 0x01 ; 1 212c0: 21 f7 brne .-56 ; 0x2128a break; } } enquecommand_P(G28W); //home 212c2: 61 e0 ldi r22, 0x01 ; 1 212c4: 84 ee ldi r24, 0xE4 ; 228 212c6: 9b e6 ldi r25, 0x6B ; 107 212c8: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center 212cc: 61 e0 ldi r22, 0x01 ; 1 212ce: 83 e6 ldi r24, 0x63 ; 99 212d0: 9b e8 ldi r25, 0x8B ; 139 212d2: 0e 94 27 88 call 0x1104e ; 0x1104e #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 212d6: 82 e0 ldi r24, 0x02 ; 2 212d8: f1 c1 rjmp .+994 ; 0x216bc break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 212da: 0e 94 1a 6f call 0xde34 ; 0xde34 menu_depth = 0; 212de: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_babystep_z, true); 212e2: 61 e0 ldi r22, 0x01 ; 1 212e4: 86 ee ldi r24, 0xE6 ; 230 212e6: 99 e3 ldi r25, 0x39 ; 57 212e8: 0f 94 0a d3 call 0x3a614 ; 0x3a614 cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 212ec: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 212f0: 81 30 cpi r24, 0x01 ; 1 212f2: f1 f4 brne .+60 ; 0x21330 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 212f4: 80 91 f9 03 lds r24, 0x03F9 ; 0x8003f9 212f8: 10 e0 ldi r17, 0x00 ; 0 212fa: 81 11 cpse r24, r1 212fc: 01 c0 rjmp .+2 ; 0x21300 212fe: 12 e0 ldi r17, 0x02 ; 2 21300: 21 2f mov r18, r17 21302: 30 e0 ldi r19, 0x00 ; 0 21304: 22 0f add r18, r18 21306: 33 1f adc r19, r19 21308: 21 5e subi r18, 0xE1 ; 225 2130a: 34 47 sbci r19, 0x74 ; 116 2130c: 3a 83 std Y+2, r19 ; 0x02 2130e: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 21310: e9 81 ldd r30, Y+1 ; 0x01 21312: fa 81 ldd r31, Y+2 ; 0x02 21314: 85 91 lpm r24, Z+ 21316: 94 91 lpm r25, Z 21318: 61 e0 ldi r22, 0x01 ; 1 2131a: 0e 94 27 88 call 0x1104e ; 0x1104e 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) 2131e: 1f 5f subi r17, 0xFF ; 255 21320: 89 81 ldd r24, Y+1 ; 0x01 21322: 9a 81 ldd r25, Y+2 ; 0x02 21324: 02 96 adiw r24, 0x02 ; 2 21326: 9a 83 std Y+2, r25 ; 0x02 21328: 89 83 std Y+1, r24 ; 0x01 2132a: 1a 30 cpi r17, 0x0A ; 10 2132c: 89 f7 brne .-30 ; 0x21310 2132e: 99 ce rjmp .-718 ; 0x21062 } } 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)); 21330: 20 e0 ldi r18, 0x00 ; 0 21332: 30 e0 ldi r19, 0x00 ; 0 21334: 40 e8 ldi r20, 0x80 ; 128 21336: 50 e4 ldi r21, 0x40 ; 64 21338: c7 01 movw r24, r14 2133a: b6 01 movw r22, r12 2133c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 21340: 20 e0 ldi r18, 0x00 ; 0 21342: 30 e0 ldi r19, 0x00 ; 0 21344: 40 e7 ldi r20, 0x70 ; 112 21346: 52 e4 ldi r21, 0x42 ; 66 21348: 0f 94 c8 86 call 0x30d90 ; 0x30d90 2134c: 9f 93 push r25 2134e: 8f 93 push r24 21350: 7f 93 push r23 21352: 6f 93 push r22 21354: 1f 92 push r1 21356: 8c e3 ldi r24, 0x3C ; 60 21358: 8f 93 push r24 2135a: 2b e0 ldi r18, 0x0B ; 11 2135c: 3b e8 ldi r19, 0x8B ; 139 2135e: 3f 93 push r19 21360: 2f 93 push r18 21362: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 21366: 20 e0 ldi r18, 0x00 ; 0 21368: 30 e0 ldi r19, 0x00 ; 0 2136a: 40 e0 ldi r20, 0x00 ; 0 2136c: 51 e4 ldi r21, 0x41 ; 65 2136e: c7 01 movw r24, r14 21370: b6 01 movw r22, r12 21372: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 21376: 20 e0 ldi r18, 0x00 ; 0 21378: 30 e0 ldi r19, 0x00 ; 0 2137a: 40 e2 ldi r20, 0x20 ; 32 2137c: 52 e4 ldi r21, 0x42 ; 66 2137e: 0f 94 c8 86 call 0x30d90 ; 0x30d90 21382: 9f 93 push r25 21384: 8f 93 push r24 21386: 7f 93 push r23 21388: 6f 93 push r22 2138a: 1f 92 push r1 2138c: 84 e6 ldi r24, 0x64 ; 100 2138e: 8f 93 push r24 21390: 2b e0 ldi r18, 0x0B ; 11 21392: 3b e8 ldi r19, 0x8B ; 139 21394: 3f 93 push r19 21396: 2f 93 push r18 21398: 0e 94 bd 88 call 0x1117a ; 0x1117a 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)); 2139c: 0f b6 in r0, 0x3f ; 63 2139e: f8 94 cli 213a0: de bf out 0x3e, r29 ; 62 213a2: 0f be out 0x3f, r0 ; 63 213a4: cd bf out 0x3d, r28 ; 61 213a6: 5d ce rjmp .-838 ; 0x21062 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]))); 213a8: 67 e0 ldi r22, 0x07 ; 7 213aa: 8d ef ldi r24, 0xFD ; 253 213ac: 9a e8 ldi r25, 0x8A ; 138 213ae: 22 ce rjmp .-956 ; 0x20ff4 } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 213b0: 61 e0 ldi r22, 0x01 ; 1 213b2: 81 ef ldi r24, 0xF1 ; 241 213b4: 9a e8 ldi r25, 0x8A ; 138 213b6: 0e 94 27 88 call 0x1104e ; 0x1104e static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 213ba: 8e e3 ldi r24, 0x3E ; 62 213bc: 8f 93 push r24 213be: 8c e4 ldi r24, 0x4C ; 76 213c0: 8f 93 push r24 213c2: 8c ec ldi r24, 0xCC ; 204 213c4: 8f 93 push r24 213c6: 8d ec ldi r24, 0xCD ; 205 213c8: 8f 93 push r24 213ca: 81 ee ldi r24, 0xE1 ; 225 213cc: 9a e8 ldi r25, 0x8A ; 138 213ce: 9f 93 push r25 213d0: 8f 93 push r24 213d2: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommand_P(PSTR("G1 F1080")); 213d6: 61 e0 ldi r22, 0x01 ; 1 213d8: 88 ed ldi r24, 0xD8 ; 216 213da: 9a e8 ldi r25, 0x8A ; 138 213dc: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 213e0: 20 e0 ldi r18, 0x00 ; 0 213e2: 30 e0 ldi r19, 0x00 ; 0 213e4: 40 e8 ldi r20, 0x80 ; 128 213e6: 50 e4 ldi r21, 0x40 ; 64 213e8: c7 01 movw r24, r14 213ea: b6 01 movw r22, r12 213ec: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 213f0: 20 e0 ldi r18, 0x00 ; 0 213f2: 30 e0 ldi r19, 0x00 ; 0 213f4: 48 ec ldi r20, 0xC8 ; 200 213f6: 51 e4 ldi r21, 0x41 ; 65 213f8: 0f 94 c8 86 call 0x30d90 ; 0x30d90 213fc: 9f 93 push r25 213fe: 8f 93 push r24 21400: 7f 93 push r23 21402: 6f 93 push r22 21404: 1f 92 push r1 21406: 1b e9 ldi r17, 0x9B ; 155 21408: 1f 93 push r17 2140a: 1f 92 push r1 2140c: 8b e4 ldi r24, 0x4B ; 75 2140e: 8f 93 push r24 21410: 86 ec ldi r24, 0xC6 ; 198 21412: 9a e8 ldi r25, 0x8A ; 138 21414: 9f 93 push r25 21416: 8f 93 push r24 21418: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 2141c: a7 01 movw r20, r14 2141e: 96 01 movw r18, r12 21420: c7 01 movw r24, r14 21422: b6 01 movw r22, r12 21424: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 21428: 20 e0 ldi r18, 0x00 ; 0 2142a: 30 e0 ldi r19, 0x00 ; 0 2142c: 48 ec ldi r20, 0xC8 ; 200 2142e: 51 e4 ldi r21, 0x41 ; 65 21430: 0f 94 c8 86 call 0x30d90 ; 0x30d90 21434: 9f 93 push r25 21436: 8f 93 push r24 21438: 7f 93 push r23 2143a: 6f 93 push r22 2143c: 1f 92 push r1 2143e: 1f 93 push r17 21440: 1f 92 push r1 21442: 84 e6 ldi r24, 0x64 ; 100 21444: 8f 93 push r24 21446: 86 ec ldi r24, 0xC6 ; 198 21448: 9a e8 ldi r25, 0x8A ; 138 2144a: 9f 93 push r25 2144c: 8f 93 push r24 2144e: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 21452: 20 e0 ldi r18, 0x00 ; 0 21454: 30 e0 ldi r19, 0x00 ; 0 21456: 48 ec ldi r20, 0xC8 ; 200 21458: 52 e4 ldi r21, 0x42 ; 66 2145a: c7 01 movw r24, r14 2145c: b6 01 movw r22, r12 2145e: 0f 94 c8 86 call 0x30d90 ; 0x30d90 21462: 9f 93 push r25 21464: 8f 93 push r24 21466: 7f 93 push r23 21468: 6f 93 push r22 2146a: 1f 92 push r1 2146c: 1f 93 push r17 2146e: 1f 92 push r1 21470: 18 ec ldi r17, 0xC8 ; 200 21472: 1f 93 push r17 21474: 86 ec ldi r24, 0xC6 ; 198 21476: 9a e8 ldi r25, 0x8A ; 138 21478: 9f 93 push r25 2147a: 8f 93 push r24 2147c: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 21480: 0f b6 in r0, 0x3f ; 63 21482: f8 94 cli 21484: de bf out 0x3e, r29 ; 62 21486: 0f be out 0x3f, r0 ; 63 21488: cd bf out 0x3d, r28 ; 61 2148a: 20 e0 ldi r18, 0x00 ; 0 2148c: 30 e0 ldi r19, 0x00 ; 0 2148e: 40 ea ldi r20, 0xA0 ; 160 21490: 51 e4 ldi r21, 0x41 ; 65 21492: c7 01 movw r24, r14 21494: b6 01 movw r22, r12 21496: 0f 94 c8 86 call 0x30d90 ; 0x30d90 2149a: 9f 93 push r25 2149c: 8f 93 push r24 2149e: 7f 93 push r23 214a0: 6f 93 push r22 214a2: 1f 92 push r1 214a4: 87 e8 ldi r24, 0x87 ; 135 214a6: 8f 93 push r24 214a8: 1f 92 push r1 214aa: 1f 93 push r17 214ac: 26 ec ldi r18, 0xC6 ; 198 214ae: 3a e8 ldi r19, 0x8A ; 138 214b0: 3f 93 push r19 214b2: 2f 93 push r18 214b4: 0e 94 bd 88 call 0x1117a ; 0x1117a 214b8: 71 cf rjmp .-286 ; 0x2139c //! @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); 214ba: 20 e0 ldi r18, 0x00 ; 0 214bc: 30 e0 ldi r19, 0x00 ; 0 214be: 46 e1 ldi r20, 0x16 ; 22 214c0: 53 e4 ldi r21, 0x43 ; 67 214c2: c7 01 movw r24, r14 214c4: b6 01 movw r22, r12 214c6: 0f 94 c8 86 call 0x30d90 ; 0x30d90 214ca: 56 2e mov r5, r22 214cc: 47 2e mov r4, r23 214ce: 38 2e mov r3, r24 214d0: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 214d2: 20 e0 ldi r18, 0x00 ; 0 214d4: 30 e0 ldi r19, 0x00 ; 0 214d6: 40 ea ldi r20, 0xA0 ; 160 214d8: 51 e4 ldi r21, 0x41 ; 65 214da: c7 01 movw r24, r14 214dc: b6 01 movw r22, r12 214de: 0f 94 c8 86 call 0x30d90 ; 0x30d90 214e2: 6b 83 std Y+3, r22 ; 0x03 214e4: c7 2e mov r12, r23 214e6: 78 2e mov r7, r24 214e8: 69 2e mov r6, r25 214ea: 85 e0 ldi r24, 0x05 ; 5 214ec: 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; 214ee: 81 2c mov r8, r1 214f0: 91 2c mov r9, r1 214f2: 96 e1 ldi r25, 0x16 ; 22 214f4: a9 2e mov r10, r25 214f6: 93 e4 ldi r25, 0x43 ; 67 214f8: 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; 214fa: 32 e3 ldi r19, 0x32 ; 50 214fc: 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; 214fe: 87 e8 ldi r24, 0x87 ; 135 21500: 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); 21502: 06 ec ldi r16, 0xC6 ; 198 21504: 1a e8 ldi r17, 0x8A ; 138 21506: 9d 81 ldd r25, Y+5 ; 0x05 21508: e9 2e mov r14, r25 2150a: f1 2c mov r15, r1 2150c: 3c 81 ldd r19, Y+4 ; 0x04 2150e: 23 2f mov r18, r19 21510: 30 e0 ldi r19, 0x00 ; 0 21512: 3a 83 std Y+2, r19 ; 0x02 21514: 29 83 std Y+1, r18 ; 0x01 21516: 2f 92 push r2 21518: 3f 92 push r3 2151a: 4f 92 push r4 2151c: 5f 92 push r5 2151e: 1f 92 push r1 21520: 9f 93 push r25 21522: 1f 92 push r1 21524: 8c 81 ldd r24, Y+4 ; 0x04 21526: 8f 93 push r24 21528: 1f 93 push r17 2152a: 0f 93 push r16 2152c: 0e 94 bd 88 call 0x1117a ; 0x1117a y_pos -= short_length; 21530: b7 01 movw r22, r14 21532: ff 0c add r15, r15 21534: 88 0b sbc r24, r24 21536: 99 0b sbc r25, r25 21538: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2153c: 20 e0 ldi r18, 0x00 ; 0 2153e: 30 e0 ldi r19, 0x00 ; 0 21540: 40 ea ldi r20, 0xA0 ; 160 21542: 51 e4 ldi r21, 0x41 ; 65 21544: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 21548: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 2154c: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 2154e: 6f 92 push r6 21550: 7f 92 push r7 21552: cf 92 push r12 21554: 9b 81 ldd r25, Y+3 ; 0x03 21556: 9f 93 push r25 21558: 1f 92 push r1 2155a: 2d 81 ldd r18, Y+5 ; 0x05 2155c: 2f 93 push r18 2155e: 1f 92 push r1 21560: 3c 81 ldd r19, Y+4 ; 0x04 21562: 3f 93 push r19 21564: 1f 93 push r17 21566: 0f 93 push r16 21568: 0e 94 bd 88 call 0x1117a ; 0x1117a x_pos += long_length; 2156c: 29 81 ldd r18, Y+1 ; 0x01 2156e: 3a 81 ldd r19, Y+2 ; 0x02 21570: b9 01 movw r22, r18 21572: 33 0f add r19, r19 21574: 88 0b sbc r24, r24 21576: 99 0b sbc r25, r25 21578: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2157c: a5 01 movw r20, r10 2157e: 94 01 movw r18, r8 21580: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 21584: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 21588: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 2158a: b7 fa bst r11, 7 2158c: b0 94 com r11 2158e: b7 f8 bld r11, 7 21590: b0 94 com r11 21592: 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) 21594: 0f b6 in r0, 0x3f ; 63 21596: f8 94 cli 21598: de bf out 0x3e, r29 ; 62 2159a: 0f be out 0x3f, r0 ; 63 2159c: cd bf out 0x3d, r28 ; 61 2159e: d1 10 cpse r13, r1 215a0: b2 cf rjmp .-156 ; 0x21506 215a2: 5f cd rjmp .-1346 ; 0x21062 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 215a4: b7 01 movw r22, r14 215a6: a6 01 movw r20, r12 215a8: 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); 215aa: 0f 94 ef 86 call 0x30dde ; 0x30dde 215ae: 59 cd rjmp .-1358 ; 0x21062 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 215b0: b7 01 movw r22, r14 215b2: a6 01 movw r20, r12 215b4: 84 e0 ldi r24, 0x04 ; 4 215b6: f9 cf rjmp .-14 ; 0x215aa break; case 4: lay1cal_square(8, layer_height, extrusion_width); 215b8: b7 01 movw r22, r14 215ba: a6 01 movw r20, r12 215bc: 88 e0 ldi r24, 0x08 ; 8 215be: f5 cf rjmp .-22 ; 0x215aa break; case 3: lay1cal_square(12, layer_height, extrusion_width); 215c0: b7 01 movw r22, r14 215c2: a6 01 movw r20, r12 215c4: 8c e0 ldi r24, 0x0C ; 12 215c6: f1 cf rjmp .-30 ; 0x215aa 215c8: 90 91 ba 13 lds r25, 0x13BA ; 0x8013ba 215cc: 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]))); 215ce: 66 e0 ldi r22, 0x06 ; 6 215d0: 8a eb ldi r24, 0xBA ; 186 215d2: 9a e8 ldi r25, 0x8A ; 138 215d4: 0e 94 a6 88 call 0x1114c ; 0x1114c if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 215d8: 29 81 ldd r18, Y+1 ; 0x01 215da: 21 30 cpi r18, 0x01 ; 1 215dc: 29 f4 brne .+10 ; 0x215e8 215de: 61 e0 ldi r22, 0x01 ; 1 215e0: 8b ed ldi r24, 0xDB ; 219 215e2: 9b e6 ldi r25, 0x6B ; 107 215e4: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommand_P(MSG_M84);// disable motors 215e8: 61 e0 ldi r22, 0x01 ; 1 215ea: 87 ed ldi r24, 0xD7 ; 215 215ec: 9b e6 ldi r25, 0x6B ; 107 215ee: 0e 94 27 88 call 0x1104e ; 0x1104e 215f2: 37 cd rjmp .-1426 ; 0x21062 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 215f4: 83 e7 ldi r24, 0x73 ; 115 215f6: 90 e7 ldi r25, 0x70 ; 112 215f8: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 lcd_commands_step = 0; 215fc: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 21600: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 21604: 82 e0 ldi r24, 0x02 ; 2 21606: 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)) 2160a: 8f e5 ldi r24, 0x5F ; 95 2160c: 9f e0 ldi r25, 0x0F ; 15 2160e: 0f 94 23 dc call 0x3b846 ; 0x3b846 21612: 88 23 and r24, r24 21614: 09 f4 brne .+2 ; 0x21618 21616: fe cd rjmp .-1028 ; 0x21214 lcd_wizard(WizState::RepeatLay1Cal); 21618: 8c e0 ldi r24, 0x0C ; 12 2161a: 0e 94 02 f9 call 0x1f204 ; 0x1f204 2161e: 21 cd rjmp .-1470 ; 0x21062 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."); 21620: 86 e9 ldi r24, 0x96 ; 150 21622: 9b e8 ldi r25, 0x8B ; 139 21624: 0e 94 57 77 call 0xeeae ; 0xeeae 21628: cf cd rjmp .-1122 ; 0x211c8 } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 2162a: 84 30 cpi r24, 0x04 ; 4 2162c: a9 f0 breq .+42 ; 0x21658 2162e: c0 f0 brcs .+48 ; 0x21660 21630: 85 30 cpi r24, 0x05 ; 5 21632: 09 f0 breq .+2 ; 0x21636 21634: 07 ce rjmp .-1010 ; 0x21244 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 21636: 61 e0 ldi r22, 0x01 ; 1 21638: 84 ee ldi r24, 0xE4 ; 228 2163a: 9b e6 ldi r25, 0x6B ; 107 2163c: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 21640: 61 e0 ldi r22, 0x01 ; 1 21642: 80 e8 ldi r24, 0x80 ; 128 21644: 9b e8 ldi r25, 0x8B ; 139 21646: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_commands_step = 4; 2164a: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 2164c: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb 21650: f9 cd rjmp .-1038 ; 0x21244 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 21652: 90 93 fb 03 sts 0x03FB, r25 ; 0x8003fb 21656: ef cf rjmp .-34 ; 0x21636 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 21658: 0f 94 ef 42 call 0x285de ; 0x285de lcd_commands_step = 3; 2165c: 83 e0 ldi r24, 0x03 ; 3 2165e: f6 cf rjmp .-20 ; 0x2164c SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 21660: 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")); 21664: 61 e0 ldi r22, 0x01 ; 1 21666: 86 e7 ldi r24, 0x76 ; 118 21668: 9b e8 ldi r25, 0x8B ; 139 2166a: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_commands_step = 2; 2166e: 82 e0 ldi r24, 0x02 ; 2 21670: ed cf rjmp .-38 ; 0x2164c break; case 2: if (thermal_model_autotune_result()) 21672: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 21676: 81 11 cpse r24, r1 21678: 05 c0 rjmp .+10 ; 0x21684 enquecommand_P(MSG_M500); 2167a: 61 e0 ldi r22, 0x01 ; 1 2167c: 8a ee ldi r24, 0xEA ; 234 2167e: 9b e6 ldi r25, 0x6B ; 107 21680: 0e 94 27 88 call 0x1104e ; 0x1104e lcd_commands_step = 1; 21684: 81 e0 ldi r24, 0x01 ; 1 21686: e2 cf rjmp .-60 ; 0x2164c break; case 1: lcd_commands_step = 0; 21688: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 2168c: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 21690: 92 e0 ldi r25, 0x02 ; 2 21692: 90 93 b8 0d sts 0x0DB8, r25 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 21696: 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)) { 2169a: 8f e5 ldi r24, 0x5F ; 95 2169c: 9f e0 ldi r25, 0x0F ; 15 2169e: 0f 94 23 dc call 0x3b846 ; 0x3b846 216a2: 88 23 and r24, r24 216a4: 69 f0 breq .+26 ; 0x216c0 // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 216a6: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.536> 216aa: 81 11 cpse r24, r1 216ac: 04 c0 rjmp .+8 ; 0x216b6 216ae: 81 e0 ldi r24, 0x01 ; 1 216b0: 0e 94 02 f9 call 0x1f204 ; 0x1f204 216b4: c7 cd rjmp .-1138 ; 0x21244 216b6: 8e e0 ldi r24, 0x0E ; 14 216b8: fb cf rjmp .-10 ; 0x216b0 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 216ba: 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; 216bc: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb menu_depth = 3; break; } } } } 216c0: 0f 90 pop r0 216c2: 0f 90 pop r0 216c4: 0f 90 pop r0 216c6: 0f 90 pop r0 216c8: 0f 90 pop r0 216ca: df 91 pop r29 216cc: cf 91 pop r28 216ce: 1f 91 pop r17 216d0: 0f 91 pop r16 216d2: ff 90 pop r15 216d4: ef 90 pop r14 216d6: df 90 pop r13 216d8: cf 90 pop r12 216da: bf 90 pop r11 216dc: af 90 pop r10 216de: 9f 90 pop r9 216e0: 8f 90 pop r8 216e2: 7f 90 pop r7 216e4: 6f 90 pop r6 216e6: 5f 90 pop r5 216e8: 4f 90 pop r4 216ea: 3f 90 pop r3 216ec: 2f 90 pop r2 216ee: 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")); 216f0: 61 e0 ldi r22, 0x01 ; 1 216f2: 8c e5 ldi r24, 0x5C ; 92 216f4: 9b e8 ldi r25, 0x8B ; 139 216f6: 0e 94 27 88 call 0x1104e ; 0x1104e if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 216fa: 8a ed ldi r24, 0xDA ; 218 216fc: 99 e4 ldi r25, 0x49 ; 73 216fe: 0e 94 b3 72 call 0xe566 ; 0xe566 21702: 41 e0 ldi r20, 0x01 ; 1 21704: 60 e0 ldi r22, 0x00 ; 0 21706: 0f 94 47 4f call 0x29e8e ; 0x29e8e 2170a: 81 11 cpse r24, r1 2170c: d9 cf rjmp .-78 ; 0x216c0 setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan 2170e: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 21712: 81 e0 ldi r24, 0x01 ; 1 21714: d3 cf rjmp .-90 ; 0x216bc } break; case 1: lcd_commands_step = 0; 21716: 10 92 fb 03 sts 0x03FB, r1 ; 0x8003fb lcd_commands_type = LcdCommands::Idle; 2171a: 10 92 b4 0d sts 0x0DB4, r1 ; 0x800db4 2171e: 82 e0 ldi r24, 0x02 ; 2 21720: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 21724: 20 e0 ldi r18, 0x00 ; 0 21726: 41 e0 ldi r20, 0x01 ; 1 21728: 62 e0 ldi r22, 0x02 ; 2 2172a: 70 e0 ldi r23, 0x00 ; 0 2172c: 81 ec ldi r24, 0xC1 ; 193 2172e: 91 ed ldi r25, 0xD1 ; 209 21730: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e menu_depth = 3; 21734: 83 e0 ldi r24, 0x03 ; 3 21736: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 2173a: c2 cf rjmp .-124 ; 0x216c0 0002173c : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 2173c: 0f 93 push r16 2173e: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 21740: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 21744: 80 95 com r24 21746: 81 70 andi r24, 0x01 ; 1 21748: 90 91 12 04 lds r25, 0x0412 ; 0x800412 2174c: 89 17 cp r24, r25 2174e: a1 f1 breq .+104 ; 0x217b8 { if(menu_menu == lcd_sdcard_menu) { 21750: 80 91 13 04 lds r24, 0x0413 ; 0x800413 21754: 90 91 14 04 lds r25, 0x0414 ; 0x800414 21758: 85 57 subi r24, 0x75 ; 117 2175a: 91 4f sbci r25, 0xF1 ; 241 2175c: 11 f4 brne .+4 ; 0x21762 // 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(); 2175e: 0f 94 65 d4 call 0x3a8ca ; 0x3a8ca } lcd_draw_update = 2; 21762: 82 e0 ldi r24, 0x02 ; 2 21764: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 21768: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2176c: 80 95 com r24 2176e: 81 70 andi r24, 0x01 ; 1 21770: 80 93 12 04 sts 0x0412, r24 ; 0x800412 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 21774: 0e 94 93 6f call 0xdf26 ; 0xdf26 backlight_wake(); 21778: 80 e0 ldi r24, 0x00 ; 0 2177a: 0e 94 74 8a call 0x114e8 ; 0x114e8 if (lcd_oldcardstatus) 2177e: 80 91 12 04 lds r24, 0x0412 ; 0x800412 21782: 88 23 and r24, r24 21784: 09 f4 brne .+2 ; 0x21788 21786: 71 c0 rjmp .+226 ; 0x2186a { if (!card.mounted) 21788: 80 91 91 14 lds r24, 0x1491 ; 0x801491 2178c: 81 11 cpse r24, r1 2178e: 05 c0 rjmp .+10 ; 0x2179a { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 21790: 0f 94 c9 80 call 0x30192 ; 0x30192 card.presort_flag = true; //force sorting of the SD menu 21794: 81 e0 ldi r24, 0x01 ; 1 21796: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df } LCD_MESSAGERPGM(MSG_WELCOME); 2179a: 83 e7 ldi r24, 0x73 ; 115 2179c: 90 e7 ldi r25, 0x70 ; 112 2179e: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 217a2: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 menu_submenu(lcd_sdcard_menu, true); 217a6: 61 e0 ldi r22, 0x01 ; 1 217a8: 85 e7 ldi r24, 0x75 ; 117 217aa: 91 ef ldi r25, 0xF1 ; 241 217ac: 0f 94 0a d3 call 0x3a614 ; 0x3a614 lcd_timeoutToStatus.start(); 217b0: 8c ed ldi r24, 0xDC ; 220 217b2: 93 e0 ldi r25, 0x03 ; 3 217b4: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 217b8: 0f 94 53 29 call 0x252a6 ; 0x252a6 217bc: 00 91 d8 03 lds r16, 0x03D8 ; 0x8003d8 217c0: 10 91 d9 03 lds r17, 0x03D9 ; 0x8003d9 217c4: 20 91 da 03 lds r18, 0x03DA ; 0x8003da 217c8: 30 91 db 03 lds r19, 0x03DB ; 0x8003db 217cc: 06 17 cp r16, r22 217ce: 17 07 cpc r17, r23 217d0: 28 07 cpc r18, r24 217d2: 39 07 cpc r19, r25 217d4: e8 f5 brcc .+122 ; 0x21850 { if (lcd_draw_update) { 217d6: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 217da: 88 23 and r24, r24 217dc: 31 f0 breq .+12 ; 0x217ea lcd_timeoutToStatus.start(); 217de: 8c ed ldi r24, 0xDC ; 220 217e0: 93 e0 ldi r25, 0x03 ; 3 217e2: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> lcd_frame_start(); 217e6: 0e 94 9b 6e call 0xdd36 ; 0xdd36 } (*menu_menu)(); 217ea: e0 91 13 04 lds r30, 0x0413 ; 0x800413 217ee: f0 91 14 04 lds r31, 0x0414 ; 0x800414 217f2: 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)))); 217f4: 80 91 13 04 lds r24, 0x0413 ; 0x800413 217f8: 90 91 14 04 lds r25, 0x0414 ; 0x800414 217fc: 86 5e subi r24, 0xE6 ; 230 217fe: 99 43 sbci r25, 0x39 ; 57 21800: 09 f4 brne .+2 ; 0x21804 21802: 46 c0 rjmp .+140 ; 0x21890 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 21804: 80 91 13 04 lds r24, 0x0413 ; 0x800413 21808: 90 91 14 04 lds r25, 0x0414 ; 0x800414 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 2180c: 29 e3 ldi r18, 0x39 ; 57 2180e: 88 31 cpi r24, 0x18 ; 24 21810: 92 07 cpc r25, r18 21812: 09 f0 breq .+2 ; 0x21816 21814: 5e c0 rjmp .+188 ; 0x218d2 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 21816: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2181a: 82 30 cpi r24, 0x02 ; 2 2181c: 21 f4 brne .+8 ; 0x21826 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2181e: 0e 94 93 6f call 0xdf26 ; 0xdf26 lcd_status_message_idx = 0; // Re-draw message from beginning 21822: 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--; 21826: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2182a: 88 23 and r24, r24 2182c: 19 f0 breq .+6 ; 0x21834 2182e: 81 50 subi r24, 0x01 ; 1 21830: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 21834: 0f 94 53 29 call 0x252a6 ; 0x252a6 21838: 6c 59 subi r22, 0x9C ; 156 2183a: 7f 4f sbci r23, 0xFF ; 255 2183c: 8f 4f sbci r24, 0xFF ; 255 2183e: 9f 4f sbci r25, 0xFF ; 255 21840: 60 93 d8 03 sts 0x03D8, r22 ; 0x8003d8 21844: 70 93 d9 03 sts 0x03D9, r23 ; 0x8003d9 21848: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da 2184c: 90 93 db 03 sts 0x03DB, r25 ; 0x8003db } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 21850: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 21854: 84 30 cpi r24, 0x04 ; 4 21856: 09 f0 breq .+2 ; 0x2185a 21858: 53 c0 rjmp .+166 ; 0x21900 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) { 2185a: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 2185e: 81 11 cpse r24, r1 21860: 4f c0 rjmp .+158 ; 0x21900 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(); } 21862: 1f 91 pop r17 21864: 0f 91 pop r16 21866: 0d 94 93 06 jmp 0x20d26 ; 0x20d26 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 2186a: 10 92 90 14 sts 0x1490, r1 ; 0x801490 mounted = false; 2186e: 10 92 91 14 sts 0x1491, r1 ; 0x801491 SERIAL_ECHO_START; 21872: 80 ed ldi r24, 0xD0 ; 208 21874: 9b ea ldi r25, 0xAB ; 171 21876: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 2187a: 88 e9 ldi r24, 0x98 ; 152 2187c: 9b e6 ldi r25, 0x6B ; 107 2187e: 0e 94 82 79 call 0xf304 ; 0xf304 lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 21882: 8d ea ldi r24, 0xAD ; 173 21884: 99 e4 ldi r25, 0x49 ; 73 21886: 0e 94 b3 72 call 0xe566 ; 0xe566 2188a: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 2188e: 94 cf rjmp .-216 ; 0x217b8 // 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)))); 21890: 0e 94 a6 67 call 0xcf4c ; 0xcf4c 21894: 81 11 cpse r24, r1 21896: 0e c0 rjmp .+28 ; 0x218b4 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) 21898: e0 91 13 04 lds r30, 0x0413 ; 0x800413 2189c: f0 91 14 04 lds r31, 0x0414 ; 0x800414 218a0: 30 97 sbiw r30, 0x00 ; 0 218a2: 39 f5 brne .+78 ; 0x218f2 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 218a4: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_return_to_status(); 218a8: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_draw_update = 2; 218ac: 82 e0 ldi r24, 0x02 ; 2 218ae: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 218b2: b1 cf rjmp .-158 ; 0x21816 // 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)))); 218b4: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 218b8: 81 11 cpse r24, r1 218ba: a4 cf rjmp .-184 ; 0x21804 218bc: 40 e9 ldi r20, 0x90 ; 144 218be: 5f e5 ldi r21, 0x5F ; 95 218c0: 61 e0 ldi r22, 0x01 ; 1 218c2: 70 e0 ldi r23, 0x00 ; 0 218c4: 8c ed ldi r24, 0xDC ; 220 218c6: 93 e0 ldi r25, 0x03 ; 3 218c8: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 218cc: 81 11 cpse r24, r1 218ce: e4 cf rjmp .-56 ; 0x21898 218d0: 99 cf rjmp .-206 ; 0x21804 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 218d2: 86 5e subi r24, 0xE6 ; 230 218d4: 99 43 sbci r25, 0x39 ; 57 218d6: 09 f4 brne .+2 ; 0x218da 218d8: 9e cf rjmp .-196 ; 0x21816 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 218da: 40 e3 ldi r20, 0x30 ; 48 218dc: 55 e7 ldi r21, 0x75 ; 117 218de: 60 e0 ldi r22, 0x00 ; 0 218e0: 70 e0 ldi r23, 0x00 ; 0 218e2: 8c ed ldi r24, 0xDC ; 220 218e4: 93 e0 ldi r25, 0x03 ; 3 218e6: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 218ea: 88 23 and r24, r24 218ec: 09 f4 brne .+2 ; 0x218f0 218ee: 93 cf rjmp .-218 ; 0x21816 218f0: d3 cf rjmp .-90 ; 0x21898 // 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; 218f2: 81 e0 ldi r24, 0x01 ; 1 218f4: 80 93 d7 03 sts 0x03D7, r24 ; 0x8003d7 (*menu_menu)(); 218f8: 19 95 eicall menu_leaving = 0; 218fa: 10 92 d7 03 sts 0x03D7, r1 ; 0x8003d7 218fe: d2 cf rjmp .-92 ; 0x218a4 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(); } 21900: 1f 91 pop r17 21902: 0f 91 pop r16 21904: 08 95 ret 00021906 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 21906: 8f e1 ldi r24, 0x1F ; 31 21908: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 2190c: 81 11 cpse r24, r1 2190e: 06 c0 rjmp .+12 ; 0x2191c // 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); 21910: 8f e1 ldi r24, 0x1F ; 31 21912: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 lcd_wizard(WizState::Run); 21916: 80 e0 ldi r24, 0x00 ; 0 21918: 0c 94 02 f9 jmp 0x1f204 ; 0x1f204 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); 2191c: 8a ec ldi r24, 0xCA ; 202 2191e: 9b e3 ldi r25, 0x3B ; 59 21920: 0e 94 b3 72 call 0xe566 ; 0xe566 21924: 41 e0 ldi r20, 0x01 ; 1 21926: 60 e0 ldi r22, 0x00 ; 0 21928: 0f 94 47 4f call 0x29e8e ; 0x29e8e } if (result) { 2192c: 88 23 and r24, r24 2192e: 81 f3 breq .-32 ; 0x21910 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 21930: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_update_enable(true); 21934: 81 e0 ldi r24, 0x01 ; 1 21936: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_update(2); 2193a: 82 e0 ldi r24, 0x02 ; 2 2193c: 0c 94 ae 6e jmp 0xdd5c ; 0xdd5c 00021940 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 21940: cf 93 push r28 21942: 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); 21944: 8f eb ldi r24, 0xBF ; 191 21946: 9e e3 ldi r25, 0x3E ; 62 21948: 0e 94 b3 72 call 0xe566 ; 0xe566 2194c: 41 e0 ldi r20, 0x01 ; 1 2194e: 4c 27 eor r20, r28 21950: 60 e0 ldi r22, 0x00 ; 0 21952: 0f 94 47 4f call 0x29e8e ; 0x29e8e 21956: 91 e0 ldi r25, 0x01 ; 1 21958: 81 11 cpse r24, r1 2195a: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2195c: c9 17 cp r28, r25 2195e: 59 f0 breq .+22 ; 0x21976 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 21960: 85 e9 ldi r24, 0x95 ; 149 21962: 9e e3 ldi r25, 0x3E ; 62 21964: cc 23 and r28, r28 21966: 11 f0 breq .+4 ; 0x2196c 21968: 8d e1 ldi r24, 0x1D ; 29 2196a: 9a e5 ldi r25, 0x5A ; 90 2196c: 0e 94 b3 72 call 0xe566 ; 0xe566 } #endif //STEEL_SHEET } 21970: 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)); 21972: 0d 94 f8 1f jmp 0x23ff0 ; 0x23ff0 } #endif //STEEL_SHEET } 21976: cf 91 pop r28 21978: 08 95 ret 0002197a : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2197a: cf 93 push r28 2197c: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2197e: 8c e6 ldi r24, 0x6C ; 108 21980: 9e e3 ldi r25, 0x3E ; 62 21982: 0e 94 b3 72 call 0xe566 ; 0xe566 21986: 40 e0 ldi r20, 0x00 ; 0 21988: 6c 2f mov r22, r28 2198a: 0f 94 47 4f call 0x29e8e ; 0x29e8e if (result == LCD_LEFT_BUTTON_CHOICE) { 2198e: 81 11 cpse r24, r1 21990: 03 c0 rjmp .+6 ; 0x21998 lcd_mesh_calibration_z(); } } 21992: 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(); 21994: 0c 94 9c ce jmp 0x19d38 ; 0x19d38 } } 21998: cf 91 pop r28 2199a: 08 95 ret 0002199c : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 2199c: bf 92 push r11 2199e: cf 92 push r12 219a0: df 92 push r13 219a2: ef 92 push r14 219a4: ff 92 push r15 219a6: 0f 93 push r16 219a8: 1f 93 push r17 219aa: cf 93 push r28 219ac: df 93 push r29 219ae: 00 d0 rcall .+0 ; 0x219b0 219b0: 1f 92 push r1 219b2: cd b7 in r28, 0x3d ; 61 219b4: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 219b6: 8c ea ldi r24, 0xAC ; 172 219b8: 9d e0 ldi r25, 0x0D ; 13 219ba: 0f 94 23 dc call 0x3b846 ; 0x3b846 219be: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 219c0: 8b ea ldi r24, 0xAB ; 171 219c2: 9d e0 ldi r25, 0x0D ; 13 219c4: 0f 94 23 dc call 0x3b846 ; 0x3b846 219c8: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 219ca: 8a ea ldi r24, 0xAA ; 170 219cc: 9d e0 ldi r25, 0x0D ; 13 219ce: 0f 94 23 dc call 0x3b846 ; 0x3b846 219d2: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 219d4: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 219d8: 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'; 219dc: 80 e3 ldi r24, 0x30 ; 48 219de: d8 2e mov r13, r24 219e0: df 0c add r13, r15 sToggle[1] = 'x'; 219e2: 98 e7 ldi r25, 0x78 ; 120 219e4: 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'; 219e6: 20 e3 ldi r18, 0x30 ; 48 219e8: e2 2e mov r14, r18 219ea: 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(); 219ec: 80 91 12 05 lds r24, 0x0512 ; 0x800512 219f0: 84 30 cpi r24, 0x04 ; 4 219f2: 08 f0 brcs .+2 ; 0x219f6 219f4: 56 c0 rjmp .+172 ; 0x21aa2 219f6: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 219fa: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 219fe: 88 23 and r24, r24 21a00: 31 f0 breq .+12 ; 0x21a0e 21a02: 87 e0 ldi r24, 0x07 ; 7 21a04: f8 12 cpse r15, r24 21a06: 03 c0 rjmp .+6 ; 0x21a0e 21a08: 81 e0 ldi r24, 0x01 ; 1 21a0a: 0f 94 bd 0c call 0x2197a ; 0x2197a // 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)); 21a0e: 86 e4 ldi r24, 0x46 ; 70 21a10: 98 e4 ldi r25, 0x48 ; 72 21a12: 0e 94 b3 72 call 0xe566 ; 0xe566 21a16: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 sToggle[0] = points_nr + '0'; 21a1a: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 21a1c: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 21a1e: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 21a20: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 21a22: 8a ef ldi r24, 0xFA ; 250 21a24: 97 e4 ldi r25, 0x47 ; 71 21a26: 0e 94 b3 72 call 0xe566 ; 0xe566 21a2a: 20 e0 ldi r18, 0x00 ; 0 21a2c: 45 e6 ldi r20, 0x65 ; 101 21a2e: 5f ec ldi r21, 0xCF ; 207 21a30: be 01 movw r22, r28 21a32: 6f 5f subi r22, 0xFF ; 255 21a34: 7f 4f sbci r23, 0xFF ; 255 21a36: 0f 94 2c d3 call 0x3a658 ; 0x3a658 sToggle[0] = mbl_z_probe_nr + '0'; 21a3a: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 21a3c: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 21a3e: 8c ee ldi r24, 0xEC ; 236 21a40: 97 e4 ldi r25, 0x47 ; 71 21a42: 0e 94 b3 72 call 0xe566 ; 0xe566 21a46: 20 e0 ldi r18, 0x00 ; 0 21a48: 46 e5 ldi r20, 0x56 ; 86 21a4a: 5f ec ldi r21, 0xCF ; 207 21a4c: be 01 movw r22, r28 21a4e: 6f 5f subi r22, 0xFF ; 255 21a50: 7f 4f sbci r23, 0xFF ; 255 21a52: 0f 94 2c d3 call 0x3a658 ; 0x3a658 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); 21a56: 87 e0 ldi r24, 0x07 ; 7 21a58: f8 12 cpse r15, r24 21a5a: 20 c0 rjmp .+64 ; 0x21a9c 21a5c: 89 ed ldi r24, 0xD9 ; 217 21a5e: 9c e5 ldi r25, 0x5C ; 92 21a60: c1 10 cpse r12, r1 21a62: 02 c0 rjmp .+4 ; 0x21a68 21a64: 83 ed ldi r24, 0xD3 ; 211 21a66: 9c e5 ldi r25, 0x5C ; 92 21a68: 0e 94 b3 72 call 0xe566 ; 0xe566 21a6c: 8c 01 movw r16, r24 21a6e: 86 ed ldi r24, 0xD6 ; 214 21a70: 97 e4 ldi r25, 0x47 ; 71 21a72: 0e 94 b3 72 call 0xe566 ; 0xe566 21a76: 22 e0 ldi r18, 0x02 ; 2 21a78: 41 e7 ldi r20, 0x71 ; 113 21a7a: 5f ec ldi r21, 0xCF ; 207 21a7c: b8 01 movw r22, r16 21a7e: 0f 94 2c d3 call 0x3a658 ; 0x3a658 MENU_END(); 21a82: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 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(); 21a86: 90 91 12 05 lds r25, 0x0512 ; 0x800512 21a8a: 9f 5f subi r25, 0xFF ; 255 21a8c: 90 93 12 05 sts 0x0512, r25 ; 0x800512 21a90: 90 91 14 05 lds r25, 0x0514 ; 0x800514 21a94: 9f 5f subi r25, 0xFF ; 255 21a96: 90 93 14 05 sts 0x0514, r25 ; 0x800514 21a9a: a8 cf rjmp .-176 ; 0x219ec 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); 21a9c: 86 ee ldi r24, 0xE6 ; 230 21a9e: 97 e4 ldi r25, 0x47 ; 71 21aa0: e3 cf rjmp .-58 ; 0x21a68 MENU_END(); } 21aa2: 0f 90 pop r0 21aa4: 0f 90 pop r0 21aa6: 0f 90 pop r0 21aa8: 0f 90 pop r0 21aaa: df 91 pop r29 21aac: cf 91 pop r28 21aae: 1f 91 pop r17 21ab0: 0f 91 pop r16 21ab2: ff 90 pop r15 21ab4: ef 90 pop r14 21ab6: df 90 pop r13 21ab8: cf 90 pop r12 21aba: bf 90 pop r11 21abc: 08 95 ret 00021abe : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 21abe: 2f 92 push r2 21ac0: 3f 92 push r3 21ac2: 4f 92 push r4 21ac4: 5f 92 push r5 21ac6: 6f 92 push r6 21ac8: 7f 92 push r7 21aca: 8f 92 push r8 21acc: 9f 92 push r9 21ace: af 92 push r10 21ad0: bf 92 push r11 21ad2: cf 92 push r12 21ad4: df 92 push r13 21ad6: ef 92 push r14 21ad8: ff 92 push r15 21ada: 0f 93 push r16 21adc: 1f 93 push r17 21ade: cf 93 push r28 21ae0: df 93 push r29 21ae2: cd b7 in r28, 0x3d ; 61 21ae4: de b7 in r29, 0x3e ; 62 21ae6: 67 97 sbiw r28, 0x17 ; 23 21ae8: 0f b6 in r0, 0x3f ; 63 21aea: f8 94 cli 21aec: de bf out 0x3e, r29 ; 62 21aee: 0f be out 0x3f, r0 ; 63 21af0: cd bf out 0x3d, r28 ; 61 21af2: 08 2f mov r16, r24 21af4: ce 01 movw r24, r28 21af6: 46 96 adiw r24, 0x16 ; 22 21af8: 9f 8b std Y+23, r25 ; 0x17 21afa: 8e 8b std Y+22, r24 ; 0x16 21afc: 83 e0 ldi r24, 0x03 ; 3 21afe: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 21b00: 95 e1 ldi r25, 0x15 ; 21 21b02: 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 21b04: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c tool_change_extruder = slot; 21b08: 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)); 21b0c: 40 2f mov r20, r16 21b0e: 64 e5 ldi r22, 0x54 ; 84 21b10: ce 01 movw r24, r28 21b12: 01 96 adiw r24, 0x01 ; 1 21b14: 0f 94 94 c5 call 0x38b28 ; 0x38b28 21b18: 49 81 ldd r20, Y+1 ; 0x01 21b1a: 5a 81 ldd r21, Y+2 ; 0x02 21b1c: 6b 81 ldd r22, Y+3 ; 0x03 21b1e: 7c 81 ldd r23, Y+4 ; 0x04 21b20: 8d 81 ldd r24, Y+5 ; 0x05 21b22: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 21b26: 61 e0 ldi r22, 0x01 ; 1 21b28: 81 e0 ldi r24, 0x01 ; 1 21b2a: 0f 94 7d ac call 0x358fa ; 0x358fa 21b2e: 18 2f mov r17, r24 21b30: 81 11 cpse r24, r1 21b32: 07 c0 rjmp .+14 ; 0x21b42 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 21b34: 0f 94 f5 c4 call 0x389ea ; 0x389ea // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 21b38: 0f 94 1b ac call 0x35836 ; 0x35836 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 21b3c: 0f 94 0b ad call 0x35a16 ; 0x35a16 21b40: e1 cf rjmp .-62 ; 0x21b04 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21b42: 0f 94 ef 42 call 0x285de ; 0x285de } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 21b46: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 21b4a: 81 30 cpi r24, 0x01 ; 1 21b4c: 79 f1 breq .+94 ; 0x21bac // 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(); 21b4e: 0f 94 0b ad call 0x35a16 ; 0x35a16 if (retries == 2 && cutter_enabled()) { 21b52: 92 e0 ldi r25, 0x02 ; 2 21b54: f9 12 cpse r15, r25 21b56: 09 c0 rjmp .+18 ; 0x21b6a 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; 21b58: 8e ec ldi r24, 0xCE ; 206 21b5a: 9e e0 ldi r25, 0x0E ; 14 21b5c: 0f 94 23 dc call 0x3b846 ; 0x3b846 21b60: 81 30 cpi r24, 0x01 ; 1 21b62: 19 f4 brne .+6 ; 0x21b6a CutFilamentInner(slot); // try cutting filament tip at the last attempt 21b64: 80 2f mov r24, r16 21b66: 0f 94 f2 ad call 0x35be4 ; 0x35be4 21b6a: 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) { 21b6c: f1 10 cpse r15, r1 21b6e: ca cf rjmp .-108 ; 0x21b04 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()) { 21b70: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21b74: 88 23 and r24, r24 21b76: 09 f4 brne .+2 ; 0x21b7a 21b78: ef c0 rjmp .+478 ; 0x21d58 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 21b7a: 67 96 adiw r28, 0x17 ; 23 21b7c: 0f b6 in r0, 0x3f ; 63 21b7e: f8 94 cli 21b80: de bf out 0x3e, r29 ; 62 21b82: 0f be out 0x3f, r0 ; 63 21b84: cd bf out 0x3d, r28 ; 61 21b86: df 91 pop r29 21b88: cf 91 pop r28 21b8a: 1f 91 pop r17 21b8c: 0f 91 pop r16 21b8e: ff 90 pop r15 21b90: ef 90 pop r14 21b92: df 90 pop r13 21b94: cf 90 pop r12 21b96: bf 90 pop r11 21b98: af 90 pop r10 21b9a: 9f 90 pop r9 21b9c: 8f 90 pop r8 21b9e: 7f 90 pop r7 21ba0: 6f 90 pop r6 21ba2: 5f 90 pop r5 21ba4: 4f 90 pop r4 21ba6: 3f 90 pop r3 21ba8: 2f 90 pop r2 21baa: 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(); 21bac: 60 91 97 13 lds r22, 0x1397 ; 0x801397 21bb0: 70 e0 ldi r23, 0x00 ; 0 21bb2: 90 e0 ldi r25, 0x00 ; 0 21bb4: 80 e0 ldi r24, 0x00 ; 0 21bb6: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 21bba: 9b 01 movw r18, r22 21bbc: ac 01 movw r20, r24 21bbe: 66 e6 ldi r22, 0x66 ; 102 21bc0: 76 e6 ldi r23, 0x66 ; 102 21bc2: 8d e9 ldi r24, 0x9D ; 157 21bc4: 92 e4 ldi r25, 0x42 ; 66 21bc6: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 21bca: 36 2e mov r3, r22 21bcc: 87 2e mov r8, r23 21bce: 98 2e mov r9, r24 21bd0: 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)) 21bd2: 26 2f mov r18, r22 21bd4: 37 2f mov r19, r23 21bd6: 48 2f mov r20, r24 21bd8: 59 2f mov r21, r25 21bda: 60 e0 ldi r22, 0x00 ; 0 21bdc: 70 e0 ldi r23, 0x00 ; 0 21bde: 80 e2 ldi r24, 0x20 ; 32 21be0: 91 e4 ldi r25, 0x41 ; 65 21be2: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 21be6: 2b 01 movw r4, r22 21be8: 3c 01 movw r6, r24 21bea: ef e1 ldi r30, 0x1F ; 31 21bec: f5 e0 ldi r31, 0x05 ; 5 21bee: 82 2d mov r24, r2 21bf0: 11 92 st Z+, r1 21bf2: 8a 95 dec r24 21bf4: e9 f7 brne .-6 ; 0x21bf0 lcd_status_message_idx = 0; 21bf6: 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); 21bfa: 83 2d mov r24, r3 21bfc: 98 2d mov r25, r8 21bfe: a9 2d mov r26, r9 21c00: be 2d mov r27, r14 21c02: bc 01 movw r22, r24 21c04: 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++) { 21c06: 91 2c mov r9, r1 21c08: 31 2c mov r3, r1 21c0a: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 21c0c: 5b 01 movw r10, r22 21c0e: 6c 01 movw r12, r24 21c10: d7 fa bst r13, 7 21c12: d0 94 com r13 21c14: d7 f8 bld r13, 7 21c16: d0 94 com r13 21c18: 20 e0 ldi r18, 0x00 ; 0 21c1a: 30 e0 ldi r19, 0x00 ; 0 21c1c: 48 e4 ldi r20, 0x48 ; 72 21c1e: 52 e4 ldi r21, 0x42 ; 66 21c20: 0f 94 b8 c5 call 0x38b70 ; 0x38b70 21c24: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 21c28: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while (planner_any_moves()) { 21c2c: 98 17 cp r25, r24 21c2e: 09 f4 brne .+2 ; 0x21c32 21c30: 49 c0 rjmp .+146 ; 0x21cc4 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 21c32: 11 23 and r17, r17 21c34: 31 f0 breq .+12 ; 0x21c42 21c36: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 21c3a: 11 e0 ldi r17, 0x01 ; 1 21c3c: 81 30 cpi r24, 0x01 ; 1 21c3e: 09 f0 breq .+2 ; 0x21c42 21c40: 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); 21c42: 83 e0 ldi r24, 0x03 ; 3 21c44: 0f 94 db 42 call 0x285b6 ; 0x285b6 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); 21c48: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 21c4c: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 21c50: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 21c54: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 21c58: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 21c5c: a3 01 movw r20, r6 21c5e: 92 01 movw r18, r4 21c60: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 21c64: 0f 94 29 de call 0x3bc52 ; 0x3bc52 21c68: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 21c6c: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 21c6e: e6 16 cp r14, r22 21c70: c1 f0 breq .+48 ; 0x21ca2 21c72: e3 2d mov r30, r3 21c74: e4 31 cpi r30, 0x14 ; 20 21c76: 08 f0 brcs .+2 ; 0x21c7a 21c78: 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); 21c7a: 33 24 eor r3, r3 21c7c: 33 94 inc r3 21c7e: 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] : '-'); 21c80: 8f ef ldi r24, 0xFF ; 255 21c82: 11 11 cpse r17, r1 21c84: 01 c0 rjmp .+2 ; 0x21c88 21c86: 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; 21c88: f0 e0 ldi r31, 0x00 ; 0 21c8a: e1 5e subi r30, 0xE1 ; 225 21c8c: fa 4f sbci r31, 0xFA ; 250 21c8e: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 21c90: 91 e0 ldi r25, 0x01 ; 1 21c92: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 21c96: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 21c9a: 81 11 cpse r24, r1 21c9c: 02 c0 rjmp .+4 ; 0x21ca2 21c9e: 0f 94 7a 2a call 0x254f4 ; 0x254f4 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 21ca2: 90 e0 ldi r25, 0x00 ; 0 21ca4: 80 e0 ldi r24, 0x00 ; 0 21ca6: 0e 94 eb 8c call 0x119d6 ; 0x119d6 } 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); 21caa: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 21cac: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 21cb0: 88 23 and r24, r24 21cb2: 09 f4 brne .+2 ; 0x21cb6 21cb4: b7 cf rjmp .-146 ; 0x21c24 return false; // power panic or a similar issue happened, bail out fast 21cb6: 10 e0 ldi r17, 0x00 ; 0 21cb8: 37 c0 rjmp .+110 ; 0x21d28 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); 21cba: c6 01 movw r24, r12 21cbc: b5 01 movw r22, r10 21cbe: 99 24 eor r9, r9 21cc0: 93 94 inc r9 21cc2: aa cf rjmp .-172 ; 0x21c18 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++) { 21cc4: 91 e0 ldi r25, 0x01 ; 1 21cc6: 99 12 cpse r9, r25 21cc8: f8 cf rjmp .-16 ; 0x21cba return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 21cca: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c if (!filament_inserted) { 21cce: 11 11 cpse r17, r1 21cd0: 08 c0 rjmp .+16 ; 0x21ce2 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 21cd2: 8f ec ldi r24, 0xCF ; 207 21cd4: 9e e0 ldi r25, 0x0E ; 14 21cd6: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 21cda: 80 ed ldi r24, 0xD0 ; 208 21cdc: 9e e0 ldi r25, 0x0E ; 14 21cde: 0e 94 22 76 call 0xec44 ; 0xec44 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); 21ce2: 44 e1 ldi r20, 0x14 ; 20 21ce4: 50 e0 ldi r21, 0x00 ; 0 21ce6: 6f e1 ldi r22, 0x1F ; 31 21ce8: 75 e0 ldi r23, 0x05 ; 5 21cea: ce 01 movw r24, r28 21cec: 01 96 adiw r24, 0x01 ; 1 21cee: 0f 94 a3 e2 call 0x3c546 ; 0x3c546 21cf2: fe 01 movw r30, r28 21cf4: 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'; 21cf6: 81 91 ld r24, Z+ 21cf8: 87 fd sbrc r24, 7 21cfa: 2c c0 rjmp .+88 ; 0x21d54 21cfc: 80 e3 ldi r24, 0x30 ; 48 21cfe: df 01 movw r26, r30 21d00: 11 97 sbiw r26, 0x01 ; 1 21d02: 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++) { 21d04: 8e 89 ldd r24, Y+22 ; 0x16 21d06: 9f 89 ldd r25, Y+23 ; 0x17 21d08: 8e 17 cp r24, r30 21d0a: 9f 07 cpc r25, r31 21d0c: a1 f7 brne .-24 ; 0x21cf6 // 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; 21d0e: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 21d10: 80 ed ldi r24, 0xD0 ; 208 21d12: 9b ea ldi r25, 0xAB ; 171 21d14: 0e 94 57 77 call 0xeeae ; 0xeeae 21d18: 84 e1 ldi r24, 0x14 ; 20 21d1a: 9f e8 ldi r25, 0x8F ; 143 21d1c: 0e 94 57 77 call 0xeeae ; 0xeeae 21d20: ce 01 movw r24, r28 21d22: 01 96 adiw r24, 0x01 ; 1 21d24: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 21d28: 84 e3 ldi r24, 0x34 ; 52 21d2a: 95 e0 ldi r25, 0x05 ; 5 21d2c: 0f 94 f6 2b call 0x257ec ; 0x257ec ::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()) { 21d30: 11 23 and r17, r17 21d32: 09 f4 brne .+2 ; 0x21d36 21d34: 0c cf rjmp .-488 ; 0x21b4e // 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 21d36: 80 2f mov r24, r16 21d38: 0f 94 0a 88 call 0x31014 ; 0x31014 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 21d3c: 00 93 49 13 sts 0x1349, r16 ; 0x801349 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 21d40: 80 91 be 13 lds r24, 0x13BE ; 0x8013be 21d44: 90 91 bf 13 lds r25, 0x13BF ; 0x8013bf 21d48: 01 96 adiw r24, 0x01 ; 1 21d4a: 90 93 bf 13 sts 0x13BF, r25 ; 0x8013bf 21d4e: 80 93 be 13 sts 0x13BE, r24 ; 0x8013be 21d52: 13 cf rjmp .-474 ; 0x21b7a 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'; 21d54: 81 e3 ldi r24, 0x31 ; 49 21d56: d3 cf rjmp .-90 ; 0x21cfe void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 21d58: 8a e2 ldi r24, 0x2A ; 42 21d5a: 90 e8 ldi r25, 0x80 ; 128 21d5c: 90 93 4c 13 sts 0x134C, r25 ; 0x80134c 21d60: 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 21d64: 61 e0 ldi r22, 0x01 ; 1 21d66: 81 e0 ldi r24, 0x01 ; 1 21d68: 0f 94 7d ac call 0x358fa ; 0x358fa 21d6c: c7 ce rjmp .-626 ; 0x21afc 00021d6e : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 21d6e: cf 93 push r28 21d70: df 93 push r29 21d72: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21d74: 0f 94 8b 88 call 0x31116 ; 0x31116 21d78: c8 2f mov r28, r24 21d7a: 88 23 and r24, r24 21d7c: 49 f1 breq .+82 ; 0x21dd0 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 21d7e: 88 ec ldi r24, 0xC8 ; 200 21d80: 90 e0 ldi r25, 0x00 ; 0 21d82: 0f 94 3a c9 call 0x39274 ; 0x39274 (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); 21d86: 82 e0 ldi r24, 0x02 ; 2 21d88: 0f 94 0e 4e call 0x29c1c ; 0x29c1c void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 21d8c: 87 e3 ldi r24, 0x37 ; 55 21d8e: 9c e5 ldi r25, 0x5C ; 92 21d90: 0e 94 b3 72 call 0xe566 ; 0xe566 21d94: 6d 2f mov r22, r29 21d96: 0f 94 d6 c4 call 0x389ac ; 0x389ac struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21d9a: 0f 94 ff 87 call 0x30ffe ; 0x30ffe FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21d9e: 0f 94 b5 86 call 0x30d6a ; 0x30d6a if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 21da2: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 21da6: 83 36 cpi r24, 0x63 ; 99 21da8: 29 f0 breq .+10 ; 0x21db4 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 21daa: 62 e1 ldi r22, 0x12 ; 18 21dac: 89 e0 ldi r24, 0x09 ; 9 21dae: 97 ea ldi r25, 0xA7 ; 167 21db0: 0f 94 62 88 call 0x310c4 ; 0x310c4 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 21db4: 8d 2f mov r24, r29 21db6: 0f 94 5f 0d call 0x21abe ; 0x21abe // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 21dba: 0e 94 e1 cd call 0x19bc2 ; 0x19bc2 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); 21dbe: 83 e0 ldi r24, 0x03 ; 3 21dc0: 0f 94 0e 4e call 0x29c1c ; 0x29c1c #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 21dc4: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21dc8: 0f 94 80 88 call 0x31100 ; 0x31100 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 21dcc: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 return true; } 21dd0: 8c 2f mov r24, r28 21dd2: df 91 pop r29 21dd4: cf 91 pop r28 21dd6: 08 95 ret 00021dd8 : 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); 21dd8: 0f 94 b7 0e call 0x21d6e ; 0x21d6e // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 21ddc: 0e 94 9a 64 call 0xc934 ; 0xc934 st_synchronize(); 21de0: 0f 94 ef 42 call 0x285de ; 0x285de // Ask user if the extruded color is correct: lcd_return_to_status(); 21de4: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_load_filament_color_check(); 21de8: 0f 94 70 4f call 0x29ee0 ; 0x29ee0 lcd_setstatuspgm(MSG_WELCOME); 21dec: 83 e7 ldi r24, 0x73 ; 115 21dee: 90 e7 ldi r25, 0x70 ; 112 21df0: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 custom_message_type = CustomMsg::Status; 21df4: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 // Clear the filament action clearFilamentAction(); 21df8: 0d 94 9a 20 jmp 0x24134 ; 0x24134 00021dfc : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 21dfc: cf 93 push r28 21dfe: df 93 push r29 21e00: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 21e02: 0f 94 8b 88 call 0x31116 ; 0x31116 21e06: c8 2f mov r28, r24 21e08: 88 23 and r24, r24 21e0a: b9 f0 breq .+46 ; 0x21e3a return false; } if (slot != extruder) { 21e0c: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 21e10: 8d 17 cp r24, r29 21e12: 99 f0 breq .+38 ; 0x21e3a 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(); 21e14: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 if (/*FindaDetectsFilament()*/ 21e18: 81 11 cpse r24, r1 21e1a: 02 c0 rjmp .+4 ; 0x21e20 /*!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(); 21e1c: 0f 94 44 ad call 0x35a88 ; 0x35a88 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 21e20: 0f 94 ff 87 call 0x30ffe ; 0x30ffe // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 21e24: 0f 94 b5 86 call 0x30d6a ; 0x30d6a bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 21e28: 0f 94 ef 42 call 0x285de ; 0x285de planner_synchronize(); ToolChangeCommon(slot); 21e2c: 8d 2f mov r24, r29 21e2e: 0f 94 5f 0d call 0x21abe ; 0x21abe 21e32: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 21e36: 0f 94 80 88 call 0x31100 ; 0x31100 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 21e3a: 8c 2f mov r24, r28 21e3c: df 91 pop r29 21e3e: cf 91 pop r28 21e40: 08 95 ret 00021e42 : /// 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) { 21e42: 1f 93 push r17 21e44: cf 93 push r28 21e46: df 93 push r29 21e48: c8 2f mov r28, r24 21e4a: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 21e4c: 0f 94 8b 88 call 0x31116 ; 0x31116 21e50: d8 2f mov r29, r24 21e52: 88 23 and r24, r24 21e54: 89 f0 breq .+34 ; 0x21e78 return false; } FSensorBlockRunout blockRunout; 21e56: 0f 94 b5 86 call 0x30d6a ; 0x30d6a switch (code) { 21e5a: c3 36 cpi r28, 0x63 ; 99 21e5c: 01 f1 breq .+64 ; 0x21e9e 21e5e: c8 37 cpi r28, 0x78 ; 120 21e60: 81 f0 breq .+32 ; 0x21e82 21e62: cf 33 cpi r28, 0x3F ; 63 21e64: 39 f4 brne .+14 ; 0x21e74 case '?': { waitForHotendTargetTemp(100, [] {}); 21e66: 84 e6 ldi r24, 0x64 ; 100 21e68: 90 e0 ldi r25, 0x00 ; 0 21e6a: 0f 94 3a c9 call 0x39274 ; 0x39274 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> load_filament_to_nozzle(slot); 21e6e: 81 2f mov r24, r17 21e70: 0f 94 b7 0e call 0x21d6e ; 0x21d6e 21e74: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 execute_load_to_nozzle_sequence(); } break; } return true; } 21e78: 8d 2f mov r24, r29 21e7a: df 91 pop r29 21e7c: cf 91 pop r28 21e7e: 1f 91 pop r17 21e80: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 21e82: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 21e86: 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); 21e8a: 81 2f mov r24, r17 21e8c: 0f 94 fe 0e call 0x21dfc ; 0x21dfc 21e90: 8f ea ldi r24, 0xAF ; 175 21e92: 90 e0 ldi r25, 0x00 ; 0 21e94: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 21e98: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 21e9c: eb cf rjmp .-42 ; 0x21e74 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 21e9e: 84 e6 ldi r24, 0x64 ; 100 21ea0: 90 e0 ldi r25, 0x00 ; 0 21ea2: 0f 94 3a c9 call 0x39274 ; 0x39274 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> execute_load_to_nozzle_sequence(); 21ea6: 0e 94 e1 cd call 0x19bc2 ; 0x19bc2 21eaa: e4 cf rjmp .-56 ; 0x21e74 00021eac : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 21eac: cf 93 push r28 21eae: 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); 21eb0: 8a ea ldi r24, 0xAA ; 170 21eb2: 95 e4 ldi r25, 0x45 ; 69 21eb4: 0e 94 b3 72 call 0xe566 ; 0xe566 21eb8: 6c 2f mov r22, r28 21eba: 0f 94 d6 c4 call 0x389ac ; 0x389ac return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 21ebe: 8c 2f mov r24, r28 21ec0: 0f 94 fe 0e call 0x21dfc ; 0x21dfc 21ec4: 0f 94 ef 42 call 0x285de ; 0x285de planner_synchronize(); unload(); 21ec8: 0f 94 44 ad call 0x35a88 ; 0x35a88 ScreenUpdateEnable(); 21ecc: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 21ed0: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 21ed2: 0d 94 9a 20 jmp 0x24134 ; 0x24134 00021ed6 : 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(){ 21ed6: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 21ed8: c0 e0 ldi r28, 0x00 ; 0 21eda: 8a ea ldi r24, 0xAA ; 170 21edc: 95 e4 ldi r25, 0x45 ; 69 21ede: 0e 94 b3 72 call 0xe566 ; 0xe566 21ee2: 6c 2f mov r22, r28 21ee4: 0f 94 d6 c4 call 0x389ac ; 0x389ac return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 21ee8: 8c 2f mov r24, r28 21eea: 0f 94 fe 0e call 0x21dfc ; 0x21dfc 21eee: 0f 94 ef 42 call 0x285de ; 0x285de planner_synchronize(); unload(); 21ef2: 0f 94 44 ad call 0x35a88 ; 0x35a88 ScreenUpdateEnable(); 21ef6: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 21efa: cf 5f subi r28, 0xFF ; 255 21efc: c5 30 cpi r28, 0x05 ; 5 21efe: 69 f7 brne .-38 ; 0x21eda MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 21f00: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 21f02: 0d 94 9a 20 jmp 0x24134 ; 0x24134 00021f06 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 21f06: cf 93 push r28 21f08: df 93 push r29 21f0a: 00 d0 rcall .+0 ; 0x21f0c 21f0c: 1f 92 push r1 21f0e: 1f 92 push r1 21f10: cd b7 in r28, 0x3d ; 61 21f12: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 21f14: 48 2f mov r20, r24 21f16: 68 e5 ldi r22, 0x58 ; 88 21f18: ce 01 movw r24, r28 21f1a: 01 96 adiw r24, 0x01 ; 1 21f1c: 0f 94 94 c5 call 0x38b28 ; 0x38b28 21f20: 49 81 ldd r20, Y+1 ; 0x01 21f22: 5a 81 ldd r21, Y+2 ; 0x02 21f24: 6b 81 ldd r22, Y+3 ; 0x03 21f26: 7c 81 ldd r23, Y+4 ; 0x04 21f28: 8d 81 ldd r24, Y+5 ; 0x05 21f2a: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 } 21f2e: 0f 90 pop r0 21f30: 0f 90 pop r0 21f32: 0f 90 pop r0 21f34: 0f 90 pop r0 21f36: 0f 90 pop r0 21f38: df 91 pop r29 21f3a: cf 91 pop r28 21f3c: 08 95 ret 00021f3e : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 21f3e: 80 e0 ldi r24, 0x00 ; 0 21f40: 0d 94 83 0f jmp 0x21f06 ; 0x21f06 00021f44 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 21f44: 1f 93 push r17 21f46: cf 93 push r28 21f48: df 93 push r29 21f4a: 00 d0 rcall .+0 ; 0x21f4c 21f4c: 1f 92 push r1 21f4e: 1f 92 push r1 21f50: cd b7 in r28, 0x3d ; 61 21f52: de b7 in r29, 0x3e ; 62 21f54: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 21f56: 0f 94 8b 88 call 0x31116 ; 0x31116 21f5a: 88 23 and r24, r24 21f5c: d9 f0 breq .+54 ; 0x21f94 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 21f5e: 41 2f mov r20, r17 21f60: 62 e5 ldi r22, 0x52 ; 82 21f62: ce 01 movw r24, r28 21f64: 01 96 adiw r24, 0x01 ; 1 21f66: 0f 94 94 c5 call 0x38b28 ; 0x38b28 21f6a: 49 81 ldd r20, Y+1 ; 0x01 21f6c: 5a 81 ldd r21, Y+2 ; 0x02 21f6e: 6b 81 ldd r22, Y+3 ; 0x03 21f70: 7c 81 ldd r23, Y+4 ; 0x04 21f72: 8d 81 ldd r24, Y+5 ; 0x05 21f74: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 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)); 21f78: 60 e0 ldi r22, 0x00 ; 0 21f7a: 80 e0 ldi r24, 0x00 ; 0 21f7c: 0f 94 7d ac call 0x358fa ; 0x358fa 21f80: 88 23 and r24, r24 21f82: 69 f3 breq .-38 ; 0x21f5e // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 21f84: 20 91 66 13 lds r18, 0x1366 ; 0x801366 21f88: 30 91 67 13 lds r19, 0x1367 ; 0x801367 21f8c: 30 93 b7 13 sts 0x13B7, r19 ; 0x8013b7 21f90: 20 93 b6 13 sts 0x13B6, r18 ; 0x8013b6 return true; } 21f94: 0f 90 pop r0 21f96: 0f 90 pop r0 21f98: 0f 90 pop r0 21f9a: 0f 90 pop r0 21f9c: 0f 90 pop r0 21f9e: df 91 pop r29 21fa0: cf 91 pop r28 21fa2: 1f 91 pop r17 21fa4: 08 95 ret 00021fa6 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 21fa6: ff 92 push r15 21fa8: 0f 93 push r16 21faa: 1f 93 push r17 21fac: cf 93 push r28 21fae: df 93 push r29 21fb0: 1f 92 push r1 21fb2: cd b7 in r28, 0x3d ; 61 21fb4: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 21fb6: ce 01 movw r24, r28 21fb8: 01 96 adiw r24, 0x01 ; 1 21fba: 0f 94 a1 31 call 0x26342 ; 0x26342 uint16_t pos = 0; 21fbe: 10 e0 ldi r17, 0x00 ; 0 21fc0: 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]; 21fc2: 85 e0 ldi r24, 0x05 ; 5 21fc4: 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()) { 21fc6: d1 99 sbic 0x1a, 1 ; 26 21fc8: 11 c0 rjmp .+34 ; 0x21fec // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 21fca: 0f 94 63 38 call 0x270c6 ; 0x270c6 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 21fce: 0e 3d cpi r16, 0xDE ; 222 21fd0: 11 05 cpc r17, r1 21fd2: c9 f7 brne .-14 ; 0x21fc6 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 21fd4: ce 01 movw r24, r28 21fd6: 01 96 adiw r24, 0x01 ; 1 21fd8: 0f 94 94 31 call 0x26328 ; 0x26328 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 21fdc: c8 01 movw r24, r16 21fde: 0f 90 pop r0 21fe0: df 91 pop r29 21fe2: cf 91 pop r28 21fe4: 1f 91 pop r17 21fe6: 0f 91 pop r16 21fe8: ff 90 pop r15 21fea: 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(); 21fec: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 21fee: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> 21ff2: 88 23 and r24, r24 21ff4: 61 f3 breq .-40 ; 0x21fce adc_values_ready = false; 21ff6: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> adc_start_cycle(); 21ffa: 0e 94 de 8d call 0x11bbc ; 0x11bbc temp_mgr_isr(); 21ffe: 0f 94 c0 35 call 0x26b80 ; 0x26b80 // stop recording for an hard error condition if(temp_error_state.v) 22002: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 22006: 81 11 cpse r24, r1 22008: 1b c0 rjmp .+54 ; 0x22040 return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 2200a: f0 9e mul r15, r16 2200c: f0 01 movw r30, r0 2200e: f1 9e mul r15, r17 22010: f0 0d add r31, r0 22012: 11 24 eor r1, r1 22014: eb 53 subi r30, 0x3B ; 59 22016: f9 4f sbci r31, 0xF9 ; 249 entry.temp = current_temperature_isr[0]; 22018: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2201c: 90 91 18 05 lds r25, 0x0518 ; 0x800518 22020: a0 91 19 05 lds r26, 0x0519 ; 0x800519 22024: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 22028: 80 83 st Z, r24 2202a: 91 83 std Z+1, r25 ; 0x01 2202c: a2 83 std Z+2, r26 ; 0x02 2202e: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 22030: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 22034: 84 83 std Z+4, r24 ; 0x04 ++pos; 22036: 0f 5f subi r16, 0xFF ; 255 22038: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 2203a: 0f 94 8b 3a call 0x27516 ; 0x27516 2203e: c7 cf rjmp .-114 ; 0x21fce adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 22040: 10 e0 ldi r17, 0x00 ; 0 22042: 00 e0 ldi r16, 0x00 ; 0 22044: c7 cf rjmp .-114 ; 0x21fd4 00022046 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 22046: fc 01 movw r30, r24 22048: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 2204a: 90 32 cpi r25, 0x20 ; 32 2204c: 49 f0 breq .+18 ; 0x22060 2204e: 87 ef ldi r24, 0xF7 ; 247 22050: 89 0f add r24, r25 22052: 82 30 cpi r24, 0x02 ; 2 22054: 28 f0 brcs .+10 ; 0x22060 22056: 81 e0 ldi r24, 0x01 ; 1 22058: 9d 30 cpi r25, 0x0D ; 13 2205a: 19 f0 breq .+6 ; 0x22062 2205c: 80 e0 ldi r24, 0x00 ; 0 2205e: 08 95 ret 22060: 81 e0 ldi r24, 0x01 ; 1 } 22062: 08 95 ret 00022064 : 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; 22064: 88 3e cpi r24, 0xE8 ; 232 22066: 23 e0 ldi r18, 0x03 ; 3 22068: 92 07 cpc r25, r18 2206a: 10 f0 brcs .+4 ; 0x22070 2206c: 87 ee ldi r24, 0xE7 ; 231 2206e: 93 e0 ldi r25, 0x03 ; 3 } 22070: 08 95 ret 00022072 : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 22072: 90 91 3c 05 lds r25, 0x053C ; 0x80053c 22076: 80 91 3b 05 lds r24, 0x053B ; 0x80053b 2207a: 2f ef ldi r18, 0xFF ; 255 2207c: 3f ef ldi r19, 0xFF ; 255 2207e: 89 17 cp r24, r25 22080: 71 f0 breq .+28 ; 0x2209e _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 22082: e9 2f mov r30, r25 22084: f0 e0 ldi r31, 0x00 ; 0 22086: e2 5c subi r30, 0xC2 ; 194 22088: fa 4f sbci r31, 0xFA ; 250 2208a: 20 81 ld r18, Z 2208c: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 2208e: 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 22090: 80 91 3a 05 lds r24, 0x053A ; 0x80053a 22094: 98 17 cp r25, r24 22096: 08 f0 brcs .+2 ; 0x2209a 22098: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 2209a: 90 93 3c 05 sts 0x053C, r25 ; 0x80053c return rbuf_get(uart2_ibuf); } 2209e: c9 01 movw r24, r18 220a0: 08 95 ret 000220a2 : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 220a2: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 220a6: 95 ff sbrs r25, 5 220a8: fc cf rjmp .-8 ; 0x220a2 UDR2 = c; // transmit byte 220aa: 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; } 220ae: 90 e0 ldi r25, 0x00 ; 0 220b0: 80 e0 ldi r24, 0x00 ; 0 220b2: 08 95 ret 000220b4 : } 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) { 220b4: cf 92 push r12 220b6: df 92 push r13 220b8: ef 92 push r14 220ba: ff 92 push r15 220bc: 0f 93 push r16 220be: 1f 93 push r17 220c0: cf 93 push r28 220c2: df 93 push r29 220c4: 8c 01 movw r16, r24 220c6: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 220c8: 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; 220ca: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 220cc: 61 50 subi r22, 0x01 ; 1 220ce: 77 0b sbc r23, r23 220d0: 29 2f mov r18, r25 220d2: 30 e0 ldi r19, 0x00 ; 0 220d4: 26 17 cp r18, r22 220d6: 37 07 cpc r19, r23 220d8: 2c f0 brlt .+10 ; 0x220e4 } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 220da: 55 23 and r21, r21 220dc: 19 f1 breq .+70 ; 0x22124 { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 220de: 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; 220e0: 50 e0 ldi r21, 0x00 ; 0 220e2: f6 cf rjmp .-20 ; 0x220d0 for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 220e4: 78 01 movw r14, r16 220e6: e2 0e add r14, r18 220e8: f3 1e adc r15, r19 220ea: f7 01 movw r30, r14 220ec: 80 81 ld r24, Z 220ee: d9 01 movw r26, r18 220f0: 11 96 adiw r26, 0x01 ; 1 220f2: 68 01 movw r12, r16 220f4: ca 0e add r12, r26 220f6: db 1e adc r13, r27 220f8: f6 01 movw r30, r12 220fa: 40 81 ld r20, Z 220fc: 48 17 cp r20, r24 220fe: 80 f4 brcc .+32 ; 0x22120 { uint8_t d = data[i]; data[i] = data[i+1]; 22100: f7 01 movw r30, r14 22102: 40 83 st Z, r20 data[i+1] = d; 22104: f6 01 movw r30, r12 22106: 80 83 st Z, r24 if (data2) 22108: 20 97 sbiw r28, 0x00 ; 0 2210a: 49 f0 breq .+18 ; 0x2211e { d = data2[i]; 2210c: fe 01 movw r30, r28 2210e: e2 0f add r30, r18 22110: f3 1f adc r31, r19 22112: 80 81 ld r24, Z data2[i] = data2[i+1]; 22114: ac 0f add r26, r28 22116: bd 1f adc r27, r29 22118: 2c 91 ld r18, X 2211a: 20 83 st Z, r18 data2[i+1] = d; 2211c: 8c 93 st X, r24 } changed = 1; 2211e: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 22120: 9f 5f subi r25, 0xFF ; 255 22122: d6 cf rjmp .-84 ; 0x220d0 data2[i+1] = d; } changed = 1; } } } 22124: df 91 pop r29 22126: cf 91 pop r28 22128: 1f 91 pop r17 2212a: 0f 91 pop r16 2212c: ff 90 pop r15 2212e: ef 90 pop r14 22130: df 90 pop r13 22132: cf 90 pop r12 22134: 08 95 ret 00022136 : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 22136: 81 30 cpi r24, 0x01 ; 1 22138: 41 f0 breq .+16 ; 0x2214a 2213a: 28 f0 brcs .+10 ; 0x22146 2213c: 82 30 cpi r24, 0x02 ; 2 2213e: 39 f0 breq .+14 ; 0x2214e 22140: 83 30 cpi r24, 0x03 ; 3 22142: 71 f0 breq .+28 ; 0x22160 22144: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 22146: a0 9a sbi 0x14, 0 ; 20 22148: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 2214a: a2 9a sbi 0x14, 2 ; 20 2214c: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 2214e: 9f b7 in r25, 0x3f ; 63 22150: f8 94 cli 22152: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22156: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 22158: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2215c: 9f bf out 0x3f, r25 ; 63 } } 2215e: 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; 22160: 9f b7 in r25, 0x3f ; 63 22162: f8 94 cli 22164: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22168: 80 61 ori r24, 0x10 ; 16 2216a: f6 cf rjmp .-20 ; 0x22158 0002216c : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 2216c: 81 30 cpi r24, 0x01 ; 1 2216e: 41 f0 breq .+16 ; 0x22180 22170: 28 f0 brcs .+10 ; 0x2217c 22172: 82 30 cpi r24, 0x02 ; 2 22174: 39 f0 breq .+14 ; 0x22184 22176: 83 30 cpi r24, 0x03 ; 3 22178: 71 f0 breq .+28 ; 0x22196 2217a: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 2217c: a0 98 cbi 0x14, 0 ; 20 2217e: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 22180: a2 98 cbi 0x14, 2 ; 20 22182: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 22184: 9f b7 in r25, 0x3f ; 63 22186: f8 94 cli 22188: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2218c: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 2218e: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22192: 9f bf out 0x3f, r25 ; 63 } } 22194: 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; 22196: 9f b7 in r25, 0x3f ; 63 22198: f8 94 cli 2219a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2219e: 8f 7e andi r24, 0xEF ; 239 221a0: f6 cf rjmp .-20 ; 0x2218e 000221a2 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 221a2: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 221a4: 0d b4 in r0, 0x2d ; 45 221a6: 07 fe sbrs r0, 7 221a8: fd cf rjmp .-6 ; 0x221a4 return SPDR; 221aa: 8e b5 in r24, 0x2e ; 46 } 221ac: 08 95 ret 000221ae : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 221ae: 2f 92 push r2 221b0: 3f 92 push r3 221b2: 4f 92 push r4 221b4: 5f 92 push r5 221b6: 6f 92 push r6 221b8: 7f 92 push r7 221ba: 8f 92 push r8 221bc: 9f 92 push r9 221be: af 92 push r10 221c0: bf 92 push r11 221c2: cf 92 push r12 221c4: df 92 push r13 221c6: ef 92 push r14 221c8: ff 92 push r15 221ca: 0f 93 push r16 221cc: 1f 93 push r17 221ce: cf 93 push r28 221d0: df 93 push r29 221d2: cd b7 in r28, 0x3d ; 61 221d4: de b7 in r29, 0x3e ; 62 221d6: 2e 97 sbiw r28, 0x0e ; 14 221d8: 0f b6 in r0, 0x3f ; 63 221da: f8 94 cli 221dc: de bf out 0x3e, r29 ; 62 221de: 0f be out 0x3f, r0 ; 63 221e0: 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]); 221e2: 20 90 1e 06 lds r2, 0x061E ; 0x80061e 221e6: 30 90 1f 06 lds r3, 0x061F ; 0x80061f 221ea: 40 90 17 05 lds r4, 0x0517 ; 0x800517 221ee: 50 90 18 05 lds r5, 0x0518 ; 0x800518 221f2: 60 90 19 05 lds r6, 0x0519 ; 0x800519 221f6: 70 90 1a 05 lds r7, 0x051A ; 0x80051a #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 221fa: 21 14 cp r2, r1 221fc: 31 04 cpc r3, r1 221fe: 39 f4 brne .+14 ; 0x2220e pid_output = 0; pid_reset[e] = true; 22200: 81 e0 ldi r24, 0x01 ; 1 22202: 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; 22206: 81 2c mov r8, r1 22208: 91 2c mov r9, r1 2220a: 54 01 movw r10, r8 2220c: f9 c0 rjmp .+498 ; 0x22400 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 2220e: b1 01 movw r22, r2 22210: 03 2c mov r0, r3 22212: 00 0c add r0, r0 22214: 88 0b sbc r24, r24 22216: 99 0b sbc r25, r25 22218: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2221c: a3 01 movw r20, r6 2221e: 92 01 movw r18, r4 22220: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 22224: 6b 01 movw r12, r22 22226: 7c 01 movw r14, r24 if(pid_reset[e]) { 22228: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 2222c: 88 23 and r24, r24 2222e: 91 f0 breq .+36 ; 0x22254 iState_sum[e] = 0.0; 22230: 10 92 f1 05 sts 0x05F1, r1 ; 0x8005f1 22234: 10 92 f2 05 sts 0x05F2, r1 ; 0x8005f2 22238: 10 92 f3 05 sts 0x05F3, r1 ; 0x8005f3 2223c: 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) 22240: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 22244: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 22248: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef 2224c: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 pid_reset[e] = false; 22250: 10 92 f5 05 sts 0x05F5, r1 ; 0x8005f5 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 22254: 20 91 26 0e lds r18, 0x0E26 ; 0x800e26 22258: 30 91 27 0e lds r19, 0x0E27 ; 0x800e27 2225c: 40 91 28 0e lds r20, 0x0E28 ; 0x800e28 22260: 50 91 29 0e lds r21, 0x0E29 ; 0x800e29 22264: c7 01 movw r24, r14 22266: b6 01 movw r22, r12 22268: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2226c: 69 83 std Y+1, r22 ; 0x01 2226e: 7a 83 std Y+2, r23 ; 0x02 22270: 8b 83 std Y+3, r24 ; 0x03 22272: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 22274: 20 91 f1 05 lds r18, 0x05F1 ; 0x8005f1 22278: 30 91 f2 05 lds r19, 0x05F2 ; 0x8005f2 2227c: 40 91 f3 05 lds r20, 0x05F3 ; 0x8005f3 22280: 50 91 f4 05 lds r21, 0x05F4 ; 0x8005f4 22284: c7 01 movw r24, r14 22286: b6 01 movw r22, r12 22288: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2228c: 4b 01 movw r8, r22 2228e: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 22290: 20 91 b3 04 lds r18, 0x04B3 ; 0x8004b3 <_ZL14iState_sum_min.lto_priv.468> 22294: 2d 87 std Y+13, r18 ; 0x0d 22296: 30 91 b4 04 lds r19, 0x04B4 ; 0x8004b4 <_ZL14iState_sum_min.lto_priv.468+0x1> 2229a: 39 87 std Y+9, r19 ; 0x09 2229c: 10 91 b5 04 lds r17, 0x04B5 ; 0x8004b5 <_ZL14iState_sum_min.lto_priv.468+0x2> 222a0: 00 91 b6 04 lds r16, 0x04B6 ; 0x8004b6 <_ZL14iState_sum_min.lto_priv.468+0x3> 222a4: 41 2f mov r20, r17 222a6: 50 2f mov r21, r16 222a8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 222ac: 87 fd sbrc r24, 7 222ae: 17 c0 rjmp .+46 ; 0x222de 222b0: 80 91 af 04 lds r24, 0x04AF ; 0x8004af <_ZL14iState_sum_max.lto_priv.469> 222b4: 8d 87 std Y+13, r24 ; 0x0d 222b6: 90 91 b0 04 lds r25, 0x04B0 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x1> 222ba: 99 87 std Y+9, r25 ; 0x09 222bc: 10 91 b1 04 lds r17, 0x04B1 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x2> 222c0: 00 91 b2 04 lds r16, 0x04B2 ; 0x8004b2 <_ZL14iState_sum_max.lto_priv.469+0x3> 222c4: 9c 01 movw r18, r24 222c6: 41 2f mov r20, r17 222c8: 50 2f mov r21, r16 222ca: b4 01 movw r22, r8 222cc: c5 01 movw r24, r10 222ce: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 222d2: 18 16 cp r1, r24 222d4: 24 f0 brlt .+8 ; 0x222de 222d6: 8d 86 std Y+13, r8 ; 0x0d 222d8: 99 86 std Y+9, r9 ; 0x09 222da: 1a 2d mov r17, r10 222dc: 0b 2d mov r16, r11 222de: 8d 85 ldd r24, Y+13 ; 0x0d 222e0: 99 85 ldd r25, Y+9 ; 0x09 222e2: a1 2f mov r26, r17 222e4: b0 2f mov r27, r16 222e6: 80 93 f1 05 sts 0x05F1, r24 ; 0x8005f1 222ea: 90 93 f2 05 sts 0x05F2, r25 ; 0x8005f2 222ee: a0 93 f3 05 sts 0x05F3, r26 ; 0x8005f3 222f2: b0 93 f4 05 sts 0x05F4, r27 ; 0x8005f4 iTerm[e] = cs.Ki * iState_sum[e]; 222f6: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 222fa: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 222fe: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 22302: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 22306: bc 01 movw r22, r24 22308: 81 2f mov r24, r17 2230a: 90 2f mov r25, r16 2230c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22310: 6d 83 std Y+5, r22 ; 0x05 22312: 7e 83 std Y+6, r23 ; 0x06 22314: 8f 83 std Y+7, r24 ; 0x07 22316: 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 22318: 20 91 e9 05 lds r18, 0x05E9 ; 0x8005e9 2231c: 30 91 ea 05 lds r19, 0x05EA ; 0x8005ea 22320: 40 91 eb 05 lds r20, 0x05EB ; 0x8005eb 22324: 50 91 ec 05 lds r21, 0x05EC ; 0x8005ec 22328: c3 01 movw r24, r6 2232a: b2 01 movw r22, r4 2232c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 22330: 20 91 2e 0e lds r18, 0x0E2E ; 0x800e2e 22334: 30 91 2f 0e lds r19, 0x0E2F ; 0x800e2f 22338: 40 91 30 0e lds r20, 0x0E30 ; 0x800e30 2233c: 50 91 31 0e lds r21, 0x0E31 ; 0x800e31 22340: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22344: 20 ed ldi r18, 0xD0 ; 208 22346: 3c ec ldi r19, 0xCC ; 204 22348: 4c e4 ldi r20, 0x4C ; 76 2234a: 5d e3 ldi r21, 0x3D ; 61 2234c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22350: 4b 01 movw r8, r22 22352: 5c 01 movw r10, r24 22354: 23 e3 ldi r18, 0x33 ; 51 22356: 33 e3 ldi r19, 0x33 ; 51 22358: 43 e7 ldi r20, 0x73 ; 115 2235a: 5f e3 ldi r21, 0x3F ; 63 2235c: 60 91 ed 05 lds r22, 0x05ED ; 0x8005ed 22360: 70 91 ee 05 lds r23, 0x05EE ; 0x8005ee 22364: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 22368: 90 91 f0 05 lds r25, 0x05F0 ; 0x8005f0 2236c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22370: 9b 01 movw r18, r22 22372: ac 01 movw r20, r24 22374: c5 01 movw r24, r10 22376: b4 01 movw r22, r8 22378: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2237c: 4b 01 movw r8, r22 2237e: 5c 01 movw r10, r24 22380: 80 92 ed 05 sts 0x05ED, r8 ; 0x8005ed 22384: 90 92 ee 05 sts 0x05EE, r9 ; 0x8005ee 22388: a0 92 ef 05 sts 0x05EF, r10 ; 0x8005ef 2238c: 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) 22390: 2d 81 ldd r18, Y+5 ; 0x05 22392: 3e 81 ldd r19, Y+6 ; 0x06 22394: 4f 81 ldd r20, Y+7 ; 0x07 22396: 58 85 ldd r21, Y+8 ; 0x08 22398: 69 81 ldd r22, Y+1 ; 0x01 2239a: 7a 81 ldd r23, Y+2 ; 0x02 2239c: 8b 81 ldd r24, Y+3 ; 0x03 2239e: 9c 81 ldd r25, Y+4 ; 0x04 223a0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 223a4: a5 01 movw r20, r10 223a6: 94 01 movw r18, r8 223a8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 223ac: 4b 01 movw r8, r22 223ae: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 223b0: 20 e0 ldi r18, 0x00 ; 0 223b2: 30 e0 ldi r19, 0x00 ; 0 223b4: 4f e7 ldi r20, 0x7F ; 127 223b6: 53 e4 ldi r21, 0x43 ; 67 223b8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 223bc: 20 e0 ldi r18, 0x00 ; 0 223be: 30 e0 ldi r19, 0x00 ; 0 223c0: 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) { 223c2: 18 16 cp r1, r24 223c4: 0c f0 brlt .+2 ; 0x223c8 223c6: 6d c1 rjmp .+730 ; 0x226a2 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 223c8: c7 01 movw r24, r14 223ca: b6 01 movw r22, r12 223cc: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 223d0: 18 16 cp r1, r24 223d2: 84 f4 brge .+32 ; 0x223f4 223d4: a7 01 movw r20, r14 223d6: 96 01 movw r18, r12 223d8: 6d 85 ldd r22, Y+13 ; 0x0d 223da: 79 85 ldd r23, Y+9 ; 0x09 223dc: 81 2f mov r24, r17 223de: 90 2f mov r25, r16 223e0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 223e4: 60 93 f1 05 sts 0x05F1, r22 ; 0x8005f1 223e8: 70 93 f2 05 sts 0x05F2, r23 ; 0x8005f2 223ec: 80 93 f3 05 sts 0x05F3, r24 ; 0x8005f3 223f0: 90 93 f4 05 sts 0x05F4, r25 ; 0x8005f4 pid_output=PID_MAX; 223f4: 81 2c mov r8, r1 223f6: 91 2c mov r9, r1 223f8: 3f e7 ldi r19, 0x7F ; 127 223fa: a3 2e mov r10, r19 223fc: 33 e4 ldi r19, 0x43 ; 67 223fe: 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; 22400: 40 92 e9 05 sts 0x05E9, r4 ; 0x8005e9 22404: 50 92 ea 05 sts 0x05EA, r5 ; 0x8005ea 22408: 60 92 eb 05 sts 0x05EB, r6 ; 0x8005eb 2240c: 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)) 22410: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.470> 22414: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.470+0x1> 22418: 07 2e mov r0, r23 2241a: 00 0c add r0, r0 2241c: 88 0b sbc r24, r24 2241e: 99 0b sbc r25, r25 22420: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 22424: 9b 01 movw r18, r22 22426: ac 01 movw r20, r24 22428: c3 01 movw r24, r6 2242a: b2 01 movw r22, r4 2242c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 22430: 87 ff sbrs r24, 7 22432: 57 c1 rjmp .+686 ; 0x226e2 22434: 23 28 or r2, r3 22436: 09 f4 brne .+2 ; 0x2243a 22438: 54 c1 rjmp .+680 ; 0x226e2 soft_pwm[e] = (int)pid_output >> 1; 2243a: c5 01 movw r24, r10 2243c: b4 01 movw r22, r8 2243e: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 22442: 75 95 asr r23 22444: 67 95 ror r22 22446: 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); 2244a: 20 91 17 06 lds r18, 0x0617 ; 0x800617 2244e: 30 91 18 06 lds r19, 0x0618 ; 0x800618 22452: 3a 83 std Y+2, r19 ; 0x02 22454: 29 83 std Y+1, r18 ; 0x01 22456: 40 90 19 06 lds r4, 0x0619 ; 0x800619 2245a: 50 90 1a 06 lds r5, 0x061A ; 0x80061a 2245e: 60 90 1b 06 lds r6, 0x061B ; 0x80061b 22462: 70 90 1c 06 lds r7, 0x061C ; 0x80061c #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 22466: b9 01 movw r22, r18 22468: 33 0f add r19, r19 2246a: 88 0b sbc r24, r24 2246c: 99 0b sbc r25, r25 2246e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 22472: a3 01 movw r20, r6 22474: 92 01 movw r18, r4 22476: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2247a: 6b 01 movw r12, r22 2247c: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 2247e: 20 91 32 0e lds r18, 0x0E32 ; 0x800e32 22482: 30 91 33 0e lds r19, 0x0E33 ; 0x800e33 22486: 40 91 34 0e lds r20, 0x0E34 ; 0x800e34 2248a: 50 91 35 0e lds r21, 0x0E35 ; 0x800e35 2248e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22492: 6d 83 std Y+5, r22 ; 0x05 22494: 7e 83 std Y+6, r23 ; 0x06 22496: 8f 83 std Y+7, r24 ; 0x07 22498: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 2249a: 20 91 fe 05 lds r18, 0x05FE ; 0x8005fe 2249e: 30 91 ff 05 lds r19, 0x05FF ; 0x8005ff 224a2: 40 91 00 06 lds r20, 0x0600 ; 0x800600 224a6: 50 91 01 06 lds r21, 0x0601 ; 0x800601 224aa: c7 01 movw r24, r14 224ac: b6 01 movw r22, r12 224ae: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 224b2: 5b 01 movw r10, r22 224b4: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 224b6: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab <_ZL19temp_iState_min_bed.lto_priv.466> 224ba: 3e 87 std Y+14, r19 ; 0x0e 224bc: 80 91 ac 04 lds r24, 0x04AC ; 0x8004ac <_ZL19temp_iState_min_bed.lto_priv.466+0x1> 224c0: 8d 87 std Y+13, r24 ; 0x0d 224c2: 30 90 ad 04 lds r3, 0x04AD ; 0x8004ad <_ZL19temp_iState_min_bed.lto_priv.466+0x2> 224c6: 20 90 ae 04 lds r2, 0x04AE ; 0x8004ae <_ZL19temp_iState_min_bed.lto_priv.466+0x3> 224ca: 23 2f mov r18, r19 224cc: 38 2f mov r19, r24 224ce: 43 2d mov r20, r3 224d0: 52 2d mov r21, r2 224d2: b5 01 movw r22, r10 224d4: c8 01 movw r24, r16 224d6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 224da: 87 fd sbrc r24, 7 224dc: 18 c0 rjmp .+48 ; 0x2250e 224de: 90 91 a7 04 lds r25, 0x04A7 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467> 224e2: 9e 87 std Y+14, r25 ; 0x0e 224e4: 20 91 a8 04 lds r18, 0x04A8 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 224e8: 2d 87 std Y+13, r18 ; 0x0d 224ea: 30 90 a9 04 lds r3, 0x04A9 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 224ee: 20 90 aa 04 lds r2, 0x04AA ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.467+0x3> 224f2: 29 2f mov r18, r25 224f4: 3d 85 ldd r19, Y+13 ; 0x0d 224f6: 43 2d mov r20, r3 224f8: 52 2d mov r21, r2 224fa: b5 01 movw r22, r10 224fc: c8 01 movw r24, r16 224fe: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 22502: 18 16 cp r1, r24 22504: 24 f0 brlt .+8 ; 0x2250e 22506: ae 86 std Y+14, r10 ; 0x0e 22508: bd 86 std Y+13, r11 ; 0x0d 2250a: 30 2e mov r3, r16 2250c: 21 2e mov r2, r17 2250e: 8e 85 ldd r24, Y+14 ; 0x0e 22510: 9d 85 ldd r25, Y+13 ; 0x0d 22512: a3 2d mov r26, r3 22514: b2 2d mov r27, r2 22516: 80 93 fe 05 sts 0x05FE, r24 ; 0x8005fe 2251a: 90 93 ff 05 sts 0x05FF, r25 ; 0x8005ff 2251e: a0 93 00 06 sts 0x0600, r26 ; 0x800600 22522: b0 93 01 06 sts 0x0601, r27 ; 0x800601 iTerm_bed = cs.bedKi * temp_iState_bed; 22526: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 2252a: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 2252e: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 22532: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 22536: bc 01 movw r22, r24 22538: 83 2d mov r24, r3 2253a: 92 2d mov r25, r2 2253c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22540: 69 87 std Y+9, r22 ; 0x09 22542: 7a 87 std Y+10, r23 ; 0x0a 22544: 8b 87 std Y+11, r24 ; 0x0b 22546: 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); 22548: 20 91 fa 05 lds r18, 0x05FA ; 0x8005fa 2254c: 30 91 fb 05 lds r19, 0x05FB ; 0x8005fb 22550: 40 91 fc 05 lds r20, 0x05FC ; 0x8005fc 22554: 50 91 fd 05 lds r21, 0x05FD ; 0x8005fd 22558: c3 01 movw r24, r6 2255a: b2 01 movw r22, r4 2255c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 22560: 20 91 3a 0e lds r18, 0x0E3A ; 0x800e3a 22564: 30 91 3b 0e lds r19, 0x0E3B ; 0x800e3b 22568: 40 91 3c 0e lds r20, 0x0E3C ; 0x800e3c 2256c: 50 91 3d 0e lds r21, 0x0E3D ; 0x800e3d 22570: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22574: 20 ed ldi r18, 0xD0 ; 208 22576: 3c ec ldi r19, 0xCC ; 204 22578: 4c e4 ldi r20, 0x4C ; 76 2257a: 5d e3 ldi r21, 0x3D ; 61 2257c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22580: 4b 01 movw r8, r22 22582: 5c 01 movw r10, r24 22584: 23 e3 ldi r18, 0x33 ; 51 22586: 33 e3 ldi r19, 0x33 ; 51 22588: 43 e7 ldi r20, 0x73 ; 115 2258a: 5f e3 ldi r21, 0x3F ; 63 2258c: 60 91 f6 05 lds r22, 0x05F6 ; 0x8005f6 22590: 70 91 f7 05 lds r23, 0x05F7 ; 0x8005f7 22594: 80 91 f8 05 lds r24, 0x05F8 ; 0x8005f8 22598: 90 91 f9 05 lds r25, 0x05F9 ; 0x8005f9 2259c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 225a0: 9b 01 movw r18, r22 225a2: ac 01 movw r20, r24 225a4: c5 01 movw r24, r10 225a6: b4 01 movw r22, r8 225a8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 225ac: 4b 01 movw r8, r22 225ae: 5c 01 movw r10, r24 225b0: 80 92 f6 05 sts 0x05F6, r8 ; 0x8005f6 225b4: 90 92 f7 05 sts 0x05F7, r9 ; 0x8005f7 225b8: a0 92 f8 05 sts 0x05F8, r10 ; 0x8005f8 225bc: b0 92 f9 05 sts 0x05F9, r11 ; 0x8005f9 temp_dState_bed = pid_input; 225c0: 40 92 fa 05 sts 0x05FA, r4 ; 0x8005fa 225c4: 50 92 fb 05 sts 0x05FB, r5 ; 0x8005fb 225c8: 60 92 fc 05 sts 0x05FC, r6 ; 0x8005fc 225cc: 70 92 fd 05 sts 0x05FD, r7 ; 0x8005fd pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 225d0: 29 85 ldd r18, Y+9 ; 0x09 225d2: 3a 85 ldd r19, Y+10 ; 0x0a 225d4: 4b 85 ldd r20, Y+11 ; 0x0b 225d6: 5c 85 ldd r21, Y+12 ; 0x0c 225d8: 6d 81 ldd r22, Y+5 ; 0x05 225da: 7e 81 ldd r23, Y+6 ; 0x06 225dc: 8f 81 ldd r24, Y+7 ; 0x07 225de: 98 85 ldd r25, Y+8 ; 0x08 225e0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 225e4: a5 01 movw r20, r10 225e6: 94 01 movw r18, r8 225e8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 225ec: 4b 01 movw r8, r22 225ee: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 225f0: 20 e0 ldi r18, 0x00 ; 0 225f2: 30 e0 ldi r19, 0x00 ; 0 225f4: 4f e7 ldi r20, 0x7F ; 127 225f6: 53 e4 ldi r21, 0x43 ; 67 225f8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 225fc: 20 e0 ldi r18, 0x00 ; 0 225fe: 30 e0 ldi r19, 0x00 ; 0 22600: 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) { 22602: 18 16 cp r1, r24 22604: 0c f0 brlt .+2 ; 0x22608 22606: 70 c0 rjmp .+224 ; 0x226e8 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 22608: c7 01 movw r24, r14 2260a: b6 01 movw r22, r12 2260c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 22610: 18 16 cp r1, r24 22612: 84 f4 brge .+32 ; 0x22634 22614: a7 01 movw r20, r14 22616: 96 01 movw r18, r12 22618: 6e 85 ldd r22, Y+14 ; 0x0e 2261a: 7d 85 ldd r23, Y+13 ; 0x0d 2261c: 83 2d mov r24, r3 2261e: 92 2d mov r25, r2 22620: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 22624: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 22628: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 2262c: 80 93 00 06 sts 0x0600, r24 ; 0x800600 22630: 90 93 01 06 sts 0x0601, r25 ; 0x800601 pid_output=MAX_BED_POWER; 22634: 81 2c mov r8, r1 22636: 91 2c mov r9, r1 22638: 9f e7 ldi r25, 0x7F ; 127 2263a: a9 2e mov r10, r25 2263c: 93 e4 ldi r25, 0x43 ; 67 2263e: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 22640: 20 e0 ldi r18, 0x00 ; 0 22642: 30 e0 ldi r19, 0x00 ; 0 22644: 4a ef ldi r20, 0xFA ; 250 22646: 52 e4 ldi r21, 0x42 ; 66 22648: c3 01 movw r24, r6 2264a: b2 01 movw r22, r4 2264c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 22650: 87 ff sbrs r24, 7 22652: 6d c0 rjmp .+218 ; 0x2272e { soft_pwm_bed = (int)pid_output >> 1; 22654: c5 01 movw r24, r10 22656: b4 01 movw r22, r8 22658: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2265c: 75 95 asr r23 2265e: 67 95 ror r22 22660: 60 93 1d 06 sts 0x061D, r22 ; 0x80061d soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 22664: 89 81 ldd r24, Y+1 ; 0x01 22666: 9a 81 ldd r25, Y+2 ; 0x02 22668: 89 2b or r24, r25 2266a: 11 f4 brne .+4 ; 0x22670 { soft_pwm_bed = 0; 2266c: 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); } 22670: 2e 96 adiw r28, 0x0e ; 14 22672: 0f b6 in r0, 0x3f ; 63 22674: f8 94 cli 22676: de bf out 0x3e, r29 ; 62 22678: 0f be out 0x3f, r0 ; 63 2267a: cd bf out 0x3d, r28 ; 61 2267c: df 91 pop r29 2267e: cf 91 pop r28 22680: 1f 91 pop r17 22682: 0f 91 pop r16 22684: ff 90 pop r15 22686: ef 90 pop r14 22688: df 90 pop r13 2268a: cf 90 pop r12 2268c: bf 90 pop r11 2268e: af 90 pop r10 22690: 9f 90 pop r9 22692: 8f 90 pop r8 22694: 7f 90 pop r7 22696: 6f 90 pop r6 22698: 5f 90 pop r5 2269a: 4f 90 pop r4 2269c: 3f 90 pop r3 2269e: 2f 90 pop r2 226a0: 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) { 226a2: c5 01 movw r24, r10 226a4: b4 01 movw r22, r8 226a6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 226aa: 87 ff sbrs r24, 7 226ac: a9 ce rjmp .-686 ; 0x22400 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 226ae: 20 e0 ldi r18, 0x00 ; 0 226b0: 30 e0 ldi r19, 0x00 ; 0 226b2: a9 01 movw r20, r18 226b4: c7 01 movw r24, r14 226b6: b6 01 movw r22, r12 226b8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 226bc: 87 ff sbrs r24, 7 226be: a3 cd rjmp .-1210 ; 0x22206 226c0: a7 01 movw r20, r14 226c2: 96 01 movw r18, r12 226c4: 6d 85 ldd r22, Y+13 ; 0x0d 226c6: 79 85 ldd r23, Y+9 ; 0x09 226c8: 81 2f mov r24, r17 226ca: 90 2f mov r25, r16 226cc: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 226d0: 60 93 f1 05 sts 0x05F1, r22 ; 0x8005f1 226d4: 70 93 f2 05 sts 0x05F2, r23 ; 0x8005f2 226d8: 80 93 f3 05 sts 0x05F3, r24 ; 0x8005f3 226dc: 90 93 f4 05 sts 0x05F4, r25 ; 0x8005f4 226e0: 92 cd rjmp .-1244 ; 0x22206 // 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; 226e2: 10 92 16 05 sts 0x0516, r1 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 226e6: b1 ce rjmp .-670 ; 0x2244a 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){ 226e8: c5 01 movw r24, r10 226ea: b4 01 movw r22, r8 226ec: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 226f0: 87 ff sbrs r24, 7 226f2: a6 cf rjmp .-180 ; 0x22640 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 226f4: 20 e0 ldi r18, 0x00 ; 0 226f6: 30 e0 ldi r19, 0x00 ; 0 226f8: a9 01 movw r20, r18 226fa: c7 01 movw r24, r14 226fc: b6 01 movw r22, r12 226fe: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 22702: 87 ff sbrs r24, 7 22704: 10 c0 rjmp .+32 ; 0x22726 22706: a7 01 movw r20, r14 22708: 96 01 movw r18, r12 2270a: 6e 85 ldd r22, Y+14 ; 0x0e 2270c: 7d 85 ldd r23, Y+13 ; 0x0d 2270e: 83 2d mov r24, r3 22710: 92 2d mov r25, r2 22712: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 22716: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 2271a: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 2271e: 80 93 00 06 sts 0x0600, r24 ; 0x800600 22722: 90 93 01 06 sts 0x0601, r25 ; 0x800601 pid_output=0; 22726: 81 2c mov r8, r1 22728: 91 2c mov r9, r1 2272a: 54 01 movw r10, r8 2272c: 89 cf rjmp .-238 ; 0x22640 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 2272e: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d 22732: 98 cf rjmp .-208 ; 0x22664 00022734 : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 22738: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2273c: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 22740: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e target_temperature_bed_isr = target_temperature_bed; 22744: 80 91 72 06 lds r24, 0x0672 ; 0x800672 22748: 90 91 73 06 lds r25, 0x0673 ; 0x800673 2274c: 90 93 18 06 sts 0x0618, r25 ; 0x800618 22750: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } 22754: 08 95 ret 00022756 : { // 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) 22756: 81 30 cpi r24, 0x01 ; 1 22758: 41 f1 breq .+80 ; 0x227aa 2275a: 20 f0 brcs .+8 ; 0x22764 2275c: 82 30 cpi r24, 0x02 ; 2 2275e: 09 f4 brne .+2 ; 0x22762 22760: 45 c0 rjmp .+138 ; 0x227ec 22762: 08 95 ret { case X_AXIS: { enable_x(); 22764: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 22766: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2276a: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 2276c: 91 e0 ldi r25, 0x01 ; 1 2276e: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 22770: 86 17 cp r24, r22 22772: 59 f0 breq .+22 ; 0x2278a WRITE_NC(X_DIR_PIN, new_x_dir_pin); 22774: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22778: 66 23 and r22, r22 2277a: 89 f0 breq .+34 ; 0x2279e 2277c: 91 60 ori r25, 0x01 ; 1 2277e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 22782: eb e4 ldi r30, 0x4B ; 75 22784: f0 e0 ldi r31, 0x00 ; 0 22786: 31 97 sbiw r30, 0x01 ; 1 22788: f1 f7 brne .-4 ; 0x22786 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 2278a: 91 e0 ldi r25, 0x01 ; 1 2278c: 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); 2278e: 88 23 and r24, r24 22790: 41 f0 breq .+16 ; 0x227a2 22792: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22796: 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); 22798: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 2279c: 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); 2279e: 9e 7f andi r25, 0xFE ; 254 227a0: ee cf rjmp .-36 ; 0x2277e #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); 227a2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227a6: 8e 7f andi r24, 0xFE ; 254 227a8: f7 cf rjmp .-18 ; 0x22798 } break; case Y_AXIS: { enable_y(); 227aa: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 227ac: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 227b0: 81 e0 ldi r24, 0x01 ; 1 227b2: 29 2f mov r18, r25 227b4: 22 70 andi r18, 0x02 ; 2 227b6: 91 ff sbrs r25, 1 227b8: 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) { 227ba: 86 17 cp r24, r22 227bc: 59 f0 breq .+22 ; 0x227d4 WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 227be: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227c2: 66 23 and r22, r22 227c4: 79 f0 breq .+30 ; 0x227e4 227c6: 82 60 ori r24, 0x02 ; 2 227c8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227cc: 8b e4 ldi r24, 0x4B ; 75 227ce: 90 e0 ldi r25, 0x00 ; 0 227d0: 01 97 sbiw r24, 0x01 ; 1 227d2: f1 f7 brne .-4 ; 0x227d0 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 227d4: 82 e0 ldi r24, 0x02 ; 2 227d6: 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); 227d8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 227dc: 22 23 and r18, r18 227de: 21 f0 breq .+8 ; 0x227e8 227e0: 82 60 ori r24, 0x02 ; 2 227e2: da cf rjmp .-76 ; 0x22798 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); 227e4: 8d 7f andi r24, 0xFD ; 253 227e6: f0 cf rjmp .-32 ; 0x227c8 #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); 227e8: 8d 7f andi r24, 0xFD ; 253 227ea: d6 cf rjmp .-84 ; 0x22798 } break; case Z_AXIS: { enable_z(); 227ec: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 227ee: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 227f2: 81 e0 ldi r24, 0x01 ; 1 227f4: 29 2f mov r18, r25 227f6: 24 70 andi r18, 0x04 ; 4 227f8: 92 ff sbrs r25, 2 227fa: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 227fc: 91 e0 ldi r25, 0x01 ; 1 227fe: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 22800: 86 17 cp r24, r22 22802: 59 f0 breq .+22 ; 0x2281a WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 22804: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22808: 66 23 and r22, r22 2280a: 91 f0 breq .+36 ; 0x22830 2280c: 94 60 ori r25, 0x04 ; 4 2280e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22812: eb e4 ldi r30, 0x4B ; 75 22814: f0 e0 ldi r31, 0x00 ; 0 22816: 31 97 sbiw r30, 0x01 ; 1 22818: f1 f7 brne .-4 ; 0x22816 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 2281a: 94 e0 ldi r25, 0x04 ; 4 2281c: 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) { 2281e: 86 17 cp r24, r22 22820: 09 f4 brne .+2 ; 0x22824 22822: bc cf rjmp .-136 ; 0x2279c WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 22824: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 22828: 22 23 and r18, r18 2282a: 21 f0 breq .+8 ; 0x22834 2282c: 84 60 ori r24, 0x04 ; 4 2282e: b4 cf rjmp .-152 ; 0x22798 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); 22830: 9b 7f andi r25, 0xFB ; 251 22832: ed cf rjmp .-38 ; 0x2280e 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); 22834: 8b 7f andi r24, 0xFB ; 251 22836: b0 cf rjmp .-160 ; 0x22798 00022838 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 22838: 80 91 39 05 lds r24, 0x0539 ; 0x800539 2283c: 81 11 cpse r24, r1 2283e: 25 c0 rjmp .+74 ; 0x2288a if((M_UCSRxA & (1< 22844: 87 ff sbrs r24, 7 22846: 3d c0 rjmp .+122 ; 0x228c2 // Test for a framing error. if (M_UCSRxA & (1< 2284c: 84 ff sbrs r24, 4 2284e: 03 c0 rjmp .+6 ; 0x22856 // 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); 22850: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 22854: 08 95 ret } else { unsigned char c = M_UDRx; 22856: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 2285a: 20 91 99 04 lds r18, 0x0499 ; 0x800499 2285e: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 22862: c9 01 movw r24, r18 22864: 01 96 adiw r24, 0x01 ; 1 22866: 8f 77 andi r24, 0x7F ; 127 22868: 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) { 2286a: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 2286e: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 22872: 86 17 cp r24, r22 22874: 97 07 cpc r25, r23 22876: 29 f1 breq .+74 ; 0x228c2 // 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; 22878: 27 5e subi r18, 0xE7 ; 231 2287a: 3b 4f sbci r19, 0xFB ; 251 2287c: f9 01 movw r30, r18 2287e: 40 83 st Z, r20 rx_buffer.head = i; 22880: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 22884: 80 93 99 04 sts 0x0499, r24 ; 0x800499 22888: 1c c0 rjmp .+56 ; 0x228c2 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 2288e: 87 ff sbrs r24, 7 22890: 18 c0 rjmp .+48 ; 0x228c2 // Test for a framing error. if (UCSR1A & (1< 22896: 84 ff sbrs r24, 4 22898: 03 c0 rjmp .+6 ; 0x228a0 // 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); 2289a: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 2289e: 08 95 ret } else { unsigned char c = UDR1; 228a0: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 228a4: 20 91 99 04 lds r18, 0x0499 ; 0x800499 228a8: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 228ac: c9 01 movw r24, r18 228ae: 01 96 adiw r24, 0x01 ; 1 228b0: 8f 77 andi r24, 0x7F ; 127 228b2: 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) { 228b4: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 228b8: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 228bc: 68 17 cp r22, r24 228be: 79 07 cpc r23, r25 228c0: d9 f6 brne .-74 ; 0x22878 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 228c2: 08 95 ret 000228c4 : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 228c4: 23 e0 ldi r18, 0x03 ; 3 228c6: 81 11 cpse r24, r1 228c8: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 228dc: 94 60 ori r25, 0x04 ; 4 228de: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228e2: 3f bf out 0x3f, r19 ; 63 228e4: fb 01 movw r30, r22 228e6: 31 97 sbiw r30, 0x01 ; 1 228e8: f1 f7 brne .-4 ; 0x228e6 delayMicroseconds(200); WRITE(BEEPER,LOW); 228ea: 3f b7 in r19, 0x3f ; 63 228ec: f8 94 cli 228ee: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228f2: 9b 7f andi r25, 0xFB ; 251 228f4: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 228f8: 3f bf out 0x3f, r19 ; 63 228fa: fa 01 movw r30, r20 228fc: 31 97 sbiw r30, 0x01 ; 1 228fe: f1 f7 brne .-4 ; 0x228fc 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); } } 22906: 08 95 ret 00022908 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 22908: 8a e0 ldi r24, 0x0A ; 10 2290a: 2b e8 ldi r18, 0x8B ; 139 2290c: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 2290e: 4f b7 in r20, 0x3f ; 63 22910: f8 94 cli 22912: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22916: 94 60 ori r25, 0x04 ; 4 22918: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2291c: 4f bf out 0x3f, r20 ; 63 2291e: f9 01 movw r30, r18 22920: 31 97 sbiw r30, 0x01 ; 1 22922: f1 f7 brne .-4 ; 0x22920 delayMicroseconds(100); WRITE(BEEPER,LOW); 22924: 4f b7 in r20, 0x3f ; 63 22926: f8 94 cli 22928: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2292c: 9b 7f andi r25, 0xFB ; 251 2292e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22932: 4f bf out 0x3f, r20 ; 63 22934: f9 01 movw r30, r18 22936: 31 97 sbiw r30, 0x01 ; 1 22938: f1 f7 brne .-4 ; 0x22936 2293a: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 2293c: 41 f7 brne .-48 ; 0x2290e WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 2293e: 08 95 ret 00022940 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 22940: 89 e0 ldi r24, 0x09 ; 9 22942: 9f e6 ldi r25, 0x6F ; 111 22944: 0c 94 82 79 jmp 0xf304 ; 0xf304 00022948 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 22948: 60 91 38 02 lds r22, 0x0238 ; 0x800238 2294c: 81 e0 ldi r24, 0x01 ; 1 2294e: 68 27 eor r22, r24 22950: 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); 22954: 87 e8 ldi r24, 0x87 ; 135 22956: 9f e0 ldi r25, 0x0F ; 15 22958: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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. 2295c: 80 91 38 02 lds r24, 0x0238 ; 0x800238 22960: 81 11 cpse r24, r1 22962: 02 c0 rjmp .+4 ; 0x22968 22964: 10 92 e6 03 sts 0x03E6, r1 ; 0x8003e6 #endif //FANCHECK } 22968: 08 95 ret 0002296a : * 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) { 2296a: af 92 push r10 2296c: bf 92 push r11 2296e: cf 92 push r12 22970: df 92 push r13 22972: ef 92 push r14 22974: ff 92 push r15 22976: 0f 93 push r16 22978: 1f 93 push r17 2297a: cf 93 push r28 2297c: df 93 push r29 2297e: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 22980: 0e 94 9b 6e call 0xdd36 ; 0xdd36 * @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; 22984: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 22986: 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; 22988: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 2298a: 6f 2d mov r22, r15 2298c: 80 e0 ldi r24, 0x00 ; 0 2298e: 0e 94 e7 6e call 0xddce ; 0xddce // 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) 22992: c6 01 movw r24, r12 22994: 0f 94 23 10 call 0x22046 ; 0x22046 22998: 88 23 and r24, r24 2299a: 29 f0 breq .+10 ; 0x229a6 2299c: 8f ef ldi r24, 0xFF ; 255 2299e: c8 1a sub r12, r24 229a0: d8 0a sbc r13, r24 229a2: 09 f4 brne .+2 ; 0x229a6 229a4: 49 c0 rjmp .+146 ; 0x22a38 229a6: c6 01 movw r24, r12 229a8: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 229ac: 84 31 cpi r24, 0x14 ; 20 229ae: 91 05 cpc r25, r1 229b0: 10 f0 brcs .+4 ; 0x229b6 229b2: 84 e1 ldi r24, 0x14 ; 20 229b4: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 229b6: e6 01 movw r28, r12 229b8: c8 0f add r28, r24 229ba: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 229bc: e3 e0 ldi r30, 0x03 ; 3 229be: fe 12 cpse r15, r30 229c0: 0a c0 rjmp .+20 ; 0x229d6 229c2: 84 31 cpi r24, 0x14 ; 20 229c4: 41 f4 brne .+16 ; 0x229d6 // 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; 229c6: fe 01 movw r30, r28 229c8: 84 91 lpm r24, Z 229ca: e1 2c mov r14, r1 if (multi_screen) 229cc: 88 23 and r24, r24 229ce: 19 f0 breq .+6 ; 0x229d6 msgend = (msgend2 -= 2); 229d0: 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; 229d2: ee 24 eor r14, r14 229d4: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 229d6: fe 01 movw r30, r28 229d8: 84 91 lpm r24, Z 229da: 88 23 and r24, r24 229dc: 09 f4 brne .+2 ; 0x229e0 229de: 40 c0 rjmp .+128 ; 0x22a60 229e0: ce 01 movw r24, r28 229e2: 0f 94 23 10 call 0x22046 ; 0x22046 229e6: 81 11 cpse r24, r1 229e8: 3b c0 rjmp .+118 ; 0x22a60 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); 229ea: fe 01 movw r30, r28 229ec: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 229ee: 92 ed ldi r25, 0xD2 ; 210 229f0: 98 0f add r25, r24 229f2: 92 30 cpi r25, 0x02 ; 2 229f4: a8 f1 brcs .+106 ; 0x22a60 229f6: 8c 32 cpi r24, 0x2C ; 44 229f8: 99 f1 breq .+102 ; 0x22a60 229fa: 96 ec ldi r25, 0xC6 ; 198 229fc: 98 0f add r25, r24 229fe: 92 30 cpi r25, 0x02 ; 2 22a00: 78 f1 brcs .+94 ; 0x22a60 22a02: 8f 33 cpi r24, 0x3F ; 63 22a04: 69 f1 breq .+90 ; 0x22a60 22a06: 81 32 cpi r24, 0x21 ; 33 22a08: 59 f1 breq .+86 ; 0x22a60 22a0a: 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)) 22a0c: c0 16 cp r12, r16 22a0e: d1 06 cpc r13, r17 22a10: 58 f4 brcc .+22 ; 0x22a28 22a12: 58 01 movw r10, r16 22a14: f1 e0 ldi r31, 0x01 ; 1 22a16: af 1a sub r10, r31 22a18: b1 08 sbc r11, r1 22a1a: c5 01 movw r24, r10 22a1c: 0f 94 23 10 call 0x22046 ; 0x22046 22a20: 81 11 cpse r24, r1 22a22: 1d c0 rjmp .+58 ; 0x22a5e -- msgend; 22a24: 85 01 movw r16, r10 22a26: f2 cf rjmp .-28 ; 0x22a0c if (msgend == msg) 22a28: c0 16 cp r12, r16 22a2a: d1 06 cpc r13, r17 22a2c: c9 f0 breq .+50 ; 0x22a60 22a2e: 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) { 22a30: f3 94 inc r15 22a32: 84 e0 ldi r24, 0x04 ; 4 22a34: f8 12 cpse r15, r24 22a36: a9 cf rjmp .-174 ; 0x2298a } lcd_print(c); } } if (multi_screen) { 22a38: ee 20 and r14, r14 22a3a: f9 f0 breq .+62 ; 0x22a7a // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 22a3c: 48 e8 ldi r20, 0x88 ; 136 22a3e: 63 e0 ldi r22, 0x03 ; 3 22a40: 83 e1 ldi r24, 0x13 ; 19 22a42: 0e 94 07 6f call 0xde0e ; 0xde0e } return multi_screen ? msgend : NULL; } 22a46: ce 01 movw r24, r28 22a48: df 91 pop r29 22a4a: cf 91 pop r28 22a4c: 1f 91 pop r17 22a4e: 0f 91 pop r16 22a50: ff 90 pop r15 22a52: ef 90 pop r14 22a54: df 90 pop r13 22a56: cf 90 pop r12 22a58: bf 90 pop r11 22a5a: af 90 pop r10 22a5c: 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)) 22a5e: 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) { 22a60: cc 16 cp r12, r28 22a62: dd 06 cpc r13, r29 22a64: 28 f7 brcc .-54 ; 0x22a30 char c = char(pgm_read_byte(msg)); 22a66: f6 01 movw r30, r12 22a68: 84 91 lpm r24, Z if (c == '\n') { 22a6a: 8a 30 cpi r24, 0x0A ; 10 22a6c: 09 f3 breq .-62 ; 0x22a30 22a6e: 0e 94 96 6f call 0xdf2c ; 0xdf2c -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 22a72: ff ef ldi r31, 0xFF ; 255 22a74: cf 1a sub r12, r31 22a76: df 0a sbc r13, r31 22a78: f3 cf rjmp .-26 ; 0x22a60 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 22a7a: d0 e0 ldi r29, 0x00 ; 0 22a7c: c0 e0 ldi r28, 0x00 ; 0 22a7e: e3 cf rjmp .-58 ; 0x22a46 00022a80 : #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){ 22a80: cf 93 push r28 22a82: df 93 push r29 22a84: cd b7 in r28, 0x3d ; 61 22a86: de b7 in r29, 0x3e ; 62 22a88: 2f 97 sbiw r28, 0x0f ; 15 22a8a: 0f b6 in r0, 0x3f ; 63 22a8c: f8 94 cli 22a8e: de bf out 0x3e, r29 ; 62 22a90: 0f be out 0x3f, r0 ; 63 22a92: cd bf out 0x3d, r28 ; 61 22a94: fc 01 movw r30, r24 22a96: de 01 movw r26, r28 22a98: 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; 22a9a: 90 e0 ldi r25, 0x00 ; 0 22a9c: 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); 22a9e: 84 91 lpm r24, Z 22aa0: 41 e0 ldi r20, 0x01 ; 1 22aa2: 49 0f add r20, r25 if( ! b ) 22aa4: 88 23 and r24, r24 22aa6: 29 f0 breq .+10 ; 0x22ab2 break; dst[i] = b; 22aa8: 8d 93 st X+, r24 22aaa: 31 96 adiw r30, 0x01 ; 1 22aac: 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 22aae: 4d 30 cpi r20, 0x0D ; 13 22ab0: b1 f7 brne .-20 ; 0x22a9e uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 22ab2: f9 01 movw r30, r18 22ab4: e9 0f add r30, r25 22ab6: f1 1d adc r31, r1 22ab8: 8a e3 ldi r24, 0x3A ; 58 22aba: 80 83 st Z, r24 ++i; 22abc: 9f 5f subi r25, 0xFF ; 255 22abe: f9 01 movw r30, r18 22ac0: e9 0f add r30, r25 22ac2: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 22ac4: 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 22ac6: 9e 30 cpi r25, 0x0E ; 14 22ac8: 19 f0 breq .+6 ; 0x22ad0 dst[i] = ' '; 22aca: 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 22acc: 9f 5f subi r25, 0xFF ; 255 22ace: fb cf rjmp .-10 ; 0x22ac6 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 22ad0: 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 22ad2: 7f 93 push r23 22ad4: 6f 93 push r22 22ad6: 3f 93 push r19 22ad8: 2f 93 push r18 22ada: 83 e3 ldi r24, 0x33 ; 51 22adc: 91 ea ldi r25, 0xA1 ; 161 22ade: 9f 93 push r25 22ae0: 8f 93 push r24 22ae2: 0e 94 c0 6e call 0xdd80 ; 0xdd80 22ae6: 0f 90 pop r0 22ae8: 0f 90 pop r0 22aea: 0f 90 pop r0 22aec: 0f 90 pop r0 22aee: 0f 90 pop r0 22af0: 0f 90 pop r0 } 22af2: 2f 96 adiw r28, 0x0f ; 15 22af4: 0f b6 in r0, 0x3f ; 63 22af6: f8 94 cli 22af8: de bf out 0x3e, r29 ; 62 22afa: 0f be out 0x3f, r0 ; 63 22afc: cd bf out 0x3d, r28 ; 61 22afe: df 91 pop r29 22b00: cf 91 pop r28 22b02: 08 95 ret 00022b04 : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 22b04: ef 92 push r14 22b06: ff 92 push r15 22b08: 0f 93 push r16 22b0a: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 22b0c: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 22b10: 81 11 cpse r24, r1 22b12: 35 c0 rjmp .+106 ; 0x22b7e { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 22b14: 80 ec ldi r24, 0xC0 ; 192 22b16: 9f e0 ldi r25, 0x0F ; 15 22b18: 0f 94 23 dc call 0x3b846 ; 0x3b846 22b1c: 81 30 cpi r24, 0x01 ; 1 22b1e: 61 f5 brne .+88 ; 0x22b78 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 22b20: 8f eb ldi r24, 0xBF ; 191 22b22: 9f e0 ldi r25, 0x0F ; 15 22b24: 0f 94 23 dc call 0x3b846 ; 0x3b846 22b28: 08 2e mov r0, r24 22b2a: 00 0c add r0, r0 22b2c: 99 0b sbc r25, r25 22b2e: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 22b32: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 22b36: 8e eb ldi r24, 0xBE ; 190 22b38: 9f e0 ldi r25, 0x0F ; 15 22b3a: 0f 94 23 dc call 0x3b846 ; 0x3b846 22b3e: 08 2e mov r0, r24 22b40: 00 0c add r0, r0 22b42: 99 0b sbc r25, r25 22b44: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 22b48: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 22b4c: 8d eb ldi r24, 0xBD ; 189 22b4e: 9f e0 ldi r25, 0x0F ; 15 22b50: 0f 94 23 dc call 0x3b846 ; 0x3b846 22b54: 08 2e mov r0, r24 22b56: 00 0c add r0, r0 22b58: 99 0b sbc r25, r25 22b5a: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 22b5e: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 22b62: 8c eb ldi r24, 0xBC ; 188 22b64: 9f e0 ldi r25, 0x0F ; 15 22b66: 0f 94 23 dc call 0x3b846 ; 0x3b846 22b6a: 08 2e mov r0, r24 22b6c: 00 0c add r0, r0 22b6e: 99 0b sbc r25, r25 22b70: 90 93 be 03 sts 0x03BE, r25 ; 0x8003be 22b74: 80 93 bd 03 sts 0x03BD, r24 ; 0x8003bd } _md->status = 1; 22b78: 81 e0 ldi r24, 0x01 ; 1 22b7a: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } MENU_BEGIN(); 22b7e: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 22b82: 10 92 12 05 sts 0x0512, r1 ; 0x800512 22b86: 80 91 12 05 lds r24, 0x0512 ; 0x800512 22b8a: 84 30 cpi r24, 0x04 ; 4 22b8c: 08 f0 brcs .+2 ; 0x22b90 22b8e: 6e c0 rjmp .+220 ; 0x22c6c 22b90: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 22b94: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 22b98: 88 23 and r24, r24 22b9a: e9 f0 breq .+58 ; 0x22bd6 22b9c: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 22ba0: 8f eb ldi r24, 0xBF ; 191 22ba2: 9f e0 ldi r25, 0x0F ; 15 22ba4: 0f 94 47 dc call 0x3b88e ; 0x3b88e 22ba8: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 22bac: 8d eb ldi r24, 0xBD ; 189 22bae: 9f e0 ldi r25, 0x0F ; 15 22bb0: 0f 94 47 dc call 0x3b88e ; 0x3b88e 22bb4: 60 91 bd 03 lds r22, 0x03BD ; 0x8003bd 22bb8: 8c eb ldi r24, 0xBC ; 188 22bba: 9f e0 ldi r25, 0x0F ; 15 22bbc: 0f 94 47 dc call 0x3b88e ; 0x3b88e 22bc0: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 22bc4: 8e eb ldi r24, 0xBE ; 190 22bc6: 9f e0 ldi r25, 0x0F ; 15 22bc8: 0f 94 47 dc call 0x3b88e ; 0x3b88e 22bcc: 61 e0 ldi r22, 0x01 ; 1 22bce: 80 ec ldi r24, 0xC0 ; 192 22bd0: 9f e0 ldi r25, 0x0F ; 15 22bd2: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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)); 22bd6: 8c eb ldi r24, 0xBC ; 188 22bd8: 99 e4 ldi r25, 0x49 ; 73 22bda: 0e 94 b3 72 call 0xe566 ; 0xe566 22bde: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22be2: 86 e9 ldi r24, 0x96 ; 150 22be4: 91 e5 ldi r25, 0x51 ; 81 22be6: 0e 94 b3 72 call 0xe566 ; 0xe566 22bea: f1 2c mov r15, r1 22bec: e1 2c mov r14, r1 22bee: 04 e6 ldi r16, 0x64 ; 100 22bf0: 10 e0 ldi r17, 0x00 ; 0 22bf2: 2c e9 ldi r18, 0x9C ; 156 22bf4: 3f ef ldi r19, 0xFF ; 255 22bf6: 40 e1 ldi r20, 0x10 ; 16 22bf8: 67 eb ldi r22, 0xB7 ; 183 22bfa: 73 e0 ldi r23, 0x03 ; 3 22bfc: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22c00: 85 e8 ldi r24, 0x85 ; 133 22c02: 91 e5 ldi r25, 0x51 ; 81 22c04: 0e 94 b3 72 call 0xe566 ; 0xe566 22c08: 2c e9 ldi r18, 0x9C ; 156 22c0a: 3f ef ldi r19, 0xFF ; 255 22c0c: 40 e1 ldi r20, 0x10 ; 16 22c0e: 69 eb ldi r22, 0xB9 ; 185 22c10: 73 e0 ldi r23, 0x03 ; 3 22c12: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22c16: 84 e7 ldi r24, 0x74 ; 116 22c18: 91 e5 ldi r25, 0x51 ; 81 22c1a: 0e 94 b3 72 call 0xe566 ; 0xe566 22c1e: 2c e9 ldi r18, 0x9C ; 156 22c20: 3f ef ldi r19, 0xFF ; 255 22c22: 40 e1 ldi r20, 0x10 ; 16 22c24: 6b eb ldi r22, 0xBB ; 187 22c26: 73 e0 ldi r23, 0x03 ; 3 22c28: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 22c2c: 83 e6 ldi r24, 0x63 ; 99 22c2e: 91 e5 ldi r25, 0x51 ; 81 22c30: 0e 94 b3 72 call 0xe566 ; 0xe566 22c34: 2c e9 ldi r18, 0x9C ; 156 22c36: 3f ef ldi r19, 0xFF ; 255 22c38: 40 e1 ldi r20, 0x10 ; 16 22c3a: 6d eb ldi r22, 0xBD ; 189 22c3c: 73 e0 ldi r23, 0x03 ; 3 22c3e: 0f 94 ed d1 call 0x3a3da ; 0x3a3da MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 22c42: 8f ee ldi r24, 0xEF ; 239 22c44: 95 e4 ldi r25, 0x45 ; 69 22c46: 0e 94 b3 72 call 0xe566 ; 0xe566 22c4a: 6c ed ldi r22, 0xDC ; 220 22c4c: 79 e3 ldi r23, 0x39 ; 57 22c4e: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_END(); 22c52: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 _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(); 22c56: 80 91 12 05 lds r24, 0x0512 ; 0x800512 22c5a: 8f 5f subi r24, 0xFF ; 255 22c5c: 80 93 12 05 sts 0x0512, r24 ; 0x800512 22c60: 80 91 14 05 lds r24, 0x0514 ; 0x800514 22c64: 8f 5f subi r24, 0xFF ; 255 22c66: 80 93 14 05 sts 0x0514, r24 ; 0x800514 22c6a: 8d cf rjmp .-230 ; 0x22b86 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(); } 22c6c: 1f 91 pop r17 22c6e: 0f 91 pop r16 22c70: ff 90 pop r15 22c72: ef 90 pop r14 22c74: 08 95 ret 00022c76 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 22c76: 87 ea ldi r24, 0xA7 ; 167 22c78: 9c e0 ldi r25, 0x0C ; 12 22c7a: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (eeprom_setting != 0) 22c7e: 81 11 cpse r24, r1 22c80: 05 c0 rjmp .+10 ; 0x22c8c return false; switch(eFilamentAction) { 22c82: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22c86: 81 50 subi r24, 0x01 ; 1 22c88: 88 30 cpi r24, 0x08 ; 8 22c8a: 10 f0 brcs .+4 ; 0x22c90 #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; 22c8c: 80 e0 ldi r24, 0x00 ; 0 22c8e: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 22c90: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 22c92: 08 95 ret 00022c94 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 22c94: 8e ec ldi r24, 0xCE ; 206 22c96: 9e e0 ldi r25, 0x0E ; 14 22c98: 0f 94 23 dc call 0x3b846 ; 0x3b846 22c9c: 60 e0 ldi r22, 0x00 ; 0 22c9e: 81 30 cpi r24, 0x01 ; 1 22ca0: 09 f0 breq .+2 ; 0x22ca4 22ca2: 61 e0 ldi r22, 0x01 ; 1 22ca4: 8e ec ldi r24, 0xCE ; 206 22ca6: 9e e0 ldi r25, 0x0E ; 14 22ca8: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00022cac : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 22cac: 86 ed ldi r24, 0xD6 ; 214 22cae: 9e e0 ldi r25, 0x0E ; 14 22cb0: 0f 94 23 dc call 0x3b846 ; 0x3b846 22cb4: 61 e0 ldi r22, 0x01 ; 1 22cb6: 82 30 cpi r24, 0x02 ; 2 22cb8: 09 f0 breq .+2 ; 0x22cbc 22cba: 62 e0 ldi r22, 0x02 ; 2 22cbc: 86 ed ldi r24, 0xD6 ; 214 22cbe: 9e e0 ldi r25, 0x0E ; 14 22cc0: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 00022cc4 : } _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(); 22cc4: 0e 94 9f 76 call 0xed3e ; 0xed3e _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 22cc8: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 } 22ccc: 08 95 ret 00022cce : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 22cce: 82 e4 ldi r24, 0x42 ; 66 22cd0: 90 e5 ldi r25, 0x50 ; 80 22cd2: 0e 94 b3 72 call 0xe566 ; 0xe566 22cd6: 0f 94 b5 14 call 0x2296a ; 0x2296a menu_back_if_clicked(); 22cda: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00022cde : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 22cde: df 92 push r13 22ce0: ef 92 push r14 22ce2: ff 92 push r15 22ce4: 0f 93 push r16 22ce6: 1f 93 push r17 22ce8: cf 93 push r28 22cea: df 93 push r29 22cec: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22cf0: 0e 94 13 6f call 0xde26 ; 0xde26 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] ); 22cf4: c9 ec ldi r28, 0xC9 ; 201 22cf6: d3 e0 ldi r29, 0x03 ; 3 22cf8: 8a 81 ldd r24, Y+2 ; 0x02 22cfa: 9b 81 ldd r25, Y+3 ; 0x03 22cfc: 2c e3 ldi r18, 0x3C ; 60 22cfe: f2 2e mov r15, r18 22d00: f8 9e mul r15, r24 22d02: 80 01 movw r16, r0 22d04: f9 9e mul r15, r25 22d06: 10 0d add r17, r0 22d08: 11 24 eor r1, r1 22d0a: 83 ef ldi r24, 0xF3 ; 243 22d0c: 98 e4 ldi r25, 0x48 ; 72 22d0e: 0e 94 b3 72 call 0xe566 ; 0xe566 22d12: e8 2e mov r14, r24 22d14: d9 2e mov r13, r25 22d16: 88 81 ld r24, Y 22d18: 99 81 ldd r25, Y+1 ; 0x01 22d1a: f8 9e mul r15, r24 22d1c: e0 01 movw r28, r0 22d1e: f9 9e mul r15, r25 22d20: d0 0d add r29, r0 22d22: 11 24 eor r1, r1 22d24: 80 e0 ldi r24, 0x00 ; 0 22d26: 99 e4 ldi r25, 0x49 ; 73 22d28: 0e 94 b3 72 call 0xe566 ; 0xe566 22d2c: 1f 93 push r17 22d2e: 0f 93 push r16 22d30: df 92 push r13 22d32: ef 92 push r14 22d34: df 93 push r29 22d36: cf 93 push r28 22d38: 9f 93 push r25 22d3a: 8f 93 push r24 22d3c: 87 e9 ldi r24, 0x97 ; 151 22d3e: 90 ea ldi r25, 0xA0 ; 160 22d40: 9f 93 push r25 22d42: 8f 93 push r24 22d44: 0e 94 c0 6e call 0xdd80 ; 0xdd80 menu_back_if_clicked(); 22d48: 8d b7 in r24, 0x3d ; 61 22d4a: 9e b7 in r25, 0x3e ; 62 22d4c: 0a 96 adiw r24, 0x0a ; 10 22d4e: 0f b6 in r0, 0x3f ; 63 22d50: f8 94 cli 22d52: 9e bf out 0x3e, r25 ; 62 22d54: 0f be out 0x3f, r0 ; 63 22d56: 8d bf out 0x3d, r24 ; 61 } 22d58: df 91 pop r29 22d5a: cf 91 pop r28 22d5c: 1f 91 pop r17 22d5e: 0f 91 pop r16 22d60: ff 90 pop r15 22d62: ef 90 pop r14 22d64: 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(); 22d66: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00022d6a : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 22d6a: cf 92 push r12 22d6c: df 92 push r13 22d6e: ef 92 push r14 22d70: ff 92 push r15 22d72: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22d76: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 22d7a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 22d7e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 22d82: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 22d86: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 22d8a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 22d8e: 6b 01 movw r12, r22 22d90: 80 e1 ldi r24, 0x10 ; 16 22d92: 94 e4 ldi r25, 0x44 ; 68 22d94: 0e 94 b3 72 call 0xe566 ; 0xe566 22d98: b6 01 movw r22, r12 22d9a: 0f 94 40 15 call 0x22a80 ; 0x22a80 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 22d9e: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 22da2: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 22da6: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 22daa: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 22dae: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 22db2: 6b 01 movw r12, r22 22db4: 85 ef ldi r24, 0xF5 ; 245 22db6: 93 e4 ldi r25, 0x43 ; 67 22db8: 0e 94 b3 72 call 0xe566 ; 0xe566 22dbc: b6 01 movw r22, r12 22dbe: 0f 94 40 15 call 0x22a80 ; 0x22a80 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 22dc2: 60 91 56 06 lds r22, 0x0656 ; 0x800656 22dc6: 70 91 57 06 lds r23, 0x0657 ; 0x800657 22dca: 80 91 58 06 lds r24, 0x0658 ; 0x800658 22dce: 90 91 59 06 lds r25, 0x0659 ; 0x800659 22dd2: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 22dd6: 6b 01 movw r12, r22 22dd8: 8d ed ldi r24, 0xDD ; 221 22dda: 9e e4 ldi r25, 0x4E ; 78 22ddc: 0e 94 b3 72 call 0xe566 ; 0xe566 22de0: b6 01 movw r22, r12 22de2: 0f 94 40 15 call 0x22a80 ; 0x22a80 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 22de6: 60 91 99 03 lds r22, 0x0399 ; 0x800399 22dea: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 22dee: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 22df2: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 22df6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 22dfa: 86 e7 ldi r24, 0x76 ; 118 22dfc: 9a e6 ldi r25, 0x6A ; 106 22dfe: 0f 94 40 15 call 0x22a80 ; 0x22a80 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 22e02: ff 90 pop r15 22e04: ef 90 pop r14 22e06: df 90 pop r13 22e08: 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(); 22e0a: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00022e0e : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 22e0e: cf 92 push r12 22e10: df 92 push r13 22e12: ef 92 push r14 22e14: ff 92 push r15 22e16: 0f 93 push r16 22e18: 1f 93 push r17 22e1a: cf 93 push r28 22e1c: df 93 push r29 22e1e: 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; 22e22: 60 91 5c 06 lds r22, 0x065C ; 0x80065c 22e26: 70 91 5d 06 lds r23, 0x065D ; 0x80065d 22e2a: 07 2e mov r0, r23 22e2c: 00 0c add r0, r0 22e2e: 88 0b sbc r24, r24 22e30: 99 0b sbc r25, r25 22e32: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 22e36: 20 e0 ldi r18, 0x00 ; 0 22e38: 30 ec ldi r19, 0xC0 ; 192 22e3a: 4f e7 ldi r20, 0x7F ; 127 22e3c: 56 e4 ldi r21, 0x46 ; 70 22e3e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 22e42: 20 e0 ldi r18, 0x00 ; 0 22e44: 30 e0 ldi r19, 0x00 ; 0 22e46: 40 ea ldi r20, 0xA0 ; 160 22e48: 50 e4 ldi r21, 0x40 ; 64 22e4a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22e4e: 27 ed ldi r18, 0xD7 ; 215 22e50: 30 e3 ldi r19, 0x30 ; 48 22e52: 44 e4 ldi r20, 0x44 ; 68 22e54: 5e e3 ldi r21, 0x3E ; 62 22e56: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 22e5a: eb 01 movw r28, r22 22e5c: 18 2f mov r17, r24 22e5e: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 22e60: 60 91 5a 06 lds r22, 0x065A ; 0x80065a 22e64: 70 91 5b 06 lds r23, 0x065B ; 0x80065b 22e68: 07 2e mov r0, r23 22e6a: 00 0c add r0, r0 22e6c: 88 0b sbc r24, r24 22e6e: 99 0b sbc r25, r25 22e70: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 22e74: 20 e0 ldi r18, 0x00 ; 0 22e76: 30 ec ldi r19, 0xC0 ; 192 22e78: 4f e7 ldi r20, 0x7F ; 127 22e7a: 56 e4 ldi r21, 0x46 ; 70 22e7c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 22e80: 20 e0 ldi r18, 0x00 ; 0 22e82: 30 e0 ldi r19, 0x00 ; 0 22e84: 40 ea ldi r20, 0xA0 ; 160 22e86: 50 e4 ldi r21, 0x40 ; 64 22e88: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 22e8c: 27 ed ldi r18, 0xD7 ; 215 22e8e: 30 e3 ldi r19, 0x30 ; 48 22e90: 44 e4 ldi r20, 0x44 ; 68 22e92: 5e e3 ldi r21, 0x3E ; 62 22e94: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 22e98: f6 2e mov r15, r22 22e9a: e7 2e mov r14, r23 22e9c: d8 2e mov r13, r24 22e9e: c9 2e mov r12, r25 lcd_home(); 22ea0: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 22ea4: cf 92 push r12 22ea6: df 92 push r13 22ea8: ef 92 push r14 22eaa: ff 92 push r15 22eac: 0f 93 push r16 22eae: 1f 93 push r17 22eb0: df 93 push r29 22eb2: cf 93 push r28 22eb4: 8d e3 ldi r24, 0x3D ; 61 22eb6: 91 ea ldi r25, 0xA1 ; 161 22eb8: 9f 93 push r25 22eba: 8f 93 push r24 22ebc: 0e 94 c0 6e call 0xdd80 ; 0xdd80 #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(); 22ec0: 8d b7 in r24, 0x3d ; 61 22ec2: 9e b7 in r25, 0x3e ; 62 22ec4: 0a 96 adiw r24, 0x0a ; 10 22ec6: 0f b6 in r0, 0x3f ; 63 22ec8: f8 94 cli 22eca: 9e bf out 0x3e, r25 ; 62 22ecc: 0f be out 0x3f, r0 ; 63 22ece: 8d bf out 0x3d, r24 ; 61 } 22ed0: df 91 pop r29 22ed2: cf 91 pop r28 22ed4: 1f 91 pop r17 22ed6: 0f 91 pop r16 22ed8: ff 90 pop r15 22eda: ef 90 pop r14 22edc: df 90 pop r13 22ede: 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(); 22ee0: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00022ee4 : //! | 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() { 22ee4: af 92 push r10 22ee6: bf 92 push r11 22ee8: cf 92 push r12 22eea: df 92 push r13 22eec: ef 92 push r14 22eee: ff 92 push r15 22ef0: 0f 93 push r16 22ef2: 1f 93 push r17 22ef4: cf 93 push r28 22ef6: df 93 push r29 22ef8: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 22efc: 84 e6 ldi r24, 0x64 ; 100 22efe: 9f e0 ldi r25, 0x0F ; 15 22f00: 0f 94 23 dc call 0x3b846 ; 0x3b846 22f04: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 22f06: 85 e6 ldi r24, 0x65 ; 101 22f08: 9f e0 ldi r25, 0x0F ; 15 22f0a: 0f 94 23 dc call 0x3b846 ; 0x3b846 22f0e: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 22f10: 86 e6 ldi r24, 0x66 ; 102 22f12: 9f e0 ldi r25, 0x0F ; 15 22f14: 0f 94 23 dc call 0x3b846 ; 0x3b846 22f18: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 22f1a: 88 e6 ldi r24, 0x68 ; 104 22f1c: 9f e0 ldi r25, 0x0F ; 15 22f1e: 0f 94 23 dc call 0x3b846 ; 0x3b846 22f22: a8 2e mov r10, r24 lcd_home(); 22f24: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(failStatsFmt, 22f28: 80 ec ldi r24, 0xC0 ; 192 22f2a: 9e e4 ldi r25, 0x4E ; 78 22f2c: 0e 94 b3 72 call 0xe566 ; 0xe566 22f30: d8 2e mov r13, r24 22f32: c9 2e mov r12, r25 22f34: 81 eb ldi r24, 0xB1 ; 177 22f36: 9e e4 ldi r25, 0x4E ; 78 22f38: 0e 94 b3 72 call 0xe566 ; 0xe566 22f3c: 08 2f mov r16, r24 22f3e: f9 2e mov r15, r25 22f40: 80 ea ldi r24, 0xA0 ; 160 22f42: 9e e4 ldi r25, 0x4E ; 78 22f44: 0e 94 b3 72 call 0xe566 ; 0xe566 22f48: ec 01 movw r28, r24 22f4a: 8a e8 ldi r24, 0x8A ; 138 22f4c: 9e e4 ldi r25, 0x4E ; 78 22f4e: 0e 94 b3 72 call 0xe566 ; 0xe566 22f52: 1f 92 push r1 22f54: af 92 push r10 22f56: 1f 92 push r1 22f58: bf 92 push r11 22f5a: cf 92 push r12 22f5c: df 92 push r13 22f5e: 1f 92 push r1 22f60: ef 92 push r14 22f62: ff 92 push r15 22f64: 0f 93 push r16 22f66: 1f 92 push r1 22f68: 1f 93 push r17 22f6a: df 93 push r29 22f6c: cf 93 push r28 22f6e: 9f 93 push r25 22f70: 8f 93 push r24 22f72: 8e ef ldi r24, 0xFE ; 254 22f74: 90 ea ldi r25, 0xA0 ; 160 22f76: 9f 93 push r25 22f78: 8f 93 push r24 22f7a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 22f7e: 8d b7 in r24, 0x3d ; 61 22f80: 9e b7 in r25, 0x3e ; 62 22f82: 42 96 adiw r24, 0x12 ; 18 22f84: 0f b6 in r0, 0x3f ; 63 22f86: f8 94 cli 22f88: 9e bf out 0x3e, r25 ; 62 22f8a: 0f be out 0x3f, r0 ; 63 22f8c: 8d bf out 0x3d, r24 ; 61 } 22f8e: df 91 pop r29 22f90: cf 91 pop r28 22f92: 1f 91 pop r17 22f94: 0f 91 pop r16 22f96: ff 90 pop r15 22f98: ef 90 pop r14 22f9a: df 90 pop r13 22f9c: cf 90 pop r12 22f9e: bf 90 pop r11 22fa0: 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(); 22fa2: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00022fa6 : //! | 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() { 22fa6: cf 92 push r12 22fa8: df 92 push r13 22faa: ef 92 push r14 22fac: ff 92 push r15 22fae: 0f 93 push r16 22fb0: 1f 93 push r17 22fb2: cf 93 push r28 22fb4: df 93 push r29 22fb6: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 22fba: 0e 94 13 6f call 0xde26 ; 0xde26 " %-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) )); 22fbe: 8f ec ldi r24, 0xCF ; 207 22fc0: 9e e0 ldi r25, 0x0E ; 14 22fc2: 0f 94 23 dc call 0x3b846 ; 0x3b846 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 22fc6: 90 e0 ldi r25, 0x00 ; 0 22fc8: 0f 94 32 10 call 0x22064 ; 0x22064 22fcc: d8 2e mov r13, r24 22fce: c9 2e mov r12, r25 22fd0: 83 e4 ldi r24, 0x43 ; 67 22fd2: 9e e4 ldi r25, 0x4E ; 78 22fd4: 0e 94 b3 72 call 0xe566 ; 0xe566 22fd8: f8 2e mov r15, r24 22fda: 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) ), 22fdc: 82 ed ldi r24, 0xD2 ; 210 22fde: 9e e0 ldi r25, 0x0E ; 14 22fe0: 0f 94 23 dc call 0x3b846 ; 0x3b846 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 22fe4: 90 e0 ldi r25, 0x00 ; 0 22fe6: 0f 94 32 10 call 0x22064 ; 0x22064 22fea: 18 2f mov r17, r24 22fec: 09 2f mov r16, r25 22fee: 87 e3 ldi r24, 0x37 ; 55 22ff0: 9e e4 ldi r25, 0x4E ; 78 22ff2: 0e 94 b3 72 call 0xe566 ; 0xe566 22ff6: ec 01 movw r28, r24 22ff8: 8a e8 ldi r24, 0x8A ; 138 22ffa: 9e e4 ldi r25, 0x4E ; 78 22ffc: 0e 94 b3 72 call 0xe566 ; 0xe566 23000: cf 92 push r12 23002: df 92 push r13 23004: ef 92 push r14 23006: ff 92 push r15 23008: 0f 93 push r16 2300a: 1f 93 push r17 2300c: df 93 push r29 2300e: cf 93 push r28 23010: 9f 93 push r25 23012: 8f 93 push r24 23014: 82 eb ldi r24, 0xB2 ; 178 23016: 90 ea ldi r25, 0xA0 ; 160 23018: 9f 93 push r25 2301a: 8f 93 push r24 2301c: 0e 94 c0 6e call 0xdd80 ; 0xdd80 " %-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(); 23020: 8d b7 in r24, 0x3d ; 61 23022: 9e b7 in r25, 0x3e ; 62 23024: 0c 96 adiw r24, 0x0c ; 12 23026: 0f b6 in r0, 0x3f ; 63 23028: f8 94 cli 2302a: 9e bf out 0x3e, r25 ; 62 2302c: 0f be out 0x3f, r0 ; 63 2302e: 8d bf out 0x3d, r24 ; 61 } 23030: df 91 pop r29 23032: cf 91 pop r28 23034: 1f 91 pop r17 23036: 0f 91 pop r16 23038: ff 90 pop r15 2303a: ef 90 pop r14 2303c: df 90 pop r13 2303e: 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(); 23040: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00023044 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 23044: 0f 93 push r16 23046: 1f 93 push r17 23048: cf 93 push r28 2304a: df 93 push r29 lcd_home(); 2304c: 0e 94 13 6f call 0xde26 ; 0xde26 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))); 23050: 8b e5 ldi r24, 0x5B ; 91 23052: 9f e0 ldi r25, 0x0F ; 15 23054: 0f 94 31 dc call 0x3b862 ; 0x3b862 23058: 18 2f mov r17, r24 2305a: 09 2f mov r16, r25 2305c: 8d e5 ldi r24, 0x5D ; 93 2305e: 9f e0 ldi r25, 0x0F ; 15 23060: 0f 94 31 dc call 0x3b862 ; 0x3b862 23064: ec 01 movw r28, r24 23066: 81 e0 ldi r24, 0x01 ; 1 23068: 9f e4 ldi r25, 0x4F ; 79 2306a: 0e 94 b3 72 call 0xe566 ; 0xe566 2306e: 0f 93 push r16 23070: 1f 93 push r17 23072: df 93 push r29 23074: cf 93 push r28 23076: 9f 93 push r25 23078: 8f 93 push r24 2307a: 81 e6 ldi r24, 0x61 ; 97 2307c: 91 ea ldi r25, 0xA1 ; 161 2307e: 9f 93 push r25 23080: 8f 93 push r24 23082: 0e 94 c0 6e call 0xdd80 ; 0xdd80 menu_back_if_clicked(); 23086: 8d b7 in r24, 0x3d ; 61 23088: 9e b7 in r25, 0x3e ; 62 2308a: 08 96 adiw r24, 0x08 ; 8 2308c: 0f b6 in r0, 0x3f ; 63 2308e: f8 94 cli 23090: 9e bf out 0x3e, r25 ; 62 23092: 0f be out 0x3f, r0 ; 63 23094: 8d bf out 0x3d, r24 ; 61 } 23096: df 91 pop r29 23098: cf 91 pop r28 2309a: 1f 91 pop r17 2309c: 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(); 2309e: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 000230a2 : //! | 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() { 230a2: 6f 92 push r6 230a4: 7f 92 push r7 230a6: 8f 92 push r8 230a8: 9f 92 push r9 230aa: af 92 push r10 230ac: bf 92 push r11 230ae: cf 92 push r12 230b0: df 92 push r13 230b2: ef 92 push r14 230b4: ff 92 push r15 230b6: 0f 93 push r16 230b8: 1f 93 push r17 230ba: cf 93 push r28 230bc: df 93 push r29 230be: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 230c2: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(failStatsFmt, 230c6: 83 e0 ldi r24, 0x03 ; 3 230c8: 9f e0 ldi r25, 0x0F ; 15 230ca: 0f 94 31 dc call 0x3b862 ; 0x3b862 230ce: 0f 94 32 10 call 0x22064 ; 0x22064 230d2: 78 2e mov r7, r24 230d4: 69 2e mov r6, r25 230d6: 85 e0 ldi r24, 0x05 ; 5 230d8: 9f e0 ldi r25, 0x0F ; 15 230da: 0f 94 31 dc call 0x3b862 ; 0x3b862 230de: 0f 94 32 10 call 0x22064 ; 0x22064 230e2: 98 2e mov r9, r24 230e4: 89 2e mov r8, r25 230e6: 80 ec ldi r24, 0xC0 ; 192 230e8: 9e e4 ldi r25, 0x4E ; 78 230ea: 0e 94 b3 72 call 0xe566 ; 0xe566 230ee: b8 2e mov r11, r24 230f0: a9 2e mov r10, r25 230f2: 81 e0 ldi r24, 0x01 ; 1 230f4: 9f e0 ldi r25, 0x0F ; 15 230f6: 0f 94 31 dc call 0x3b862 ; 0x3b862 230fa: 0f 94 32 10 call 0x22064 ; 0x22064 230fe: d8 2e mov r13, r24 23100: c9 2e mov r12, r25 23102: 81 eb ldi r24, 0xB1 ; 177 23104: 9e e4 ldi r25, 0x4E ; 78 23106: 0e 94 b3 72 call 0xe566 ; 0xe566 2310a: f8 2e mov r15, r24 2310c: e9 2e mov r14, r25 2310e: 8f ef ldi r24, 0xFF ; 255 23110: 9e e0 ldi r25, 0x0E ; 14 23112: 0f 94 31 dc call 0x3b862 ; 0x3b862 23116: 0f 94 32 10 call 0x22064 ; 0x22064 2311a: 18 2f mov r17, r24 2311c: 09 2f mov r16, r25 2311e: 80 ea ldi r24, 0xA0 ; 160 23120: 9e e4 ldi r25, 0x4E ; 78 23122: 0e 94 b3 72 call 0xe566 ; 0xe566 23126: ec 01 movw r28, r24 23128: 89 e7 ldi r24, 0x79 ; 121 2312a: 9e e4 ldi r25, 0x4E ; 78 2312c: 0e 94 b3 72 call 0xe566 ; 0xe566 23130: 6f 92 push r6 23132: 7f 92 push r7 23134: 8f 92 push r8 23136: 9f 92 push r9 23138: af 92 push r10 2313a: bf 92 push r11 2313c: cf 92 push r12 2313e: df 92 push r13 23140: ef 92 push r14 23142: ff 92 push r15 23144: 0f 93 push r16 23146: 1f 93 push r17 23148: df 93 push r29 2314a: cf 93 push r28 2314c: 9f 93 push r25 2314e: 8f 93 push r24 23150: 8e ef ldi r24, 0xFE ; 254 23152: 90 ea ldi r25, 0xA0 ; 160 23154: 9f 93 push r25 23156: 8f 93 push r24 23158: 0e 94 c0 6e call 0xdd80 ; 0xdd80 _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(); 2315c: 8d b7 in r24, 0x3d ; 61 2315e: 9e b7 in r25, 0x3e ; 62 23160: 42 96 adiw r24, 0x12 ; 18 23162: 0f b6 in r0, 0x3f ; 63 23164: f8 94 cli 23166: 9e bf out 0x3e, r25 ; 62 23168: 0f be out 0x3f, r0 ; 63 2316a: 8d bf out 0x3d, r24 ; 61 } 2316c: df 91 pop r29 2316e: cf 91 pop r28 23170: 1f 91 pop r17 23172: 0f 91 pop r16 23174: ff 90 pop r15 23176: ef 90 pop r14 23178: df 90 pop r13 2317a: cf 90 pop r12 2317c: bf 90 pop r11 2317e: af 90 pop r10 23180: 9f 90 pop r9 23182: 8f 90 pop r8 23184: 7f 90 pop r7 23186: 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(); 23188: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 0002318c : //! | 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() { 2318c: 8f 92 push r8 2318e: 9f 92 push r9 23190: af 92 push r10 23192: bf 92 push r11 23194: cf 92 push r12 23196: df 92 push r13 23198: ef 92 push r14 2319a: ff 92 push r15 2319c: 0f 93 push r16 2319e: 1f 93 push r17 231a0: cf 93 push r28 231a2: df 93 push r29 231a4: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 231a8: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P( 231ac: 80 91 c0 13 lds r24, 0x13C0 ; 0x8013c0 231b0: 90 91 c1 13 lds r25, 0x13C1 ; 0x8013c1 231b4: 0f 94 32 10 call 0x22064 ; 0x22064 231b8: 98 2e mov r9, r24 231ba: 89 2e mov r8, r25 231bc: 84 e5 ldi r24, 0x54 ; 84 231be: 9e e4 ldi r25, 0x4E ; 78 231c0: 0e 94 b3 72 call 0xe566 ; 0xe566 231c4: b8 2e mov r11, r24 231c6: a9 2e mov r10, r25 231c8: 80 ed ldi r24, 0xD0 ; 208 231ca: 9e e0 ldi r25, 0x0E ; 14 231cc: 0f 94 31 dc call 0x3b862 ; 0x3b862 231d0: 0f 94 32 10 call 0x22064 ; 0x22064 231d4: d8 2e mov r13, r24 231d6: c9 2e mov r12, r25 231d8: 83 e4 ldi r24, 0x43 ; 67 231da: 9e e4 ldi r25, 0x4E ; 78 231dc: 0e 94 b3 72 call 0xe566 ; 0xe566 231e0: f8 2e mov r15, r24 231e2: e9 2e mov r14, r25 231e4: 83 ed ldi r24, 0xD3 ; 211 231e6: 9e e0 ldi r25, 0x0E ; 14 231e8: 0f 94 31 dc call 0x3b862 ; 0x3b862 231ec: 0f 94 32 10 call 0x22064 ; 0x22064 231f0: 18 2f mov r17, r24 231f2: 09 2f mov r16, r25 231f4: 87 e3 ldi r24, 0x37 ; 55 231f6: 9e e4 ldi r25, 0x4E ; 78 231f8: 0e 94 b3 72 call 0xe566 ; 0xe566 231fc: ec 01 movw r28, r24 231fe: 89 e7 ldi r24, 0x79 ; 121 23200: 9e e4 ldi r25, 0x4E ; 78 23202: 0e 94 b3 72 call 0xe566 ; 0xe566 23206: 8f 92 push r8 23208: 9f 92 push r9 2320a: af 92 push r10 2320c: bf 92 push r11 2320e: cf 92 push r12 23210: df 92 push r13 23212: ef 92 push r14 23214: ff 92 push r15 23216: 0f 93 push r16 23218: 1f 93 push r17 2321a: df 93 push r29 2321c: cf 93 push r28 2321e: 9f 93 push r25 23220: 8f 93 push r24 23222: 81 ed ldi r24, 0xD1 ; 209 23224: 90 ea ldi r25, 0xA0 ; 160 23226: 9f 93 push r25 23228: 8f 93 push r24 2322a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 ), _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(); 2322e: 8d b7 in r24, 0x3d ; 61 23230: 9e b7 in r25, 0x3e ; 62 23232: 40 96 adiw r24, 0x10 ; 16 23234: 0f b6 in r0, 0x3f ; 63 23236: f8 94 cli 23238: 9e bf out 0x3e, r25 ; 62 2323a: 0f be out 0x3f, r0 ; 63 2323c: 8d bf out 0x3d, r24 ; 61 } 2323e: df 91 pop r29 23240: cf 91 pop r28 23242: 1f 91 pop r17 23244: 0f 91 pop r16 23246: ff 90 pop r15 23248: ef 90 pop r14 2324a: df 90 pop r13 2324c: cf 90 pop r12 2324e: bf 90 pop r11 23250: af 90 pop r10 23252: 9f 90 pop r9 23254: 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(); 23256: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 0002325a : //! |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() { 2325a: cf 93 push r28 2325c: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 2325e: 80 e4 ldi r24, 0x40 ; 64 23260: 91 e5 ldi r25, 0x51 ; 81 23262: 0e 94 b3 72 call 0xe566 ; 0xe566 23266: ac 01 movw r20, r24 23268: 60 e0 ldi r22, 0x00 ; 0 2326a: 80 e0 ldi r24, 0x00 ; 0 2326c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 1, STR_SEPARATOR); 23270: 41 e9 ldi r20, 0x91 ; 145 23272: 5a e8 ldi r21, 0x8A ; 138 23274: 61 e0 ldi r22, 0x01 ; 1 23276: 80 e0 ldi r24, 0x00 ; 0 23278: 0e 94 fb 6e call 0xddf6 ; 0xddf6 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 2327c: 62 e0 ldi r22, 0x02 ; 2 2327e: 80 e0 ldi r24, 0x00 ; 0 23280: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 23284: 85 ee ldi r24, 0xE5 ; 229 23286: 9f e0 ldi r25, 0x0F ; 15 23288: 0f 94 2b dc call 0x3b856 ; 0x3b856 2328c: 9f 93 push r25 2328e: 8f 93 push r24 23290: 7f 93 push r23 23292: 6f 93 push r22 23294: 1f 92 push r1 23296: 88 e5 ldi r24, 0x58 ; 88 23298: 8f 93 push r24 2329a: cf e3 ldi r28, 0x3F ; 63 2329c: d3 ea ldi r29, 0xA3 ; 163 2329e: df 93 push r29 232a0: cf 93 push r28 232a2: 0e 94 c0 6e call 0xdd80 ; 0xdd80 { 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); 232a6: 63 e0 ldi r22, 0x03 ; 3 232a8: 80 e0 ldi r24, 0x00 ; 0 232aa: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 232ae: 89 ee ldi r24, 0xE9 ; 233 232b0: 9f e0 ldi r25, 0x0F ; 15 232b2: 0f 94 2b dc call 0x3b856 ; 0x3b856 232b6: 9f 93 push r25 232b8: 8f 93 push r24 232ba: 7f 93 push r23 232bc: 6f 93 push r22 232be: 1f 92 push r1 232c0: 89 e5 ldi r24, 0x59 ; 89 232c2: 8f 93 push r24 232c4: df 93 push r29 232c6: cf 93 push r28 232c8: 0e 94 c0 6e call 0xdd80 ; 0xdd80 } menu_back_if_clicked(); 232cc: 8d b7 in r24, 0x3d ; 61 232ce: 9e b7 in r25, 0x3e ; 62 232d0: 40 96 adiw r24, 0x10 ; 16 232d2: 0f b6 in r0, 0x3f ; 63 232d4: f8 94 cli 232d6: 9e bf out 0x3e, r25 ; 62 232d8: 0f be out 0x3f, r0 ; 63 232da: 8d bf out 0x3d, r24 ; 61 } 232dc: df 91 pop r29 232de: 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(); 232e0: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 000232e4 : //! ---------------------- //! 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() { 232e4: cf 92 push r12 232e6: df 92 push r13 232e8: ef 92 push r14 232ea: ff 92 push r15 232ec: 0f 93 push r16 232ee: 1f 93 push r17 232f0: cf 93 push r28 232f2: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 232f4: 80 e6 ldi r24, 0x60 ; 96 232f6: 9f e0 ldi r25, 0x0F ; 15 232f8: 0f 94 2b dc call 0x3b856 ; 0x3b856 232fc: 6b 01 movw r12, r22 232fe: 7c 01 movw r14, r24 lcd_home(); 23300: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(_N( 23304: 82 e3 ldi r24, 0x32 ; 50 23306: 91 e5 ldi r25, 0x51 ; 81 23308: 0e 94 b3 72 call 0xe566 ; 0xe566 2330c: 18 2f mov r17, r24 2330e: 09 2f mov r16, r25 23310: 84 e2 ldi r24, 0x24 ; 36 23312: 91 e5 ldi r25, 0x51 ; 81 23314: 0e 94 b3 72 call 0xe566 ; 0xe566 23318: ec 01 movw r28, r24 2331a: 84 e1 ldi r24, 0x14 ; 20 2331c: 91 e5 ldi r25, 0x51 ; 81 2331e: 0e 94 b3 72 call 0xe566 ; 0xe566 23322: 2e e3 ldi r18, 0x3E ; 62 23324: 2f 93 push r18 23326: 20 e8 ldi r18, 0x80 ; 128 23328: 2f 93 push r18 2332a: 1f 92 push r1 2332c: 1f 92 push r1 2332e: 0f 93 push r16 23330: 1f 93 push r17 23332: 2d e3 ldi r18, 0x3D ; 61 23334: 2f 93 push r18 23336: 25 ef ldi r18, 0xF5 ; 245 23338: 2f 93 push r18 2333a: 22 ec ldi r18, 0xC2 ; 194 2333c: 2f 93 push r18 2333e: 20 e9 ldi r18, 0x90 ; 144 23340: 2f 93 push r18 23342: df 93 push r29 23344: cf 93 push r28 23346: 21 e9 ldi r18, 0x91 ; 145 23348: 3a e8 ldi r19, 0x8A ; 138 2334a: 3f 93 push r19 2334c: 2f 93 push r18 2334e: 9f 93 push r25 23350: 8f 93 push r24 23352: 8d eb ldi r24, 0xBD ; 189 23354: 9f e6 ldi r25, 0x6F ; 111 23356: 9f 93 push r25 23358: 8f 93 push r24 2335a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 _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); 2335e: 60 e0 ldi r22, 0x00 ; 0 23360: 8f e0 ldi r24, 0x0F ; 15 23362: 0e 94 e7 6e call 0xddce ; 0xddce if (angleDiff < 100){ 23366: 8d b7 in r24, 0x3d ; 61 23368: 9e b7 in r25, 0x3e ; 62 2336a: 42 96 adiw r24, 0x12 ; 18 2336c: 0f b6 in r0, 0x3f ; 63 2336e: f8 94 cli 23370: 9e bf out 0x3e, r25 ; 62 23372: 0f be out 0x3f, r0 ; 63 23374: 8d bf out 0x3d, r24 ; 61 23376: 20 e0 ldi r18, 0x00 ; 0 23378: 30 e0 ldi r19, 0x00 ; 0 2337a: 48 ec ldi r20, 0xC8 ; 200 2337c: 52 e4 ldi r21, 0x42 ; 66 2337e: c7 01 movw r24, r14 23380: b6 01 movw r22, r12 23382: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 23386: 87 ff sbrs r24, 7 23388: 32 c0 rjmp .+100 ; 0x233ee } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 2338a: 20 e0 ldi r18, 0x00 ; 0 2338c: 30 e0 ldi r19, 0x00 ; 0 2338e: 44 e3 ldi r20, 0x34 ; 52 23390: 53 e4 ldi r21, 0x43 ; 67 23392: c7 01 movw r24, r14 23394: b6 01 movw r22, r12 23396: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2339a: 2b ed ldi r18, 0xDB ; 219 2339c: 3f e0 ldi r19, 0x0F ; 15 2339e: 49 e4 ldi r20, 0x49 ; 73 233a0: 50 e4 ldi r21, 0x40 ; 64 233a2: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__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)); 233a6: 9f 93 push r25 233a8: 8f 93 push r24 233aa: 7f 93 push r23 233ac: 6f 93 push r22 233ae: 86 eb ldi r24, 0xB6 ; 182 233b0: 9f e6 ldi r25, 0x6F ; 111 233b2: 9f 93 push r25 233b4: 8f 93 push r24 233b6: 0e 94 c0 6e call 0xdd80 ; 0xdd80 233ba: 0f 90 pop r0 233bc: 0f 90 pop r0 233be: 0f 90 pop r0 233c0: 0f 90 pop r0 233c2: 0f 90 pop r0 233c4: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 233c6: 0e 94 04 71 call 0xe208 ; 0xe208 233ca: 88 23 and r24, r24 233cc: b9 f0 breq .+46 ; 0x233fc menu_goto(lcd_menu_xyz_offset, 0, true); 233ce: 20 e0 ldi r18, 0x00 ; 0 233d0: 41 e0 ldi r20, 0x01 ; 1 233d2: 70 e0 ldi r23, 0x00 ; 0 233d4: 60 e0 ldi r22, 0x00 ; 0 233d6: 86 e7 ldi r24, 0x76 ; 118 233d8: 99 e3 ldi r25, 0x39 ; 57 } 233da: df 91 pop r29 233dc: cf 91 pop r28 233de: 1f 91 pop r17 233e0: 0f 91 pop r16 233e2: ff 90 pop r15 233e4: ef 90 pop r14 233e6: df 90 pop r13 233e8: 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); 233ea: 0d 94 c7 d1 jmp 0x3a38e ; 0x3a38e ); 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)); 233ee: 86 ee ldi r24, 0xE6 ; 230 233f0: 97 e4 ldi r25, 0x47 ; 71 233f2: 0e 94 b3 72 call 0xe566 ; 0xe566 233f6: 0e 94 d2 6e call 0xdda4 ; 0xdda4 233fa: e5 cf rjmp .-54 ; 0x233c6 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 233fc: df 91 pop r29 233fe: cf 91 pop r28 23400: 1f 91 pop r17 23402: 0f 91 pop r16 23404: ff 90 pop r15 23406: ef 90 pop r14 23408: df 90 pop r13 2340a: cf 90 pop r12 2340c: 08 95 ret 0002340e : //! |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() { 2340e: 2f 92 push r2 23410: 3f 92 push r3 23412: 4f 92 push r4 23414: 5f 92 push r5 23416: 6f 92 push r6 23418: 7f 92 push r7 2341a: 8f 92 push r8 2341c: 9f 92 push r9 2341e: af 92 push r10 23420: bf 92 push r11 23422: cf 92 push r12 23424: df 92 push r13 23426: ef 92 push r14 23428: ff 92 push r15 2342a: 0f 93 push r16 2342c: 1f 93 push r17 2342e: cf 93 push r28 23430: df 93 push r29 23432: cd b7 in r28, 0x3d ; 61 23434: de b7 in r29, 0x3e ; 62 23436: a8 97 sbiw r28, 0x28 ; 40 23438: 0f b6 in r0, 0x3f ; 63 2343a: f8 94 cli 2343c: de bf out 0x3e, r29 ; 62 2343e: 0f be out 0x3f, r0 ; 63 23440: 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); 23442: 48 e0 ldi r20, 0x08 ; 8 23444: 50 e0 ldi r21, 0x00 ; 0 23446: 65 ee ldi r22, 0xE5 ; 229 23448: 7f e0 ldi r23, 0x0F ; 15 2344a: ce 01 movw r24, r28 2344c: 41 96 adiw r24, 0x11 ; 17 2344e: 0f 94 13 dc call 0x3b826 ; 0x3b826 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 23452: 48 e0 ldi r20, 0x08 ; 8 23454: 50 e0 ldi r21, 0x00 ; 0 23456: 6d ed ldi r22, 0xDD ; 221 23458: 7f e0 ldi r23, 0x0F ; 15 2345a: ce 01 movw r24, r28 2345c: 09 96 adiw r24, 0x09 ; 9 2345e: 0f 94 13 dc call 0x3b826 ; 0x3b826 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 23462: 48 e0 ldi r20, 0x08 ; 8 23464: 50 e0 ldi r21, 0x00 ; 0 23466: 65 ed ldi r22, 0xD5 ; 213 23468: 7f e0 ldi r23, 0x0F ; 15 2346a: ce 01 movw r24, r28 2346c: 01 96 adiw r24, 0x01 ; 1 2346e: 0f 94 13 dc call 0x3b826 ; 0x3b826 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]; 23472: 8d 84 ldd r8, Y+13 ; 0x0d 23474: 9e 84 ldd r9, Y+14 ; 0x0e 23476: af 84 ldd r10, Y+15 ; 0x0f 23478: b8 88 ldd r11, Y+16 ; 0x10 2347a: e8 ee ldi r30, 0xE8 ; 232 2347c: f5 ea ldi r31, 0xA5 ; 165 2347e: 25 91 lpm r18, Z+ 23480: 35 91 lpm r19, Z+ 23482: 45 91 lpm r20, Z+ 23484: 54 91 lpm r21, Z 23486: cd 80 ldd r12, Y+5 ; 0x05 23488: de 80 ldd r13, Y+6 ; 0x06 2348a: ef 80 ldd r14, Y+7 ; 0x07 2348c: f8 84 ldd r15, Y+8 ; 0x08 2348e: ec ee ldi r30, 0xEC ; 236 23490: f5 ea ldi r31, 0xA5 ; 165 23492: 85 91 lpm r24, Z+ 23494: 95 91 lpm r25, Z+ 23496: a5 91 lpm r26, Z+ 23498: b4 91 lpm r27, Z 2349a: 8d a3 std Y+37, r24 ; 0x25 2349c: 9e a3 std Y+38, r25 ; 0x26 2349e: af a3 std Y+39, r26 ; 0x27 234a0: b8 a7 std Y+40, r27 ; 0x28 234a2: 8d 89 ldd r24, Y+21 ; 0x15 234a4: 9e 89 ldd r25, Y+22 ; 0x16 234a6: af 89 ldd r26, Y+23 ; 0x17 234a8: b8 8d ldd r27, Y+24 ; 0x18 234aa: 89 a3 std Y+33, r24 ; 0x21 234ac: 9a a3 std Y+34, r25 ; 0x22 234ae: ab a3 std Y+35, r26 ; 0x23 234b0: bc a3 std Y+36, r27 ; 0x24 234b2: c5 01 movw r24, r10 234b4: b4 01 movw r22, r8 234b6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 234ba: 2b 01 movw r4, r22 234bc: 3c 01 movw r6, r24 234be: 2d a1 ldd r18, Y+37 ; 0x25 234c0: 3e a1 ldd r19, Y+38 ; 0x26 234c2: 4f a1 ldd r20, Y+39 ; 0x27 234c4: 58 a5 ldd r21, Y+40 ; 0x28 234c6: c7 01 movw r24, r14 234c8: b6 01 movw r22, r12 234ca: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 234ce: 9b 01 movw r18, r22 234d0: ac 01 movw r20, r24 234d2: c3 01 movw r24, r6 234d4: b2 01 movw r22, r4 234d6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 234da: 29 a1 ldd r18, Y+33 ; 0x21 234dc: 3a a1 ldd r19, Y+34 ; 0x22 234de: 4b a1 ldd r20, Y+35 ; 0x23 234e0: 5c a1 ldd r21, Y+36 ; 0x24 234e2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 234e6: 20 e0 ldi r18, 0x00 ; 0 234e8: 30 e0 ldi r19, 0x00 ; 0 234ea: 40 e9 ldi r20, 0x90 ; 144 234ec: 50 e4 ldi r21, 0x40 ; 64 234ee: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 234f2: 1b 01 movw r2, r22 234f4: 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]; 234f6: e0 ef ldi r30, 0xF0 ; 240 234f8: f5 ea ldi r31, 0xA5 ; 165 234fa: 25 91 lpm r18, Z+ 234fc: 35 91 lpm r19, Z+ 234fe: 45 91 lpm r20, Z+ 23500: 54 91 lpm r21, Z 23502: e4 ef ldi r30, 0xF4 ; 244 23504: f5 ea ldi r31, 0xA5 ; 165 23506: 45 90 lpm r4, Z+ 23508: 55 90 lpm r5, Z+ 2350a: 65 90 lpm r6, Z+ 2350c: 74 90 lpm r7, Z 2350e: c5 01 movw r24, r10 23510: b4 01 movw r22, r8 23512: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 23516: 4b 01 movw r8, r22 23518: 5c 01 movw r10, r24 2351a: a3 01 movw r20, r6 2351c: 92 01 movw r18, r4 2351e: c7 01 movw r24, r14 23520: b6 01 movw r22, r12 23522: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 23526: 9b 01 movw r18, r22 23528: ac 01 movw r20, r24 2352a: c5 01 movw r24, r10 2352c: b4 01 movw r22, r8 2352e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 23532: 29 a1 ldd r18, Y+33 ; 0x21 23534: 3a a1 ldd r19, Y+34 ; 0x22 23536: 4b a1 ldd r20, Y+35 ; 0x23 23538: 5c a1 ldd r21, Y+36 ; 0x24 2353a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 2353e: 20 e0 ldi r18, 0x00 ; 0 23540: 30 e0 ldi r19, 0x00 ; 0 23542: 40 e9 ldi r20, 0x90 ; 144 23544: 50 e4 ldi r21, 0x40 ; 64 23546: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2354a: 6d 8f std Y+29, r22 ; 0x1d 2354c: 7e 8f std Y+30, r23 ; 0x1e 2354e: 8f 8f std Y+31, r24 ; 0x1f 23550: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 23552: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(_N( 23556: 8c e0 ldi r24, 0x0C ; 12 23558: 91 e5 ldi r25, 0x51 ; 81 2355a: 0e 94 b3 72 call 0xe566 ; 0xe566 2355e: d8 2e mov r13, r24 23560: c9 2e mov r12, r25 23562: 85 e0 ldi r24, 0x05 ; 5 23564: 91 e5 ldi r25, 0x51 ; 81 23566: 0e 94 b3 72 call 0xe566 ; 0xe566 2356a: f8 2e mov r15, r24 2356c: e9 2e mov r14, r25 2356e: 8f ee ldi r24, 0xEF ; 239 23570: 90 e5 ldi r25, 0x50 ; 80 23572: 0e 94 b3 72 call 0xe566 ; 0xe566 23576: cf 92 push r12 23578: df 92 push r13 2357a: ef 92 push r14 2357c: ff 92 push r15 2357e: 21 e9 ldi r18, 0x91 ; 145 23580: 3a e8 ldi r19, 0x8A ; 138 23582: 3f 93 push r19 23584: 2f 93 push r18 23586: 9f 93 push r25 23588: 8f 93 push r24 2358a: 88 ea ldi r24, 0xA8 ; 168 2358c: 9f e6 ldi r25, 0x6F ; 111 2358e: 9f 93 push r25 23590: 8f 93 push r24 23592: 0e 94 c0 6e call 0xdd80 ; 0xdd80 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 23596: 62 e0 ldi r22, 0x02 ; 2 23598: 8b e0 ldi r24, 0x0B ; 11 2359a: 0e 94 e7 6e call 0xddce ; 0xddce if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2359e: 0f b6 in r0, 0x3f ; 63 235a0: f8 94 cli 235a2: de bf out 0x3e, r29 ; 62 235a4: 0f be out 0x3f, r0 ; 63 235a6: cd bf out 0x3d, r28 ; 61 235a8: 20 e0 ldi r18, 0x00 ; 0 235aa: 30 e0 ldi r19, 0x00 ; 0 235ac: 48 e4 ldi r20, 0x48 ; 72 235ae: 53 e4 ldi r21, 0x43 ; 67 235b0: 62 2d mov r22, r2 235b2: 73 2d mov r23, r3 235b4: 80 2f mov r24, r16 235b6: 91 2f mov r25, r17 235b8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 235bc: 87 ff sbrs r24, 7 235be: 51 c0 rjmp .+162 ; 0x23662 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 235c0: 1f 93 push r17 235c2: 0f 93 push r16 235c4: 3f 92 push r3 235c6: 2f 92 push r2 235c8: 80 ea ldi r24, 0xA0 ; 160 235ca: 9f e6 ldi r25, 0x6F ; 111 235cc: 9f 93 push r25 235ce: 8f 93 push r24 235d0: 0e 94 c0 6e call 0xdd80 ; 0xdd80 235d4: 0f 90 pop r0 235d6: 0f 90 pop r0 235d8: 0f 90 pop r0 235da: 0f 90 pop r0 235dc: 0f 90 pop r0 235de: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 235e0: 63 e0 ldi r22, 0x03 ; 3 235e2: 8b e0 ldi r24, 0x0B ; 11 235e4: 0e 94 e7 6e call 0xddce ; 0xddce if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 235e8: 1d 8d ldd r17, Y+29 ; 0x1d 235ea: 0e 8d ldd r16, Y+30 ; 0x1e 235ec: ff 8c ldd r15, Y+31 ; 0x1f 235ee: e8 a0 ldd r14, Y+32 ; 0x20 235f0: 20 e0 ldi r18, 0x00 ; 0 235f2: 30 e0 ldi r19, 0x00 ; 0 235f4: 48 e4 ldi r20, 0x48 ; 72 235f6: 53 e4 ldi r21, 0x43 ; 67 235f8: d8 01 movw r26, r16 235fa: f7 01 movw r30, r14 235fc: 6b 2f mov r22, r27 235fe: 7a 2f mov r23, r26 23600: 8f 2f mov r24, r31 23602: 9e 2f mov r25, r30 23604: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 23608: 87 fd sbrc r24, 7 2360a: 32 c0 rjmp .+100 ; 0x23670 2360c: 86 ee ldi r24, 0xE6 ; 230 2360e: 97 e4 ldi r25, 0x47 ; 71 23610: 0e 94 b3 72 call 0xe566 ; 0xe566 23614: 0e 94 d2 6e call 0xdda4 ; 0xdda4 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 23618: 0e 94 04 71 call 0xe208 ; 0xe208 2361c: 88 23 and r24, r24 2361e: 41 f0 breq .+16 ; 0x23630 menu_goto(lcd_menu_xyz_skew, 0, true); 23620: 20 e0 ldi r18, 0x00 ; 0 23622: 41 e0 ldi r20, 0x01 ; 1 23624: 70 e0 ldi r23, 0x00 ; 0 23626: 60 e0 ldi r22, 0x00 ; 0 23628: 86 e1 ldi r24, 0x16 ; 22 2362a: 99 e3 ldi r25, 0x39 ; 57 2362c: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e } 23630: a8 96 adiw r28, 0x28 ; 40 23632: 0f b6 in r0, 0x3f ; 63 23634: f8 94 cli 23636: de bf out 0x3e, r29 ; 62 23638: 0f be out 0x3f, r0 ; 63 2363a: cd bf out 0x3d, r28 ; 61 2363c: df 91 pop r29 2363e: cf 91 pop r28 23640: 1f 91 pop r17 23642: 0f 91 pop r16 23644: ff 90 pop r15 23646: ef 90 pop r14 23648: df 90 pop r13 2364a: cf 90 pop r12 2364c: bf 90 pop r11 2364e: af 90 pop r10 23650: 9f 90 pop r9 23652: 8f 90 pop r8 23654: 7f 90 pop r7 23656: 6f 90 pop r6 23658: 5f 90 pop r5 2365a: 4f 90 pop r4 2365c: 3f 90 pop r3 2365e: 2f 90 pop r2 23660: 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)); 23662: 86 ee ldi r24, 0xE6 ; 230 23664: 97 e4 ldi r25, 0x47 ; 71 23666: 0e 94 b3 72 call 0xe566 ; 0xe566 2366a: 0e 94 d2 6e call 0xdda4 ; 0xdda4 2366e: b8 cf rjmp .-144 ; 0x235e0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 23670: ef 92 push r14 23672: ff 92 push r15 23674: 0f 93 push r16 23676: 1f 93 push r17 23678: 80 ea ldi r24, 0xA0 ; 160 2367a: 9f e6 ldi r25, 0x6F ; 111 2367c: 9f 93 push r25 2367e: 8f 93 push r24 23680: 0e 94 c0 6e call 0xdd80 ; 0xdd80 23684: 0f 90 pop r0 23686: 0f 90 pop r0 23688: 0f 90 pop r0 2368a: 0f 90 pop r0 2368c: 0f 90 pop r0 2368e: 0f 90 pop r0 23690: c3 cf rjmp .-122 ; 0x23618 00023692 <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 23692: 2f 92 push r2 23694: 3f 92 push r3 23696: 4f 92 push r4 23698: 5f 92 push r5 2369a: 6f 92 push r6 2369c: 7f 92 push r7 2369e: 9f 92 push r9 236a0: af 92 push r10 236a2: bf 92 push r11 236a4: cf 92 push r12 236a6: df 92 push r13 236a8: ef 92 push r14 236aa: ff 92 push r15 236ac: 0f 93 push r16 236ae: 1f 93 push r17 236b0: cf 93 push r28 236b2: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 236b4: 70 91 a7 0d lds r23, 0x0DA7 ; 0x800da7 236b8: 71 11 cpse r23, r1 236ba: 04 c0 rjmp .+8 ; 0x236c4 <_lcd_move(char const*, unsigned char, int, int)+0x32> 236bc: 70 91 a8 0d lds r23, 0x0DA8 ; 0x800da8 236c0: 77 23 and r23, r23 236c2: 99 f0 breq .+38 ; 0x236ea <_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(); } 236c4: df 91 pop r29 236c6: cf 91 pop r28 236c8: 1f 91 pop r17 236ca: 0f 91 pop r16 236cc: ff 90 pop r15 236ce: ef 90 pop r14 236d0: df 90 pop r13 236d2: cf 90 pop r12 236d4: bf 90 pop r11 236d6: af 90 pop r10 236d8: 9f 90 pop r9 236da: 7f 90 pop r7 236dc: 6f 90 pop r6 236de: 5f 90 pop r5 236e0: 4f 90 pop r4 236e2: 3f 90 pop r3 236e4: 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(); 236e6: 0d 94 65 d4 jmp 0x3a8ca ; 0x3a8ca 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) 236ea: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 236ee: 71 11 cpse r23, r1 236f0: 09 c0 rjmp .+18 ; 0x23704 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 236f2: 70 91 b7 02 lds r23, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; 236f6: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> { _md->endstopsEnabledPrevious = enable_endstops(false); 236fa: 70 93 aa 03 sts 0x03AA, r23 ; 0x8003aa _md->initialized = true; 236fe: 71 e0 ldi r23, 0x01 ; 1 23700: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 23704: 19 01 movw r2, r18 23706: 6a 01 movw r12, r20 23708: c6 2f mov r28, r22 2370a: d9 2f mov r29, r25 2370c: 98 2e mov r9, r24 } if (lcd_encoder != 0) 2370e: 80 91 70 06 lds r24, 0x0670 ; 0x800670 23712: 90 91 71 06 lds r25, 0x0671 ; 0x800671 23716: 89 2b or r24, r25 23718: 09 f4 brne .+2 ; 0x2371c <_lcd_move(char const*, unsigned char, int, int)+0x8a> 2371a: 71 c0 rjmp .+226 ; 0x237fe <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 2371c: 0e 94 ca 66 call 0xcd94 ; 0xcd94 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; 23720: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if (++ next_block_index == BLOCK_BUFFER_SIZE) 23724: 8f 5f subi r24, 0xFF ; 255 23726: 80 31 cpi r24, 0x10 ; 16 23728: 09 f4 brne .+2 ; 0x2372c <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 2372a: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 2372c: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 if (! planner_queue_full()) 23730: 98 17 cp r25, r24 23732: 09 f4 brne .+2 ; 0x23736 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 23734: 64 c0 rjmp .+200 ; 0x237fe <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 23736: 84 e0 ldi r24, 0x04 ; 4 23738: c8 9f mul r28, r24 2373a: 80 01 movw r16, r0 2373c: 11 24 eor r1, r1 2373e: f8 01 movw r30, r16 23740: ee 56 subi r30, 0x6E ; 110 23742: f9 4f sbci r31, 0xF9 ; 249 23744: 5f 01 movw r10, r30 23746: 60 91 70 06 lds r22, 0x0670 ; 0x800670 2374a: 70 91 71 06 lds r23, 0x0671 ; 0x800671 2374e: 07 2e mov r0, r23 23750: 00 0c add r0, r0 23752: 88 0b sbc r24, r24 23754: 99 0b sbc r25, r25 23756: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2375a: f5 01 movw r30, r10 2375c: 20 81 ld r18, Z 2375e: 31 81 ldd r19, Z+1 ; 0x01 23760: 42 81 ldd r20, Z+2 ; 0x02 23762: 53 81 ldd r21, Z+3 ; 0x03 23764: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 23768: 2b 01 movw r4, r22 2376a: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 2376c: b6 01 movw r22, r12 2376e: dd 0c add r13, r13 23770: 88 0b sbc r24, r24 23772: 99 0b sbc r25, r25 23774: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 23778: 6b 01 movw r12, r22 2377a: 7c 01 movw r14, r24 2377c: ac 01 movw r20, r24 2377e: 9b 01 movw r18, r22 23780: c3 01 movw r24, r6 23782: b2 01 movw r22, r4 23784: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 23788: f5 01 movw r30, r10 2378a: 87 fd sbrc r24, 7 2378c: 7d c0 rjmp .+250 ; 0x23888 <_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; 2378e: 40 82 st Z, r4 23790: 51 82 std Z+1, r5 ; 0x01 23792: 62 82 std Z+2, r6 ; 0x02 23794: 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; 23796: b1 01 movw r22, r2 23798: 33 0c add r3, r3 2379a: 88 0b sbc r24, r24 2379c: 99 0b sbc r25, r25 2379e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 237a2: 2b 01 movw r4, r22 237a4: 3c 01 movw r6, r24 237a6: c8 01 movw r24, r16 237a8: 8e 56 subi r24, 0x6E ; 110 237aa: 99 4f sbci r25, 0xF9 ; 249 237ac: 7c 01 movw r14, r24 237ae: a3 01 movw r20, r6 237b0: 92 01 movw r18, r4 237b2: fc 01 movw r30, r24 237b4: 60 81 ld r22, Z 237b6: 71 81 ldd r23, Z+1 ; 0x01 237b8: 82 81 ldd r24, Z+2 ; 0x02 237ba: 93 81 ldd r25, Z+3 ; 0x03 237bc: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 237c0: 18 16 cp r1, r24 237c2: 2c f4 brge .+10 ; 0x237ce <_lcd_move(char const*, unsigned char, int, int)+0x13c> 237c4: f7 01 movw r30, r14 237c6: 40 82 st Z, r4 237c8: 51 82 std Z+1, r5 ; 0x01 237ca: 62 82 std Z+2, r6 ; 0x02 237cc: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 237ce: 10 92 71 06 sts 0x0671, r1 ; 0x800671 237d2: 10 92 70 06 sts 0x0670, r1 ; 0x800670 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 237d6: 66 e9 ldi r22, 0x96 ; 150 237d8: 76 e0 ldi r23, 0x06 ; 6 237da: 82 e9 ldi r24, 0x92 ; 146 237dc: 96 e0 ldi r25, 0x06 ; 6 237de: 0e 94 b1 6a call 0xd562 ; 0xd562 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 237e2: f8 01 movw r30, r16 237e4: e6 50 subi r30, 0x06 ; 6 237e6: fd 4f sbci r31, 0xFD ; 253 237e8: 60 81 ld r22, Z 237ea: 71 81 ldd r23, Z+1 ; 0x01 237ec: 82 81 ldd r24, Z+2 ; 0x02 237ee: 93 81 ldd r25, Z+3 ; 0x03 237f0: 0e 94 ce 66 call 0xcd9c ; 0xcd9c 237f4: 0f 94 50 c0 call 0x380a0 ; 0x380a0 lcd_draw_update = 1; 237f8: 81 e0 ldi r24, 0x01 ; 1 237fa: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 237fe: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23802: 88 23 and r24, r24 23804: 11 f1 breq .+68 ; 0x2384a <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 23806: 61 e0 ldi r22, 0x01 ; 1 23808: 80 e0 ldi r24, 0x00 ; 0 2380a: 0e 94 e7 6e call 0xddce ; 0xddce menu_draw_float31(name, current_position[axis]); 2380e: 84 e0 ldi r24, 0x04 ; 4 23810: c8 9f mul r28, r24 23812: f0 01 movw r30, r0 23814: 11 24 eor r1, r1 23816: ee 56 subi r30, 0x6E ; 110 23818: 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); 2381a: 83 81 ldd r24, Z+3 ; 0x03 2381c: 8f 93 push r24 2381e: 82 81 ldd r24, Z+2 ; 0x02 23820: 8f 93 push r24 23822: 81 81 ldd r24, Z+1 ; 0x01 23824: 8f 93 push r24 23826: 80 81 ld r24, Z 23828: 8f 93 push r24 2382a: df 93 push r29 2382c: 9f 92 push r9 2382e: 86 e2 ldi r24, 0x26 ; 38 23830: 93 ea ldi r25, 0xA3 ; 163 23832: 9f 93 push r25 23834: 8f 93 push r24 23836: 0e 94 c0 6e call 0xdd80 ; 0xdd80 2383a: ed b7 in r30, 0x3d ; 61 2383c: fe b7 in r31, 0x3e ; 62 2383e: 38 96 adiw r30, 0x08 ; 8 23840: 0f b6 in r0, 0x3f ; 63 23842: f8 94 cli 23844: fe bf out 0x3e, r31 ; 62 23846: 0f be out 0x3f, r0 ; 63 23848: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 2384a: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 2384e: 81 11 cpse r24, r1 23850: 04 c0 rjmp .+8 ; 0x2385a <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 23852: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 23856: 88 23 and r24, r24 23858: 21 f0 breq .+8 ; 0x23862 <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 2385a: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 2385e: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> menu_back_if_clicked(); } 23862: df 91 pop r29 23864: cf 91 pop r28 23866: 1f 91 pop r17 23868: 0f 91 pop r16 2386a: ff 90 pop r15 2386c: ef 90 pop r14 2386e: df 90 pop r13 23870: cf 90 pop r12 23872: bf 90 pop r11 23874: af 90 pop r10 23876: 9f 90 pop r9 23878: 7f 90 pop r7 2387a: 6f 90 pop r6 2387c: 5f 90 pop r5 2387e: 4f 90 pop r4 23880: 3f 90 pop r3 23882: 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(); 23884: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 23888: c0 82 st Z, r12 2388a: d1 82 std Z+1, r13 ; 0x01 2388c: e2 82 std Z+2, r14 ; 0x02 2388e: f3 82 std Z+3, r15 ; 0x03 23890: 82 cf rjmp .-252 ; 0x23796 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00023892 : } 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); 23892: 22 ed ldi r18, 0xD2 ; 210 23894: 30 e0 ldi r19, 0x00 ; 0 23896: 50 e0 ldi r21, 0x00 ; 0 23898: 40 e0 ldi r20, 0x00 ; 0 2389a: 62 e0 ldi r22, 0x02 ; 2 2389c: 80 e5 ldi r24, 0x50 ; 80 2389e: 93 ea ldi r25, 0xA3 ; 163 238a0: 0d 94 49 1b jmp 0x23692 ; 0x23692 <_lcd_move(char const*, unsigned char, int, int)> 000238a4 : // 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); 238a4: 24 ed ldi r18, 0xD4 ; 212 238a6: 30 e0 ldi r19, 0x00 ; 0 238a8: 4c ef ldi r20, 0xFC ; 252 238aa: 5f ef ldi r21, 0xFF ; 255 238ac: 61 e0 ldi r22, 0x01 ; 1 238ae: 8d e4 ldi r24, 0x4D ; 77 238b0: 93 ea ldi r25, 0xA3 ; 163 238b2: 0d 94 49 1b jmp 0x23692 ; 0x23692 <_lcd_move(char const*, unsigned char, int, int)> 000238b6 : } // 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); 238b6: 2f ef ldi r18, 0xFF ; 255 238b8: 30 e0 ldi r19, 0x00 ; 0 238ba: 50 e0 ldi r21, 0x00 ; 0 238bc: 40 e0 ldi r20, 0x00 ; 0 238be: 60 e0 ldi r22, 0x00 ; 0 238c0: 8a e4 ldi r24, 0x4A ; 74 238c2: 93 ea ldi r25, 0xA3 ; 163 238c4: 0d 94 49 1b jmp 0x23692 ; 0x23692 <_lcd_move(char const*, unsigned char, int, int)> 000238c8 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 238c8: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 238cc: 10 92 12 05 sts 0x0512, r1 ; 0x800512 238d0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 238d4: 84 30 cpi r24, 0x04 ; 4 238d6: 28 f5 brcc .+74 ; 0x23922 238d8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 238dc: 88 ea ldi r24, 0xA8 ; 168 238de: 98 e4 ldi r25, 0x48 ; 72 238e0: 0e 94 b3 72 call 0xe566 ; 0xe566 238e4: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 238e8: 80 ed ldi r24, 0xD0 ; 208 238ea: 9e e4 ldi r25, 0x4E ; 78 238ec: 0e 94 b3 72 call 0xe566 ; 0xe566 238f0: 66 e8 ldi r22, 0x86 ; 134 238f2: 7a e3 ldi r23, 0x3A ; 58 238f4: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 238f8: 88 ec ldi r24, 0xC8 ; 200 238fa: 9e e4 ldi r25, 0x4E ; 78 238fc: 0e 94 b3 72 call 0xe566 ; 0xe566 23900: 60 e2 ldi r22, 0x20 ; 32 23902: 7a e3 ldi r23, 0x3A ; 58 23904: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_END(); 23908: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 2390c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23910: 8f 5f subi r24, 0xFF ; 255 23912: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23916: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2391a: 8f 5f subi r24, 0xFF ; 255 2391c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23920: d7 cf rjmp .-82 ; 0x238d0 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(); } 23922: 08 95 ret 00023924 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 23924: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 23928: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2392c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23930: 84 30 cpi r24, 0x04 ; 4 23932: 68 f5 brcc .+90 ; 0x2398e 23934: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 23938: 88 ea ldi r24, 0xA8 ; 168 2393a: 98 e4 ldi r25, 0x48 ; 72 2393c: 0e 94 b3 72 call 0xe566 ; 0xe566 23940: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 23944: 80 ed ldi r24, 0xD0 ; 208 23946: 9e e4 ldi r25, 0x4E ; 78 23948: 0e 94 b3 72 call 0xe566 ; 0xe566 2394c: 64 ec ldi r22, 0xC4 ; 196 2394e: 79 e3 ldi r23, 0x39 ; 57 23950: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 23954: 88 ec ldi r24, 0xC8 ; 200 23956: 9e e4 ldi r25, 0x4E ; 78 23958: 0e 94 b3 72 call 0xe566 ; 0xe566 2395c: 66 ee ldi r22, 0xE6 ; 230 2395e: 7a e3 ldi r23, 0x3A ; 58 23960: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 23964: 86 e6 ldi r24, 0x66 ; 102 23966: 9e e4 ldi r25, 0x4E ; 78 23968: 0e 94 b3 72 call 0xe566 ; 0xe566 2396c: 60 e0 ldi r22, 0x00 ; 0 2396e: 7b e3 ldi r23, 0x3B ; 59 23970: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_END(); 23974: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 23978: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2397c: 8f 5f subi r24, 0xFF ; 255 2397e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23982: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23986: 8f 5f subi r24, 0xFF ; 255 23988: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2398c: cf cf rjmp .-98 ; 0x2392c 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(); } 2398e: 08 95 ret 00023990 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 23990: 80 91 63 06 lds r24, 0x0663 ; 0x800663 23994: 81 11 cpse r24, r1 23996: 03 c0 rjmp .+6 ; 0x2399e 23998: 82 e0 ldi r24, 0x02 ; 2 2399a: 0d 94 49 d4 jmp 0x3a892 ; 0x3a892 2399e: 81 e0 ldi r24, 0x01 ; 1 239a0: fc cf rjmp .-8 ; 0x2399a 000239a2 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 239a2: ef 92 push r14 239a4: ff 92 push r15 239a6: 0f 93 push r16 239a8: 1f 93 push r17 239aa: cf 93 push r28 239ac: 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) 239ae: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 239b2: 88 23 and r24, r24 239b4: 29 f0 breq .+10 ; 0x239c0 239b6: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 239ba: 92 30 cpi r25, 0x02 ; 2 239bc: 09 f0 breq .+2 ; 0x239c0 239be: 80 c1 rjmp .+768 ; 0x23cc0 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 239c0: 81 e0 ldi r24, 0x01 ; 1 239c2: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 239c6: 80 91 01 17 lds r24, 0x1701 ; 0x801701 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 239ca: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa if (_md->is_flash_air) { 239ce: 88 23 and r24, r24 239d0: 21 f0 breq .+8 ; 0x239da card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 239d2: 8b ea ldi r24, 0xAB ; 171 239d4: 93 e0 ldi r25, 0x03 ; 3 239d6: 0f 94 d5 85 call 0x30baa ; 0x30baa { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 239da: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 239de: 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); 239e2: 81 ea ldi r24, 0xA1 ; 161 239e4: e8 2e mov r14, r24 239e6: 81 ea ldi r24, 0xA1 ; 161 239e8: 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]); 239ea: c0 e7 ldi r28, 0x70 ; 112 239ec: d1 ea ldi r29, 0xA1 ; 161 239ee: 0f ea ldi r16, 0xAF ; 175 239f0: 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(); 239f2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 239f6: 84 30 cpi r24, 0x04 ; 4 239f8: 08 f0 brcs .+2 ; 0x239fc 239fa: 89 c1 rjmp .+786 ; 0x23d0e 239fc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 23a00: 88 ea ldi r24, 0xA8 ; 168 23a02: 98 e4 ldi r25, 0x48 ; 72 23a04: 0e 94 b3 72 call 0xe566 ; 0xe566 23a08: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR("Firmware:")); 23a0c: 89 e0 ldi r24, 0x09 ; 9 23a0e: 92 ea ldi r25, 0xA2 ; 162 23a10: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 23a14: 8c ef ldi r24, 0xFC ; 252 23a16: 91 ea ldi r25, 0xA1 ; 161 23a18: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 23a1c: 8e ee ldi r24, 0xEE ; 238 23a1e: 91 ea ldi r25, 0xA1 ; 161 23a20: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 23a24: 8e ed ldi r24, 0xDE ; 222 23a26: 91 ea ldi r25, 0xA1 ; 161 23a28: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 23a2c: 87 e4 ldi r24, 0x47 ; 71 23a2e: 9f e6 ldi r25, 0x6F ; 111 23a30: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 23a34: 85 e3 ldi r24, 0x35 ; 53 23a36: 9f e6 ldi r25, 0x6F ; 111 23a38: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 23a3c: 84 e2 ldi r24, 0x24 ; 36 23a3e: 9f e6 ldi r25, 0x6F ; 111 23a40: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(STR_SEPARATOR); 23a44: 81 e9 ldi r24, 0x91 ; 145 23a46: 9a e8 ldi r25, 0x8A ; 138 23a48: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 23a4c: 83 ed ldi r24, 0xD3 ; 211 23a4e: 91 ea ldi r25, 0xA1 ; 161 23a50: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 23a54: 89 ec ldi r24, 0xC9 ; 201 23a56: 91 ea ldi r25, 0xA1 ; 161 23a58: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 23a5c: 8a eb ldi r24, 0xBA ; 186 23a5e: 91 ea ldi r25, 0xA1 ; 161 23a60: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(STR_SEPARATOR); 23a64: 81 e9 ldi r24, 0x91 ; 145 23a66: 9a e8 ldi r25, 0x8A ; 138 23a68: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(_T(MSG_DATE)); 23a6c: 8d e6 ldi r24, 0x6D ; 109 23a6e: 9f e4 ldi r25, 0x4F ; 79 23a70: 0e 94 b3 72 call 0xe566 ; 0xe566 23a74: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 23a78: 8f ea ldi r24, 0xAF ; 175 23a7a: 91 ea ldi r25, 0xA1 ; 161 23a7c: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 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); 23a80: 81 e9 ldi r24, 0x91 ; 145 23a82: 9a e8 ldi r25, 0x8A ; 138 23a84: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 if (MMU2::mmu2.Enabled()) 23a88: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 23a8c: 81 30 cpi r24, 0x01 ; 1 23a8e: 09 f0 breq .+2 ; 0x23a92 23a90: 39 c1 rjmp .+626 ; 0x23d04 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 23a92: 8d e5 ldi r24, 0x5D ; 93 23a94: 9f e4 ldi r25, 0x4F ; 79 23a96: 0e 94 b3 72 call 0xe566 ; 0xe566 23a9a: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 23a9e: 8a ea ldi r24, 0xAA ; 170 23aa0: 91 ea ldi r25, 0xA1 ; 161 23aa2: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 if (((menu_item - 1) == menu_line) && lcd_draw_update) 23aa6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23aaa: 81 50 subi r24, 0x01 ; 1 23aac: 99 0b sbc r25, r25 23aae: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23ab2: 28 17 cp r18, r24 23ab4: 19 06 cpc r1, r25 23ab6: 49 f5 brne .+82 ; 0x23b0a 23ab8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23abc: 88 23 and r24, r24 23abe: 29 f1 breq .+74 ; 0x23b0a { lcd_set_cursor(6, menu_row); 23ac0: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23ac4: 86 e0 ldi r24, 0x06 ; 6 23ac6: 0e 94 e7 6e call 0xddce ; 0xddce 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) { 23aca: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 23ace: 81 30 cpi r24, 0x01 ; 1 23ad0: 09 f0 breq .+2 ; 0x23ad4 23ad2: 11 c1 rjmp .+546 ; 0x23cf6 23ad4: 80 91 9a 13 lds r24, 0x139A ; 0x80139a 23ad8: 90 91 9b 13 lds r25, 0x139B ; 0x80139b 23adc: 20 91 9c 13 lds r18, 0x139C ; 0x80139c MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 23ae0: 88 23 and r24, r24 23ae2: 09 f4 brne .+2 ; 0x23ae6 23ae4: 08 c1 rjmp .+528 ; 0x23cf6 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 23ae6: 1f 92 push r1 23ae8: 2f 93 push r18 23aea: 1f 92 push r1 23aec: 9f 93 push r25 23aee: 1f 92 push r1 23af0: 8f 93 push r24 23af2: ff 92 push r15 23af4: ef 92 push r14 23af6: 0e 94 c0 6e call 0xdd80 ; 0xdd80 23afa: 8d b7 in r24, 0x3d ; 61 23afc: 9e b7 in r25, 0x3e ; 62 23afe: 08 96 adiw r24, 0x08 ; 8 23b00: 0f b6 in r0, 0x3f ; 63 23b02: f8 94 cli 23b04: 9e bf out 0x3e, r25 ; 62 23b06: 0f be out 0x3f, r0 ; 63 23b08: 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) { 23b0a: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 23b0e: 88 23 and r24, r24 23b10: 09 f4 brne .+2 ; 0x23b14 23b12: 40 c0 rjmp .+128 ; 0x23b94 MENU_ITEM_BACK_P(STR_SEPARATOR); 23b14: 81 e9 ldi r24, 0x91 ; 145 23b16: 9a e8 ldi r25, 0x8A ; 138 23b18: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 23b1c: 80 e8 ldi r24, 0x80 ; 128 23b1e: 91 ea ldi r25, 0xA1 ; 161 23b20: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(" ")); 23b24: 8e e7 ldi r24, 0x7E ; 126 23b26: 91 ea ldi r25, 0xA1 ; 161 23b28: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23b2c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23b30: 81 50 subi r24, 0x01 ; 1 23b32: 99 0b sbc r25, r25 23b34: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23b38: 28 17 cp r18, r24 23b3a: 19 06 cpc r1, r25 23b3c: 59 f5 brne .+86 ; 0x23b94 23b3e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23b42: 88 23 and r24, r24 23b44: 39 f1 breq .+78 ; 0x23b94 lcd_set_cursor(2, menu_row); 23b46: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23b4a: 82 e0 ldi r24, 0x02 ; 2 23b4c: 0e 94 e7 6e call 0xddce ; 0xddce 23b50: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 23b54: 1f 92 push r1 23b56: 8f 93 push r24 23b58: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 23b5c: 1f 92 push r1 23b5e: 8f 93 push r24 23b60: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 23b64: 1f 92 push r1 23b66: 8f 93 push r24 23b68: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 23b6c: 1f 92 push r1 23b6e: 8f 93 push r24 23b70: df 93 push r29 23b72: cf 93 push r28 23b74: 1f 93 push r17 23b76: 0f 93 push r16 23b78: 0f 94 3a db call 0x3b674 ; 0x3b674 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 23b7c: 8f ea ldi r24, 0xAF ; 175 23b7e: 93 e0 ldi r25, 0x03 ; 3 23b80: 0e 94 ee 70 call 0xe1dc ; 0xe1dc 23b84: 8d b7 in r24, 0x3d ; 61 23b86: 9e b7 in r25, 0x3e ; 62 23b88: 0c 96 adiw r24, 0x0c ; 12 23b8a: 0f b6 in r0, 0x3f ; 63 23b8c: f8 94 cli 23b8e: 9e bf out 0x3e, r25 ; 62 23b90: 0f be out 0x3f, r0 ; 63 23b92: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 23b94: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23b98: 90 91 5f 06 lds r25, 0x065F ; 0x80065f 23b9c: a0 91 60 06 lds r26, 0x0660 ; 0x800660 23ba0: b0 91 61 06 lds r27, 0x0661 ; 0x800661 23ba4: 89 2b or r24, r25 23ba6: 8a 2b or r24, r26 23ba8: 8b 2b or r24, r27 23baa: 09 f4 brne .+2 ; 0x23bae 23bac: 42 c0 rjmp .+132 ; 0x23c32 MENU_ITEM_BACK_P(STR_SEPARATOR); 23bae: 81 e9 ldi r24, 0x91 ; 145 23bb0: 9a e8 ldi r25, 0x8A ; 138 23bb2: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 23bb6: 80 e4 ldi r24, 0x40 ; 64 23bb8: 9f e4 ldi r25, 0x4F ; 79 23bba: 0e 94 b3 72 call 0xe566 ; 0xe566 23bbe: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_BACK_P(PSTR(" ")); 23bc2: 8c e7 ldi r24, 0x7C ; 124 23bc4: 91 ea ldi r25, 0xA1 ; 161 23bc6: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 23bca: 80 91 15 05 lds r24, 0x0515 ; 0x800515 23bce: 81 50 subi r24, 0x01 ; 1 23bd0: 99 0b sbc r25, r25 23bd2: 20 91 14 05 lds r18, 0x0514 ; 0x800514 23bd6: 28 17 cp r18, r24 23bd8: 19 06 cpc r1, r25 23bda: 59 f5 brne .+86 ; 0x23c32 23bdc: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 23be0: 88 23 and r24, r24 23be2: 39 f1 breq .+78 ; 0x23c32 lcd_set_cursor(2, menu_row); 23be4: 60 91 12 05 lds r22, 0x0512 ; 0x800512 23be8: 82 e0 ldi r24, 0x02 ; 2 23bea: 0e 94 e7 6e call 0xddce ; 0xddce 23bee: 80 91 61 06 lds r24, 0x0661 ; 0x800661 23bf2: 1f 92 push r1 23bf4: 8f 93 push r24 23bf6: 80 91 60 06 lds r24, 0x0660 ; 0x800660 23bfa: 1f 92 push r1 23bfc: 8f 93 push r24 23bfe: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 23c02: 1f 92 push r1 23c04: 8f 93 push r24 23c06: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 23c0a: 1f 92 push r1 23c0c: 8f 93 push r24 23c0e: df 93 push r29 23c10: cf 93 push r28 23c12: 1f 93 push r17 23c14: 0f 93 push r16 23c16: 0f 94 3a db call 0x3b674 ; 0x3b674 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 23c1a: 8f ea ldi r24, 0xAF ; 175 23c1c: 93 e0 ldi r25, 0x03 ; 3 23c1e: 0e 94 ee 70 call 0xe1dc ; 0xe1dc 23c22: 8d b7 in r24, 0x3d ; 61 23c24: 9e b7 in r25, 0x3e ; 62 23c26: 0c 96 adiw r24, 0x0c ; 12 23c28: 0f b6 in r0, 0x3f ; 63 23c2a: f8 94 cli 23c2c: 9e bf out 0x3e, r25 ; 62 23c2e: 0f be out 0x3f, r0 ; 63 23c30: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 23c32: 81 e9 ldi r24, 0x91 ; 145 23c34: 9a e8 ldi r25, 0x8A ; 138 23c36: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 23c3a: 8d e2 ldi r24, 0x2D ; 45 23c3c: 9f e4 ldi r25, 0x4F ; 79 23c3e: 0e 94 b3 72 call 0xe566 ; 0xe566 23c42: 68 e0 ldi r22, 0x08 ; 8 23c44: 7b e3 ldi r23, 0x3B ; 59 23c46: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 23c4a: 8d e1 ldi r24, 0x1D ; 29 23c4c: 9f e4 ldi r25, 0x4F ; 79 23c4e: 0e 94 b3 72 call 0xe566 ; 0xe566 23c52: 6c e4 ldi r22, 0x4C ; 76 23c54: 79 e3 ldi r23, 0x39 ; 57 23c56: 0f 94 1b d4 call 0x3a836 ; 0x3a836 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 23c5a: 8f e0 ldi r24, 0x0F ; 15 23c5c: 9f e4 ldi r25, 0x4F ; 79 23c5e: 0e 94 b3 72 call 0xe566 ; 0xe566 23c62: 6c e2 ldi r22, 0x2C ; 44 23c64: 73 ee ldi r23, 0xE3 ; 227 23c66: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 23c6a: 81 e0 ldi r24, 0x01 ; 1 23c6c: 9f e4 ldi r25, 0x4F ; 79 23c6e: 0e 94 b3 72 call 0xe566 ; 0xe566 23c72: 6e e0 ldi r22, 0x0E ; 14 23c74: 7b e3 ldi r23, 0x3B ; 59 23c76: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 23c7a: 82 ef ldi r24, 0xF2 ; 242 23c7c: 9e e4 ldi r25, 0x4E ; 78 23c7e: 0e 94 b3 72 call 0xe566 ; 0xe566 23c82: 62 e3 ldi r22, 0x32 ; 50 23c84: 79 e3 ldi r23, 0x39 ; 57 23c86: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 23c8a: 87 ee ldi r24, 0xE7 ; 231 23c8c: 9e e4 ldi r25, 0x4E ; 78 23c8e: 0e 94 b3 72 call 0xe566 ; 0xe566 23c92: 64 ea ldi r22, 0xA4 ; 164 23c94: 79 e3 ldi r23, 0x39 ; 57 23c96: 0f 94 1b d4 call 0x3a836 ; 0x3a836 #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 23c9a: 60 e5 ldi r22, 0x50 ; 80 23c9c: 7a e3 ldi r23, 0x3A ; 58 23c9e: 88 e1 ldi r24, 0x18 ; 24 23ca0: 9f e6 ldi r25, 0x6F ; 111 23ca2: 0f 94 1a d1 call 0x3a234 ; 0x3a234 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(); 23ca6: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 23caa: 80 91 12 05 lds r24, 0x0512 ; 0x800512 23cae: 8f 5f subi r24, 0xFF ; 255 23cb0: 80 93 12 05 sts 0x0512, r24 ; 0x800512 23cb4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 23cb8: 8f 5f subi r24, 0xFF ; 255 23cba: 80 93 14 05 sts 0x0514, r24 ; 0x800514 23cbe: 99 ce rjmp .-718 ; 0x239f2 _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) 23cc0: 90 91 aa 03 lds r25, 0x03AA ; 0x8003aa 23cc4: 99 23 and r25, r25 23cc6: 09 f4 brne .+2 ; 0x23cca 23cc8: 88 ce rjmp .-752 ; 0x239da 23cca: 40 91 ab 03 lds r20, 0x03AB ; 0x8003ab 23cce: 50 91 ac 03 lds r21, 0x03AC ; 0x8003ac 23cd2: 60 91 ad 03 lds r22, 0x03AD ; 0x8003ad 23cd6: 70 91 ae 03 lds r23, 0x03AE ; 0x8003ae 23cda: 45 2b or r20, r21 23cdc: 46 2b or r20, r22 23cde: 47 2b or r20, r23 23ce0: 09 f0 breq .+2 ; 0x23ce4 23ce2: 7b ce rjmp .-778 ; 0x239da 23ce4: 8f 5f subi r24, 0xFF ; 255 23ce6: 80 31 cpi r24, 0x10 ; 16 23ce8: 19 f0 breq .+6 ; 0x23cf0 23cea: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 23cee: 75 ce rjmp .-790 ; 0x239da { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 23cf0: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 23cf4: 72 ce rjmp .-796 ; 0x239da 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)); 23cf6: 83 e5 ldi r24, 0x53 ; 83 23cf8: 9f e4 ldi r25, 0x4F ; 79 23cfa: 0e 94 b3 72 call 0xe566 ; 0xe566 23cfe: 0e 94 d2 6e call 0xdda4 ; 0xdda4 23d02: 03 cf rjmp .-506 ; 0x23b0a } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 23d04: 82 e9 ldi r24, 0x92 ; 146 23d06: 91 ea ldi r25, 0xA1 ; 161 23d08: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 23d0c: fe ce rjmp .-516 ; 0x23b0a #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 23d0e: df 91 pop r29 23d10: cf 91 pop r28 23d12: 1f 91 pop r17 23d14: 0f 91 pop r16 23d16: ff 90 pop r15 23d18: ef 90 pop r14 23d1a: 08 95 ret 00023d1c : { 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) { 23d1c: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 23d20: 81 11 cpse r24, r1 23d22: 19 c0 rjmp .+50 ; 0x23d56 lcd_clear(); 23d24: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 23d28: 86 e6 ldi r24, 0x66 ; 102 23d2a: 9e e4 ldi r25, 0x4E ; 78 23d2c: 0e 94 b3 72 call 0xe566 ; 0xe566 23d30: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_putc(':'); 23d34: 8a e3 ldi r24, 0x3A ; 58 23d36: 0e 94 d6 6e call 0xddac ; 0xddac lcd_set_cursor(10, 1); 23d3a: 61 e0 ldi r22, 0x01 ; 1 23d3c: 8a e0 ldi r24, 0x0A ; 10 23d3e: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 23d42: 88 ea ldi r24, 0xA8 ; 168 23d44: 9c e0 ldi r25, 0x0C ; 12 23d46: 0f 94 2b dc call 0x3b856 ; 0x3b856 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 23d4a: 4a e0 ldi r20, 0x0A ; 10 23d4c: 0e 94 3b 70 call 0xe076 ; 0xe076 _md->initialized = true; 23d50: 81 e0 ldi r24, 0x01 ; 1 23d52: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } menu_back_if_clicked(); 23d56: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e 00023d5a : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 23d5a: 0e 94 93 6f call 0xdf26 ; 0xdf26 lcd_status_message_idx = 0; // Re-draw message from beginning 23d5e: 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); 23d62: 20 e0 ldi r18, 0x00 ; 0 23d64: 41 e0 ldi r20, 0x01 ; 1 23d66: 70 e0 ldi r23, 0x00 ; 0 23d68: 60 e0 ldi r22, 0x00 ; 0 23d6a: 88 e1 ldi r24, 0x18 ; 24 23d6c: 99 e3 ldi r25, 0x39 ; 57 23d6e: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e menu_depth = 0; 23d72: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 23d76: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 } 23d7a: 08 95 ret 00023d7c : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 23d7c: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 23d80: 87 ea ldi r24, 0xA7 ; 167 23d82: 91 e5 ldi r25, 0x51 ; 81 23d84: 0e 94 b3 72 call 0xe566 ; 0xe566 23d88: ac 01 movw r20, r24 23d8a: 60 e0 ldi r22, 0x00 ; 0 23d8c: 80 e0 ldi r24, 0x00 ; 0 23d8e: 0e 94 fb 6e call 0xddf6 ; 0xddf6 pid_temp += lcd_encoder; 23d92: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 23d96: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23d9a: 20 91 70 06 lds r18, 0x0670 ; 0x800670 23d9e: 30 91 71 06 lds r19, 0x0671 ; 0x800671 23da2: 82 0f add r24, r18 23da4: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 23da6: 82 33 cpi r24, 0x32 ; 50 23da8: 21 e0 ldi r18, 0x01 ; 1 23daa: 92 07 cpc r25, r18 23dac: 50 f1 brcs .+84 ; 0x23e02 23dae: 81 e3 ldi r24, 0x31 ; 49 23db0: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 23db2: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23db6: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.441> lcd_encoder = 0; 23dba: 10 92 71 06 sts 0x0671, r1 ; 0x800671 23dbe: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_set_cursor(1, 2); 23dc2: 62 e0 ldi r22, 0x02 ; 2 23dc4: 81 e0 ldi r24, 0x01 ; 1 23dc6: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%3u"), pid_temp); 23dca: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.441+0x1> 23dce: 8f 93 push r24 23dd0: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.441> 23dd4: 8f 93 push r24 23dd6: 84 e6 ldi r24, 0x64 ; 100 23dd8: 93 ea ldi r25, 0xA3 ; 163 23dda: 9f 93 push r25 23ddc: 8f 93 push r24 23dde: 0e 94 c0 6e call 0xdd80 ; 0xdd80 if (lcd_clicked()) { 23de2: 0e 94 04 71 call 0xe208 ; 0xe208 23de6: 0f 90 pop r0 23de8: 0f 90 pop r0 23dea: 0f 90 pop r0 23dec: 0f 90 pop r0 23dee: 88 23 and r24, r24 23df0: 71 f0 breq .+28 ; 0x23e0e lcd_commands_type = LcdCommands::PidExtruder; 23df2: 83 e0 ldi r24, 0x03 ; 3 23df4: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 23df8: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_update(2); 23dfc: 82 e0 ldi r24, 0x02 ; 2 23dfe: 0c 94 ae 6e jmp 0xdd5c ; 0xdd5c { 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; 23e02: 8a 30 cpi r24, 0x0A ; 10 23e04: 91 05 cpc r25, r1 23e06: a8 f6 brcc .-86 ; 0x23db2 23e08: 8a e0 ldi r24, 0x0A ; 10 23e0a: 90 e0 ldi r25, 0x00 ; 0 23e0c: d2 cf rjmp .-92 ; 0x23db2 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 23e0e: 08 95 ret 00023e10 : } 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){ 23e10: 0f 93 push r16 23e12: 1f 93 push r17 23e14: cf 93 push r28 23e16: df 93 push r29 23e18: ec 01 movw r28, r24 23e1a: cb 01 movw r24, r22 23e1c: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 23e1e: 4a 81 ldd r20, Y+2 ; 0x02 23e20: 41 30 cpi r20, 0x01 ; 1 23e22: 29 f0 breq .+10 ; 0x23e2e 23e24: 88 f0 brcs .+34 ; 0x23e48 23e26: 42 30 cpi r20, 0x02 ; 2 23e28: 09 f1 breq .+66 ; 0x23e6c 23e2a: 43 30 cpi r20, 0x03 ; 3 23e2c: d1 f4 brne .+52 ; 0x23e62 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 ){ 23e2e: 8b 81 ldd r24, Y+3 ; 0x03 23e30: 81 11 cpse r24, r1 23e32: 25 c0 rjmp .+74 ; 0x23e7e state = next_state; // advance to the next state 23e34: 82 e0 ldi r24, 0x02 ; 2 23e36: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 23e38: 63 e0 ldi r22, 0x03 ; 3 23e3a: 80 e9 ldi r24, 0x90 ; 144 23e3c: 9e e9 ldi r25, 0x9E ; 158 23e3e: 0e 94 24 f1 call 0x1e248 ; 0x1e248 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 23e42: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 23e44: 8b 83 std Y+3, r24 ; 0x03 23e46: 0d c0 rjmp .+26 ; 0x23e62 //! @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 ){ 23e48: a9 01 movw r20, r18 23e4a: 98 01 movw r18, r16 23e4c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 23e50: 18 16 cp r1, r24 23e52: 3c f4 brge .+14 ; 0x23e62 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 23e54: 63 e0 ldi r22, 0x03 ; 3 23e56: 88 81 ld r24, Y 23e58: 99 81 ldd r25, Y+1 ; 0x01 23e5a: 0e 94 24 f1 call 0x1e248 ; 0x1e248 state = States::TempAboveMintemp; 23e5e: 81 e0 ldi r24, 0x01 ; 1 23e60: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 23e62: df 91 pop r29 23e64: cf 91 pop r28 23e66: 1f 91 pop r17 23e68: 0f 91 pop r16 23e6a: 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 ){ 23e6c: 8b 81 ldd r24, Y+3 ; 0x03 23e6e: 81 11 cpse r24, r1 23e70: 06 c0 rjmp .+12 ; 0x23e7e 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); 23e72: 88 81 ld r24, Y 23e74: 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 23e76: 23 e0 ldi r18, 0x03 ; 3 23e78: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 23e7a: 63 e0 ldi r22, 0x03 ; 3 23e7c: e0 cf rjmp .-64 ; 0x23e3e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 23e7e: 81 50 subi r24, 0x01 ; 1 23e80: e1 cf rjmp .-62 ; 0x23e44 00023e82 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 23e82: cf 93 push r28 if(IsStopped() == false) { 23e84: 90 91 11 05 lds r25, 0x0511 ; 0x800511 23e88: 91 11 cpse r25, r1 23e8a: 18 c0 rjmp .+48 ; 0x23ebc 23e8c: c6 2f mov r28, r22 if (isPreheat) { 23e8e: 88 23 and r24, r24 23e90: c9 f0 breq .+50 ; 0x23ec4 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 23e92: 84 e3 ldi r24, 0x34 ; 52 23e94: 9e e9 ldi r25, 0x9E ; 158 23e96: 66 23 and r22, r22 23e98: 11 f0 breq .+4 ; 0x23e9e 23e9a: 82 e4 ldi r24, 0x42 ; 66 23e9c: 9e e9 ldi r25, 0x9E ; 158 23e9e: 63 e0 ldi r22, 0x03 ; 3 23ea0: 0e 94 24 f1 call 0x1e248 ; 0x1e248 SERIAL_ERROR_START; 23ea4: 88 ea ldi r24, 0xA8 ; 168 23ea6: 9b ea ldi r25, 0xAB ; 171 23ea8: 0e 94 57 77 call 0xeeae ; 0xeeae if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 23eac: 81 e1 ldi r24, 0x11 ; 17 23eae: 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) { 23eb0: c1 11 cpse r28, r1 23eb2: 02 c0 rjmp .+4 ; 0x23eb8 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 23eb4: 8f ee ldi r24, 0xEF ; 239 23eb6: 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"); 23eb8: 0e 94 82 79 call 0xf304 ; 0xf304 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 23ebc: 80 e0 ldi r24, 0x00 ; 0 } 23ebe: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 23ec0: 0c 94 b3 79 jmp 0xf366 ; 0xf366 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); 23ec4: 8b ec ldi r24, 0xCB ; 203 23ec6: 9d e9 ldi r25, 0x9D ; 157 23ec8: 66 23 and r22, r22 23eca: 11 f0 breq .+4 ; 0x23ed0 23ecc: 8b ed ldi r24, 0xDB ; 219 23ece: 9d e9 ldi r25, 0x9D ; 157 23ed0: 63 e0 ldi r22, 0x03 ; 3 23ed2: 0e 94 24 f1 call 0x1e248 ; 0x1e248 SERIAL_ERROR_START; 23ed6: 88 ea ldi r24, 0xA8 ; 168 23ed8: 9b ea ldi r25, 0xAB ; 171 23eda: 0e 94 57 77 call 0xeeae ; 0xeeae if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 23ede: 82 eb ldi r24, 0xB2 ; 178 23ee0: 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) { 23ee2: c1 11 cpse r28, r1 23ee4: e9 cf rjmp .-46 ; 0x23eb8 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 23ee6: 8a e9 ldi r24, 0x9A ; 154 23ee8: 9d e9 ldi r25, 0x9D ; 157 23eea: e6 cf rjmp .-52 ; 0x23eb8 00023eec : static void Sound_DoSound_Prompt(void) { backlight_wake(2); 23eec: 82 e0 ldi r24, 0x02 ; 2 23eee: 0e 94 74 8a call 0x114e8 ; 0x114e8 WRITE(BEEPER,HIGH); 23ef2: 9f b7 in r25, 0x3f ; 63 23ef4: f8 94 cli 23ef6: e2 e0 ldi r30, 0x02 ; 2 23ef8: f1 e0 ldi r31, 0x01 ; 1 23efa: 80 81 ld r24, Z 23efc: 84 60 ori r24, 0x04 ; 4 23efe: 80 83 st Z, r24 23f00: 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); 23f02: 2f ef ldi r18, 0xFF ; 255 23f04: 89 e6 ldi r24, 0x69 ; 105 23f06: 98 e1 ldi r25, 0x18 ; 24 23f08: 21 50 subi r18, 0x01 ; 1 23f0a: 80 40 sbci r24, 0x00 ; 0 23f0c: 90 40 sbci r25, 0x00 ; 0 23f0e: e1 f7 brne .-8 ; 0x23f08 23f10: 00 c0 rjmp .+0 ; 0x23f12 23f12: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 23f14: 9f b7 in r25, 0x3f ; 63 23f16: f8 94 cli 23f18: 80 81 ld r24, Z 23f1a: 8b 7f andi r24, 0xFB ; 251 23f1c: 80 83 st Z, r24 23f1e: 9f bf out 0x3f, r25 ; 63 } 23f20: 08 95 ret 00023f22 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 23f22: 81 30 cpi r24, 0x01 ; 1 23f24: 21 f4 brne .+8 ; 0x23f2e case STATE_ON: lcd_puts_P(_N(" 1")); 23f26: 8e ee ldi r24, 0xEE ; 238 23f28: 9f e6 ldi r25, 0x6F ; 111 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 23f2a: 0c 94 d2 6e jmp 0xdda4 ; 0xdda4 23f2e: 8a ee ldi r24, 0xEA ; 234 23f30: 9f e6 ldi r25, 0x6F ; 111 23f32: fb cf rjmp .-10 ; 0x23f2a 00023f34 : //! @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) { 23f34: cf 92 push r12 23f36: df 92 push r13 23f38: ef 92 push r14 23f3a: ff 92 push r15 23f3c: 0f 93 push r16 23f3e: 1f 93 push r17 23f40: cf 93 push r28 23f42: df 93 push r29 23f44: d8 2f mov r29, r24 23f46: 6b 01 movw r12, r22 23f48: 7a 01 movw r14, r20 23f4a: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 23f4c: 40 e2 ldi r20, 0x20 ; 32 23f4e: 81 11 cpse r24, r1 23f50: 01 c0 rjmp .+2 ; 0x23f54 23f52: 4e e3 ldi r20, 0x3E ; 62 23f54: 63 e0 ldi r22, 0x03 ; 3 23f56: 80 e0 ldi r24, 0x00 ; 0 23f58: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_puts_P(first_choice); 23f5c: c6 01 movw r24, r12 23f5e: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 23f62: 40 e2 ldi r20, 0x20 ; 32 23f64: d1 30 cpi r29, 0x01 ; 1 23f66: 09 f4 brne .+2 ; 0x23f6a 23f68: 4e e3 ldi r20, 0x3E ; 62 23f6a: 63 e0 ldi r22, 0x03 ; 3 23f6c: 8c 2f mov r24, r28 23f6e: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_puts_P(second_choice); 23f72: c7 01 movw r24, r14 23f74: 0e 94 d2 6e call 0xdda4 ; 0xdda4 if (third_choice) { 23f78: 01 15 cp r16, r1 23f7a: 11 05 cpc r17, r1 23f7c: 19 f1 breq .+70 ; 0x23fc4 23f7e: c8 01 movw r24, r16 23f80: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> 23f84: d8 2e mov r13, r24 23f86: c7 01 movw r24, r14 23f88: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__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; 23f8c: 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;} 23f8e: 93 e1 ldi r25, 0x13 ; 19 23f90: 9d 19 sub r25, r13 23f92: 8c 0f add r24, r28 23f94: 89 17 cp r24, r25 23f96: 08 f4 brcc .+2 ; 0x23f9a 23f98: 89 2f mov r24, r25 23f9a: 83 31 cpi r24, 0x13 ; 19 23f9c: 08 f0 brcs .+2 ; 0x23fa0 23f9e: 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 ? '>': ' '); 23fa0: 40 e2 ldi r20, 0x20 ; 32 23fa2: d2 30 cpi r29, 0x02 ; 2 23fa4: 09 f4 brne .+2 ; 0x23fa8 23fa6: 4e e3 ldi r20, 0x3E ; 62 23fa8: 63 e0 ldi r22, 0x03 ; 3 23faa: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_puts_P(third_choice); 23fae: c8 01 movw r24, r16 } } 23fb0: df 91 pop r29 23fb2: cf 91 pop r28 23fb4: 1f 91 pop r17 23fb6: 0f 91 pop r16 23fb8: ff 90 pop r15 23fba: ef 90 pop r14 23fbc: df 90 pop r13 23fbe: 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); 23fc0: 0c 94 d2 6e jmp 0xdda4 ; 0xdda4 } } 23fc4: df 91 pop r29 23fc6: cf 91 pop r28 23fc8: 1f 91 pop r17 23fca: 0f 91 pop r16 23fcc: ff 90 pop r15 23fce: ef 90 pop r14 23fd0: df 90 pop r13 23fd2: cf 90 pop r12 23fd4: 08 95 ret 00023fd6 : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 23fd6: cf 93 push r28 23fd8: df 93 push r29 23fda: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 23fdc: 80 e0 ldi r24, 0x00 ; 0 23fde: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 23fe2: 0e 94 1a 6f call 0xde34 ; 0xde34 return lcd_display_message_fullscreen_nonBlocking_P(msg); 23fe6: ce 01 movw r24, r28 } 23fe8: df 91 pop r29 23fea: 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); 23fec: 0d 94 b5 14 jmp 0x2296a ; 0x2296a 00023ff0 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 23ff0: cf 92 push r12 23ff2: df 92 push r13 23ff4: ef 92 push r14 23ff6: ff 92 push r15 23ff8: 0f 93 push r16 23ffa: 1f 93 push r17 23ffc: cf 93 push r28 23ffe: df 93 push r29 24000: d8 2e mov r13, r24 24002: 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) 24004: 01 e0 ldi r16, 0x01 ; 1 24006: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 2400a: 81 11 cpse r24, r1 2400c: 01 c0 rjmp .+2 ; 0x24010 2400e: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 24010: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 24014: 8d 2d mov r24, r13 24016: 9c 2d mov r25, r12 24018: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 2401c: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 2401e: 0e 94 ff 70 call 0xe1fe ; 0xe1fe KEEPALIVE_STATE(PAUSED_FOR_USER); 24022: 84 e0 ldi r24, 0x04 ; 4 24024: 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); 24028: 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) { 2402a: 20 97 sbiw r28, 0x00 ; 0 2402c: 29 f4 brne .+10 ; 0x24038 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 2402e: 49 e8 ldi r20, 0x89 ; 137 24030: 63 e0 ldi r22, 0x03 ; 3 24032: 83 e1 ldi r24, 0x13 ; 19 24034: 0e 94 07 6f call 0xde0e ; 0xde0e * @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); 24038: 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); 2403a: 82 e3 ldi r24, 0x32 ; 50 2403c: 90 e0 ldi r25, 0x00 ; 0 2403e: 0e 94 eb 8c call 0x119d6 ; 0x119d6 if (lcd_clicked()) { 24042: 0e 94 04 71 call 0xe208 ; 0xe208 24046: 88 23 and r24, r24 24048: 81 f0 breq .+32 ; 0x2406a if (msg_next == NULL) { 2404a: 20 97 sbiw r28, 0x00 ; 0 2404c: 81 f4 brne .+32 ; 0x2406e KEEPALIVE_STATE(IN_HANDLER); 2404e: 82 e0 ldi r24, 0x02 ; 2 24050: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 24054: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 24058: df 91 pop r29 2405a: cf 91 pop r28 2405c: 1f 91 pop r17 2405e: 0f 91 pop r16 24060: ff 90 pop r15 24062: ef 90 pop r14 24064: df 90 pop r13 24066: cf 90 pop r12 24068: 08 95 ret 2406a: 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) { 2406c: 31 f7 brne .-52 ; 0x2403a else { break; } } } if (multi_screen) { 2406e: e1 14 cp r14, r1 24070: f1 04 cpc r15, r1 24072: d9 f2 breq .-74 ; 0x2402a if (msg_next == NULL) 24074: 20 97 sbiw r28, 0x00 ; 0 24076: 11 f4 brne .+4 ; 0x2407c msg_next = msg; 24078: cd 2d mov r28, r13 2407a: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 2407c: ce 01 movw r24, r28 2407e: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 24082: ec 01 movw r28, r24 24084: d2 cf rjmp .-92 ; 0x2402a 00024086 : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 24086: cf 93 push r28 24088: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 2408a: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 disable_x(); 2408e: 17 9a sbi 0x02, 7 ; 2 24090: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 24094: 16 9a sbi 0x02, 6 ; 2 24096: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_z(); disable_e0(); 2409a: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2409c: 10 92 73 06 sts 0x0673, r1 ; 0x800673 240a0: 10 92 72 06 sts 0x0672, r1 ; 0x800672 240a4: 68 2f mov r22, r24 240a6: 86 ea ldi r24, 0xA6 ; 166 240a8: 9f e0 ldi r25, 0x0F ; 15 240aa: 0f 94 47 dc call 0x3b88e ; 0x3b88e 240ae: 6c 2f mov r22, r28 240b0: 8f ea ldi r24, 0xAF ; 175 240b2: 9f e0 ldi r25, 0x0F ; 15 240b4: 0f 94 47 dc call 0x3b88e ; 0x3b88e // 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) { 240b8: cc 23 and r28, r28 240ba: 89 f0 breq .+34 ; 0x240de SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 240bc: 83 ea ldi r24, 0xA3 ; 163 240be: 93 ea ldi r25, 0xA3 ; 163 240c0: 0e 94 82 79 call 0xf304 ; 0xf304 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 240c4: 85 ed ldi r24, 0xD5 ; 213 240c6: 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)); 240c8: 0e 94 b3 72 call 0xe566 ; 0xe566 240cc: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 } lcd_update_enable(true); 240d0: 81 e0 ldi r24, 0x01 ; 1 240d2: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_update(2); 240d6: 82 e0 ldi r24, 0x02 ; 2 } 240d8: 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); 240da: 0c 94 ae 6e jmp 0xdd5c ; 0xdd5c 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."); 240de: 88 e6 ldi r24, 0x68 ; 104 240e0: 93 ea ldi r25, 0xA3 ; 163 240e2: 0e 94 82 79 call 0xf304 ; 0xf304 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 240e6: 8a eb ldi r24, 0xBA ; 186 240e8: 91 e5 ldi r25, 0x51 ; 81 240ea: ee cf rjmp .-36 ; 0x240c8 000240ec : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 240ec: 1f 93 push r17 240ee: cf 93 push r28 240f0: 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); 240f2: 64 e6 ldi r22, 0x64 ; 100 240f4: 70 e0 ldi r23, 0x00 ; 0 240f6: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 240fa: 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++) { 240fc: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 240fe: 4e e2 ldi r20, 0x2E ; 46 24100: 63 e0 ldi r22, 0x03 ; 3 24102: 81 2f mov r24, r17 24104: 0e 94 07 6f call 0xde0e ; 0xde0e //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 24108: ce 01 movw r24, r28 2410a: 0e 94 eb 8c call 0x119d6 ; 0x119d6 2410e: ce 01 movw r24, r28 24110: 0e 94 eb 8c call 0x119d6 ; 0x119d6 24114: ce 01 movw r24, r28 24116: 0e 94 eb 8c call 0x119d6 ; 0x119d6 2411a: ce 01 movw r24, r28 2411c: 0e 94 eb 8c call 0x119d6 ; 0x119d6 24120: ce 01 movw r24, r28 24122: 0e 94 eb 8c call 0x119d6 ; 0x119d6 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 24126: 1f 5f subi r17, 0xFF ; 255 24128: 14 31 cpi r17, 0x14 ; 20 2412a: 49 f7 brne .-46 ; 0x240fe //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 2412c: df 91 pop r29 2412e: cf 91 pop r28 24130: 1f 91 pop r17 24132: 08 95 ret 00024134 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 24134: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 24138: 08 95 ret 0002413a : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 2413a: cf 93 push r28 MENU_BEGIN(); 2413c: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 24140: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24144: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24148: 84 30 cpi r24, 0x04 ; 4 2414a: 08 f0 brcs .+2 ; 0x2414e 2414c: a1 c0 rjmp .+322 ; 0x24290 2414e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 24152: 8f e5 ldi r24, 0x5F ; 95 24154: 9f e0 ldi r25, 0x0F ; 15 24156: 0f 94 23 dc call 0x3b846 ; 0x3b846 2415a: 81 11 cpse r24, r1 2415c: 10 c0 rjmp .+32 ; 0x2417e { ON_MENU_LEAVE( 2415e: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 24162: 81 11 cpse r24, r1 24164: 0f 94 9a 20 call 0x24134 ; 0x24134 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 24168: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2416c: 8a 30 cpi r24, 0x0A ; 10 2416e: 09 f4 brne .+2 ; 0x24172 24170: 8c c0 rjmp .+280 ; 0x2428a 24172: 88 ea ldi r24, 0xA8 ; 168 24174: 98 e4 ldi r25, 0x48 ; 72 24176: 0e 94 b3 72 call 0xe566 ; 0xe566 2417a: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 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(); 2417e: 0f 94 3b 16 call 0x22c76 ; 0x22c76 24182: 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); 24184: 8b e0 ldi r24, 0x0B ; 11 24186: 93 ea ldi r25, 0xA3 ; 163 24188: cc 23 and r28, r28 2418a: 11 f0 breq .+4 ; 0x24190 2418c: 8a e1 ldi r24, 0x1A ; 26 2418e: 93 ea ldi r25, 0xA3 ; 163 24190: 64 e9 ldi r22, 0x94 ; 148 24192: 7a e3 ldi r23, 0x3A ; 58 24194: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 24198: 80 ef ldi r24, 0xF0 ; 240 2419a: 92 ea ldi r25, 0xA2 ; 162 2419c: cc 23 and r28, r28 2419e: 11 f0 breq .+4 ; 0x241a4 241a0: 8f ef ldi r24, 0xFF ; 255 241a2: 92 ea ldi r25, 0xA2 ; 162 241a4: 68 ef ldi r22, 0xF8 ; 248 241a6: 79 e3 ldi r23, 0x39 ; 57 241a8: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 241ac: 84 ed ldi r24, 0xD4 ; 212 241ae: 92 ea ldi r25, 0xA2 ; 162 241b0: cc 23 and r28, r28 241b2: 11 f0 breq .+4 ; 0x241b8 241b4: 84 ee ldi r24, 0xE4 ; 228 241b6: 92 ea ldi r25, 0xA2 ; 162 241b8: 62 ee ldi r22, 0xE2 ; 226 241ba: 79 e3 ldi r23, 0x39 ; 57 241bc: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 241c0: 88 eb ldi r24, 0xB8 ; 184 241c2: 92 ea ldi r25, 0xA2 ; 162 241c4: cc 23 and r28, r28 241c6: 11 f0 breq .+4 ; 0x241cc 241c8: 88 ec ldi r24, 0xC8 ; 200 241ca: 92 ea ldi r25, 0xA2 ; 162 241cc: 64 ee ldi r22, 0xE4 ; 228 241ce: 79 e3 ldi r23, 0x39 ; 57 241d0: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 241d4: 8d e9 ldi r24, 0x9D ; 157 241d6: 92 ea ldi r25, 0xA2 ; 162 241d8: cc 23 and r28, r28 241da: 11 f0 breq .+4 ; 0x241e0 241dc: 8c ea ldi r24, 0xAC ; 172 241de: 92 ea ldi r25, 0xA2 ; 162 241e0: 66 e5 ldi r22, 0x56 ; 86 241e2: 79 e3 ldi r23, 0x39 ; 57 241e4: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 241e8: 82 e8 ldi r24, 0x82 ; 130 241ea: 92 ea ldi r25, 0xA2 ; 162 241ec: cc 23 and r28, r28 241ee: 11 f0 breq .+4 ; 0x241f4 241f0: 81 e9 ldi r24, 0x91 ; 145 241f2: 92 ea ldi r25, 0xA2 ; 162 241f4: 60 ef ldi r22, 0xF0 ; 240 241f6: 79 e3 ldi r23, 0x39 ; 57 241f8: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 241fc: 86 e6 ldi r24, 0x66 ; 102 241fe: 92 ea ldi r25, 0xA2 ; 162 24200: cc 23 and r28, r28 24202: 11 f0 breq .+4 ; 0x24208 24204: 86 e7 ldi r24, 0x76 ; 118 24206: 92 ea ldi r25, 0xA2 ; 162 24208: 6e e4 ldi r22, 0x4E ; 78 2420a: 7a e3 ldi r23, 0x3A ; 58 2420c: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 24210: 8a e4 ldi r24, 0x4A ; 74 24212: 92 ea ldi r25, 0xA2 ; 162 24214: cc 23 and r28, r28 24216: 11 f0 breq .+4 ; 0x2421c 24218: 8a e5 ldi r24, 0x5A ; 90 2421a: 92 ea ldi r25, 0xA2 ; 162 2421c: 6e e5 ldi r22, 0x5E ; 94 2421e: 7a e3 ldi r23, 0x3A ; 58 24220: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 24224: 8e e2 ldi r24, 0x2E ; 46 24226: 92 ea ldi r25, 0xA2 ; 162 24228: cc 23 and r28, r28 2422a: 11 f0 breq .+4 ; 0x24230 2422c: 8e e3 ldi r24, 0x3E ; 62 2422e: 92 ea ldi r25, 0xA2 ; 162 24230: 68 e9 ldi r22, 0x98 ; 152 24232: 7a e3 ldi r23, 0x3A ; 58 24234: 0f 94 1b d4 call 0x3a836 ; 0x3a836 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); 24238: 83 e1 ldi r24, 0x13 ; 19 2423a: 92 ea ldi r25, 0xA2 ; 162 2423c: cc 23 and r28, r28 2423e: 11 f0 breq .+4 ; 0x24244 24240: 82 e2 ldi r24, 0x22 ; 34 24242: 92 ea ldi r25, 0xA2 ; 162 24244: 6c eb ldi r22, 0xBC ; 188 24246: 7a e3 ldi r23, 0x3A ; 58 24248: 0f 94 1b d4 call 0x3a836 ; 0x3a836 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 2424c: 8f e5 ldi r24, 0x5F ; 95 2424e: 9f e0 ldi r25, 0x0F ; 15 24250: 0f 94 23 dc call 0x3b846 ; 0x3b846 24254: 81 11 cpse r24, r1 24256: 0c c0 rjmp .+24 ; 0x24270 24258: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2425c: 89 30 cpi r24, 0x09 ; 9 2425e: 41 f4 brne .+16 ; 0x24270 24260: 84 e0 ldi r24, 0x04 ; 4 24262: 90 e5 ldi r25, 0x50 ; 80 24264: 0e 94 b3 72 call 0xe566 ; 0xe566 24268: 6c e1 ldi r22, 0x1C ; 28 2426a: 7b e3 ldi r23, 0x3B ; 59 2426c: 0f 94 1a d1 call 0x3a234 ; 0x3a234 MENU_END(); 24270: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 24274: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24278: 8f 5f subi r24, 0xFF ; 255 2427a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2427e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24282: 8f 5f subi r24, 0xFF ; 255 24284: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24288: 5d cf rjmp .-326 ; 0x24144 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)); 2428a: 8c eb ldi r24, 0xBC ; 188 2428c: 99 e4 ldi r25, 0x49 ; 73 2428e: 73 cf rjmp .-282 ; 0x24176 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(); } 24290: cf 91 pop r28 24292: 08 95 ret 00024294 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 24294: 89 e0 ldi r24, 0x09 ; 9 24296: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_generic_preheat_menu(); 2429a: 0d 94 9d 20 jmp 0x2413a ; 0x2413a 0002429e : // 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); 2429e: 81 e0 ldi r24, 0x01 ; 1 242a0: 0e 94 dd 6e call 0xddba ; 0xddba if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 242a4: 0f 94 c0 74 call 0x2e980 ; 0x2e980 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; 242a8: 90 91 a2 13 lds r25, 0x13A2 ; 0x8013a2 242ac: 93 36 cpi r25, 0x63 ; 99 242ae: 09 f4 brne .+2 ; 0x242b2 242b0: 9f ef ldi r25, 0xFF ; 255 242b2: 89 13 cpse r24, r25 242b4: 0e c0 rjmp .+28 ; 0x242d2 lcd_putc('F'); 242b6: 86 e4 ldi r24, 0x46 ; 70 242b8: 0e 94 d6 6e call 0xddac ; 0xddac lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 242bc: 0f 94 c0 74 call 0x2e980 ; 0x2e980 242c0: 8f 3f cpi r24, 0xFF ; 255 242c2: 29 f0 breq .+10 ; 0x242ce 242c4: 8f 5c subi r24, 0xCF ; 207 242c6: 0e 94 d6 6e call 0xddac ; 0xddac 242ca: 83 e0 ldi r24, 0x03 ; 3 242cc: 08 95 ret 242ce: 8f e3 ldi r24, 0x3F ; 63 242d0: fa cf rjmp .-12 ; 0x242c6 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 242d2: 8f 3f cpi r24, 0xFF ; 255 242d4: 89 f0 breq .+34 ; 0x242f8 242d6: 8f 5c subi r24, 0xCF ; 207 242d8: 0e 94 d6 6e call 0xddac ; 0xddac lcd_putc('>'); 242dc: 8e e3 ldi r24, 0x3E ; 62 242de: 0e 94 d6 6e call 0xddac ; 0xddac 242e2: 80 91 a2 13 lds r24, 0x13A2 ; 0x8013a2 242e6: 83 36 cpi r24, 0x63 ; 99 242e8: 49 f0 breq .+18 ; 0x242fc lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 242ea: 8f 3f cpi r24, 0xFF ; 255 242ec: 39 f0 breq .+14 ; 0x242fc 242ee: 8f 5c subi r24, 0xCF ; 207 242f0: 0e 94 d6 6e call 0xddac ; 0xddac chars += 3; 242f4: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 242f6: 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'); 242f8: 8f e3 ldi r24, 0x3F ; 63 242fa: ee cf rjmp .-36 ; 0x242d8 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 242fc: 8f e3 ldi r24, 0x3F ; 63 242fe: f8 cf rjmp .-16 ; 0x242f0 00024300 : } // 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); 24300: 5f 93 push r21 24302: 4f 93 push r20 24304: 7f 93 push r23 24306: 6f 93 push r22 24308: 28 2f mov r18, r24 2430a: 08 2e mov r0, r24 2430c: 00 0c add r0, r0 2430e: 33 0b sbc r19, r19 24310: 3f 93 push r19 24312: 8f 93 push r24 24314: 84 ea ldi r24, 0xA4 ; 164 24316: 9e e6 ldi r25, 0x6E ; 110 24318: 9f 93 push r25 2431a: 8f 93 push r24 2431c: 0e 94 c0 6e call 0xdd80 ; 0xdd80 lcd_space(9 - chars); 24320: 2d b7 in r18, 0x3d ; 61 24322: 3e b7 in r19, 0x3e ; 62 24324: 28 5f subi r18, 0xF8 ; 248 24326: 3f 4f sbci r19, 0xFF ; 255 24328: 0f b6 in r0, 0x3f ; 63 2432a: f8 94 cli 2432c: 3e bf out 0x3e, r19 ; 62 2432e: 0f be out 0x3f, r0 ; 63 24330: 2d bf out 0x3d, r18 ; 61 24332: 99 e0 ldi r25, 0x09 ; 9 24334: 98 1b sub r25, r24 24336: 89 2f mov r24, r25 24338: 0c 94 dd 6e jmp 0xddba ; 0xddba 0002433c : default: return false; } } void lcd_print_target_temps_first_line() { 2433c: cf 93 push r28 2433e: df 93 push r29 lcd_home(); 24340: 0e 94 13 6f call 0xde26 ; 0xde26 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 24344: c0 91 b6 0d lds r28, 0x0DB6 ; 0x800db6 24348: d0 91 b7 0d lds r29, 0x0DB7 ; 0x800db7 2434c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 24350: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 24354: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 24358: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2435c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 24360: ae 01 movw r20, r28 24362: 82 e8 ldi r24, 0x82 ; 130 24364: 0f 94 80 21 call 0x24300 ; 0x24300 lcd_set_cursor(10, 0); 24368: 60 e0 ldi r22, 0x00 ; 0 2436a: 8a e0 ldi r24, 0x0A ; 10 2436c: 0e 94 e7 6e call 0xddce ; 0xddce FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 24370: c0 91 72 06 lds r28, 0x0672 ; 0x800672 24374: d0 91 73 06 lds r29, 0x0673 ; 0x800673 int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 24378: 20 97 sbiw r28, 0x00 ; 0 2437a: 81 f0 breq .+32 ; 0x2439c lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 2437c: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 24380: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 24384: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 24388: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2438c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 24390: ae 01 movw r20, r28 24392: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 24394: df 91 pop r29 24396: 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); 24398: 0d 94 80 21 jmp 0x24300 ; 0x24300 } else { lcd_space(10); 2439c: 8a e0 ldi r24, 0x0A ; 10 } } 2439e: df 91 pop r29 243a0: 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); 243a2: 0c 94 dd 6e jmp 0xddba ; 0xddba 000243a6 : 243a6: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 243aa: 0f 94 9e 21 call 0x2433c ; 0x2433c lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 243ae: 8d e9 ldi r24, 0x9D ; 157 243b0: 9f e4 ldi r25, 0x4F ; 79 243b2: 0e 94 b3 72 call 0xe566 ; 0xe566 243b6: ac 01 movw r20, r24 243b8: 61 e0 ldi r22, 0x01 ; 1 243ba: 80 e0 ldi r24, 0x00 ; 0 243bc: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(0,2); 243c0: 62 e0 ldi r22, 0x02 ; 2 243c2: 80 e0 ldi r24, 0x00 ; 0 243c4: 0e 94 e7 6e call 0xddce ; 0xddce switch(eFilamentAction) { 243c8: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 243cc: 83 30 cpi r24, 0x03 ; 3 243ce: 81 f1 breq .+96 ; 0x24430 243d0: 48 f4 brcc .+18 ; 0x243e4 243d2: 81 30 cpi r24, 0x01 ; 1 243d4: 60 f0 brcs .+24 ; 0x243ee case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 243d6: 8a e8 ldi r24, 0x8A ; 138 243d8: 9f e4 ldi r25, 0x4F ; 79 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 243da: 0e 94 b3 72 call 0xe566 ; 0xe566 243de: 0e 94 d2 6e call 0xdda4 ; 0xdda4 243e2: 05 c0 rjmp .+10 ; 0x243ee 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) { 243e4: 85 30 cpi r24, 0x05 ; 5 243e6: 21 f1 breq .+72 ; 0x24430 243e8: b0 f3 brcs .-20 ; 0x243d6 243ea: 88 30 cpi r24, 0x08 ; 8 243ec: a1 f3 breq .-24 ; 0x243d6 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 243ee: 0e 94 04 71 call 0xe208 ; 0xe208 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 243f2: 81 11 cpse r24, r1 243f4: 09 c0 rjmp .+18 ; 0x24408 243f6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 243fa: 81 50 subi r24, 0x01 ; 1 243fc: 82 30 cpi r24, 0x02 ; 2 243fe: 28 f5 brcc .+74 ; 0x2444a 24400: 80 91 ae 17 lds r24, 0x17AE ; 0x8017ae 24404: 88 23 and r24, r24 24406: 09 f1 breq .+66 ; 0x2444a #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 24408: 80 91 63 06 lds r24, 0x0663 ; 0x800663 2440c: 81 11 cpse r24, r1 2440e: 13 c0 rjmp .+38 ; 0x24436 24410: 83 e0 ldi r24, 0x03 ; 3 24412: 0f 94 49 d4 call 0x3a892 ; 0x3a892 switch(eFilamentAction) { 24416: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2441a: 82 30 cpi r24, 0x02 ; 2 2441c: 71 f0 breq .+28 ; 0x2443a 2441e: 83 30 cpi r24, 0x03 ; 3 24420: 81 f0 breq .+32 ; 0x24442 24422: 81 30 cpi r24, 0x01 ; 1 24424: 91 f4 brne .+36 ; 0x2444a case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 24426: 61 e0 ldi r22, 0x01 ; 1 24428: 83 e5 ldi r24, 0x53 ; 83 2442a: 9f e6 ldi r25, 0x6F ; 111 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 2442c: 0c 94 27 88 jmp 0x1104e ; 0x1104e 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)); 24430: 85 e7 ldi r24, 0x75 ; 117 24432: 9f e4 ldi r25, 0x4F ; 79 24434: d2 cf rjmp .-92 ; 0x243da #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); 24436: 82 e0 ldi r24, 0x02 ; 2 24438: ec cf rjmp .-40 ; 0x24412 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2443a: 81 e0 ldi r24, 0x01 ; 1 2443c: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 24440: f2 cf rjmp .-28 ; 0x24426 [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 24442: 61 e0 ldi r22, 0x01 ; 1 24444: 8b ed ldi r24, 0xDB ; 219 24446: 9b e6 ldi r25, 0x6B ; 107 24448: f1 cf rjmp .-30 ; 0x2442c case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 2444a: 08 95 ret 0002444c <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 2444c: 1f 92 push r1 2444e: 0f 92 push r0 24450: 0f b6 in r0, 0x3f ; 63 24452: 0f 92 push r0 24454: 11 24 eor r1, r1 24456: 0b b6 in r0, 0x3b ; 59 24458: 0f 92 push r0 2445a: 2f 93 push r18 2445c: 3f 93 push r19 2445e: 4f 93 push r20 24460: 5f 93 push r21 24462: 6f 93 push r22 24464: 7f 93 push r23 24466: 8f 93 push r24 24468: 9f 93 push r25 2446a: af 93 push r26 2446c: bf 93 push r27 2446e: ef 93 push r30 24470: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 24472: 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 24476: 80 91 3b 05 lds r24, 0x053B ; 0x80053b uint8_t buf_r = ptr[2]; //get read index 2447a: 90 91 3c 05 lds r25, 0x053C ; 0x80053c _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 2447e: e8 2f mov r30, r24 24480: f0 e0 ldi r31, 0x00 ; 0 24482: e2 5c subi r30, 0xC2 ; 194 24484: fa 4f sbci r31, 0xFA ; 250 24486: 20 83 st Z, r18 buf_w++; //incerment write index 24488: 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 2448a: 20 91 3a 05 lds r18, 0x053A ; 0x80053a 2448e: 82 17 cp r24, r18 24490: 08 f0 brcs .+2 ; 0x24494 <__vector_51+0x48> 24492: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 24494: 98 13 cpse r25, r24 24496: 17 c0 rjmp .+46 ; 0x244c6 <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 24498: 84 e5 ldi r24, 0x54 ; 84 2449a: 90 ea ldi r25, 0xA0 ; 160 2449c: 0f 94 0c db call 0x3b618 ; 0x3b618 } } 244a0: ff 91 pop r31 244a2: ef 91 pop r30 244a4: bf 91 pop r27 244a6: af 91 pop r26 244a8: 9f 91 pop r25 244aa: 8f 91 pop r24 244ac: 7f 91 pop r23 244ae: 6f 91 pop r22 244b0: 5f 91 pop r21 244b2: 4f 91 pop r20 244b4: 3f 91 pop r19 244b6: 2f 91 pop r18 244b8: 0f 90 pop r0 244ba: 0b be out 0x3b, r0 ; 59 244bc: 0f 90 pop r0 244be: 0f be out 0x3f, r0 ; 63 244c0: 0f 90 pop r0 244c2: 1f 90 pop r1 244c4: 18 95 reti ptr[1] = buf_w; //store write index 244c6: 80 93 3b 05 sts 0x053B, r24 ; 0x80053b 244ca: ea cf rjmp .-44 ; 0x244a0 <__vector_51+0x54> 000244cc <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 244cc: 1f 92 push r1 244ce: 0f 92 push r0 244d0: 0f b6 in r0, 0x3f ; 63 244d2: 0f 92 push r0 244d4: 11 24 eor r1, r1 244d6: 0b b6 in r0, 0x3b ; 59 244d8: 0f 92 push r0 244da: 8f 93 push r24 244dc: 9f 93 push r25 244de: ef 93 push r30 244e0: ff 93 push r31 WRITE(BEEPER, 0); 244e2: 9f b7 in r25, 0x3f ; 63 244e4: f8 94 cli 244e6: e2 e0 ldi r30, 0x02 ; 2 244e8: f1 e0 ldi r31, 0x01 ; 1 244ea: 80 81 ld r24, Z 244ec: 8b 7f andi r24, 0xFB ; 251 244ee: 80 83 st Z, r24 244f0: 9f bf out 0x3f, r25 ; 63 } 244f2: ff 91 pop r31 244f4: ef 91 pop r30 244f6: 9f 91 pop r25 244f8: 8f 91 pop r24 244fa: 0f 90 pop r0 244fc: 0b be out 0x3b, r0 ; 59 244fe: 0f 90 pop r0 24500: 0f be out 0x3f, r0 ; 63 24502: 0f 90 pop r0 24504: 1f 90 pop r1 24506: 18 95 reti 00024508 <__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) { 24508: 1f 92 push r1 2450a: 0f 92 push r0 2450c: 0f b6 in r0, 0x3f ; 63 2450e: 0f 92 push r0 24510: 11 24 eor r1, r1 24512: 0b b6 in r0, 0x3b ; 59 24514: 0f 92 push r0 24516: 8f 93 push r24 24518: 9f 93 push r25 2451a: ef 93 push r30 2451c: ff 93 push r31 WRITE(BEEPER, 1); 2451e: 9f b7 in r25, 0x3f ; 63 24520: f8 94 cli 24522: e2 e0 ldi r30, 0x02 ; 2 24524: f1 e0 ldi r31, 0x01 ; 1 24526: 80 81 ld r24, Z 24528: 84 60 ori r24, 0x04 ; 4 2452a: 80 83 st Z, r24 2452c: 9f bf out 0x3f, r25 ; 63 } 2452e: ff 91 pop r31 24530: ef 91 pop r30 24532: 9f 91 pop r25 24534: 8f 91 pop r24 24536: 0f 90 pop r0 24538: 0b be out 0x3b, r0 ; 59 2453a: 0f 90 pop r0 2453c: 0f be out 0x3f, r0 ; 63 2453e: 0f 90 pop r0 24540: 1f 90 pop r1 24542: 18 95 reti 00024544 : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 24544: 6f 92 push r6 24546: 7f 92 push r7 24548: 8f 92 push r8 2454a: 9f 92 push r9 2454c: af 92 push r10 2454e: bf 92 push r11 24550: df 92 push r13 24552: ef 92 push r14 24554: ff 92 push r15 24556: 0f 93 push r16 24558: 1f 93 push r17 2455a: cf 93 push r28 2455c: df 93 push r29 2455e: cd b7 in r28, 0x3d ; 61 24560: de b7 in r29, 0x3e ; 62 24562: e0 97 sbiw r28, 0x30 ; 48 24564: 0f b6 in r0, 0x3f ; 63 24566: f8 94 cli 24568: de bf out 0x3e, r29 ; 62 2456a: 0f be out 0x3f, r0 ; 63 2456c: cd bf out 0x3d, r28 ; 61 2456e: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 24570: ae 01 movw r20, r28 24572: 4f 5f subi r20, 0xFF ; 255 24574: 5f 4f sbci r21, 0xFF ; 255 24576: 60 e1 ldi r22, 0x10 ; 16 24578: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 bubblesort_uint8(step, 16, 0); 2457c: 50 e0 ldi r21, 0x00 ; 0 2457e: 40 e0 ldi r20, 0x00 ; 0 24580: 60 e1 ldi r22, 0x10 ; 16 24582: ce 01 movw r24, r28 24584: 01 96 adiw r24, 0x01 ; 1 24586: 0f 94 5a 10 call 0x220b4 ; 0x220b4 puts_P(PSTR("sorted samples:")); 2458a: 84 e4 ldi r24, 0x44 ; 68 2458c: 90 ea ldi r25, 0xA0 ; 160 2458e: 0f 94 0c db call 0x3b618 ; 0x3b618 24592: 9e 01 movw r18, r28 24594: 2f 5f subi r18, 0xFF ; 255 24596: 3f 4f sbci r19, 0xFF ; 255 24598: 59 01 movw r10, r18 2459a: 10 e0 ldi r17, 0x00 ; 0 2459c: 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]); 2459e: 23 e3 ldi r18, 0x33 ; 51 245a0: e2 2e mov r14, r18 245a2: 20 ea ldi r18, 0xA0 ; 160 245a4: f2 2e mov r15, r18 245a6: d5 01 movw r26, r10 245a8: 8d 91 ld r24, X+ 245aa: 5d 01 movw r10, r26 245ac: 1f 92 push r1 245ae: 8f 93 push r24 245b0: 1f 93 push r17 245b2: 0f 93 push r16 245b4: ff 92 push r15 245b6: ef 92 push r14 245b8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 245bc: 0f 5f subi r16, 0xFF ; 255 245be: 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++) 245c0: 0f 90 pop r0 245c2: 0f 90 pop r0 245c4: 0f 90 pop r0 245c6: 0f 90 pop r0 245c8: 0f 90 pop r0 245ca: 0f 90 pop r0 245cc: 00 31 cpi r16, 0x10 ; 16 245ce: 11 05 cpc r17, r1 245d0: 51 f7 brne .-44 ; 0x245a6 } 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]; 245d2: 09 81 ldd r16, Y+1 ; 0x01 245d4: 10 e0 ldi r17, 0x00 ; 0 245d6: 5e 01 movw r10, r28 245d8: b2 e0 ldi r27, 0x02 ; 2 245da: ab 0e add r10, r27 245dc: b1 1c adc r11, r1 245de: ee 24 eor r14, r14 245e0: e3 94 inc r14 245e2: f1 2c mov r15, r1 245e4: ec 0e add r14, r28 245e6: fd 1e adc r15, r29 245e8: e0 e1 ldi r30, 0x10 ; 16 245ea: ee 0e add r14, r30 245ec: f1 1c adc r15, r1 uint8_t cl = 0; 245ee: 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; 245f0: 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]; 245f2: d5 01 movw r26, r10 245f4: 3d 91 ld r19, X+ 245f6: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 245f8: 62 2f mov r22, r18 245fa: 70 e0 ldi r23, 0x00 ; 0 245fc: c8 01 movw r24, r16 245fe: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 24602: 46 2f mov r20, r22 24604: 43 1b sub r20, r19 24606: 36 17 cp r19, r22 24608: 10 f0 brcs .+4 ; 0x2460e else dif = d - val; 2460a: 43 2f mov r20, r19 2460c: 46 1b sub r20, r22 2460e: 83 2f mov r24, r19 24610: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 24612: 42 30 cpi r20, 0x02 ; 2 24614: 08 f0 brcs .+2 ; 0x24618 24616: 47 c0 rjmp .+142 ; 0x246a6 { cnt += 1; 24618: 2f 5f subi r18, 0xFF ; 255 sum += d; 2461a: 08 0f add r16, r24 2461c: 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++) 2461e: ae 14 cp r10, r14 24620: bf 04 cpc r11, r15 24622: 39 f7 brne .-50 ; 0x245f2 cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 24624: ae 2e mov r10, r30 24626: b1 2c mov r11, r1 24628: a1 e1 ldi r26, 0x11 ; 17 2462a: b0 e0 ldi r27, 0x00 ; 0 2462c: ac 0f add r26, r28 2462e: bd 1f adc r27, r29 24630: aa 0d add r26, r10 24632: bb 1d adc r27, r11 24634: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 24636: 7e 01 movw r14, r28 24638: b1 e2 ldi r27, 0x21 ; 33 2463a: eb 0e add r14, r27 2463c: f1 1c adc r15, r1 2463e: ae 0c add r10, r14 24640: bf 1c adc r11, r15 24642: 62 2f mov r22, r18 24644: 70 e0 ldi r23, 0x00 ; 0 24646: c8 01 movw r24, r16 24648: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2464c: d5 01 movw r26, r10 2464e: 6c 93 st X, r22 return ++cl; 24650: 11 e0 ldi r17, 0x01 ; 1 24652: 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:")); 24654: 89 e2 ldi r24, 0x29 ; 41 24656: 90 ea ldi r25, 0xA0 ; 160 24658: 0f 94 0c db call 0x3b618 ; 0x3b618 2465c: fe 01 movw r30, r28 2465e: 71 96 adiw r30, 0x11 ; 17 24660: 3f 01 movw r6, r30 24662: 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]); 24664: 81 e1 ldi r24, 0x11 ; 17 24666: 88 2e mov r8, r24 24668: 80 ea ldi r24, 0xA0 ; 160 2466a: 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++) 2466c: 8a 2d mov r24, r10 2466e: 8e 19 sub r24, r14 24670: 81 17 cp r24, r17 24672: 70 f5 brcc .+92 ; 0x246d0 24674: c5 01 movw r24, r10 24676: 8e 19 sub r24, r14 24678: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 2467a: d5 01 movw r26, r10 2467c: 3d 91 ld r19, X+ 2467e: 5d 01 movw r10, r26 24680: f3 01 movw r30, r6 24682: 21 91 ld r18, Z+ 24684: 3f 01 movw r6, r30 24686: 1f 92 push r1 24688: 3f 93 push r19 2468a: 1f 92 push r1 2468c: 2f 93 push r18 2468e: 9f 93 push r25 24690: 8f 93 push r24 24692: 9f 92 push r9 24694: 8f 92 push r8 24696: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2469a: 0f b6 in r0, 0x3f ; 63 2469c: f8 94 cli 2469e: de bf out 0x3e, r29 ; 62 246a0: 0f be out 0x3f, r0 ; 63 246a2: cd bf out 0x3d, r28 ; 61 246a4: e3 cf rjmp .-58 ; 0x2466c 246a6: 4e 2f mov r20, r30 246a8: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 246aa: a1 e1 ldi r26, 0x11 ; 17 246ac: b0 e0 ldi r27, 0x00 ; 0 246ae: ac 0f add r26, r28 246b0: bd 1f adc r27, r29 246b2: a4 0f add r26, r20 246b4: b5 1f adc r27, r21 246b6: ef 5f subi r30, 0xFF ; 255 246b8: 2c 93 st X, r18 if (cval) cval[cl] = val; 246ba: 21 e2 ldi r18, 0x21 ; 33 246bc: 30 e0 ldi r19, 0x00 ; 0 246be: 2c 0f add r18, r28 246c0: 3d 1f adc r19, r29 246c2: 42 0f add r20, r18 246c4: 53 1f adc r21, r19 246c6: da 01 movw r26, r20 246c8: 6c 93 st X, r22 cnt = 1; sum = d; 246ca: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 246cc: 21 e0 ldi r18, 0x01 ; 1 246ce: a7 cf rjmp .-178 ; 0x2461e 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); 246d0: a7 01 movw r20, r14 246d2: 61 2f mov r22, r17 246d4: ce 01 movw r24, r28 246d6: 41 96 adiw r24, 0x11 ; 17 246d8: 0f 94 5a 10 call 0x220b4 ; 0x220b4 tmc2130_home_origin[axis] = val[cl-1]; 246dc: fe 01 movw r30, r28 246de: e1 0f add r30, r17 246e0: f1 1d adc r31, r1 246e2: 80 a1 ldd r24, Z+32 ; 0x20 246e4: ed 2d mov r30, r13 246e6: f0 e0 ldi r31, 0x00 ; 0 246e8: ed 50 subi r30, 0x0D ; 13 246ea: fb 4f sbci r31, 0xFB ; 251 246ec: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 246ee: 1f 92 push r1 246f0: 8f 93 push r24 246f2: 8f ef ldi r24, 0xFF ; 255 246f4: 9f e9 ldi r25, 0x9F ; 159 246f6: 9f 93 push r25 246f8: 8f 93 push r24 246fa: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 246fe: 0f 90 pop r0 24700: 0f 90 pop r0 24702: 0f 90 pop r0 24704: 0f 90 pop r0 24706: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 2470a: 8e ef ldi r24, 0xFE ; 254 2470c: 9e e0 ldi r25, 0x0E ; 14 2470e: dd 20 and r13, r13 24710: 21 f0 breq .+8 ; 0x2471a 24712: 60 91 f4 04 lds r22, 0x04F4 ; 0x8004f4 24716: 8b ef ldi r24, 0xFB ; 251 24718: 9e e0 ldi r25, 0x0E ; 14 2471a: 0f 94 47 dc call 0x3b88e ; 0x3b88e else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 2471e: 81 e0 ldi r24, 0x01 ; 1 24720: e0 96 adiw r28, 0x30 ; 48 24722: 0f b6 in r0, 0x3f ; 63 24724: f8 94 cli 24726: de bf out 0x3e, r29 ; 62 24728: 0f be out 0x3f, r0 ; 63 2472a: cd bf out 0x3d, r28 ; 61 2472c: df 91 pop r29 2472e: cf 91 pop r28 24730: 1f 91 pop r17 24732: 0f 91 pop r16 24734: ff 90 pop r15 24736: ef 90 pop r14 24738: df 90 pop r13 2473a: bf 90 pop r11 2473c: af 90 pop r10 2473e: 9f 90 pop r9 24740: 8f 90 pop r8 24742: 7f 90 pop r7 24744: 6f 90 pop r6 24746: 08 95 ret 00024748 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 24748: 81 30 cpi r24, 0x01 ; 1 2474a: 49 f0 breq .+18 ; 0x2475e 2474c: 28 f0 brcs .+10 ; 0x24758 2474e: 82 30 cpi r24, 0x02 ; 2 24750: 41 f0 breq .+16 ; 0x24762 24752: 83 30 cpi r24, 0x03 ; 3 24754: 41 f0 breq .+16 ; 0x24766 24756: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 24758: 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; 2475a: 86 b9 out 0x06, r24 ; 6 } } 2475c: 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; 2475e: 82 e0 ldi r24, 0x02 ; 2 24760: fc cf rjmp .-8 ; 0x2475a case Z_AXIS: _DO_STEP_Z; break; 24762: 84 e0 ldi r24, 0x04 ; 4 24764: fa cf rjmp .-12 ; 0x2475a case E_AXIS: _DO_STEP_E; break; 24766: 88 e0 ldi r24, 0x08 ; 8 24768: f8 cf rjmp .-16 ; 0x2475a 0002476a : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2476a: 81 30 cpi r24, 0x01 ; 1 2476c: d1 f0 breq .+52 ; 0x247a2 2476e: 48 f0 brcs .+18 ; 0x24782 24770: 82 30 cpi r24, 0x02 ; 2 24772: 21 f1 breq .+72 ; 0x247bc 24774: 83 30 cpi r24, 0x03 ; 3 24776: 79 f1 breq .+94 ; 0x247d6 24778: 8b e4 ldi r24, 0x4B ; 75 2477a: 90 e0 ldi r25, 0x00 ; 0 2477c: 01 97 sbiw r24, 0x01 ; 1 2477e: f1 f7 brne .-4 ; 0x2477c 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); } 24780: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 24782: 9f b7 in r25, 0x3f ; 63 24784: 66 23 and r22, r22 24786: 41 f0 breq .+16 ; 0x24798 24788: f8 94 cli 2478a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2478e: 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; 24790: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24794: 9f bf out 0x3f, r25 ; 63 24796: f0 cf rjmp .-32 ; 0x24778 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 24798: f8 94 cli 2479a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2479e: 8e 7f andi r24, 0xFE ; 254 247a0: f7 cf rjmp .-18 ; 0x24790 case Y_AXIS: _SET_DIR_Y(dir); break; 247a2: 9f b7 in r25, 0x3f ; 63 247a4: 61 11 cpse r22, r1 247a6: 05 c0 rjmp .+10 ; 0x247b2 247a8: f8 94 cli 247aa: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247ae: 82 60 ori r24, 0x02 ; 2 247b0: ef cf rjmp .-34 ; 0x24790 247b2: f8 94 cli 247b4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247b8: 8d 7f andi r24, 0xFD ; 253 247ba: ea cf rjmp .-44 ; 0x24790 case Z_AXIS: _SET_DIR_Z(dir); break; 247bc: 9f b7 in r25, 0x3f ; 63 247be: 66 23 and r22, r22 247c0: 29 f0 breq .+10 ; 0x247cc 247c2: f8 94 cli 247c4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247c8: 84 60 ori r24, 0x04 ; 4 247ca: e2 cf rjmp .-60 ; 0x24790 247cc: f8 94 cli 247ce: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247d2: 8b 7f andi r24, 0xFB ; 251 247d4: dd cf rjmp .-70 ; 0x24790 case E_AXIS: _SET_DIR_E(dir); break; 247d6: 9f b7 in r25, 0x3f ; 63 247d8: 61 11 cpse r22, r1 247da: 05 c0 rjmp .+10 ; 0x247e6 247dc: f8 94 cli 247de: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247e2: 80 64 ori r24, 0x40 ; 64 247e4: d5 cf rjmp .-86 ; 0x24790 247e6: f8 94 cli 247e8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 247ec: 8f 7b andi r24, 0xBF ; 191 247ee: d0 cf rjmp .-96 ; 0x24790 000247f0 : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 247f0: cf 92 push r12 247f2: df 92 push r13 247f4: ef 92 push r14 247f6: ff 92 push r15 247f8: 0f 93 push r16 247fa: 1f 93 push r17 247fc: cf 93 push r28 247fe: df 93 push r29 24800: 18 2f mov r17, r24 24802: f6 2e mov r15, r22 24804: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 24806: 0c e5 ldi r16, 0x5C ; 92 24808: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 2480a: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 2480c: 0f 94 b6 10 call 0x2216c ; 0x2216c TMC2130_SPI_TXRX(addr); // address 24810: 8f 2d mov r24, r15 24812: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX(0); // MSB 24816: 80 e0 ldi r24, 0x00 ; 0 24818: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX(0); 2481c: 80 e0 ldi r24, 0x00 ; 0 2481e: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX(0); 24822: 80 e0 ldi r24, 0x00 ; 0 24824: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX(0); // LSB 24828: 80 e0 ldi r24, 0x00 ; 0 2482a: 0f 94 d1 10 call 0x221a2 ; 0x221a2 tmc2130_cs_high(axis); 2482e: 81 2f mov r24, r17 24830: 0f 94 9b 10 call 0x22136 ; 0x22136 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 24834: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 24836: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 24838: 81 2f mov r24, r17 2483a: 0f 94 b6 10 call 0x2216c ; 0x2216c uint8_t stat = TMC2130_SPI_TXRX(0); // status 2483e: 80 e0 ldi r24, 0x00 ; 0 24840: 0f 94 d1 10 call 0x221a2 ; 0x221a2 24844: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 24846: 80 e0 ldi r24, 0x00 ; 0 24848: 0f 94 d1 10 call 0x221a2 ; 0x221a2 2484c: 90 e0 ldi r25, 0x00 ; 0 2484e: b0 e0 ldi r27, 0x00 ; 0 24850: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24852: cc 24 eor r12, r12 24854: d8 2e mov r13, r24 24856: e9 2e mov r14, r25 24858: fa 2e mov r15, r26 2485a: 80 e0 ldi r24, 0x00 ; 0 2485c: 0f 94 d1 10 call 0x221a2 ; 0x221a2 24860: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 24862: fe 2c mov r15, r14 24864: ed 2c mov r14, r13 24866: dc 2c mov r13, r12 24868: cc 24 eor r12, r12 2486a: 80 e0 ldi r24, 0x00 ; 0 2486c: 0f 94 d1 10 call 0x221a2 ; 0x221a2 24870: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 24872: fe 2c mov r15, r14 24874: ed 2c mov r14, r13 24876: dc 2c mov r13, r12 24878: cc 24 eor r12, r12 2487a: 80 e0 ldi r24, 0x00 ; 0 2487c: 0f 94 d1 10 call 0x221a2 ; 0x221a2 24880: c8 2a or r12, r24 tmc2130_cs_high(axis); 24882: 81 2f mov r24, r17 24884: 0f 94 9b 10 call 0x22136 ; 0x22136 TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 24888: c8 82 st Y, r12 2488a: d9 82 std Y+1, r13 ; 0x01 2488c: ea 82 std Y+2, r14 ; 0x02 2488e: fb 82 std Y+3, r15 ; 0x03 return stat; } 24890: 80 2f mov r24, r16 24892: df 91 pop r29 24894: cf 91 pop r28 24896: 1f 91 pop r17 24898: 0f 91 pop r16 2489a: ff 90 pop r15 2489c: ef 90 pop r14 2489e: df 90 pop r13 248a0: cf 90 pop r12 248a2: 08 95 ret 000248a4 : #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) { 248a4: ef 92 push r14 248a6: ff 92 push r15 248a8: 0f 93 push r16 248aa: 1f 93 push r17 248ac: cf 93 push r28 248ae: df 93 push r29 248b0: c8 2f mov r28, r24 248b2: e6 2e mov r14, r22 248b4: d2 2f mov r29, r18 248b6: 13 2f mov r17, r19 248b8: 04 2f mov r16, r20 248ba: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 248bc: 8c e5 ldi r24, 0x5C ; 92 248be: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 248c0: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 248c2: 8c 2f mov r24, r28 248c4: 0f 94 b6 10 call 0x2216c ; 0x2216c TMC2130_SPI_TXRX(addr); // address 248c8: 8e 2d mov r24, r14 248ca: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 248ce: 8f 2d mov r24, r15 248d0: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX((wval >> 16) & 0xff); 248d4: 80 2f mov r24, r16 248d6: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX((wval >> 8) & 0xff); 248da: 81 2f mov r24, r17 248dc: 0f 94 d1 10 call 0x221a2 ; 0x221a2 TMC2130_SPI_TXRX(wval & 0xff); // LSB 248e0: 8d 2f mov r24, r29 248e2: 0f 94 d1 10 call 0x221a2 ; 0x221a2 tmc2130_cs_high(axis); 248e6: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 248e8: df 91 pop r29 248ea: cf 91 pop r28 248ec: 1f 91 pop r17 248ee: 0f 91 pop r16 248f0: ff 90 pop r15 248f2: 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); 248f4: 0d 94 9b 10 jmp 0x22136 ; 0x22136 000248f8 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 248f8: cf 93 push r28 248fa: df 93 push r29 248fc: 00 d0 rcall .+0 ; 0x248fe 248fe: 1f 92 push r1 24900: cd b7 in r28, 0x3d ; 61 24902: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 24904: 19 82 std Y+1, r1 ; 0x01 24906: 1a 82 std Y+2, r1 ; 0x02 24908: 1b 82 std Y+3, r1 ; 0x03 2490a: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 2490c: ae 01 movw r20, r28 2490e: 4f 5f subi r20, 0xFF ; 255 24910: 5f 4f sbci r21, 0xFF ; 255 24912: 6a e6 ldi r22, 0x6A ; 106 24914: 0f 94 f8 23 call 0x247f0 ; 0x247f0 return val32 & 0x3ff; 24918: 89 81 ldd r24, Y+1 ; 0x01 2491a: 9a 81 ldd r25, Y+2 ; 0x02 } 2491c: 93 70 andi r25, 0x03 ; 3 2491e: 0f 90 pop r0 24920: 0f 90 pop r0 24922: 0f 90 pop r0 24924: 0f 90 pop r0 24926: df 91 pop r29 24928: cf 91 pop r28 2492a: 08 95 ret 0002492c : #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 */) { 2492c: ff 92 push r15 2492e: 0f 93 push r16 24930: 1f 93 push r17 24932: cf 93 push r28 24934: df 93 push r29 24936: f8 2e mov r15, r24 24938: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 2493a: e8 2f mov r30, r24 2493c: f0 e0 ldi r31, 0x00 ; 0 2493e: 83 e0 ldi r24, 0x03 ; 3 24940: f8 9e mul r15, r24 24942: 80 01 movw r16, r0 24944: 11 24 eor r1, r1 24946: 03 5a subi r16, 0xA3 ; 163 24948: 1d 4f sbci r17, 0xFD ; 253 2494a: d8 01 movw r26, r16 2494c: 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) {} 2494e: 30 e0 ldi r19, 0x00 ; 0 24950: 37 7f andi r19, 0xF7 ; 247 24952: 3f 7e andi r19, 0xEF ; 239 24954: 3f 7d andi r19, 0xDF ; 223 24956: 3f 7b andi r19, 0xBF ; 191 24958: 40 e0 ldi r20, 0x00 ; 0 2495a: 80 fb bst r24, 0 2495c: 41 f9 bld r20, 1 2495e: 43 70 andi r20, 0x03 ; 3 24960: 56 2f mov r21, r22 24962: 5f 70 andi r21, 0x0F ; 15 24964: 50 62 ori r21, 0x20 ; 32 24966: 5f 7b andi r21, 0xBF ; 191 24968: 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 2496a: 81 e0 ldi r24, 0x01 ; 1 2496c: 61 11 cpse r22, r1 2496e: 01 c0 rjmp .+2 ; 0x24972 24970: 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); 24972: 80 fb bst r24, 0 24974: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 24976: bf 01 movw r22, r30 24978: 66 0f add r22, r22 2497a: 77 1f adc r23, r23 2497c: fb 01 movw r30, r22 2497e: eb 55 subi r30, 0x5B ; 91 24980: fd 4f sbci r31, 0xFD ; 253 24982: 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 24984: 92 2f mov r25, r18 24986: 99 1f adc r25, r25 24988: 99 27 eor r25, r25 2498a: 99 1f adc r25, r25 2498c: 81 81 ldd r24, Z+1 ; 0x01 2498e: 87 70 andi r24, 0x07 ; 7 24990: 88 0f add r24, r24 24992: 89 2b or r24, r25 24994: 80 fb bst r24, 0 24996: 27 f9 bld r18, 7 24998: 86 95 lsr r24 2499a: 87 70 andi r24, 0x07 ; 7 2499c: 38 7f andi r19, 0xF8 ; 248 2499e: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 249a0: 6a 55 subi r22, 0x5A ; 90 249a2: 7d 4f sbci r23, 0xFD ; 253 249a4: fb 01 movw r30, r22 249a6: 80 81 ld r24, Z 249a8: 86 95 lsr r24 249aa: 86 95 lsr r24 249ac: 86 95 lsr r24 249ae: 80 fb bst r24, 0 249b0: 37 f9 bld r19, 7 249b2: 81 fb bst r24, 1 249b4: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 249b6: 6c ee ldi r22, 0xEC ; 236 249b8: 8f 2d mov r24, r15 249ba: 0f 94 52 24 call 0x248a4 ; 0x248a4 if (curr == nullptr) { 249be: 20 97 sbiw r28, 0x00 ; 0 249c0: 09 f4 brne .+2 ; 0x249c4 curr = ¤ts[axis]; 249c2: e8 01 movw r28, r16 249c4: 19 81 ldd r17, Y+1 ; 0x01 249c6: 8a 81 ldd r24, Y+2 ; 0x02 249c8: c1 2f mov r28, r17 249ca: 81 17 cp r24, r17 249cc: 08 f4 brcc .+2 ; 0x249d0 249ce: 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()) { 249d0: 18 17 cp r17, r24 249d2: 40 f4 brcc .+16 ; 0x249e4 // Let user know firmware modified the value SERIAL_ECHO_START; 249d4: 80 ed ldi r24, 0xD0 ; 208 249d6: 9b ea ldi r25, 0xAB ; 171 249d8: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 249dc: 8e e7 ldi r24, 0x7E ; 126 249de: 9e e6 ldi r25, 0x6E ; 110 249e0: 0e 94 82 79 call 0xf304 ; 0xf304 struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 249e4: 2c 2f mov r18, r28 249e6: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 249e8: 31 2f mov r19, r17 249ea: 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); 249ec: 4f e0 ldi r20, 0x0F ; 15 249ee: 50 e0 ldi r21, 0x00 ; 0 249f0: 60 e9 ldi r22, 0x90 ; 144 249f2: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 249f4: df 91 pop r29 249f6: cf 91 pop r28 249f8: 1f 91 pop r17 249fa: 0f 91 pop r16 249fc: 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); 249fe: 0d 94 52 24 jmp 0x248a4 ; 0x248a4 00024a02 : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 24a02: e8 2f mov r30, r24 24a04: 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--; 24a06: 98 e0 ldi r25, 0x08 ; 8 24a08: 76 95 lsr r23 24a0a: 67 95 ror r22 24a0c: 61 15 cp r22, r1 24a0e: 71 05 cpc r23, r1 24a10: 11 f0 breq .+4 ; 0x24a16 24a12: 91 50 subi r25, 0x01 ; 1 24a14: f9 cf rjmp .-14 ; 0x24a08 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 24a16: eb 50 subi r30, 0x0B ; 11 24a18: fb 4f sbci r31, 0xFB ; 251 24a1a: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 24a1c: 50 e0 ldi r21, 0x00 ; 0 24a1e: 40 e0 ldi r20, 0x00 ; 0 24a20: 69 2f mov r22, r25 24a22: 0d 94 96 24 jmp 0x2492c ; 0x2492c 00024a26 : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 24a26: 0f 93 push r16 24a28: 1f 93 push r17 24a2a: cf 93 push r28 24a2c: df 93 push r29 24a2e: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 24a30: 08 2f mov r16, r24 24a32: 10 e0 ldi r17, 0x00 ; 0 24a34: f8 01 movw r30, r16 24a36: eb 50 subi r30, 0x0B ; 11 24a38: fb 4f sbci r31, 0xFB ; 251 24a3a: 50 e0 ldi r21, 0x00 ; 0 24a3c: 40 e0 ldi r20, 0x00 ; 0 24a3e: 60 81 ld r22, Z 24a40: 0f 94 96 24 call 0x2492c ; 0x2492c tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 24a44: 20 e0 ldi r18, 0x00 ; 0 24a46: 30 e0 ldi r19, 0x00 ; 0 24a48: a9 01 movw r20, r18 24a4a: 61 e9 ldi r22, 0x91 ; 145 24a4c: 8c 2f mov r24, r28 24a4e: 0f 94 52 24 call 0x248a4 ; 0x248a4 const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 24a52: d0 91 8c 06 lds r29, 0x068C ; 0x80068c if (axis == Z_AXIS) { 24a56: c2 30 cpi r28, 0x02 ; 2 24a58: e1 f5 brne .+120 ; 0x24ad2 #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 24a5a: 20 e0 ldi r18, 0x00 ; 0 24a5c: 30 e0 ldi r19, 0x00 ; 0 24a5e: 44 e0 ldi r20, 0x04 ; 4 24a60: 51 e0 ldi r21, 0x01 ; 1 24a62: 6d ee ldi r22, 0xED ; 237 24a64: 82 e0 ldi r24, 0x02 ; 2 24a66: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24a6a: 24 ef ldi r18, 0xF4 ; 244 24a6c: 31 e0 ldi r19, 0x01 ; 1 24a6e: 40 e0 ldi r20, 0x00 ; 0 24a70: 50 e0 ldi r21, 0x00 ; 0 24a72: d1 30 cpi r29, 0x01 ; 1 24a74: 19 f4 brne .+6 ; 0x24a7c 24a76: 20 e0 ldi r18, 0x00 ; 0 24a78: 30 e0 ldi r19, 0x00 ; 0 24a7a: a9 01 movw r20, r18 24a7c: 64 e9 ldi r22, 0x94 ; 148 24a7e: 82 e0 ldi r24, 0x02 ; 2 24a80: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 24a84: 24 e8 ldi r18, 0x84 ; 132 24a86: 31 e0 ldi r19, 0x01 ; 1 24a88: 40 e0 ldi r20, 0x00 ; 0 24a8a: 50 e0 ldi r21, 0x00 ; 0 24a8c: d1 30 cpi r29, 0x01 ; 1 24a8e: 21 f4 brne .+8 ; 0x24a98 24a90: 24 e0 ldi r18, 0x04 ; 4 24a92: 30 e0 ldi r19, 0x00 ; 0 24a94: 40 e0 ldi r20, 0x00 ; 0 24a96: 50 e0 ldi r21, 0x00 ; 0 24a98: 60 e8 ldi r22, 0x80 ; 128 24a9a: 82 e0 ldi r24, 0x02 ; 2 24a9c: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24aa0: 28 ec ldi r18, 0xC8 ; 200 24aa2: 34 e0 ldi r19, 0x04 ; 4 24aa4: 46 e0 ldi r20, 0x06 ; 6 24aa6: 50 e0 ldi r21, 0x00 ; 0 24aa8: 60 ef ldi r22, 0xF0 ; 240 24aaa: 82 e0 ldi r24, 0x02 ; 2 24aac: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 24ab0: 20 ef ldi r18, 0xF0 ; 240 24ab2: 3f ef ldi r19, 0xFF ; 255 24ab4: 4f e0 ldi r20, 0x0F ; 15 24ab6: 50 e0 ldi r21, 0x00 ; 0 24ab8: d1 30 cpi r29, 0x01 ; 1 24aba: 19 f4 brne .+6 ; 0x24ac2 24abc: 20 e0 ldi r18, 0x00 ; 0 24abe: 30 e0 ldi r19, 0x00 ; 0 24ac0: a9 01 movw r20, r18 24ac2: 63 e9 ldi r22, 0x93 ; 147 24ac4: 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); } } 24ac6: df 91 pop r29 24ac8: cf 91 pop r28 24aca: 1f 91 pop r17 24acc: 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); 24ace: 0d 94 52 24 jmp 0x248a4 ; 0x248a4 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)); 24ad2: f8 01 movw r30, r16 24ad4: e6 5e subi r30, 0xE6 ; 230 24ad6: fc 4f sbci r31, 0xFC ; 252 24ad8: 20 81 ld r18, Z 24ada: 30 e0 ldi r19, 0x00 ; 0 24adc: 50 e0 ldi r21, 0x00 ; 0 24ade: 40 e0 ldi r20, 0x00 ; 0 24ae0: a9 01 movw r20, r18 24ae2: 33 27 eor r19, r19 24ae4: 22 27 eor r18, r18 24ae6: 51 60 ori r21, 0x01 ; 1 24ae8: 6d ee ldi r22, 0xED ; 237 24aea: 8c 2f mov r24, r28 24aec: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 24af0: 20 e0 ldi r18, 0x00 ; 0 24af2: 30 e0 ldi r19, 0x00 ; 0 24af4: a9 01 movw r20, r18 24af6: d1 30 cpi r29, 0x01 ; 1 24af8: 61 f0 breq .+24 ; 0x24b12 uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24afa: 2e ea ldi r18, 0xAE ; 174 24afc: 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) 24afe: c2 30 cpi r28, 0x02 ; 2 24b00: 30 f0 brcs .+12 ; 0x24b0e { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 24b02: 24 ef ldi r18, 0xF4 ; 244 24b04: 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) 24b06: c2 30 cpi r28, 0x02 ; 2 24b08: 11 f0 breq .+4 ; 0x24b0e { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 24b0a: 30 e0 ldi r19, 0x00 ; 0 24b0c: 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)); 24b0e: 50 e0 ldi r21, 0x00 ; 0 24b10: 40 e0 ldi r20, 0x00 ; 0 24b12: 64 e9 ldi r22, 0x94 ; 148 24b14: 8c 2f mov r24, r28 24b16: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 24b1a: 20 e8 ldi r18, 0x80 ; 128 24b1c: 31 e0 ldi r19, 0x01 ; 1 24b1e: 40 e0 ldi r20, 0x00 ; 0 24b20: 50 e0 ldi r21, 0x00 ; 0 24b22: d1 30 cpi r29, 0x01 ; 1 24b24: 21 f4 brne .+8 ; 0x24b2e 24b26: 24 e0 ldi r18, 0x04 ; 4 24b28: 30 e0 ldi r19, 0x00 ; 0 24b2a: 40 e0 ldi r20, 0x00 ; 0 24b2c: 50 e0 ldi r21, 0x00 ; 0 24b2e: 60 e8 ldi r22, 0x80 ; 128 24b30: 8c 2f mov r24, r28 24b32: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 24b36: 00 0f add r16, r16 24b38: 11 1f adc r17, r17 24b3a: 00 0f add r16, r16 24b3c: 11 1f adc r17, r17 24b3e: f8 01 movw r30, r16 24b40: e6 5f subi r30, 0xF6 ; 246 24b42: fc 4f sbci r31, 0xFC ; 252 24b44: 20 81 ld r18, Z 24b46: 31 81 ldd r19, Z+1 ; 0x01 24b48: 42 81 ldd r20, Z+2 ; 0x02 24b4a: 53 81 ldd r21, Z+3 ; 0x03 24b4c: 60 ef ldi r22, 0xF0 ; 240 24b4e: 8c 2f mov r24, r28 24b50: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 24b54: 20 e0 ldi r18, 0x00 ; 0 24b56: 30 e0 ldi r19, 0x00 ; 0 24b58: a9 01 movw r20, r18 24b5a: 63 e9 ldi r22, 0x93 ; 147 24b5c: 8c 2f mov r24, r28 24b5e: b3 cf rjmp .-154 ; 0x24ac6 00024b60 : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 24b60: 1f 93 push r17 24b62: cf 93 push r28 24b64: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 24b66: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24b6a: 1f 92 push r1 24b6c: 8f 93 push r24 24b6e: 89 ec ldi r24, 0xC9 ; 201 24b70: 9f e9 ldi r25, 0x9F ; 159 24b72: 9f 93 push r25 24b74: 8f 93 push r24 24b76: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 24b7a: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24b7e: 83 70 andi r24, 0x03 ; 3 24b80: 0f 90 pop r0 24b82: 0f 90 pop r0 24b84: 0f 90 pop r0 24b86: 0f 90 pop r0 24b88: 11 f0 breq .+4 ; 0x24b8e tmc2130_wait_standstill_xy(1000); 24b8a: 0f 94 1f 88 call 0x3103e ; 0x3103e if (tmc2130_sg_homing_axes_mask) 24b8e: 10 91 43 06 lds r17, 0x0643 ; 0x800643 24b92: 11 23 and r17, r17 24b94: 71 f0 breq .+28 ; 0x24bb2 { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 24b96: d1 e0 ldi r29, 0x01 ; 1 24b98: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 24b9a: 81 2f mov r24, r17 24b9c: 8d 23 and r24, r29 24b9e: 19 f0 breq .+6 ; 0x24ba6 tmc2130_XYZ_reg_init(axis); 24ba0: 8c 2f mov r24, r28 24ba2: 0f 94 13 25 call 0x24a26 ; 0x24a26 #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 24ba6: cf 5f subi r28, 0xFF ; 255 24ba8: dd 0f add r29, r29 24baa: c3 30 cpi r28, 0x03 ; 3 24bac: b1 f7 brne .-20 ; 0x24b9a { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 24bae: 10 92 43 06 sts 0x0643, r1 ; 0x800643 } tmc2130_sg_crash = false; 24bb2: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d #endif } 24bb6: df 91 pop r29 24bb8: cf 91 pop r28 24bba: 1f 91 pop r17 24bbc: 08 95 ret 00024bbe : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24bbe: df 92 push r13 24bc0: ef 92 push r14 24bc2: ff 92 push r15 24bc4: 0f 93 push r16 24bc6: 1f 93 push r17 24bc8: cf 93 push r28 24bca: df 93 push r29 24bcc: 00 d0 rcall .+0 ; 0x24bce 24bce: cd b7 in r28, 0x3d ; 61 24bd0: de b7 in r29, 0x3e ; 62 24bd2: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 24bd4: 1f 92 push r1 24bd6: 8f 93 push r24 24bd8: 83 ea ldi r24, 0xA3 ; 163 24bda: 9f e9 ldi r25, 0x9F ; 159 24bdc: 9f 93 push r25 24bde: 8f 93 push r24 24be0: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 24be4: 8d 2d mov r24, r13 24be6: 83 70 andi r24, 0x03 ; 3 24be8: 0f 90 pop r0 24bea: 0f 90 pop r0 24bec: 0f 90 pop r0 24bee: 0f 90 pop r0 24bf0: 11 f0 breq .+4 ; 0x24bf6 tmc2130_wait_standstill_xy(1000); 24bf2: 0f 94 1f 88 call 0x3103e ; 0x3103e } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 24bf6: 10 e0 ldi r17, 0x00 ; 0 24bf8: 00 e0 ldi r16, 0x00 ; 0 24bfa: ff 24 eor r15, r15 24bfc: f3 94 inc r15 24bfe: 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) 24c00: 8d 2d mov r24, r13 24c02: 8f 21 and r24, r15 24c04: 09 f4 brne .+2 ; 0x24c08 24c06: 46 c0 rjmp .+140 ; 0x24c94 { tmc2130_sg_homing_axes_mask |= mask; 24c08: 80 91 43 06 lds r24, 0x0643 ; 0x800643 24c0c: 8f 29 or r24, r15 24c0e: 80 93 43 06 sts 0x0643, r24 ; 0x800643 //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 24c12: 20 e0 ldi r18, 0x00 ; 0 24c14: 30 e0 ldi r19, 0x00 ; 0 24c16: a9 01 movw r20, r18 24c18: 60 e8 ldi r22, 0x80 ; 128 24c1a: 80 2f mov r24, r16 24c1c: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 24c20: f8 01 movw r30, r16 24c22: e6 5e subi r30, 0xE6 ; 230 24c24: fc 4f sbci r31, 0xFC ; 252 24c26: 20 81 ld r18, Z 24c28: 30 e0 ldi r19, 0x00 ; 0 24c2a: 50 e0 ldi r21, 0x00 ; 0 24c2c: 40 e0 ldi r20, 0x00 ; 0 24c2e: a9 01 movw r20, r18 24c30: 33 27 eor r19, r19 24c32: 22 27 eor r18, r18 24c34: 6d ee ldi r22, 0xED ; 237 24c36: 80 2f mov r24, r16 24c38: 0f 94 52 24 call 0x248a4 ; 0x248a4 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) 24c3c: 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; 24c3e: 24 ef ldi r18, 0xF4 ; 244 24c40: 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) 24c42: 08 17 cp r16, r24 24c44: 11 f0 breq .+4 ; 0x24c4a { case X_AXIS: return TMC2130_TCOOLTHRS_X; 24c46: 2e ea ldi r18, 0xAE ; 174 24c48: 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)); 24c4a: 50 e0 ldi r21, 0x00 ; 0 24c4c: 40 e0 ldi r20, 0x00 ; 0 24c4e: 64 e9 ldi r22, 0x94 ; 148 24c50: 8e 2d mov r24, r14 24c52: 0f 94 52 24 call 0x248a4 ; 0x248a4 iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 24c56: b8 01 movw r22, r16 24c58: 66 0f add r22, r22 24c5a: 77 1f adc r23, r23 24c5c: 60 0f add r22, r16 24c5e: 71 1f adc r23, r17 24c60: 69 56 subi r22, 0x69 ; 105 24c62: 70 46 sbci r23, 0x60 ; 96 24c64: 43 e0 ldi r20, 0x03 ; 3 24c66: 50 e0 ldi r21, 0x00 ; 0 24c68: ce 01 movw r24, r28 24c6a: 01 96 adiw r24, 0x01 ; 1 24c6c: 0f 94 bd d9 call 0x3b37a ; 0x3b37a MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 24c70: ae 01 movw r20, r28 24c72: 4f 5f subi r20, 0xFF ; 255 24c74: 5f 4f sbci r21, 0xFF ; 255 24c76: f8 01 movw r30, r16 24c78: eb 50 subi r30, 0x0B ; 11 24c7a: fb 4f sbci r31, 0xFB ; 251 24c7c: 60 81 ld r22, Z 24c7e: 8e 2d mov r24, r14 24c80: 0f 94 96 24 call 0x2492c ; 0x2492c tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 24c84: 20 e8 ldi r18, 0x80 ; 128 24c86: 31 e0 ldi r19, 0x01 ; 1 24c88: 40 e0 ldi r20, 0x00 ; 0 24c8a: 50 e0 ldi r21, 0x00 ; 0 24c8c: 60 e8 ldi r22, 0x80 ; 128 24c8e: 8e 2d mov r24, r14 24c90: 0f 94 52 24 call 0x248a4 ; 0x248a4 { 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 24c94: ff 0c add r15, r15 24c96: 0f 5f subi r16, 0xFF ; 255 24c98: 1f 4f sbci r17, 0xFF ; 255 24c9a: 03 30 cpi r16, 0x03 ; 3 24c9c: 11 05 cpc r17, r1 24c9e: 09 f0 breq .+2 ; 0x24ca2 24ca0: ae cf rjmp .-164 ; 0x24bfe 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 } 24ca2: 0f 90 pop r0 24ca4: 0f 90 pop r0 24ca6: 0f 90 pop r0 24ca8: df 91 pop r29 24caa: cf 91 pop r28 24cac: 1f 91 pop r17 24cae: 0f 91 pop r16 24cb0: ff 90 pop r15 24cb2: ef 90 pop r14 24cb4: df 90 pop r13 24cb6: 08 95 ret 00024cb8 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 24cb8: 89 e6 ldi r24, 0x69 ; 105 24cba: 9f e0 ldi r25, 0x0F ; 15 24cbc: 0f 94 23 dc call 0x3b846 ; 0x3b846 24cc0: 91 e0 ldi r25, 0x01 ; 1 24cc2: 81 11 cpse r24, r1 24cc4: 01 c0 rjmp .+2 ; 0x24cc8 24cc6: 90 e0 ldi r25, 0x00 ; 0 24cc8: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 24ccc: 08 95 ret 00024cce : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 24cce: cf 93 push r28 24cd0: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 24cd2: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 24cd4: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 24cd6: 9f b7 in r25, 0x3f ; 63 24cd8: f8 94 cli 24cda: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cde: 80 62 ori r24, 0x20 ; 32 24ce0: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24ce4: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 24ce6: 9f b7 in r25, 0x3f ; 63 24ce8: f8 94 cli 24cea: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cee: 80 61 ori r24, 0x10 ; 16 24cf0: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24cf4: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 24cf6: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 24cf8: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 24cfa: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24cfe: 80 62 ori r24, 0x20 ; 32 24d00: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 24d04: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d08: 80 61 ori r24, 0x10 ; 16 24d0a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 24d0e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d12: 8b 7f andi r24, 0xFB ; 251 24d14: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 24d18: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d1c: 8f 77 andi r24, 0x7F ; 127 24d1e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 24d22: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d26: 8f 7b andi r24, 0xBF ; 191 24d28: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 24d2c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 24d30: 87 7f andi r24, 0xF7 ; 247 24d32: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 24d36: 9f b7 in r25, 0x3f ; 63 24d38: f8 94 cli 24d3a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d3e: 84 60 ori r24, 0x04 ; 4 24d40: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d44: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 24d46: 9f b7 in r25, 0x3f ; 63 24d48: f8 94 cli 24d4a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d4e: 80 68 ori r24, 0x80 ; 128 24d50: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d54: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 24d56: 9f b7 in r25, 0x3f ; 63 24d58: f8 94 cli 24d5a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d5e: 80 64 ori r24, 0x40 ; 64 24d60: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d64: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 24d66: 9f b7 in r25, 0x3f ; 63 24d68: f8 94 cli 24d6a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d6e: 88 60 ori r24, 0x08 ; 8 24d70: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 24d74: 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); 24d76: 80 e0 ldi r24, 0x00 ; 0 24d78: 0f 94 13 25 call 0x24a26 ; 0x24a26 24d7c: 81 e0 ldi r24, 0x01 ; 1 24d7e: 0f 94 13 25 call 0x24a26 ; 0x24a26 24d82: 82 e0 ldi r24, 0x02 ; 2 24d84: 0f 94 13 25 call 0x24a26 ; 0x24a26 } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 24d88: 50 e0 ldi r21, 0x00 ; 0 24d8a: 40 e0 ldi r20, 0x00 ; 0 24d8c: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 24d90: 83 e0 ldi r24, 0x03 ; 3 24d92: 0f 94 96 24 call 0x2492c ; 0x2492c tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 24d96: 20 e0 ldi r18, 0x00 ; 0 24d98: 30 e0 ldi r19, 0x00 ; 0 24d9a: a9 01 movw r20, r18 24d9c: 61 e9 ldi r22, 0x91 ; 145 24d9e: 83 e0 ldi r24, 0x03 ; 3 24da0: 0f 94 52 24 call 0x248a4 ; 0x248a4 #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 24da4: c1 fd sbrc r28, 1 24da6: 1d c0 rjmp .+58 ; 0x24de2 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 24da8: 20 e8 ldi r18, 0x80 ; 128 24daa: 31 e0 ldi r19, 0x01 ; 1 24dac: 40 e0 ldi r20, 0x00 ; 0 24dae: 50 e0 ldi r21, 0x00 ; 0 24db0: 60 e8 ldi r22, 0x80 ; 128 24db2: 83 e0 ldi r24, 0x03 ; 3 24db4: 0f 94 52 24 call 0x248a4 ; 0x248a4 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]); 24db8: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 24dbc: 80 e0 ldi r24, 0x00 ; 0 24dbe: 0f 94 93 88 call 0x31126 ; 0x31126 tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 24dc2: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 24dc6: 81 e0 ldi r24, 0x01 ; 1 24dc8: 0f 94 93 88 call 0x31126 ; 0x31126 tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 24dcc: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 24dd0: 82 e0 ldi r24, 0x02 ; 2 24dd2: 0f 94 93 88 call 0x31126 ; 0x31126 #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 24dd6: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 24dda: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 24ddc: 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]); 24dde: 0d 94 93 88 jmp 0x31126 ; 0x31126 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)); 24de2: 20 e0 ldi r18, 0x00 ; 0 24de4: 30 e0 ldi r19, 0x00 ; 0 24de6: 43 e0 ldi r20, 0x03 ; 3 24de8: 50 e0 ldi r21, 0x00 ; 0 24dea: 6d ee ldi r22, 0xED ; 237 24dec: 83 e0 ldi r24, 0x03 ; 3 24dee: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 24df2: 20 e0 ldi r18, 0x00 ; 0 24df4: 30 e0 ldi r19, 0x00 ; 0 24df6: a9 01 movw r20, r18 24df8: 64 e9 ldi r22, 0x94 ; 148 24dfa: 83 e0 ldi r24, 0x03 ; 3 24dfc: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 24e00: 24 e0 ldi r18, 0x04 ; 4 24e02: 30 e0 ldi r19, 0x00 ; 0 24e04: 40 e0 ldi r20, 0x00 ; 0 24e06: 50 e0 ldi r21, 0x00 ; 0 24e08: 60 e8 ldi r22, 0x80 ; 128 24e0a: 83 e0 ldi r24, 0x03 ; 3 24e0c: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 24e10: 2b e2 ldi r18, 0x2B ; 43 24e12: 34 e5 ldi r19, 0x54 ; 84 24e14: 42 e0 ldi r20, 0x02 ; 2 24e16: 50 e0 ldi r21, 0x00 ; 0 24e18: 60 ef ldi r22, 0xF0 ; 240 24e1a: 83 e0 ldi r24, 0x03 ; 3 24e1c: 0f 94 52 24 call 0x248a4 ; 0x248a4 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 24e20: 23 e9 ldi r18, 0x93 ; 147 24e22: 31 e0 ldi r19, 0x01 ; 1 24e24: 40 e0 ldi r20, 0x00 ; 0 24e26: 50 e0 ldi r21, 0x00 ; 0 24e28: 63 e9 ldi r22, 0x93 ; 147 24e2a: 83 e0 ldi r24, 0x03 ; 3 24e2c: 0f 94 52 24 call 0x248a4 ; 0x248a4 SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 24e30: 87 e7 ldi r24, 0x77 ; 119 24e32: 9f e9 ldi r25, 0x9F ; 159 24e34: 0e 94 82 79 call 0xf304 ; 0xf304 24e38: bf cf rjmp .-130 ; 0x24db8 00024e3a : , 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()); } 24e3a: fc 01 movw r30, r24 24e3c: 20 81 ld r18, Z 24e3e: 92 81 ldd r25, Z+2 ; 0x02 24e40: 49 2f mov r20, r25 24e42: 50 e0 ldi r21, 0x00 ; 0 24e44: 21 11 cpse r18, r1 24e46: 02 c0 rjmp .+4 ; 0x24e4c 24e48: 44 0f add r20, r20 24e4a: 55 1f adc r21, r21 24e4c: 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; } 24e4e: 21 11 cpse r18, r1 24e50: 01 c0 rjmp .+2 ; 0x24e54 24e52: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 24e54: 84 17 cp r24, r20 24e56: 15 06 cpc r1, r21 24e58: 31 f0 breq .+12 ; 0x24e66 24e5a: 2c f0 brlt .+10 ; 0x24e66 24e5c: 89 2f mov r24, r25 24e5e: 21 11 cpse r18, r1 24e60: 02 c0 rjmp .+4 ; 0x24e66 24e62: 88 0f add r24, r24 24e64: 08 95 ret 24e66: 08 95 ret 00024e68 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 24e68: 3f b7 in r19, 0x3f ; 63 cli(); 24e6a: f8 94 cli m = timer2_overflow_count; 24e6c: 80 91 3f 06 lds r24, 0x063F ; 0x80063f 24e70: 90 91 40 06 lds r25, 0x0640 ; 0x800640 24e74: a0 91 41 06 lds r26, 0x0641 ; 0x800641 24e78: b0 91 42 06 lds r27, 0x0642 ; 0x800642 #if defined(TCNT2) t = TCNT2; 24e7c: 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)) 24e80: b8 9b sbis 0x17, 0 ; 23 24e82: 05 c0 rjmp .+10 ; 0x24e8e 24e84: 2f 3f cpi r18, 0xFF ; 255 24e86: 19 f0 breq .+6 ; 0x24e8e m++; 24e88: 01 96 adiw r24, 0x01 ; 1 24e8a: a1 1d adc r26, r1 24e8c: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 24e8e: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 24e90: ba 2f mov r27, r26 24e92: a9 2f mov r26, r25 24e94: 98 2f mov r25, r24 24e96: 88 27 eor r24, r24 24e98: bc 01 movw r22, r24 24e9a: cd 01 movw r24, r26 24e9c: 62 0f add r22, r18 24e9e: 71 1d adc r23, r1 24ea0: 81 1d adc r24, r1 24ea2: 91 1d adc r25, r1 24ea4: 42 e0 ldi r20, 0x02 ; 2 24ea6: 66 0f add r22, r22 24ea8: 77 1f adc r23, r23 24eaa: 88 1f adc r24, r24 24eac: 99 1f adc r25, r25 24eae: 4a 95 dec r20 24eb0: d1 f7 brne .-12 ; 0x24ea6 } 24eb2: 08 95 ret 00024eb4 : void delay2(unsigned long ms) { 24eb4: 8f 92 push r8 24eb6: 9f 92 push r9 24eb8: af 92 push r10 24eba: bf 92 push r11 24ebc: cf 92 push r12 24ebe: df 92 push r13 24ec0: ef 92 push r14 24ec2: ff 92 push r15 24ec4: 6b 01 movw r12, r22 24ec6: 7c 01 movw r14, r24 uint32_t start = micros2(); 24ec8: 0f 94 34 27 call 0x24e68 ; 0x24e68 24ecc: 4b 01 movw r8, r22 24ece: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 24ed0: c1 14 cp r12, r1 24ed2: d1 04 cpc r13, r1 24ed4: e1 04 cpc r14, r1 24ed6: f1 04 cpc r15, r1 24ed8: b9 f0 breq .+46 ; 0x24f08 24eda: 0f 94 34 27 call 0x24e68 ; 0x24e68 24ede: 68 19 sub r22, r8 24ee0: 79 09 sbc r23, r9 24ee2: 8a 09 sbc r24, r10 24ee4: 9b 09 sbc r25, r11 24ee6: 68 3e cpi r22, 0xE8 ; 232 24ee8: 73 40 sbci r23, 0x03 ; 3 24eea: 81 05 cpc r24, r1 24eec: 91 05 cpc r25, r1 24eee: 80 f3 brcs .-32 ; 0x24ed0 { ms--; 24ef0: 21 e0 ldi r18, 0x01 ; 1 24ef2: c2 1a sub r12, r18 24ef4: d1 08 sbc r13, r1 24ef6: e1 08 sbc r14, r1 24ef8: f1 08 sbc r15, r1 start += 1000; 24efa: 88 ee ldi r24, 0xE8 ; 232 24efc: 88 0e add r8, r24 24efe: 83 e0 ldi r24, 0x03 ; 3 24f00: 98 1e adc r9, r24 24f02: a1 1c adc r10, r1 24f04: b1 1c adc r11, r1 24f06: e4 cf rjmp .-56 ; 0x24ed0 } } } 24f08: ff 90 pop r15 24f0a: ef 90 pop r14 24f0c: df 90 pop r13 24f0e: cf 90 pop r12 24f10: bf 90 pop r11 24f12: af 90 pop r10 24f14: 9f 90 pop r9 24f16: 8f 90 pop r8 24f18: 08 95 ret 00024f1a : * @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() { 24f1a: ef 92 push r14 24f1c: ff 92 push r15 24f1e: 0f 93 push r16 24f20: 1f 93 push r17 24f22: cf 93 push r28 24f24: df 93 push r29 24f26: cd b7 in r28, 0x3d ; 61 24f28: de b7 in r29, 0x3e ; 62 24f2a: 63 97 sbiw r28, 0x13 ; 19 24f2c: 0f b6 in r0, 0x3f ; 63 24f2e: f8 94 cli 24f30: de bf out 0x3e, r29 ; 62 24f32: 0f be out 0x3f, r0 ; 63 24f34: 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) 24f36: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 24f3a: 81 11 cpse r24, r1 24f3c: 3a c0 rjmp .+116 ; 0x24fb2 { // Menu was entered. // Initialize its status. _md->status = 1; 24f3e: 81 e0 ldi r24, 0x01 ; 1 24f40: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 check_babystep(); 24f44: 0e 94 86 79 call 0xf30c ; 0xf30c if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 24f48: 81 ea ldi r24, 0xA1 ; 161 24f4a: 9d e0 ldi r25, 0x0D ; 13 24f4c: 0f 94 23 dc call 0x3b846 ; 0x3b846 24f50: 18 2f mov r17, r24 24f52: 0e 94 48 76 call 0xec90 ; 0xec90 24f56: 81 11 cpse r24, r1 24f58: ee c0 rjmp .+476 ; 0x25136 _md->babystepMemZ = 0; 24f5a: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 24f5e: 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)) 24f62: 80 e1 ldi r24, 0x10 ; 16 24f64: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 24f68: 81 11 cpse r24, r1 24f6a: 04 c0 rjmp .+8 ; 0x24f74 _md->babystepMemZ = 0; 24f6c: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 24f70: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 24f74: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 24f78: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 24f7c: 07 2e mov r0, r23 24f7e: 00 0c add r0, r0 24f80: 88 0b sbc r24, r24 24f82: 99 0b sbc r25, r25 24f84: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 24f88: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 24f8c: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 24f90: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 24f94: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 24f98: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 24f9c: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 24fa0: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 24fa4: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 24fa8: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af lcd_draw_update = 1; 24fac: 81 e0 ldi r24, 0x01 ; 1 24fae: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 24fb2: 80 91 70 06 lds r24, 0x0670 ; 0x800670 24fb6: 90 91 71 06 lds r25, 0x0671 ; 0x800671 24fba: 00 97 sbiw r24, 0x00 ; 0 24fbc: f1 f1 breq .+124 ; 0x2503a { _md->babystepMemZ += lcd_encoder; 24fbe: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 24fc2: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 24fc6: 28 0f add r18, r24 24fc8: 39 1f adc r19, r25 24fca: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 24fce: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 24fd2: 21 36 cpi r18, 0x61 ; 97 24fd4: 40 ef ldi r20, 0xF0 ; 240 24fd6: 34 07 cpc r19, r20 24fd8: 0c f0 brlt .+2 ; 0x24fdc 24fda: ba c0 rjmp .+372 ; 0x25150 24fdc: 81 e6 ldi r24, 0x61 ; 97 24fde: 90 ef ldi r25, 0xF0 ; 240 24fe0: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 24fe4: 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]; 24fe8: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 24fec: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 24ff0: 07 2e mov r0, r23 24ff2: 00 0c add r0, r0 24ff4: 88 0b sbc r24, r24 24ff6: 99 0b sbc r25, r25 24ff8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 24ffc: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 25000: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 25004: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 25008: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2500c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 25010: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 25014: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 25018: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 2501c: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af _delay(50); 25020: 62 e3 ldi r22, 0x32 ; 50 25022: 70 e0 ldi r23, 0x00 ; 0 25024: 80 e0 ldi r24, 0x00 ; 0 25026: 90 e0 ldi r25, 0x00 ; 0 25028: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 lcd_encoder = 0; 2502c: 10 92 71 06 sts 0x0671, r1 ; 0x800671 25030: 10 92 70 06 sts 0x0670, r1 ; 0x800670 lcd_draw_update = 1; 25034: 81 e0 ldi r24, 0x01 ; 1 25036: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 2503a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2503e: 88 23 and r24, r24 25040: c9 f1 breq .+114 ; 0x250b4 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 25042: 81 ea ldi r24, 0xA1 ; 161 25044: 9d e0 ldi r25, 0x0D ; 13 25046: 0f 94 23 dc call 0x3b846 ; 0x3b846 2504a: 2b e0 ldi r18, 0x0B ; 11 2504c: 82 9f mul r24, r18 2504e: c0 01 movw r24, r0 25050: 11 24 eor r1, r1 25052: be 01 movw r22, r28 25054: 6f 5f subi r22, 0xFF ; 255 25056: 7f 4f sbci r23, 0xFF ; 255 25058: 87 5b subi r24, 0xB7 ; 183 2505a: 92 4f sbci r25, 0xF2 ; 242 2505c: 0f 94 37 d0 call 0x3a06e ; 0x3a06e lcd_home(); 25060: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_print(buffer.c); 25064: ce 01 movw r24, r28 25066: 01 96 adiw r24, 0x01 ; 1 25068: 0e 94 ee 70 call 0xe1dc ; 0xe1dc lcd_set_cursor(0, 1); 2506c: 61 e0 ldi r22, 0x01 ; 1 2506e: 80 e0 ldi r24, 0x00 ; 0 25070: 0e 94 e7 6e call 0xddce ; 0xddce menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 25074: 10 91 ac 03 lds r17, 0x03AC ; 0x8003ac 25078: 00 91 ad 03 lds r16, 0x03AD ; 0x8003ad 2507c: f0 90 ae 03 lds r15, 0x03AE ; 0x8003ae 25080: e0 90 af 03 lds r14, 0x03AF ; 0x8003af 25084: 85 e5 ldi r24, 0x55 ; 85 25086: 91 e5 ldi r25, 0x51 ; 81 25088: 0e 94 b3 72 call 0xe566 ; 0xe566 //! (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); 2508c: ef 92 push r14 2508e: ff 92 push r15 25090: 0f 93 push r16 25092: 1f 93 push r17 25094: 9f 93 push r25 25096: 8f 93 push r24 25098: 1f 92 push r1 2509a: 80 e2 ldi r24, 0x20 ; 32 2509c: 8f 93 push r24 2509e: 83 e5 ldi r24, 0x53 ; 83 250a0: 93 ea ldi r25, 0xA3 ; 163 250a2: 9f 93 push r25 250a4: 8f 93 push r24 250a6: 0e 94 c0 6e call 0xdd80 ; 0xdd80 250aa: 0f b6 in r0, 0x3f ; 63 250ac: f8 94 cli 250ae: de bf out 0x3e, r29 ; 62 250b0: 0f be out 0x3f, r0 ; 63 250b2: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 250b4: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 250b8: 81 11 cpse r24, r1 250ba: 04 c0 rjmp .+8 ; 0x250c4 250bc: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 250c0: 88 23 and r24, r24 250c2: 51 f1 breq .+84 ; 0x25118 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 250c4: 81 ea ldi r24, 0xA1 ; 161 250c6: 9d e0 ldi r25, 0x0D ; 13 250c8: 0f 94 23 dc call 0x3b846 ; 0x3b846 250cc: 9b e0 ldi r25, 0x0B ; 11 250ce: 89 9f mul r24, r25 250d0: 80 01 movw r16, r0 250d2: 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); 250d4: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 250d8: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 250dc: c8 01 movw r24, r16 250de: 80 5b subi r24, 0xB0 ; 176 250e0: 92 4f sbci r25, 0xF2 ; 242 250e2: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 250e6: 60 91 72 06 lds r22, 0x0672 ; 0x800672 250ea: c8 01 movw r24, r16 250ec: 8e 5a subi r24, 0xAE ; 174 250ee: 92 4f sbci r25, 0xF2 ; 242 250f0: 0f 94 47 dc call 0x3b88e ; 0x3b88e 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); 250f4: 60 91 99 03 lds r22, 0x0399 ; 0x800399 250f8: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 250fc: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 25100: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 25104: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 25108: c8 01 movw r24, r16 2510a: 8d 5a subi r24, 0xAD ; 173 2510c: 92 4f sbci r25, 0xF2 ; 242 2510e: 0f 94 47 dc call 0x3b88e ; 0x3b88e #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 25112: 80 e1 ldi r24, 0x10 ; 16 25114: 0e 94 99 ee call 0x1dd32 ; 0x1dd32 } menu_back_if_clicked(); 25118: 0f 94 07 d5 call 0x3aa0e ; 0x3aa0e } 2511c: 63 96 adiw r28, 0x13 ; 19 2511e: 0f b6 in r0, 0x3f ; 63 25120: f8 94 cli 25122: de bf out 0x3e, r29 ; 62 25124: 0f be out 0x3f, r0 ; 63 25126: cd bf out 0x3d, r28 ; 61 25128: df 91 pop r29 2512a: cf 91 pop r28 2512c: 1f 91 pop r17 2512e: 0f 91 pop r16 25130: ff 90 pop r15 25132: ef 90 pop r14 25134: 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-> 25136: 2b e0 ldi r18, 0x0B ; 11 25138: 12 9f mul r17, r18 2513a: c0 01 movw r24, r0 2513c: 11 24 eor r1, r1 2513e: 80 5b subi r24, 0xB0 ; 176 25140: 92 4f sbci r25, 0xF2 ; 242 25142: 0f 94 31 dc call 0x3b862 ; 0x3b862 25146: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 2514a: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 2514e: 09 cf rjmp .-494 ; 0x24f62 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 25150: 12 16 cp r1, r18 25152: 13 06 cpc r1, r19 25154: 2c f4 brge .+10 ; 0x25160 25156: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 2515a: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa 2515e: 44 cf rjmp .-376 ; 0x24fe8 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 25160: 2f b7 in r18, 0x3f ; 63 25162: f8 94 cli babystepsTodo[Z_AXIS] += n; 25164: 40 91 6d 06 lds r20, 0x066D ; 0x80066d 25168: 50 91 6e 06 lds r21, 0x066E ; 0x80066e 2516c: 84 0f add r24, r20 2516e: 95 1f adc r25, r21 25170: 90 93 6e 06 sts 0x066E, r25 ; 0x80066e 25174: 80 93 6d 06 sts 0x066D, r24 ; 0x80066d CRITICAL_SECTION_END 25178: 2f bf out 0x3f, r18 ; 63 2517a: 36 cf rjmp .-404 ; 0x24fe8 0002517c : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 2517c: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 25180: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 25184: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 25188: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 2518c: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 25190: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 25194: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 25198: 26 17 cp r18, r22 2519a: 37 07 cpc r19, r23 2519c: 0c f0 brlt .+2 ; 0x251a0 2519e: 65 c0 rjmp .+202 ; 0x2526a { if (lcd_encoder != 0) 251a0: 80 91 70 06 lds r24, 0x0670 ; 0x800670 251a4: 90 91 71 06 lds r25, 0x0671 ; 0x800671 251a8: 89 2b or r24, r25 251aa: b9 f1 breq .+110 ; 0x2521a { refresh_cmd_timeout(); 251ac: 0e 94 ca 66 call 0xcd94 ; 0xcd94 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; 251b0: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 if (++ next_block_index == BLOCK_BUFFER_SIZE) 251b4: 8f 5f subi r24, 0xFF ; 255 251b6: 80 31 cpi r24, 0x10 ; 16 251b8: 09 f4 brne .+2 ; 0x251bc next_block_index = 0; 251ba: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 251bc: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 if (! planner_queue_full()) 251c0: 98 17 cp r25, r24 251c2: 59 f1 breq .+86 ; 0x2521a { current_position[E_AXIS] += lcd_encoder; 251c4: 60 91 70 06 lds r22, 0x0670 ; 0x800670 251c8: 70 91 71 06 lds r23, 0x0671 ; 0x800671 251cc: 07 2e mov r0, r23 251ce: 00 0c add r0, r0 251d0: 88 0b sbc r24, r24 251d2: 99 0b sbc r25, r25 251d4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 251d8: 9b 01 movw r18, r22 251da: ac 01 movw r20, r24 251dc: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 251e0: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 251e4: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 251e8: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 251ec: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 251f0: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 251f4: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 251f8: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 251fc: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 lcd_encoder = 0; 25200: 10 92 71 06 sts 0x0671, r1 ; 0x800671 25204: 10 92 70 06 sts 0x0670, r1 ; 0x800670 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 25208: 65 e5 ldi r22, 0x55 ; 85 2520a: 75 e5 ldi r23, 0x55 ; 85 2520c: 85 ed ldi r24, 0xD5 ; 213 2520e: 9f e3 ldi r25, 0x3F ; 63 25210: 0f 94 50 c0 call 0x380a0 ; 0x380a0 lcd_draw_update = 1; 25214: 81 e0 ldi r24, 0x01 ; 1 25216: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 2521a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2521e: 88 23 and r24, r24 25220: 11 f1 breq .+68 ; 0x25266 { lcd_set_cursor(0, 1); 25222: 61 e0 ldi r22, 0x01 ; 1 25224: 80 e0 ldi r24, 0x00 ; 0 25226: 0e 94 e7 6e call 0xddce ; 0xddce //! 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); 2522a: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 2522e: 8f 93 push r24 25230: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 25234: 8f 93 push r24 25236: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 2523a: 8f 93 push r24 2523c: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 25240: 8f 93 push r24 25242: 85 e3 ldi r24, 0x35 ; 53 25244: 93 ea ldi r25, 0xA3 ; 163 25246: 9f 93 push r25 25248: 8f 93 push r24 2524a: 86 e2 ldi r24, 0x26 ; 38 2524c: 93 ea ldi r25, 0xA3 ; 163 2524e: 9f 93 push r25 25250: 8f 93 push r24 25252: 0e 94 c0 6e call 0xdd80 ; 0xdd80 25256: 8d b7 in r24, 0x3d ; 61 25258: 9e b7 in r25, 0x3e ; 62 2525a: 08 96 adiw r24, 0x08 ; 8 2525c: 0f b6 in r0, 0x3f ; 63 2525e: f8 94 cli 25260: 9e bf out 0x3e, r25 ; 62 25262: 0f be out 0x3f, r0 ; 63 25264: 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(); 25266: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e }; } void show_preheat_nozzle_warning() { lcd_clear(); 2526a: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 2526e: 86 ee ldi r24, 0xE6 ; 230 25270: 90 e5 ldi r25, 0x50 ; 80 25272: 0e 94 b3 72 call 0xe566 ; 0xe566 25276: ac 01 movw r20, r24 25278: 60 e0 ldi r22, 0x00 ; 0 2527a: 80 e0 ldi r24, 0x00 ; 0 2527c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 25280: 80 ed ldi r24, 0xD0 ; 208 25282: 90 e5 ldi r25, 0x50 ; 80 25284: 0e 94 b3 72 call 0xe566 ; 0xe566 25288: ac 01 movw r20, r24 2528a: 62 e0 ldi r22, 0x02 ; 2 2528c: 80 e0 ldi r24, 0x00 ; 0 2528e: 0e 94 fb 6e call 0xddf6 ; 0xddf6 _delay(2000); 25292: 60 ed ldi r22, 0xD0 ; 208 25294: 77 e0 ldi r23, 0x07 ; 7 25296: 80 e0 ldi r24, 0x00 ; 0 25298: 90 e0 ldi r25, 0x00 ; 0 2529a: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 lcd_clear(); 2529e: 0e 94 1a 6f call 0xde34 ; 0xde34 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 252a2: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 000252a6 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 252a6: 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(); 252a8: f8 94 cli m = timer2_millis; 252aa: 60 91 3b 06 lds r22, 0x063B ; 0x80063b 252ae: 70 91 3c 06 lds r23, 0x063C ; 0x80063c 252b2: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 252b6: 90 91 3e 06 lds r25, 0x063E ; 0x80063e SREG = oldSREG; 252ba: 2f bf out 0x3f, r18 ; 63 return m; } 252bc: 08 95 ret 000252be : } //! @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); 252be: 20 e0 ldi r18, 0x00 ; 0 252c0: 30 e0 ldi r19, 0x00 ; 0 252c2: 40 e8 ldi r20, 0x80 ; 128 252c4: 5f eb ldi r21, 0xBF ; 191 252c6: 60 e0 ldi r22, 0x00 ; 0 252c8: 70 e0 ldi r23, 0x00 ; 0 252ca: cb 01 movw r24, r22 252cc: 0e 94 3e 89 call 0x1127c ; 0x1127c SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 252d0: 89 ef ldi r24, 0xF9 ; 249 252d2: 9e e6 ldi r25, 0x6E ; 110 252d4: 0e 94 82 79 call 0xf304 ; 0xf304 // Indicate that the printer is paused did_pause_print = true; 252d8: 81 e0 ldi r24, 0x01 ; 1 252da: 80 93 e4 03 sts 0x03E4, r24 ; 0x8003e4 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 252de: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 252e2: 81 30 cpi r24, 0x01 ; 1 252e4: 69 f4 brne .+26 ; 0x25300 state = PAUSED; 252e6: 82 e0 ldi r24, 0x02 ; 2 252e8: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 252ec: 0f 94 53 29 call 0x252a6 ; 0x252a6 252f0: 60 93 52 06 sts 0x0652, r22 ; 0x800652 252f4: 70 93 53 06 sts 0x0653, r23 ; 0x800653 252f8: 80 93 54 06 sts 0x0654, r24 ; 0x800654 252fc: 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; 25300: 82 e0 ldi r24, 0x02 ; 2 25302: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 lcd_return_to_status(); 25306: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 0002530a ::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) 2530a: ff 92 push r15 2530c: 0f 93 push r16 2530e: 1f 93 push r17 25310: cf 93 push r28 25312: df 93 push r29 { if (!m_isRunning) return false; 25314: fc 01 movw r30, r24 25316: f0 80 ld r15, Z 25318: f1 10 cpse r15, r1 2531a: 08 c0 rjmp .+16 ; 0x2532c ::expired(unsigned short)+0x22> 2531c: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 2531e: 8f 2d mov r24, r15 25320: df 91 pop r29 25322: cf 91 pop r28 25324: 1f 91 pop r17 25326: 0f 91 pop r16 25328: ff 90 pop r15 2532a: 08 95 ret 2532c: 8b 01 movw r16, r22 2532e: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 25330: 0f 94 53 29 call 0x252a6 ; 0x252a6 if (m_started <= m_started + msPeriod) 25334: 89 81 ldd r24, Y+1 ; 0x01 25336: 9a 81 ldd r25, Y+2 ; 0x02 25338: 08 0f add r16, r24 2533a: 19 1f adc r17, r25 2533c: 08 17 cp r16, r24 2533e: 19 07 cpc r17, r25 25340: 40 f0 brcs .+16 ; 0x25352 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 25342: 60 17 cp r22, r16 25344: 71 07 cpc r23, r17 25346: 18 f4 brcc .+6 ; 0x2534e ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 25348: 68 17 cp r22, r24 2534a: 79 07 cpc r23, r25 2534c: 38 f7 brcc .-50 ; 0x2531c ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 2534e: 18 82 st Y, r1 25350: e6 cf rjmp .-52 ; 0x2531e ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 25352: 60 17 cp r22, r16 25354: 71 07 cpc r23, r17 25356: c0 f7 brcc .-16 ; 0x25348 ::expired(unsigned short)+0x3e> 25358: e1 cf rjmp .-62 ; 0x2531c ::expired(unsigned short)+0x12> 0002535a ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2535a: fc 01 movw r30, r24 2535c: 20 81 ld r18, Z 2535e: 21 11 cpse r18, r1 25360: 0d 94 85 29 jmp 0x2530a ; 0x2530a ::expired(unsigned short)> } 25364: 81 e0 ldi r24, 0x01 ; 1 25366: 08 95 ret 00025368 ::start()>: /** * @brief Start timer */ template void Timer::start() 25368: cf 93 push r28 2536a: df 93 push r29 2536c: ec 01 movw r28, r24 { m_started = _millis(); 2536e: 0f 94 53 29 call 0x252a6 ; 0x252a6 25372: 7a 83 std Y+2, r23 ; 0x02 25374: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 25376: 81 e0 ldi r24, 0x01 ; 1 25378: 88 83 st Y, r24 } 2537a: df 91 pop r29 2537c: cf 91 pop r28 2537e: 08 95 ret 00025380 : TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); } static uint8_t twi_wait(uint8_t status) { 25380: 1f 93 push r17 25382: cf 93 push r28 25384: df 93 push r29 25386: 00 d0 rcall .+0 ; 0x25388 25388: cd b7 in r28, 0x3d ; 61 2538a: de b7 in r29, 0x3e ; 62 2538c: 18 2f mov r17, r24 ShortTimer timmy; 2538e: 19 82 std Y+1, r1 ; 0x01 25390: 1b 82 std Y+3, r1 ; 0x03 25392: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 25394: ce 01 movw r24, r28 25396: 01 96 adiw r24, 0x01 ; 1 25398: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> while(!(TWCR & _BV(TWINT))) { 2539c: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 253a0: 87 fd sbrc r24, 7 253a2: 0a c0 rjmp .+20 ; 0x253b8 if (timmy.expired(TWI_TIMEOUT_MS)) { 253a4: 6a e0 ldi r22, 0x0A ; 10 253a6: 70 e0 ldi r23, 0x00 ; 0 253a8: ce 01 movw r24, r28 253aa: 01 96 adiw r24, 0x01 ; 1 253ac: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 253b0: 88 23 and r24, r24 253b2: a1 f3 breq .-24 ; 0x2539c return 2; 253b4: 82 e0 ldi r24, 0x02 ; 2 253b6: 09 c0 rjmp .+18 ; 0x253ca } } if(TW_STATUS != status) 253b8: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 253bc: 88 7f andi r24, 0xF8 ; 248 253be: 18 17 cp r17, r24 253c0: 59 f0 breq .+22 ; 0x253d8 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 253c2: 84 e9 ldi r24, 0x94 ; 148 253c4: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 253c8: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 253ca: 0f 90 pop r0 253cc: 0f 90 pop r0 253ce: 0f 90 pop r0 253d0: df 91 pop r29 253d2: cf 91 pop r28 253d4: 1f 91 pop r17 253d6: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 253d8: 80 e0 ldi r24, 0x00 ; 0 253da: f7 cf rjmp .-18 ; 0x253ca 000253dc : } return standstill; } void tmc2130_check_overtemp() { 253dc: 1f 93 push r17 253de: cf 93 push r28 253e0: df 93 push r29 253e2: 00 d0 rcall .+0 ; 0x253e4 253e4: 1f 92 push r1 253e6: cd b7 in r28, 0x3d ; 61 253e8: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 253ea: 68 ee ldi r22, 0xE8 ; 232 253ec: 73 e0 ldi r23, 0x03 ; 3 253ee: 84 e4 ldi r24, 0x44 ; 68 253f0: 96 e0 ldi r25, 0x06 ; 6 253f2: 0f 94 ad 29 call 0x2535a ; 0x2535a ::expired_cont(unsigned short)> 253f6: 88 23 and r24, r24 253f8: 91 f1 breq .+100 ; 0x2545e { for (uint_least8_t i = 0; i < 4; i++) 253fa: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 253fc: 19 82 std Y+1, r1 ; 0x01 253fe: 1a 82 std Y+2, r1 ; 0x02 25400: 1b 82 std Y+3, r1 ; 0x03 25402: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 25404: ae 01 movw r20, r28 25406: 4f 5f subi r20, 0xFF ; 255 25408: 5f 4f sbci r21, 0xFF ; 255 2540a: 6f e6 ldi r22, 0x6F ; 111 2540c: 81 2f mov r24, r17 2540e: 0f 94 f8 23 call 0x247f0 ; 0x247f0 if (drv_status & ((uint32_t)1 << 26)) 25412: 89 81 ldd r24, Y+1 ; 0x01 25414: 9a 81 ldd r25, Y+2 ; 0x02 25416: ab 81 ldd r26, Y+3 ; 0x03 25418: bc 81 ldd r27, Y+4 ; 0x04 2541a: b2 ff sbrs r27, 2 2541c: 19 c0 rjmp .+50 ; 0x25450 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 2541e: 8a e6 ldi r24, 0x6A ; 106 25420: 9e e6 ldi r25, 0x6E ; 110 25422: 0e 94 57 77 call 0xeeae ; 0xeeae } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 25426: 81 2f mov r24, r17 25428: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 2542c: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 25430: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 25432: 20 e0 ldi r18, 0x00 ; 0 25434: 30 e0 ldi r19, 0x00 ; 0 25436: 41 e0 ldi r20, 0x01 ; 1 25438: 50 e0 ldi r21, 0x00 ; 0 2543a: 6c ee ldi r22, 0xEC ; 236 2543c: 81 2f mov r24, r17 2543e: 0f 94 52 24 call 0x248a4 ; 0x248a4 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++) 25442: 1f 5f subi r17, 0xFF ; 255 25444: 14 30 cpi r17, 0x04 ; 4 25446: a9 f7 brne .-22 ; 0x25432 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 25448: 8a e6 ldi r24, 0x6A ; 106 2544a: 9e e6 ldi r25, 0x6E ; 110 2544c: 0e 94 11 7a call 0xf422 ; 0xf422 void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 25450: 1f 5f subi r17, 0xFF ; 255 25452: 14 30 cpi r17, 0x04 ; 4 25454: 99 f6 brne .-90 ; 0x253fc tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 25456: 84 e4 ldi r24, 0x44 ; 68 25458: 96 e0 ldi r25, 0x06 ; 6 2545a: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> } } 2545e: 0f 90 pop r0 25460: 0f 90 pop r0 25462: 0f 90 pop r0 25464: 0f 90 pop r0 25466: df 91 pop r29 25468: cf 91 pop r28 2546a: 1f 91 pop r17 2546c: 08 95 ret 0002546e ::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) 2546e: 8f 92 push r8 25470: 9f 92 push r9 25472: af 92 push r10 25474: bf 92 push r11 25476: cf 92 push r12 25478: df 92 push r13 2547a: ef 92 push r14 2547c: ff 92 push r15 2547e: 1f 93 push r17 25480: cf 93 push r28 25482: df 93 push r29 { if (!m_isRunning) return false; 25484: fc 01 movw r30, r24 25486: 10 81 ld r17, Z 25488: 11 11 cpse r17, r1 2548a: 0e c0 rjmp .+28 ; 0x254a8 ::expired(unsigned long)+0x3a> 2548c: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 2548e: 81 2f mov r24, r17 25490: df 91 pop r29 25492: cf 91 pop r28 25494: 1f 91 pop r17 25496: ff 90 pop r15 25498: ef 90 pop r14 2549a: df 90 pop r13 2549c: cf 90 pop r12 2549e: bf 90 pop r11 254a0: af 90 pop r10 254a2: 9f 90 pop r9 254a4: 8f 90 pop r8 254a6: 08 95 ret 254a8: 6a 01 movw r12, r20 254aa: 7b 01 movw r14, r22 254ac: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 254ae: 0f 94 53 29 call 0x252a6 ; 0x252a6 254b2: 4b 01 movw r8, r22 254b4: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 254b6: 89 81 ldd r24, Y+1 ; 0x01 254b8: 9a 81 ldd r25, Y+2 ; 0x02 254ba: ab 81 ldd r26, Y+3 ; 0x03 254bc: bc 81 ldd r27, Y+4 ; 0x04 254be: c8 0e add r12, r24 254c0: d9 1e adc r13, r25 254c2: ea 1e adc r14, r26 254c4: fb 1e adc r15, r27 254c6: c8 16 cp r12, r24 254c8: d9 06 cpc r13, r25 254ca: ea 06 cpc r14, r26 254cc: fb 06 cpc r15, r27 254ce: 60 f0 brcs .+24 ; 0x254e8 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 254d0: 8c 14 cp r8, r12 254d2: 9d 04 cpc r9, r13 254d4: ae 04 cpc r10, r14 254d6: bf 04 cpc r11, r15 254d8: 28 f4 brcc .+10 ; 0x254e4 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 254da: 88 16 cp r8, r24 254dc: 99 06 cpc r9, r25 254de: aa 06 cpc r10, r26 254e0: bb 06 cpc r11, r27 254e2: a0 f6 brcc .-88 ; 0x2548c ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 254e4: 18 82 st Y, r1 254e6: d3 cf rjmp .-90 ; 0x2548e ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 254e8: 8c 14 cp r8, r12 254ea: 9d 04 cpc r9, r13 254ec: ae 04 cpc r10, r14 254ee: bf 04 cpc r11, r15 254f0: a0 f7 brcc .-24 ; 0x254da ::expired(unsigned long)+0x6c> 254f2: cc cf rjmp .-104 ; 0x2548c ::expired(unsigned long)+0x1e> 000254f4 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 254f4: 0f 93 push r16 254f6: 1f 93 push r17 254f8: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 254fa: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 254fe: 88 23 and r24, r24 25500: 09 f4 brne .+2 ; 0x25504 25502: 4d c0 rjmp .+154 ; 0x2559e heating_status_counter++; 25504: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 25508: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 2550a: 8e 30 cpi r24, 0x0E ; 14 2550c: b0 f4 brcc .+44 ; 0x2553a //! @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++; 2550e: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 25512: 63 e0 ldi r22, 0x03 ; 3 25514: 87 e0 ldi r24, 0x07 ; 7 25516: 0e 94 e7 6e call 0xddce ; 0xddce lcd_space(13); 2551a: 8d e0 ldi r24, 0x0D ; 13 2551c: 0e 94 dd 6e call 0xddba ; 0xddba for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 25520: c0 e0 ldi r28, 0x00 ; 0 25522: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 25526: c8 17 cp r28, r24 25528: 58 f4 brcc .+22 ; 0x25540 lcd_putc_at(7 + dots, 3, '.'); 2552a: 4e e2 ldi r20, 0x2E ; 46 2552c: 63 e0 ldi r22, 0x03 ; 3 2552e: 87 e0 ldi r24, 0x07 ; 7 25530: 8c 0f add r24, r28 25532: 0e 94 07 6f call 0xde0e ; 0xde0e heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 25536: cf 5f subi r28, 0xFF ; 255 25538: f4 cf rjmp .-24 ; 0x25522 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; 2553a: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b 2553e: e9 cf rjmp .-46 ; 0x25512 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 25540: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 25544: 82 30 cpi r24, 0x02 ; 2 25546: d1 f0 breq .+52 ; 0x2557c 25548: 30 f4 brcc .+12 ; 0x25556 2554a: 81 30 cpi r24, 0x01 ; 1 2554c: 59 f0 breq .+22 ; 0x25564 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2554e: cf 91 pop r28 25550: 1f 91 pop r17 25552: 0f 91 pop r16 25554: 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) { 25556: 83 30 cpi r24, 0x03 ; 3 25558: f9 f0 breq .+62 ; 0x25598 2555a: 84 30 cpi r24, 0x04 ; 4 2555c: c1 f7 brne .-16 ; 0x2554e 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)); 2555e: 84 e0 ldi r24, 0x04 ; 4 25560: 9e e4 ldi r25, 0x4E ; 78 25562: 0e c0 rjmp .+28 ; 0x25580 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)); 25564: 8d e2 ldi r24, 0x2D ; 45 25566: 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)); 25568: 0e 94 b3 72 call 0xe566 ; 0xe566 2556c: ac 01 movw r20, r24 2556e: 63 e0 ldi r22, 0x03 ; 3 25570: 80 e0 ldi r24, 0x00 ; 0 break; } } } 25572: cf 91 pop r28 25574: 1f 91 pop r17 25576: 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)); 25578: 0c 94 fb 6e jmp 0xddf6 ; 0xddf6 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)); 2557c: 8d e1 ldi r24, 0x1D ; 29 2557e: 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)); 25580: 0e 94 b3 72 call 0xe566 ; 0xe566 25584: ac 01 movw r20, r24 25586: 63 e0 ldi r22, 0x03 ; 3 25588: 80 e0 ldi r24, 0x00 ; 0 2558a: 0e 94 fb 6e call 0xddf6 ; 0xddf6 heating_status = HeatingStatus::NO_HEATING; 2558e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 heating_status_counter = 0; 25592: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b 25596: db cf rjmp .-74 ; 0x2554e 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)); 25598: 8f e0 ldi r24, 0x0F ; 15 2559a: 9e e4 ldi r25, 0x4E ; 78 2559c: e5 cf rjmp .-54 ; 0x25568 break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 2559e: 80 91 90 14 lds r24, 0x1490 ; 0x801490 255a2: 88 23 and r24, r24 255a4: 61 f1 breq .+88 ; 0x255fe break; default: break; } } else if ((IS_SD_PRINTING) && 255a6: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 255aa: 81 11 cpse r24, r1 255ac: 28 c0 rjmp .+80 ; 0x255fe (custom_message_type == CustomMsg::Status) && 255ae: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> 255b2: 82 30 cpi r24, 0x02 ; 2 255b4: 20 f5 brcc .+72 ; 0x255fe } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 255b6: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452> 255ba: 81 11 cpse r24, r1 255bc: 16 c0 rjmp .+44 ; 0x255ea (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); 255be: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 255c2: 88 23 and r24, r24 255c4: 09 f4 brne .+2 ; 0x255c8 255c6: 35 c0 rjmp .+106 ; 0x25632 255c8: 87 ea ldi r24, 0xA7 ; 167 255ca: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 255cc: 20 91 b9 0d lds r18, 0x0DB9 ; 0x800db9 255d0: 64 e1 ldi r22, 0x14 ; 20 255d2: 82 0f add r24, r18 255d4: 91 1d adc r25, r1 255d6: 0e 94 d6 70 call 0xe1ac ; 0xe1ac 255da: 81 11 cpse r24, r1 255dc: 2d c0 rjmp .+90 ; 0x25638 { scrollstuff++; 255de: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 255e2: 8f 5f subi r24, 0xFF ; 255 255e4: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 255e8: b2 cf rjmp .-156 ; 0x2554e 255ea: 40 e2 ldi r20, 0x20 ; 32 255ec: 5e e4 ldi r21, 0x4E ; 78 255ee: 60 e0 ldi r22, 0x00 ; 0 255f0: 70 e0 ldi r23, 0x00 ; 0 255f2: 84 e3 ldi r24, 0x34 ; 52 255f4: 95 e0 ldi r25, 0x05 ; 5 255f6: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 255fa: 81 11 cpse r24, r1 255fc: e0 cf rjmp .-64 ; 0x255be 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) 255fe: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 25602: 81 11 cpse r24, r1 25604: 1c c0 rjmp .+56 ; 0x2563e { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 25606: e0 91 c4 06 lds r30, 0x06C4 ; 0x8006c4 2560a: ea 30 cpi r30, 0x0A ; 10 2560c: 08 f0 brcs .+2 ; 0x25610 2560e: 9f cf rjmp .-194 ; 0x2554e 25610: f0 e0 ldi r31, 0x00 ; 0 25612: 88 27 eor r24, r24 25614: e1 5f subi r30, 0xF1 ; 241 25616: f4 4d sbci r31, 0xD4 ; 212 25618: 8e 4f sbci r24, 0xFE ; 254 2561a: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 2561e: be 39 cpi r27, 0x9E ; 158 25620: b6 3a cpi r27, 0xA6 ; 166 25622: be 39 cpi r27, 0x9E ; 158 25624: fc 39 cpi r31, 0x9C ; 156 25626: 56 3a cpi r21, 0xA6 ; 166 25628: c0 3a cpi r28, 0xA0 ; 160 2562a: be 39 cpi r27, 0x9E ; 158 2562c: be 39 cpi r27, 0x9E ; 158 2562e: 72 3a cpi r23, 0xA2 ; 162 25630: 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); 25632: 82 e9 ldi r24, 0x92 ; 146 25634: 94 e1 ldi r25, 0x14 ; 20 25636: ca cf rjmp .-108 ; 0x255cc if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 25638: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 2563c: 88 cf rjmp .-240 ; 0x2554e } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 2563e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 <_ZL26lcd_status_message_timeout.lto_priv.452> 25642: 88 23 and r24, r24 25644: 01 f3 breq .-64 ; 0x25606 * 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; 25646: 0f 94 53 29 call 0x252a6 ; 0x252a6 2564a: 00 91 35 05 lds r16, 0x0535 ; 0x800535 <_ZL26lcd_status_message_timeout.lto_priv.452+0x1> 2564e: 10 91 36 05 lds r17, 0x0536 ; 0x800536 <_ZL26lcd_status_message_timeout.lto_priv.452+0x2> 25652: 20 91 37 05 lds r18, 0x0537 ; 0x800537 <_ZL26lcd_status_message_timeout.lto_priv.452+0x3> 25656: 30 91 38 05 lds r19, 0x0538 ; 0x800538 <_ZL26lcd_status_message_timeout.lto_priv.452+0x4> 2565a: 60 1b sub r22, r16 2565c: 71 0b sbc r23, r17 2565e: 82 0b sbc r24, r18 25660: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 25662: 60 3a cpi r22, 0xA0 ; 160 25664: 7f 40 sbci r23, 0x0F ; 15 25666: 81 05 cpc r24, r1 25668: 91 05 cpc r25, r1 2566a: 68 f6 brcc .-102 ; 0x25606 2566c: 70 cf rjmp .-288 ; 0x2554e 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); 2566e: 63 e0 ldi r22, 0x03 ; 3 25670: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> 25674: 0e 94 e7 6e call 0xddce ; 0xddce const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 25678: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> 2567c: c4 e1 ldi r28, 0x14 ; 20 2567e: 6c 2f mov r22, r28 25680: 68 1b sub r22, r24 25682: 90 e0 ldi r25, 0x00 ; 0 25684: 81 5e subi r24, 0xE1 ; 225 25686: 9a 4f sbci r25, 0xFA ; 250 25688: 0e 94 d6 70 call 0xe1ac ; 0xe1ac lcd_status_message_idx = LCD_WIDTH - padding; 2568c: c8 1b sub r28, r24 2568e: c0 93 1e 05 sts 0x051E, r28 ; 0x80051e <_ZL22lcd_status_message_idx.lto_priv.448> 25692: 5d cf rjmp .-326 ; 0x2554e } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 25694: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 25698: 8b 30 cpi r24, 0x0B ; 11 2569a: 08 f1 brcs .+66 ; 0x256de lcd_set_cursor(0, 3); 2569c: 63 e0 ldi r22, 0x03 ; 3 2569e: 80 e0 ldi r24, 0x00 ; 0 256a0: 0e 94 e7 6e call 0xddce ; 0xddce lcd_space(LCD_WIDTH); 256a4: 84 e1 ldi r24, 0x14 ; 20 256a6: 0e 94 dd 6e call 0xddba ; 0xddba lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 256aa: 84 ef ldi r24, 0xF4 ; 244 256ac: 9d e4 ldi r25, 0x4D ; 77 256ae: 0e 94 b3 72 call 0xe566 ; 0xe566 256b2: ac 01 movw r20, r24 256b4: 63 e0 ldi r22, 0x03 ; 3 256b6: 80 e0 ldi r24, 0x00 ; 0 256b8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_P(PSTR(" : ")); 256bc: 80 e8 ldi r24, 0x80 ; 128 256be: 90 ea ldi r25, 0xA0 ; 160 256c0: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_print(custom_message_state - 10); 256c4: 60 91 f7 03 lds r22, 0x03F7 ; 0x8003f7 256c8: 6a 50 subi r22, 0x0A ; 10 256ca: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 256cc: 07 2e mov r0, r23 256ce: 00 0c add r0, r0 256d0: 88 0b sbc r24, r24 256d2: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 256d4: cf 91 pop r28 256d6: 1f 91 pop r17 256d8: 0f 91 pop r16 256da: 0c 94 a0 70 jmp 0xe140 ; 0xe140 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) { 256de: 83 30 cpi r24, 0x03 ; 3 256e0: 31 f4 brne .+12 ; 0x256ee lcd_setstatuspgm(MSG_WELCOME); 256e2: 83 e7 ldi r24, 0x73 ; 115 256e4: 90 e7 ldi r25, 0x70 ; 112 256e6: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 custom_message_type = CustomMsg::Status; 256ea: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } if (custom_message_state > 3 && custom_message_state <= 10) { 256ee: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 256f2: 84 50 subi r24, 0x04 ; 4 256f4: 87 30 cpi r24, 0x07 ; 7 256f6: 08 f0 brcs .+2 ; 0x256fa 256f8: 2a cf rjmp .-428 ; 0x2554e lcd_set_cursor(0, 3); 256fa: 63 e0 ldi r22, 0x03 ; 3 256fc: 80 e0 ldi r24, 0x00 ; 0 256fe: 0e 94 e7 6e call 0xddce ; 0xddce lcd_space(19); 25702: 83 e1 ldi r24, 0x13 ; 19 25704: 0e 94 dd 6e call 0xddba ; 0xddba lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 25708: 81 ee ldi r24, 0xE1 ; 225 2570a: 9d e4 ldi r25, 0x4D ; 77 2570c: 0e 94 b3 72 call 0xe566 ; 0xe566 25710: ac 01 movw r20, r24 25712: 63 e0 ldi r22, 0x03 ; 3 25714: 80 e0 ldi r24, 0x00 ; 0 25716: 0e 94 fb 6e call 0xddf6 ; 0xddf6 custom_message_state--; 2571a: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 2571e: 81 50 subi r24, 0x01 ; 1 25720: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 25724: 14 cf rjmp .-472 ; 0x2554e } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 25726: 64 e1 ldi r22, 0x14 ; 20 25728: 8f e1 ldi r24, 0x1F ; 31 2572a: 95 e0 ldi r25, 0x05 ; 5 2572c: 0e 94 d6 70 call 0xe1ac ; 0xe1ac if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 25730: 20 91 49 06 lds r18, 0x0649 ; 0x800649 25734: 30 91 4a 06 lds r19, 0x064A ; 0x80064a 25738: 80 91 47 06 lds r24, 0x0647 ; 0x800647 2573c: 90 91 48 06 lds r25, 0x0648 ; 0x800648 25740: 82 17 cp r24, r18 25742: 93 07 cpc r25, r19 25744: 0c f4 brge .+2 ; 0x25748 25746: 03 cf rjmp .-506 ; 0x2554e 25748: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 2574c: 88 23 and r24, r24 2574e: 09 f4 brne .+2 ; 0x25752 25750: fe ce rjmp .-516 ; 0x2554e lcd_set_cursor(10, 3); 25752: 63 e0 ldi r22, 0x03 ; 3 25754: 8a e0 ldi r24, 0x0A ; 10 25756: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 2575a: 80 91 48 06 lds r24, 0x0648 ; 0x800648 2575e: 8f 93 push r24 25760: 80 91 47 06 lds r24, 0x0647 ; 0x800647 25764: 8f 93 push r24 25766: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 2576a: 8f 93 push r24 2576c: 80 91 49 06 lds r24, 0x0649 ; 0x800649 25770: 8f 93 push r24 25772: 87 e7 ldi r24, 0x77 ; 119 25774: 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); 25776: 9f 93 push r25 25778: 8f 93 push r24 2577a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 2577e: 0f 90 pop r0 25780: 0f 90 pop r0 25782: 0f 90 pop r0 25784: 0f 90 pop r0 25786: 0f 90 pop r0 25788: 0f 90 pop r0 2578a: e1 ce rjmp .-574 ; 0x2554e 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); 2578c: 63 e0 ldi r22, 0x03 ; 3 2578e: 80 e0 ldi r24, 0x00 ; 0 25790: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 25794: c0 91 f7 03 lds r28, 0x03F7 ; 0x8003f7 25798: 81 e1 ldi r24, 0x11 ; 17 2579a: 95 e4 ldi r25, 0x45 ; 69 2579c: 0e 94 b3 72 call 0xe566 ; 0xe566 257a0: 1f 92 push r1 257a2: cf 93 push r28 257a4: 9f 93 push r25 257a6: 8f 93 push r24 257a8: 89 e6 ldi r24, 0x69 ; 105 257aa: 90 ea ldi r25, 0xA0 ; 160 257ac: e4 cf rjmp .-56 ; 0x25776 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 257ae: 81 ed ldi r24, 0xD1 ; 209 257b0: 9d e4 ldi r25, 0x4D ; 77 257b2: 0e 94 b3 72 call 0xe566 ; 0xe566 257b6: ac 01 movw r20, r24 257b8: 63 e0 ldi r22, 0x03 ; 3 257ba: 80 e0 ldi r24, 0x00 ; 0 257bc: 0e 94 fb 6e call 0xddf6 ; 0xddf6 if (custom_message_state <= PINDA_HEAT_T) { 257c0: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 257c4: 89 37 cpi r24, 0x79 ; 121 257c6: 08 f0 brcs .+2 ; 0x257ca 257c8: c2 ce rjmp .-636 ; 0x2554e lcd_puts_P(PSTR(": ")); 257ca: 86 e6 ldi r24, 0x66 ; 102 257cc: 90 ea ldi r25, 0xA0 ; 160 257ce: 0e 94 d2 6e call 0xdda4 ; 0xdda4 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 257d2: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 257d6: 0e 94 96 6f call 0xdf2c ; 0xdf2c } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 257da: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 257dc: cf 91 pop r28 257de: 1f 91 pop r17 257e0: 0f 91 pop r16 257e2: 0c 94 96 6f jmp 0xdf2c ; 0xdf2c lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 257e6: 80 ec ldi r24, 0xC0 ; 192 257e8: 9d e4 ldi r25, 0x4D ; 77 257ea: be ce rjmp .-644 ; 0x25568 000257ec ::start()>: /** * @brief Start timer */ template void Timer::start() 257ec: cf 93 push r28 257ee: df 93 push r29 257f0: ec 01 movw r28, r24 { m_started = _millis(); 257f2: 0f 94 53 29 call 0x252a6 ; 0x252a6 257f6: 69 83 std Y+1, r22 ; 0x01 257f8: 7a 83 std Y+2, r23 ; 0x02 257fa: 8b 83 std Y+3, r24 ; 0x03 257fc: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 257fe: 81 e0 ldi r24, 0x01 ; 1 25800: 88 83 st Y, r24 } 25802: df 91 pop r29 25804: cf 91 pop r28 25806: 08 95 ret 00025808 : //! 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) { 25808: cf 92 push r12 2580a: df 92 push r13 2580c: ff 92 push r15 2580e: 0f 93 push r16 25810: 1f 93 push r17 25812: cf 93 push r28 25814: df 93 push r29 25816: cd b7 in r28, 0x3d ; 61 25818: de b7 in r29, 0x3e ; 62 2581a: 64 97 sbiw r28, 0x14 ; 20 2581c: 0f b6 in r0, 0x3f ; 63 2581e: f8 94 cli 25820: de bf out 0x3e, r29 ; 62 25822: 0f be out 0x3f, r0 ; 63 25824: cd bf out 0x3d, r28 ; 61 25826: 8c 01 movw r16, r24 25828: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 2582a: 6a e7 ldi r22, 0x7A ; 122 2582c: 7e e9 ldi r23, 0x9E ; 158 2582e: ce 01 movw r24, r28 25830: 01 96 adiw r24, 0x01 ; 1 25832: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 strcat_P(msg, type); 25836: b8 01 movw r22, r16 25838: ce 01 movw r24, r28 2583a: 01 96 adiw r24, 0x01 ; 1 2583c: 0f 94 c6 d9 call 0x3b38c ; 0x3b38c lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 25840: 83 e0 ldi r24, 0x03 ; 3 25842: 0e 94 0e f1 call 0x1e21c ; 0x1e21c 25846: 88 23 and r24, r24 25848: e1 f0 breq .+56 ; 0x25882 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 2584a: be 01 movw r22, r28 2584c: 6f 5f subi r22, 0xFF ; 255 2584e: 7f 4f sbci r23, 0xFF ; 255 25850: 8f e1 ldi r24, 0x1F ; 31 25852: 95 e0 ldi r25, 0x05 ; 5 25854: 0f 94 85 e2 call 0x3c50a ; 0x3c50a 25858: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 2585a: 84 e3 ldi r24, 0x34 ; 52 2585c: 95 e0 ldi r25, 0x05 ; 5 2585e: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> lcd_status_message_level = severity; 25862: 83 e0 ldi r24, 0x03 ; 3 25864: 80 93 d5 03 sts 0x03D5, r24 ; 0x8003d5 <_ZL24lcd_status_message_level.lto_priv.451> custom_message_type = CustomMsg::Status; 25868: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 custom_message_state = 0; 2586c: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 if (!same) { 25870: cd 28 or r12, r13 25872: 39 f0 breq .+14 ; 0x25882 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 25874: 60 e0 ldi r22, 0x00 ; 0 25876: ce 01 movw r24, r28 25878: 01 96 adiw r24, 0x01 ; 1 2587a: 0e 94 f3 f0 call 0x1e1e6 ; 0x1e1e6 lcd_return_to_status(); 2587e: 0f 94 ad 1e call 0x23d5a ; 0x23d5a lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 25882: 88 ea ldi r24, 0xA8 ; 168 25884: 9b ea ldi r25, 0xAB ; 171 25886: 0e 94 57 77 call 0xeeae ; 0xeeae if(e != EXTRUDERS) { 2588a: 81 e0 ldi r24, 0x01 ; 1 2588c: f8 16 cp r15, r24 2588e: 49 f0 breq .+18 ; 0x258a2 25890: 60 e0 ldi r22, 0x00 ; 0 25892: 70 e0 ldi r23, 0x00 ; 0 25894: cb 01 movw r24, r22 25896: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 2589a: 87 e7 ldi r24, 0x77 ; 119 2589c: 9e e9 ldi r25, 0x9E ; 158 2589e: 0e 94 57 77 call 0xeeae ; 0xeeae } SERIAL_ERRORPGM("Heaters switched off. "); 258a2: 80 e6 ldi r24, 0x60 ; 96 258a4: 9e e9 ldi r25, 0x9E ; 158 258a6: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORRPGM(type); 258aa: c8 01 movw r24, r16 258ac: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORLNPGM(" triggered!"); 258b0: 84 e5 ldi r24, 0x54 ; 84 258b2: 9e e9 ldi r25, 0x9E ; 158 258b4: 0e 94 82 79 call 0xf304 ; 0xf304 } 258b8: 64 96 adiw r28, 0x14 ; 20 258ba: 0f b6 in r0, 0x3f ; 63 258bc: f8 94 cli 258be: de bf out 0x3e, r29 ; 62 258c0: 0f be out 0x3f, r0 ; 63 258c2: cd bf out 0x3d, r28 ; 61 258c4: df 91 pop r29 258c6: cf 91 pop r28 258c8: 1f 91 pop r17 258ca: 0f 91 pop r16 258cc: ff 90 pop r15 258ce: df 90 pop r13 258d0: cf 90 pop r12 258d2: 08 95 ret 000258d4 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 258d4: 1f 92 push r1 258d6: 0f 92 push r0 258d8: 0f b6 in r0, 0x3f ; 63 258da: 0f 92 push r0 258dc: 11 24 eor r1, r1 258de: 2f 93 push r18 258e0: 3f 93 push r19 258e2: 8f 93 push r24 258e4: 9f 93 push r25 258e6: af 93 push r26 258e8: 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; 258ea: 80 91 3b 06 lds r24, 0x063B ; 0x80063b 258ee: 90 91 3c 06 lds r25, 0x063C ; 0x80063c 258f2: a0 91 3d 06 lds r26, 0x063D ; 0x80063d 258f6: b0 91 3e 06 lds r27, 0x063E ; 0x80063e unsigned char f = timer2_fract; 258fa: 30 91 3a 06 lds r19, 0x063A ; 0x80063a m += MILLIS_INC; f += FRACT_INC; 258fe: 23 e0 ldi r18, 0x03 ; 3 25900: 23 0f add r18, r19 if (f >= FRACT_MAX) 25902: 2d 37 cpi r18, 0x7D ; 125 25904: 58 f5 brcc .+86 ; 0x2595c <__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; 25906: 01 96 adiw r24, 0x01 ; 1 25908: a1 1d adc r26, r1 2590a: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 2590c: 20 93 3a 06 sts 0x063A, r18 ; 0x80063a timer2_millis = m; 25910: 80 93 3b 06 sts 0x063B, r24 ; 0x80063b 25914: 90 93 3c 06 sts 0x063C, r25 ; 0x80063c 25918: a0 93 3d 06 sts 0x063D, r26 ; 0x80063d 2591c: b0 93 3e 06 sts 0x063E, r27 ; 0x80063e timer2_overflow_count++; 25920: 80 91 3f 06 lds r24, 0x063F ; 0x80063f 25924: 90 91 40 06 lds r25, 0x0640 ; 0x800640 25928: a0 91 41 06 lds r26, 0x0641 ; 0x800641 2592c: b0 91 42 06 lds r27, 0x0642 ; 0x800642 25930: 01 96 adiw r24, 0x01 ; 1 25932: a1 1d adc r26, r1 25934: b1 1d adc r27, r1 25936: 80 93 3f 06 sts 0x063F, r24 ; 0x80063f 2593a: 90 93 40 06 sts 0x0640, r25 ; 0x800640 2593e: a0 93 41 06 sts 0x0641, r26 ; 0x800641 25942: b0 93 42 06 sts 0x0642, r27 ; 0x800642 } 25946: bf 91 pop r27 25948: af 91 pop r26 2594a: 9f 91 pop r25 2594c: 8f 91 pop r24 2594e: 3f 91 pop r19 25950: 2f 91 pop r18 25952: 0f 90 pop r0 25954: 0f be out 0x3f, r0 ; 63 25956: 0f 90 pop r0 25958: 1f 90 pop r1 2595a: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 2595c: 26 e8 ldi r18, 0x86 ; 134 2595e: 23 0f add r18, r19 m += 1; 25960: 02 96 adiw r24, 0x02 ; 2 25962: a1 1d adc r26, r1 25964: b1 1d adc r27, r1 25966: d2 cf rjmp .-92 ; 0x2590c <__vector_15+0x38> 00025968 : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 25968: 2f 92 push r2 2596a: 3f 92 push r3 2596c: 4f 92 push r4 2596e: 5f 92 push r5 25970: 6f 92 push r6 25972: 7f 92 push r7 25974: 8f 92 push r8 25976: 9f 92 push r9 25978: af 92 push r10 2597a: bf 92 push r11 2597c: cf 92 push r12 2597e: df 92 push r13 25980: ef 92 push r14 25982: ff 92 push r15 25984: 0f 93 push r16 25986: 1f 93 push r17 25988: cf 93 push r28 2598a: df 93 push r29 2598c: 00 d0 rcall .+0 ; 0x2598e 2598e: 00 d0 rcall .+0 ; 0x25990 25990: 1f 92 push r1 25992: cd b7 in r28, 0x3d ; 61 25994: de b7 in r29, 0x3e ; 62 25996: 9c 83 std Y+4, r25 ; 0x04 25998: 8b 83 std Y+3, r24 ; 0x03 2599a: 0d 83 std Y+5, r16 ; 0x05 2599c: 26 01 movw r4, r12 2599e: 37 01 movw r6, r14 *var = v; 259a0: fb 01 movw r30, r22 259a2: 20 83 st Z, r18 259a4: 31 83 std Z+1, r19 ; 0x01 259a6: 42 83 std Z+2, r20 ; 0x02 259a8: 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); 259aa: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 259ae: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 259b2: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 259b6: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 259ba: 61 e7 ldi r22, 0x71 ; 113 259bc: 7d e3 ldi r23, 0x3D ; 61 259be: 8a e8 ldi r24, 0x8A ; 138 259c0: 9e e3 ldi r25, 0x3E ; 62 259c2: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 259c6: 60 93 3d 13 sts 0x133D, r22 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 259ca: 70 93 3e 13 sts 0x133E, r23 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 259ce: 80 93 3f 13 sts 0x133F, r24 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 259d2: 90 93 40 13 sts 0x1340, r25 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> warn_s = warn * TEMP_MGR_INTV; 259d6: 21 e7 ldi r18, 0x71 ; 113 259d8: 3d e3 ldi r19, 0x3D ; 61 259da: 4a e8 ldi r20, 0x8A ; 138 259dc: 5e e3 ldi r21, 0x3E ; 62 259de: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 259e2: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 259e6: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 259ea: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 259ee: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 259f2: 60 93 41 13 sts 0x1341, r22 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 259f6: 70 93 42 13 sts 0x1342, r23 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 259fa: 80 93 43 13 sts 0x1343, r24 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 259fe: 90 93 44 13 sts 0x1344, r25 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> err_s = err * TEMP_MGR_INTV; 25a02: 21 e7 ldi r18, 0x71 ; 113 25a04: 3d e3 ldi r19, 0x3D ; 61 25a06: 4a e8 ldi r20, 0x8A ; 138 25a08: 5e e3 ldi r21, 0x3E ; 62 25a0a: 60 91 38 13 lds r22, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 25a0e: 70 91 39 13 lds r23, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 25a12: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 25a16: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 25a1a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 25a1e: 60 93 45 13 sts 0x1345, r22 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 25a22: 70 93 46 13 sts 0x1346, r23 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 25a26: 80 93 47 13 sts 0x1347, r24 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 25a2a: 90 93 48 13 sts 0x1348, r25 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 25a2e: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25a32: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25a36: 6e e0 ldi r22, 0x0E ; 14 25a38: 71 e0 ldi r23, 0x01 ; 1 25a3a: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 25a3e: 60 93 d0 12 sts 0x12D0, r22 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 25a42: e0 eb ldi r30, 0xB0 ; 176 25a44: 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; 25a46: 80 e0 ldi r24, 0x00 ; 0 25a48: 90 e0 ldi r25, 0x00 ; 0 25a4a: a0 ec ldi r26, 0xC0 ; 192 25a4c: bf e7 ldi r27, 0x7F ; 127 25a4e: 81 93 st Z+, r24 25a50: 91 93 st Z+, r25 25a52: a1 93 st Z+, r26 25a54: 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) 25a56: 22 e1 ldi r18, 0x12 ; 18 25a58: e0 3d cpi r30, 0xD0 ; 208 25a5a: f2 07 cpc r31, r18 25a5c: c1 f7 brne .-16 ; 0x25a4e dT_lag_buf[i] = NAN; dT_lag_idx = 0; 25a5e: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> dT_err_prev = 0; 25a62: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 25a66: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 25a6a: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 25a6e: 10 92 d5 12 sts 0x12D5, r1 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> T_prev = NAN; 25a72: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 25a76: 90 93 d7 12 sts 0x12D7, r25 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 25a7a: a0 93 d8 12 sts 0x12D8, r26 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 25a7e: b0 93 d9 12 sts 0x12D9, r27 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> // clear the initialization flag flag_bits.uninitialized = false; 25a82: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 25a86: 8e 7f andi r24, 0xFE ; 254 25a88: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 25a8c: 85 ec ldi r24, 0xC5 ; 197 25a8e: 96 e0 ldi r25, 0x06 ; 6 25a90: 9f 83 std Y+7, r25 ; 0x07 25a92: 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) { 25a94: e1 e0 ldi r30, 0x01 ; 1 25a96: f0 e0 ldi r31, 0x00 ; 0 25a98: fa 83 std Y+2, r31 ; 0x02 25a9a: 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; 25a9c: 31 2c mov r3, r1 25a9e: 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; 25aa0: 81 2c mov r8, r1 25aa2: 91 2c mov r9, r1 25aa4: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 25aa6: 29 81 ldd r18, Y+1 ; 0x01 25aa8: 3a 81 ldd r19, Y+2 ; 0x02 25aaa: 8b 81 ldd r24, Y+3 ; 0x03 25aac: 9c 81 ldd r25, Y+4 ; 0x04 25aae: 28 17 cp r18, r24 25ab0: 39 07 cpc r19, r25 25ab2: c8 f5 brcc .+114 ; 0x25b26 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 25ab4: ee 81 ldd r30, Y+6 ; 0x06 25ab6: ff 81 ldd r31, Y+7 ; 0x07 25ab8: 25 81 ldd r18, Z+5 ; 0x05 25aba: 36 81 ldd r19, Z+6 ; 0x06 25abc: 47 81 ldd r20, Z+7 ; 0x07 25abe: 50 85 ldd r21, Z+8 ; 0x08 25ac0: 83 01 movw r16, r6 25ac2: 72 01 movw r14, r4 25ac4: 6d 81 ldd r22, Y+5 ; 0x05 25ac6: 81 85 ldd r24, Z+9 ; 0x09 25ac8: 0e 94 3a e5 call 0x1ca74 ; 0x1ca74 float err_v = thermal_model::data.dT_err_prev; 25acc: c0 90 d2 12 lds r12, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 25ad0: d0 90 d3 12 lds r13, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 25ad4: e0 90 d4 12 lds r14, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 25ad8: f0 90 d5 12 lds r15, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> if(!isnan(err_v)) { 25adc: a7 01 movw r20, r14 25ade: 96 01 movw r18, r12 25ae0: c7 01 movw r24, r14 25ae2: b6 01 movw r22, r12 25ae4: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 25ae8: 81 11 cpse r24, r1 25aea: 11 c0 rjmp .+34 ; 0x25b0e err += err_v * err_v; 25aec: a7 01 movw r20, r14 25aee: 96 01 movw r18, r12 25af0: c7 01 movw r24, r14 25af2: b6 01 movw r22, r12 25af4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 25af8: 9b 01 movw r18, r22 25afa: ac 01 movw r20, r24 25afc: c5 01 movw r24, r10 25afe: b4 01 movw r22, r8 25b00: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 25b04: 4b 01 movw r8, r22 25b06: 5c 01 movw r10, r24 ++cnt; 25b08: ff ef ldi r31, 0xFF ; 255 25b0a: 2f 1a sub r2, r31 25b0c: 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) { 25b0e: 29 81 ldd r18, Y+1 ; 0x01 25b10: 3a 81 ldd r19, Y+2 ; 0x02 25b12: 2f 5f subi r18, 0xFF ; 255 25b14: 3f 4f sbci r19, 0xFF ; 255 25b16: 3a 83 std Y+2, r19 ; 0x02 25b18: 29 83 std Y+1, r18 ; 0x01 25b1a: 8e 81 ldd r24, Y+6 ; 0x06 25b1c: 9f 81 ldd r25, Y+7 ; 0x07 25b1e: 05 96 adiw r24, 0x05 ; 5 25b20: 9f 83 std Y+7, r25 ; 0x07 25b22: 8e 83 std Y+6, r24 ; 0x06 25b24: c0 cf rjmp .-128 ; 0x25aa6 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 25b26: 60 e0 ldi r22, 0x00 ; 0 25b28: 70 e0 ldi r23, 0x00 ; 0 25b2a: 80 ec ldi r24, 0xC0 ; 192 25b2c: 9f e7 ldi r25, 0x7F ; 127 25b2e: 21 14 cp r2, r1 25b30: 31 04 cpc r3, r1 25b32: 59 f0 breq .+22 ; 0x25b4a 25b34: b1 01 movw r22, r2 25b36: 90 e0 ldi r25, 0x00 ; 0 25b38: 80 e0 ldi r24, 0x00 ; 0 25b3a: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 25b3e: 9b 01 movw r18, r22 25b40: ac 01 movw r20, r24 25b42: c5 01 movw r24, r10 25b44: b4 01 movw r22, r8 25b46: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> } 25b4a: 27 96 adiw r28, 0x07 ; 7 25b4c: 0f b6 in r0, 0x3f ; 63 25b4e: f8 94 cli 25b50: de bf out 0x3e, r29 ; 62 25b52: 0f be out 0x3f, r0 ; 63 25b54: cd bf out 0x3d, r28 ; 61 25b56: df 91 pop r29 25b58: cf 91 pop r28 25b5a: 1f 91 pop r17 25b5c: 0f 91 pop r16 25b5e: ff 90 pop r15 25b60: ef 90 pop r14 25b62: df 90 pop r13 25b64: cf 90 pop r12 25b66: bf 90 pop r11 25b68: af 90 pop r10 25b6a: 9f 90 pop r9 25b6c: 8f 90 pop r8 25b6e: 7f 90 pop r7 25b70: 6f 90 pop r6 25b72: 5f 90 pop r5 25b74: 4f 90 pop r4 25b76: 3f 90 pop r3 25b78: 2f 90 pop r2 25b7a: 08 95 ret 00025b7c : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 25b7c: cf 93 push r28 25b7e: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 25b80: 0e 94 e8 74 call 0xe9d0 ; 0xe9d0 fanSpeed = fan_speed; 25b84: c0 93 e7 03 sts 0x03E7, r28 ; 0x8003e7 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 25b88: c0 93 a6 04 sts 0x04A6, r28 ; 0x8004a6 #endif } 25b8c: cf 91 pop r28 25b8e: 08 95 ret 00025b90 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 25b90: cf 92 push r12 25b92: df 92 push r13 25b94: ef 92 push r14 25b96: ff 92 push r15 25b98: 0f 93 push r16 25b9a: 1f 93 push r17 25b9c: cf 93 push r28 25b9e: df 93 push r29 SERIAL_ECHO_START; 25ba0: 80 ed ldi r24, 0xD0 ; 208 25ba2: 9b ea ldi r25, 0xAB ; 171 25ba4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNPGM("Thermal Model settings:"); 25ba8: 8f e1 ldi r24, 0x1F ; 31 25baa: 9f e9 ldi r25, 0x9F ; 159 25bac: 0e 94 82 79 call 0xf304 ; 0xf304 25bb0: c0 ef ldi r28, 0xF0 ; 240 25bb2: d2 e1 ldi r29, 0x12 ; 18 25bb4: 10 e0 ldi r17, 0x00 ; 0 25bb6: 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]); 25bb8: 80 ed ldi r24, 0xD0 ; 208 25bba: e8 2e mov r14, r24 25bbc: 8b ea ldi r24, 0xAB ; 171 25bbe: f8 2e mov r15, r24 25bc0: 9b e0 ldi r25, 0x0B ; 11 25bc2: c9 2e mov r12, r25 25bc4: 9f e9 ldi r25, 0x9F ; 159 25bc6: d9 2e mov r13, r25 25bc8: 88 81 ld r24, Y 25bca: 99 81 ldd r25, Y+1 ; 0x01 25bcc: 2a 81 ldd r18, Y+2 ; 0x02 25bce: 3b 81 ldd r19, Y+3 ; 0x03 25bd0: 24 96 adiw r28, 0x04 ; 4 25bd2: 3f 93 push r19 25bd4: 2f 93 push r18 25bd6: 9f 93 push r25 25bd8: 8f 93 push r24 25bda: 1f 93 push r17 25bdc: 0f 93 push r16 25bde: ff 92 push r15 25be0: ef 92 push r14 25be2: df 92 push r13 25be4: cf 92 push r12 25be6: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 25bea: 0f 5f subi r16, 0xFF ; 255 25bec: 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) 25bee: 8d b7 in r24, 0x3d ; 61 25bf0: 9e b7 in r25, 0x3e ; 62 25bf2: 0a 96 adiw r24, 0x0a ; 10 25bf4: 0f b6 in r0, 0x3f ; 63 25bf6: f8 94 cli 25bf8: 9e bf out 0x3e, r25 ; 62 25bfa: 0f be out 0x3f, r0 ; 63 25bfc: 8d bf out 0x3d, r24 ; 61 25bfe: 00 31 cpi r16, 0x10 ; 16 25c00: 11 05 cpc r17, r1 25c02: 11 f7 brne .-60 ; 0x25bc8 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"), 25c04: 80 91 33 13 lds r24, 0x1333 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> 25c08: 8f 93 push r24 25c0a: 80 91 32 13 lds r24, 0x1332 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 25c0e: 8f 93 push r24 25c10: 80 91 31 13 lds r24, 0x1331 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 25c14: 8f 93 push r24 25c16: 80 91 30 13 lds r24, 0x1330 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 25c1a: 8f 93 push r24 25c1c: 80 91 37 13 lds r24, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 25c20: 8f 93 push r24 25c22: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 25c26: 8f 93 push r24 25c28: 80 91 35 13 lds r24, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 25c2c: 8f 93 push r24 25c2e: 80 91 34 13 lds r24, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 25c32: 8f 93 push r24 25c34: 80 91 3b 13 lds r24, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 25c38: 8f 93 push r24 25c3a: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 25c3e: 8f 93 push r24 25c40: 80 91 39 13 lds r24, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 25c44: 8f 93 push r24 25c46: 80 91 38 13 lds r24, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 25c4a: 8f 93 push r24 25c4c: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> 25c50: 1f 92 push r1 25c52: 8f 93 push r24 25c54: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 25c58: 1f 92 push r1 25c5a: 8f 93 push r24 25c5c: 80 91 ef 12 lds r24, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25c60: 8f 93 push r24 25c62: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25c66: 8f 93 push r24 25c68: 80 91 ed 12 lds r24, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> 25c6c: 8f 93 push r24 25c6e: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 25c72: 8f 93 push r24 25c74: 80 91 eb 12 lds r24, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 25c78: 8f 93 push r24 25c7a: 80 91 ea 12 lds r24, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 25c7e: 8f 93 push r24 25c80: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25c84: 8f 93 push r24 25c86: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25c8a: 8f 93 push r24 25c8c: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25c90: 8f 93 push r24 25c92: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 25c96: 8f 93 push r24 25c98: 80 91 e5 12 lds r24, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 25c9c: 8f 93 push r24 25c9e: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 25ca2: 8f 93 push r24 25ca4: 80 91 e3 12 lds r24, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 25ca8: 8f 93 push r24 25caa: 80 91 e2 12 lds r24, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 25cae: 8f 93 push r24 25cb0: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 25cb4: 8f 93 push r24 25cb6: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 25cba: 8f 93 push r24 25cbc: 80 91 df 12 lds r24, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 25cc0: 8f 93 push r24 25cc2: 80 91 de 12 lds r24, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 25cc6: 8f 93 push r24 25cc8: 80 91 dd 12 lds r24, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 25ccc: 8f 93 push r24 25cce: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 25cd2: 8f 93 push r24 25cd4: 80 91 db 12 lds r24, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 25cd8: 8f 93 push r24 25cda: 80 91 da 12 lds r24, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 25cde: 8f 93 push r24 25ce0: ff 92 push r15 25ce2: ef 92 push r14 25ce4: 85 ec ldi r24, 0xC5 ; 197 25ce6: 9e e9 ldi r25, 0x9E ; 158 25ce8: 9f 93 push r25 25cea: 8f 93 push r24 25cec: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 25cf0: 8d b7 in r24, 0x3d ; 61 25cf2: 9e b7 in r25, 0x3e ; 62 25cf4: 8a 96 adiw r24, 0x2a ; 42 25cf6: 0f b6 in r0, 0x3f ; 63 25cf8: f8 94 cli 25cfa: 9e bf out 0x3e, r25 ; 62 25cfc: 0f be out 0x3f, r0 ; 63 25cfe: 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); } 25d00: df 91 pop r29 25d02: cf 91 pop r28 25d04: 1f 91 pop r17 25d06: 0f 91 pop r16 25d08: ff 90 pop r15 25d0a: ef 90 pop r14 25d0c: df 90 pop r13 25d0e: cf 90 pop r12 25d10: 08 95 ret 00025d12 : // 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); 25d12: 89 57 subi r24, 0x79 ; 121 25d14: 9f 4f sbci r25, 0xFF ; 255 25d16: 6e e0 ldi r22, 0x0E ; 14 25d18: 71 e0 ldi r23, 0x01 ; 1 25d1a: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 25d1e: 61 15 cp r22, r1 25d20: 71 05 cpc r23, r1 25d22: 99 f0 breq .+38 ; 0x25d4a 25d24: 69 30 cpi r22, 0x09 ; 9 25d26: 71 05 cpc r23, r1 25d28: 10 f0 brcs .+4 ; 0x25d2e 25d2a: 68 e0 ldi r22, 0x08 ; 8 25d2c: 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; 25d2e: 2e e0 ldi r18, 0x0E ; 14 25d30: 31 e0 ldi r19, 0x01 ; 1 25d32: 62 9f mul r22, r18 25d34: c0 01 movw r24, r0 25d36: 63 9f mul r22, r19 25d38: 90 0d add r25, r0 25d3a: 72 9f mul r23, r18 25d3c: 90 0d add r25, r0 25d3e: 11 24 eor r1, r1 25d40: 90 93 ef 12 sts 0x12EF, r25 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25d44: 80 93 ee 12 sts 0x12EE, r24 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> } 25d48: 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; 25d4a: 61 e0 ldi r22, 0x01 ; 1 25d4c: 70 e0 ldi r23, 0x00 ; 0 25d4e: ef cf rjmp .-34 ; 0x25d2e 00025d50 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 25d50: cf 93 push r28 25d52: df 93 push r29 if(!(data.P > 0)) return false; 25d54: 20 e0 ldi r18, 0x00 ; 0 25d56: 30 e0 ldi r19, 0x00 ; 0 25d58: a9 01 movw r20, r18 25d5a: 60 91 da 12 lds r22, 0x12DA ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 25d5e: 70 91 db 12 lds r23, 0x12DB ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 25d62: 80 91 dc 12 lds r24, 0x12DC ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 25d66: 90 91 dd 12 lds r25, 0x12DD ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> 25d6a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 25d6e: 18 16 cp r1, r24 25d70: 0c f0 brlt .+2 ; 0x25d74 25d72: 54 c0 rjmp .+168 ; 0x25e1c if(isnan(data.U)) return false; 25d74: 60 91 de 12 lds r22, 0x12DE ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 25d78: 70 91 df 12 lds r23, 0x12DF ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 25d7c: 80 91 e0 12 lds r24, 0x12E0 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 25d80: 90 91 e1 12 lds r25, 0x12E1 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> 25d84: 9b 01 movw r18, r22 25d86: ac 01 movw r20, r24 25d88: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 25d8c: 81 11 cpse r24, r1 25d8e: 46 c0 rjmp .+140 ; 0x25e1c if(isnan(data.V)) return false; 25d90: 60 91 e2 12 lds r22, 0x12E2 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 25d94: 70 91 e3 12 lds r23, 0x12E3 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 25d98: 80 91 e4 12 lds r24, 0x12E4 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 25d9c: 90 91 e5 12 lds r25, 0x12E5 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> 25da0: 9b 01 movw r18, r22 25da2: ac 01 movw r20, r24 25da4: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 25da8: 81 11 cpse r24, r1 25daa: 38 c0 rjmp .+112 ; 0x25e1c if(!(data.C > 0)) return false; 25dac: 20 e0 ldi r18, 0x00 ; 0 25dae: 30 e0 ldi r19, 0x00 ; 0 25db0: a9 01 movw r20, r18 25db2: 60 91 e6 12 lds r22, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 25db6: 70 91 e7 12 lds r23, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 25dba: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 25dbe: 90 91 e9 12 lds r25, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 25dc2: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 25dc6: 18 16 cp r1, r24 25dc8: 4c f5 brge .+82 ; 0x25e1c if(isnan(data.fS)) return false; 25dca: 60 91 ea 12 lds r22, 0x12EA ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 25dce: 70 91 eb 12 lds r23, 0x12EB ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 25dd2: 80 91 ec 12 lds r24, 0x12EC ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 25dd6: 90 91 ed 12 lds r25, 0x12ED ; 0x8012ed <_ZN13thermal_modelL4dataE.lto_priv.400+0x3d> 25dda: 9b 01 movw r18, r22 25ddc: ac 01 movw r20, r24 25dde: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 25de2: 81 11 cpse r24, r1 25de4: 1b c0 rjmp .+54 ; 0x25e1c if(!(data.L > 0)) return false; 25de6: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 25dea: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 25dee: 89 2b or r24, r25 25df0: a9 f0 breq .+42 ; 0x25e1c 25df2: c0 ef ldi r28, 0xF0 ; 240 25df4: 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)) 25df6: 69 91 ld r22, Y+ 25df8: 79 91 ld r23, Y+ 25dfa: 89 91 ld r24, Y+ 25dfc: 99 91 ld r25, Y+ 25dfe: 20 e0 ldi r18, 0x00 ; 0 25e00: 30 e0 ldi r19, 0x00 ; 0 25e02: a9 01 movw r20, r18 25e04: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 25e08: 87 fd sbrc r24, 7 25e0a: 08 c0 rjmp .+16 ; 0x25e1c 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) { 25e0c: 83 e1 ldi r24, 0x13 ; 19 25e0e: c0 33 cpi r28, 0x30 ; 48 25e10: d8 07 cpc r29, r24 25e12: 89 f7 brne .-30 ; 0x25df6 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 25e14: 81 e0 ldi r24, 0x01 ; 1 } 25e16: df 91 pop r29 25e18: cf 91 pop r28 25e1a: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 25e1c: 80 e0 ldi r24, 0x00 ; 0 25e1e: fb cf rjmp .-10 ; 0x25e16 00025e20 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 25e20: 0f 94 a8 2e call 0x25d50 ; 0x25d50 25e24: 81 11 cpse r24, r1 25e26: 02 c0 rjmp .+4 ; 0x25e2c 25e28: 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 25e2c: 81 e0 ldi r24, 0x01 ; 1 25e2e: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 25e32: 80 91 39 06 lds r24, 0x0639 ; 0x800639 25e36: 8d 7f andi r24, 0xFD ; 253 25e38: 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(); } 25e3c: 08 95 ret 00025e3e : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 25e3e: 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; 25e40: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 25e44: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 25e48: 10 92 73 06 sts 0x0673, r1 ; 0x800673 25e4c: 10 92 72 06 sts 0x0672, r1 ; 0x800672 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 25e50: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 25e52: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 25e54: 0f 94 9a 13 call 0x22734 ; 0x22734 temp_mgr_pid(); 25e58: 0f 94 d7 10 call 0x221ae ; 0x221ae // 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); 25e5c: 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; 25e5e: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 25e62: cf bf out 0x3f, r28 ; 63 #endif } } 25e64: cf 91 pop r28 25e66: 08 95 ret 00025e68 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 25e68: 0f 94 1f 2f call 0x25e3e ; 0x25e3e fanSpeed = 0; 25e6c: 10 92 e7 03 sts 0x03E7, r1 ; 0x8003e7 lcd_return_to_status(); 25e70: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 00025e74 : // 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) { 25e74: 1f 93 push r17 25e76: cf 93 push r28 25e78: df 93 push r29 25e7a: c8 2f mov r28, r24 25e7c: 16 2f mov r17, r22 25e7e: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 25e80: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25e84: 80 fd sbrc r24, 0 25e86: 18 c0 rjmp .+48 ; 0x25eb8 25e88: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 25e8c: 81 11 cpse r24, r1 25e8e: 14 c0 rjmp .+40 ; 0x25eb8 saved_bed_temperature = target_temperature_bed; 25e90: 80 91 72 06 lds r24, 0x0672 ; 0x800672 25e94: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_temperature = target_temperature[index]; 25e98: e6 2f mov r30, r22 25e9a: f0 e0 ldi r31, 0x00 ; 0 25e9c: ee 0f add r30, r30 25e9e: ff 1f adc r31, r31 25ea0: ea 54 subi r30, 0x4A ; 74 25ea2: f2 4f sbci r31, 0xF2 ; 242 25ea4: 80 81 ld r24, Z 25ea6: 91 81 ldd r25, Z+1 ; 0x01 25ea8: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 25eac: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_fan_speed = fanSpeed; 25eb0: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 25eb4: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 25eb8: 0f 94 1f 2f call 0x25e3e ; 0x25e3e void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 25ebc: 0e 94 e8 74 call 0xe9d0 ; 0xe9d0 setExtruderAutoFanState(3); 25ec0: 83 e0 ldi r24, 0x03 ; 3 25ec2: 0e 94 62 75 call 0xeac4 ; 0xeac4 SET_OUTPUT(FAN_PIN); 25ec6: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 25eca: 88 60 ori r24, 0x08 ; 8 25ecc: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 25ed0: 8f ef ldi r24, 0xFF ; 255 25ed2: 80 93 a6 04 sts 0x04A6, r24 ; 0x8004a6 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 25ed6: 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) { 25eda: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25ede: 80 ff sbrs r24, 0 25ee0: 07 c0 rjmp .+14 ; 0x25ef0 25ee2: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25ee6: 82 95 swap r24 25ee8: 86 95 lsr r24 25eea: 87 70 andi r24, 0x07 ; 7 25eec: d8 17 cp r29, r24 25eee: c0 f4 brcc .+48 ; 0x25f20 temp_error_state.source = (uint8_t)source; 25ef0: c3 70 andi r28, 0x03 ; 3 25ef2: cc 0f add r28, r28 25ef4: cc 0f add r28, r28 25ef6: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25efa: 83 7f andi r24, 0xF3 ; 243 25efc: 8c 2b or r24, r28 25efe: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> temp_error_state.index = index; 25f02: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f06: 10 fb bst r17, 0 25f08: 84 f9 bld r24, 4 25f0a: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> temp_error_state.type = (uint8_t)type; 25f0e: d2 95 swap r29 25f10: dd 0f add r29, r29 25f12: d0 7e andi r29, 0xE0 ; 224 25f14: 40 91 1b 05 lds r20, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f18: 4f 71 andi r20, 0x1F ; 31 25f1a: 4d 2b or r20, r29 25f1c: 40 93 1b 05 sts 0x051B, r20 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> } // always set the error state temp_error_state.error = true; 25f20: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f24: 81 60 ori r24, 0x01 ; 1 25f26: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> temp_error_state.assert = true; 25f2a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 25f2e: 82 60 ori r24, 0x02 ; 2 25f30: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> } 25f34: df 91 pop r29 25f36: cf 91 pop r28 25f38: 1f 91 pop r17 25f3a: 08 95 ret 00025f3c : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 25f3c: 20 91 09 06 lds r18, 0x0609 ; 0x800609 25f40: 30 91 0a 06 lds r19, 0x060A ; 0x80060a 25f44: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.471> 25f48: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.471+0x1> 25f4c: 28 17 cp r18, r24 25f4e: 39 07 cpc r19, r25 25f50: 2c f0 brlt .+10 ; 0x25f5c #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 25f52: 41 e0 ldi r20, 0x01 ; 1 25f54: 60 e0 ldi r22, 0x00 ; 0 25f56: 81 e0 ldi r24, 0x01 ; 1 25f58: 0d 94 3a 2f jmp 0x25e74 ; 0x25e74 } } 25f5c: 08 95 ret 00025f5e : 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]) { 25f5e: 20 91 0b 06 lds r18, 0x060B ; 0x80060b 25f62: 30 91 0c 06 lds r19, 0x060C ; 0x80060c 25f66: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.472> 25f6a: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.472+0x1> 25f6e: 28 17 cp r18, r24 25f70: 39 07 cpc r19, r25 25f72: 2c f0 brlt .+10 ; 0x25f7e #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 25f74: 41 e0 ldi r20, 0x01 ; 1 25f76: 60 e0 ldi r22, 0x00 ; 0 25f78: 80 e0 ldi r24, 0x00 ; 0 25f7a: 0d 94 3a 2f jmp 0x25e74 ; 0x25e74 } } 25f7e: 08 95 ret 00025f80 : 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) { 25f80: 2f 92 push r2 25f82: 3f 92 push r3 25f84: 4f 92 push r4 25f86: 5f 92 push r5 25f88: 6f 92 push r6 25f8a: 7f 92 push r7 25f8c: 8f 92 push r8 25f8e: 9f 92 push r9 25f90: af 92 push r10 25f92: bf 92 push r11 25f94: cf 92 push r12 25f96: df 92 push r13 25f98: ef 92 push r14 25f9a: ff 92 push r15 25f9c: 0f 93 push r16 25f9e: 1f 93 push r17 25fa0: cf 93 push r28 25fa2: df 93 push r29 25fa4: cd b7 in r28, 0x3d ; 61 25fa6: de b7 in r29, 0x3e ; 62 25fa8: 2c 97 sbiw r28, 0x0c ; 12 25faa: 0f b6 in r0, 0x3f ; 63 25fac: f8 94 cli 25fae: de bf out 0x3e, r29 ; 62 25fb0: 0f be out 0x3f, r0 ; 63 25fb2: cd bf out 0x3d, r28 ; 61 25fb4: 28 2e mov r2, r24 25fb6: 49 83 std Y+1, r20 ; 0x01 25fb8: 5a 83 std Y+2, r21 ; 0x02 25fba: 6b 83 std Y+3, r22 ; 0x03 25fbc: 7c 83 std Y+4, r23 ; 0x04 25fbe: 28 01 movw r4, r16 25fc0: 39 01 movw r6, r18 25fc2: 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) 25fc4: 0f 94 53 29 call 0x252a6 ; 0x252a6 25fc8: 02 2d mov r16, r2 25fca: 10 e0 ldi r17, 0x00 ; 0 25fcc: 98 01 movw r18, r16 25fce: 22 0f add r18, r18 25fd0: 33 1f adc r19, r19 25fd2: 22 0f add r18, r18 25fd4: 33 1f adc r19, r19 25fd6: 3c 87 std Y+12, r19 ; 0x0c 25fd8: 2b 87 std Y+11, r18 ; 0x0b 25fda: f9 01 movw r30, r18 25fdc: e7 53 subi r30, 0x37 ; 55 25fde: fa 4f sbci r31, 0xFA ; 250 25fe0: 80 80 ld r8, Z 25fe2: 91 80 ldd r9, Z+1 ; 0x01 25fe4: a2 80 ldd r10, Z+2 ; 0x02 25fe6: b3 80 ldd r11, Z+3 ; 0x03 25fe8: 68 19 sub r22, r8 25fea: 79 09 sbc r23, r9 25fec: 8a 09 sbc r24, r10 25fee: 9b 09 sbc r25, r11 25ff0: 61 3d cpi r22, 0xD1 ; 209 25ff2: 77 40 sbci r23, 0x07 ; 7 25ff4: 81 05 cpc r24, r1 25ff6: 91 05 cpc r25, r1 25ff8: 08 f4 brcc .+2 ; 0x25ffc 25ffa: ea c0 rjmp .+468 ; 0x261d0 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 25ffc: 33 20 and r3, r3 25ffe: 09 f4 brne .+2 ; 0x26002 26000: 75 c0 rjmp .+234 ; 0x260ec { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 26002: 88 e6 ldi r24, 0x68 ; 104 26004: 91 e0 ldi r25, 0x01 ; 1 26006: 9a 87 std Y+10, r25 ; 0x0a 26008: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 2600a: 80 e0 ldi r24, 0x00 ; 0 2600c: 90 e0 ldi r25, 0x00 ; 0 2600e: a0 ea ldi r26, 0xA0 ; 160 26010: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 26012: 8d 83 std Y+5, r24 ; 0x05 26014: 9e 83 std Y+6, r25 ; 0x06 26016: af 83 std Y+7, r26 ; 0x07 26018: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 2601a: 0f 94 53 29 call 0x252a6 ; 0x252a6 2601e: eb 85 ldd r30, Y+11 ; 0x0b 26020: fc 85 ldd r31, Y+12 ; 0x0c 26022: e7 53 subi r30, 0x37 ; 55 26024: fa 4f sbci r31, 0xFA ; 250 26026: 60 83 st Z, r22 26028: 71 83 std Z+1, r23 ; 0x01 2602a: 82 83 std Z+2, r24 ; 0x02 2602c: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 2602e: 20 e0 ldi r18, 0x00 ; 0 26030: 30 e0 ldi r19, 0x00 ; 0 26032: a9 01 movw r20, r18 26034: c7 01 movw r24, r14 26036: b6 01 movw r22, r12 26038: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2603c: 81 11 cpse r24, r1 2603e: 07 c0 rjmp .+14 ; 0x2604e { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26040: f8 01 movw r30, r16 26042: ee 0f add r30, r30 26044: ff 1f adc r31, r31 26046: eb 53 subi r30, 0x3B ; 59 26048: fa 4f sbci r31, 0xFA ; 250 2604a: 11 82 std Z+1, r1 ; 0x01 2604c: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 2604e: ab 85 ldd r26, Y+11 ; 0x0b 26050: bc 85 ldd r27, Y+12 ; 0x0c 26052: a3 54 subi r26, 0x43 ; 67 26054: ba 4f sbci r27, 0xFA ; 250 26056: 5d 01 movw r10, r26 26058: 29 81 ldd r18, Y+1 ; 0x01 2605a: 3a 81 ldd r19, Y+2 ; 0x02 2605c: 4b 81 ldd r20, Y+3 ; 0x03 2605e: 5c 81 ldd r21, Y+4 ; 0x04 26060: 6d 91 ld r22, X+ 26062: 7d 91 ld r23, X+ 26064: 8d 91 ld r24, X+ 26066: 9c 91 ld r25, X 26068: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2606c: 88 23 and r24, r24 2606e: 09 f4 brne .+2 ; 0x26072 26070: 91 c0 rjmp .+290 ; 0x26194 { if (_target_temperature > 0) 26072: 20 e0 ldi r18, 0x00 ; 0 26074: 30 e0 ldi r19, 0x00 ; 0 26076: a9 01 movw r20, r18 26078: 69 81 ldd r22, Y+1 ; 0x01 2607a: 7a 81 ldd r23, Y+2 ; 0x02 2607c: 8b 81 ldd r24, Y+3 ; 0x03 2607e: 9c 81 ldd r25, Y+4 ; 0x04 26080: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 26084: f8 01 movw r30, r16 26086: e5 54 subi r30, 0x45 ; 69 26088: fa 4f sbci r31, 0xFA ; 250 2608a: 18 16 cp r1, r24 2608c: c4 f5 brge .+112 ; 0x260fe { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 2608e: 81 e0 ldi r24, 0x01 ; 1 26090: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 26092: 89 81 ldd r24, Y+1 ; 0x01 26094: 9a 81 ldd r25, Y+2 ; 0x02 26096: ab 81 ldd r26, Y+3 ; 0x03 26098: bc 81 ldd r27, Y+4 ; 0x04 2609a: f5 01 movw r30, r10 2609c: 80 83 st Z, r24 2609e: 91 83 std Z+1, r25 ; 0x01 260a0: a2 83 std Z+2, r26 ; 0x02 260a2: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 260a4: eb 85 ldd r30, Y+11 ; 0x0b 260a6: fc 85 ldd r31, Y+12 ; 0x0c 260a8: ed 54 subi r30, 0x4D ; 77 260aa: fa 4f sbci r31, 0xFA ; 250 260ac: 40 82 st Z, r4 260ae: 51 82 std Z+1, r5 ; 0x01 260b0: 62 82 std Z+2, r6 ; 0x02 260b2: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 260b4: f8 01 movw r30, r16 260b6: ef 54 subi r30, 0x4F ; 79 260b8: fa 4f sbci r31, 0xFA ; 250 260ba: 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)) 260bc: a3 01 movw r20, r6 260be: 92 01 movw r18, r4 260c0: bc 01 movw r22, r24 260c2: cd 01 movw r24, r26 260c4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 260c8: 18 16 cp r1, r24 260ca: 1c f5 brge .+70 ; 0x26112 { __preheat_counter[_heater_id]++; 260cc: f8 01 movw r30, r16 260ce: ef 54 subi r30, 0x4F ; 79 260d0: fa 4f sbci r31, 0xFA ; 250 260d2: 80 81 ld r24, Z 260d4: 8f 5f subi r24, 0xFF ; 255 260d6: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 260d8: 31 10 cpse r3, r1 260da: c7 c0 rjmp .+398 ; 0x2626a 260dc: 89 30 cpi r24, 0x09 ; 9 260de: c8 f0 brcs .+50 ; 0x26112 { __delta=2.0; 260e0: 81 2c mov r8, r1 260e2: 91 2c mov r9, r1 260e4: a1 2c mov r10, r1 260e6: 50 e4 ldi r21, 0x40 ; 64 260e8: b5 2e mov r11, r21 260ea: e8 c0 rjmp .+464 ; 0x262bc #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 260ec: ad e2 ldi r26, 0x2D ; 45 260ee: b0 e0 ldi r27, 0x00 ; 0 260f0: ba 87 std Y+10, r27 ; 0x0a 260f2: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 260f4: 80 e0 ldi r24, 0x00 ; 0 260f6: 90 e0 ldi r25, 0x00 ; 0 260f8: a0 e7 ldi r26, 0x70 ; 112 260fa: b1 e4 ldi r27, 0x41 ; 65 260fc: 8a cf rjmp .-236 ; 0x26012 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 260fe: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 26100: 89 81 ldd r24, Y+1 ; 0x01 26102: 9a 81 ldd r25, Y+2 ; 0x02 26104: ab 81 ldd r26, Y+3 ; 0x03 26106: bc 81 ldd r27, Y+4 ; 0x04 26108: f5 01 movw r30, r10 2610a: 80 83 st Z, r24 2610c: 91 83 std Z+1, r25 ; 0x01 2610e: a2 83 std Z+2, r26 ; 0x02 26110: 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) 26112: 2d 81 ldd r18, Y+5 ; 0x05 26114: 3e 81 ldd r19, Y+6 ; 0x06 26116: 4f 81 ldd r20, Y+7 ; 0x07 26118: 58 85 ldd r21, Y+8 ; 0x08 2611a: 69 81 ldd r22, Y+1 ; 0x01 2611c: 7a 81 ldd r23, Y+2 ; 0x02 2611e: 8b 81 ldd r24, Y+3 ; 0x03 26120: 9c 81 ldd r25, Y+4 ; 0x04 26122: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 26126: a3 01 movw r20, r6 26128: 92 01 movw r18, r4 2612a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2612e: 87 ff sbrs r24, 7 26130: 46 c0 rjmp .+140 ; 0x261be 26132: f8 01 movw r30, r16 26134: e5 54 subi r30, 0x45 ; 69 26136: fa 4f sbci r31, 0xFA ; 250 26138: 80 81 ld r24, Z 2613a: 81 30 cpi r24, 0x01 ; 1 2613c: 49 f4 brne .+18 ; 0x26150 { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 2613e: 82 e0 ldi r24, 0x02 ; 2 26140: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26142: f8 01 movw r30, r16 26144: ee 0f add r30, r30 26146: ff 1f adc r31, r31 26148: eb 53 subi r30, 0x3B ; 59 2614a: fa 4f sbci r31, 0xFA ; 250 2614c: 11 82 std Z+1, r1 ; 0x01 2614e: 10 82 st Z, r1 } if (_output > 0) 26150: 20 e0 ldi r18, 0x00 ; 0 26152: 30 e0 ldi r19, 0x00 ; 0 26154: a9 01 movw r20, r18 26156: c7 01 movw r24, r14 26158: b6 01 movw r22, r12 2615a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2615e: 18 16 cp r1, r24 26160: bc f5 brge .+110 ; 0x261d0 if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 26162: 29 81 ldd r18, Y+1 ; 0x01 26164: 3a 81 ldd r19, Y+2 ; 0x02 26166: 4b 81 ldd r20, Y+3 ; 0x03 26168: 5c 81 ldd r21, Y+4 ; 0x04 2616a: 6d 81 ldd r22, Y+5 ; 0x05 2616c: 7e 81 ldd r23, Y+6 ; 0x06 2616e: 8f 81 ldd r24, Y+7 ; 0x07 26170: 98 85 ldd r25, Y+8 ; 0x08 26172: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 26176: a3 01 movw r20, r6 26178: 92 01 movw r18, r4 2617a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2617e: 18 16 cp r1, r24 26180: 0c f0 brlt .+2 ; 0x26184 26182: 3f c0 rjmp .+126 ; 0x26202 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 26184: 00 0f add r16, r16 26186: 11 1f adc r17, r17 26188: f8 01 movw r30, r16 2618a: eb 53 subi r30, 0x3B ; 59 2618c: fa 4f sbci r31, 0xFA ; 250 2618e: 11 82 std Z+1, r1 ; 0x01 26190: 10 82 st Z, r1 26192: 1e c0 rjmp .+60 ; 0x261d0 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)) 26194: a3 01 movw r20, r6 26196: 92 01 movw r18, r4 26198: 69 81 ldd r22, Y+1 ; 0x01 2619a: 7a 81 ldd r23, Y+2 ; 0x02 2619c: 8b 81 ldd r24, Y+3 ; 0x03 2619e: 9c 81 ldd r25, Y+4 ; 0x04 261a0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 261a4: 18 16 cp r1, r24 261a6: 0c f0 brlt .+2 ; 0x261aa 261a8: b4 cf rjmp .-152 ; 0x26112 261aa: f8 01 movw r30, r16 261ac: e5 54 subi r30, 0x45 ; 69 261ae: fa 4f sbci r31, 0xFA ; 250 261b0: 80 81 ld r24, Z 261b2: 81 30 cpi r24, 0x01 ; 1 261b4: 09 f0 breq .+2 ; 0x261b8 261b6: ad cf rjmp .-166 ; 0x26112 261b8: 89 cf rjmp .-238 ; 0x260cc 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; 261ba: 10 82 st Z, r1 261bc: 97 c0 rjmp .+302 ; 0x262ec temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 261be: 20 e0 ldi r18, 0x00 ; 0 261c0: 30 e0 ldi r19, 0x00 ; 0 261c2: a9 01 movw r20, r18 261c4: c7 01 movw r24, r14 261c6: b6 01 movw r22, r12 261c8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 261cc: 18 16 cp r1, r24 261ce: cc f0 brlt .+50 ; 0x26202 } } } } } 261d0: 2c 96 adiw r28, 0x0c ; 12 261d2: 0f b6 in r0, 0x3f ; 63 261d4: f8 94 cli 261d6: de bf out 0x3e, r29 ; 62 261d8: 0f be out 0x3f, r0 ; 63 261da: cd bf out 0x3d, r28 ; 61 261dc: df 91 pop r29 261de: cf 91 pop r28 261e0: 1f 91 pop r17 261e2: 0f 91 pop r16 261e4: ff 90 pop r15 261e6: ef 90 pop r14 261e8: df 90 pop r13 261ea: cf 90 pop r12 261ec: bf 90 pop r11 261ee: af 90 pop r10 261f0: 9f 90 pop r9 261f2: 8f 90 pop r8 261f4: 7f 90 pop r7 261f6: 6f 90 pop r6 261f8: 5f 90 pop r5 261fa: 4f 90 pop r4 261fc: 3f 90 pop r3 261fe: 2f 90 pop r2 26200: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 26202: f8 01 movw r30, r16 26204: e5 54 subi r30, 0x45 ; 69 26206: fa 4f sbci r31, 0xFA ; 250 26208: 80 81 ld r24, Z 2620a: 82 30 cpi r24, 0x02 ; 2 2620c: 08 f3 brcs .-62 ; 0x261d0 { temp_runaway_error_counter[_heater_id]++; 2620e: 00 0f add r16, r16 26210: 11 1f adc r17, r17 26212: f8 01 movw r30, r16 26214: eb 53 subi r30, 0x3B ; 59 26216: fa 4f sbci r31, 0xFA ; 250 26218: 80 81 ld r24, Z 2621a: 91 81 ldd r25, Z+1 ; 0x01 2621c: 01 96 adiw r24, 0x01 ; 1 2621e: 91 83 std Z+1, r25 ; 0x01 26220: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 26222: 88 0f add r24, r24 26224: 99 1f adc r25, r25 26226: e9 85 ldd r30, Y+9 ; 0x09 26228: fa 85 ldd r31, Y+10 ; 0x0a 2622a: e8 17 cp r30, r24 2622c: f9 07 cpc r31, r25 2622e: 80 f6 brcc .-96 ; 0x261d0 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 26230: 43 e0 ldi r20, 0x03 ; 3 26232: 62 2d mov r22, r2 26234: 83 2d mov r24, r3 } } } } } 26236: 2c 96 adiw r28, 0x0c ; 12 26238: 0f b6 in r0, 0x3f ; 63 2623a: f8 94 cli 2623c: de bf out 0x3e, r29 ; 62 2623e: 0f be out 0x3f, r0 ; 63 26240: cd bf out 0x3d, r28 ; 61 26242: df 91 pop r29 26244: cf 91 pop r28 26246: 1f 91 pop r17 26248: 0f 91 pop r16 2624a: ff 90 pop r15 2624c: ef 90 pop r14 2624e: df 90 pop r13 26250: cf 90 pop r12 26252: bf 90 pop r11 26254: af 90 pop r10 26256: 9f 90 pop r9 26258: 8f 90 pop r8 2625a: 7f 90 pop r7 2625c: 6f 90 pop r6 2625e: 5f 90 pop r5 26260: 4f 90 pop r4 26262: 3f 90 pop r3 26264: 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); 26266: 0d 94 3a 2f jmp 0x25e74 ; 0x25e74 } 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 2626a: 81 31 cpi r24, 0x11 ; 17 2626c: 08 f4 brcc .+2 ; 0x26270 2626e: 51 cf rjmp .-350 ; 0x26112 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 26270: 20 e0 ldi r18, 0x00 ; 0 26272: 30 e0 ldi r19, 0x00 ; 0 26274: 44 eb ldi r20, 0xB4 ; 180 26276: 52 e4 ldi r21, 0x42 ; 66 26278: c3 01 movw r24, r6 2627a: b2 01 movw r22, r4 2627c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 26280: 81 2c mov r8, r1 26282: 91 2c mov r9, r1 26284: e0 e4 ldi r30, 0x40 ; 64 26286: ae 2e mov r10, r30 26288: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 2628a: 18 16 cp r1, r24 2628c: 2c f4 brge .+10 ; 0x26298 2628e: 81 2c mov r8, r1 26290: 91 2c mov r9, r1 26292: a1 2c mov r10, r1 26294: 70 e4 ldi r23, 0x40 ; 64 26296: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 26298: 20 e0 ldi r18, 0x00 ; 0 2629a: 30 e0 ldi r19, 0x00 ; 0 2629c: 42 ed ldi r20, 0xD2 ; 210 2629e: 52 e4 ldi r21, 0x42 ; 66 262a0: c3 01 movw r24, r6 262a2: b2 01 movw r22, r4 262a4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 262a8: 18 16 cp r1, r24 262aa: 44 f4 brge .+16 ; 0x262bc 262ac: 6a e9 ldi r22, 0x9A ; 154 262ae: 86 2e mov r8, r22 262b0: 69 e9 ldi r22, 0x99 ; 153 262b2: 96 2e mov r9, r22 262b4: 69 e1 ldi r22, 0x19 ; 25 262b6: a6 2e mov r10, r22 262b8: 6f e3 ldi r22, 0x3F ; 63 262ba: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 262bc: eb 85 ldd r30, Y+11 ; 0x0b 262be: fc 85 ldd r31, Y+12 ; 0x0c 262c0: ed 54 subi r30, 0x4D ; 77 262c2: fa 4f sbci r31, 0xFA ; 250 262c4: 20 81 ld r18, Z 262c6: 31 81 ldd r19, Z+1 ; 0x01 262c8: 42 81 ldd r20, Z+2 ; 0x02 262ca: 53 81 ldd r21, Z+3 ; 0x03 262cc: c3 01 movw r24, r6 262ce: b2 01 movw r22, r4 262d0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 262d4: a5 01 movw r20, r10 262d6: 94 01 movw r18, r8 262d8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 262dc: f8 01 movw r30, r16 262de: e1 55 subi r30, 0x51 ; 81 262e0: fa 4f sbci r31, 0xFA ; 250 262e2: 87 ff sbrs r24, 7 262e4: 6a cf rjmp .-300 ; 0x261ba __preheat_errors[_heater_id]++; 262e6: 80 81 ld r24, Z 262e8: 8f 5f subi r24, 0xFF ; 255 262ea: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 262ec: 80 81 ld r24, Z 262ee: 90 e0 ldi r25, 0x00 ; 0 262f0: 31 10 cpse r3, r1 262f2: 04 c0 rjmp .+8 ; 0x262fc 262f4: 06 97 sbiw r24, 0x06 ; 6 262f6: 4c f0 brlt .+18 ; 0x2630a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 262f8: 80 e0 ldi r24, 0x00 ; 0 262fa: 03 c0 rjmp .+6 ; 0x26302 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 262fc: 04 97 sbiw r24, 0x04 ; 4 262fe: 2c f0 brlt .+10 ; 0x2630a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 26300: 81 e0 ldi r24, 0x01 ; 1 26302: 42 e0 ldi r20, 0x02 ; 2 26304: 62 2d mov r22, r2 26306: 0f 94 3a 2f call 0x25e74 ; 0x25e74 __preheat_start[_heater_id] = _current_temperature; 2630a: 2b 85 ldd r18, Y+11 ; 0x0b 2630c: 3c 85 ldd r19, Y+12 ; 0x0c 2630e: 2d 54 subi r18, 0x4D ; 77 26310: 3a 4f sbci r19, 0xFA ; 250 26312: d9 01 movw r26, r18 26314: 4d 92 st X+, r4 26316: 5d 92 st X+, r5 26318: 6d 92 st X+, r6 2631a: 7c 92 st X, r7 2631c: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 2631e: f8 01 movw r30, r16 26320: ef 54 subi r30, 0x4F ; 79 26322: fa 4f sbci r31, 0xFA ; 250 26324: 10 82 st Z, r1 26326: f5 ce rjmp .-534 ; 0x26112 00026328 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 26328: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2632a: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2632c: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 2632e: 80 81 ld r24, Z 26330: 88 23 and r24, r24 26332: 29 f0 breq .+10 ; 0x2633e 26334: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 26338: 82 60 ori r24, 0x02 ; 2 2633a: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2633e: 9f bf out 0x3f, r25 ; 63 } } 26340: 08 95 ret 00026342 : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 26342: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 26344: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26346: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 26348: e3 e7 ldi r30, 0x73 ; 115 2634a: f0 e0 ldi r31, 0x00 ; 0 2634c: 90 81 ld r25, Z 2634e: 96 95 lsr r25 26350: 91 70 andi r25, 0x01 ; 1 26352: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 26354: 80 81 ld r24, Z 26356: 8d 7f andi r24, 0xFD ; 253 26358: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2635a: 2f bf out 0x3f, r18 ; 63 } } 2635c: 08 95 ret 0002635e : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 2635e: cf 93 push r28 26360: df 93 push r29 26362: 1f 92 push r1 26364: cd b7 in r28, 0x3d ; 61 26366: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 26368: ce 01 movw r24, r28 2636a: 01 96 adiw r24, 0x01 ; 1 2636c: 0f 94 a1 31 call 0x26342 ; 0x26342 thermal_model::data.P = THERMAL_MODEL_DEF(P); 26370: 80 e0 ldi r24, 0x00 ; 0 26372: 90 e0 ldi r25, 0x00 ; 0 26374: a0 e7 ldi r26, 0x70 ; 112 26376: b2 e4 ldi r27, 0x42 ; 66 26378: 80 93 da 12 sts 0x12DA, r24 ; 0x8012da <_ZN13thermal_modelL4dataE.lto_priv.400+0x2a> 2637c: 90 93 db 12 sts 0x12DB, r25 ; 0x8012db <_ZN13thermal_modelL4dataE.lto_priv.400+0x2b> 26380: a0 93 dc 12 sts 0x12DC, r26 ; 0x8012dc <_ZN13thermal_modelL4dataE.lto_priv.400+0x2c> 26384: b0 93 dd 12 sts 0x12DD, r27 ; 0x8012dd <_ZN13thermal_modelL4dataE.lto_priv.400+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 26388: 84 e3 ldi r24, 0x34 ; 52 2638a: 90 e8 ldi r25, 0x80 ; 128 2638c: a7 eb ldi r26, 0xB7 ; 183 2638e: ba eb ldi r27, 0xBA ; 186 26390: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de <_ZN13thermal_modelL4dataE.lto_priv.400+0x2e> 26394: 90 93 df 12 sts 0x12DF, r25 ; 0x8012df <_ZN13thermal_modelL4dataE.lto_priv.400+0x2f> 26398: a0 93 e0 12 sts 0x12E0, r26 ; 0x8012e0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x30> 2639c: b0 93 e1 12 sts 0x12E1, r27 ; 0x8012e1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 263a0: 86 e6 ldi r24, 0x66 ; 102 263a2: 96 e6 ldi r25, 0x66 ; 102 263a4: a6 e8 ldi r26, 0x86 ; 134 263a6: bf e3 ldi r27, 0x3F ; 63 263a8: 80 93 e2 12 sts 0x12E2, r24 ; 0x8012e2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x32> 263ac: 90 93 e3 12 sts 0x12E3, r25 ; 0x8012e3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x33> 263b0: a0 93 e4 12 sts 0x12E4, r26 ; 0x8012e4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x34> 263b4: b0 93 e5 12 sts 0x12E5, r27 ; 0x8012e5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 263b8: 8a e9 ldi r24, 0x9A ; 154 263ba: 99 e9 ldi r25, 0x99 ; 153 263bc: a1 e1 ldi r26, 0x11 ; 17 263be: b1 e4 ldi r27, 0x41 ; 65 263c0: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 263c4: 90 93 e7 12 sts 0x12E7, r25 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 263c8: a0 93 e8 12 sts 0x12E8, r26 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 263cc: b0 93 e9 12 sts 0x12E9, r27 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 263d0: 8a e9 ldi r24, 0x9A ; 154 263d2: 99 e9 ldi r25, 0x99 ; 153 263d4: a9 e1 ldi r26, 0x19 ; 25 263d6: be e3 ldi r27, 0x3E ; 62 263d8: 80 93 ea 12 sts 0x12EA, r24 ; 0x8012ea <_ZN13thermal_modelL4dataE.lto_priv.400+0x3a> 263dc: 90 93 eb 12 sts 0x12EB, r25 ; 0x8012eb <_ZN13thermal_modelL4dataE.lto_priv.400+0x3b> 263e0: a0 93 ec 12 sts 0x12EC, r26 ; 0x8012ec <_ZN13thermal_modelL4dataE.lto_priv.400+0x3c> 263e4: 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); 263e8: 8e e0 ldi r24, 0x0E ; 14 263ea: 91 e0 ldi r25, 0x01 ; 1 263ec: 90 93 ef 12 sts 0x12EF, r25 ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 263f0: 80 93 ee 12 sts 0x12EE, r24 ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 263f4: 87 e3 ldi r24, 0x37 ; 55 263f6: 9f e9 ldi r25, 0x9F ; 159 263f8: a0 ef ldi r26, 0xF0 ; 240 263fa: 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); 263fc: fc 01 movw r30, r24 263fe: 45 91 lpm r20, Z+ 26400: 55 91 lpm r21, Z+ 26402: 65 91 lpm r22, Z+ 26404: 74 91 lpm r23, Z 26406: 4d 93 st X+, r20 26408: 5d 93 st X+, r21 2640a: 6d 93 st X+, r22 2640c: 7d 93 st X+, r23 2640e: 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) 26410: 23 e1 ldi r18, 0x13 ; 19 26412: a0 33 cpi r26, 0x30 ; 48 26414: b2 07 cpc r27, r18 26416: 91 f7 brne .-28 ; 0x263fc thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 26418: 80 e0 ldi r24, 0x00 ; 0 2641a: 90 e0 ldi r25, 0x00 ; 0 2641c: a0 ee ldi r26, 0xE0 ; 224 2641e: b0 ec ldi r27, 0xC0 ; 192 26420: 80 93 30 13 sts 0x1330, r24 ; 0x801330 <_ZN13thermal_modelL4dataE.lto_priv.400+0x80> 26424: 90 93 31 13 sts 0x1331, r25 ; 0x801331 <_ZN13thermal_modelL4dataE.lto_priv.400+0x81> 26428: a0 93 32 13 sts 0x1332, r26 ; 0x801332 <_ZN13thermal_modelL4dataE.lto_priv.400+0x82> 2642c: b0 93 33 13 sts 0x1333, r27 ; 0x801333 <_ZN13thermal_modelL4dataE.lto_priv.400+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 26430: 8a e9 ldi r24, 0x9A ; 154 26432: 99 e9 ldi r25, 0x99 ; 153 26434: a9 e5 ldi r26, 0x59 ; 89 26436: bf e3 ldi r27, 0x3F ; 63 26438: 80 93 34 13 sts 0x1334, r24 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 2643c: 90 93 35 13 sts 0x1335, r25 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 26440: a0 93 36 13 sts 0x1336, r26 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 26444: b0 93 37 13 sts 0x1337, r27 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 26448: 84 ea ldi r24, 0xA4 ; 164 2644a: 90 e7 ldi r25, 0x70 ; 112 2644c: ad e9 ldi r26, 0x9D ; 157 2644e: bf e3 ldi r27, 0x3F ; 63 26450: 80 93 38 13 sts 0x1338, r24 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 26454: 90 93 39 13 sts 0x1339, r25 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 26458: a0 93 3a 13 sts 0x133A, r26 ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 2645c: b0 93 3b 13 sts 0x133B, r27 ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> thermal_model::warn_beep = true; 26460: 81 e0 ldi r24, 0x01 ; 1 26462: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> thermal_model::enabled = true; 26466: 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 2646a: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 2646e: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26472: 8d 7f andi r24, 0xFD ; 253 26474: 80 93 39 06 sts 0x0639, r24 ; 0x800639 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 26478: ce 01 movw r24, r28 2647a: 01 96 adiw r24, 0x01 ; 1 2647c: 0f 94 94 31 call 0x26328 ; 0x26328 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(); } 26480: 0f 90 pop r0 26482: df 91 pop r29 26484: cf 91 pop r28 26486: 08 95 ret 00026488 : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 26488: 1f 93 push r17 2648a: cf 93 push r28 2648c: df 93 push r29 2648e: 1f 92 push r1 26490: cd b7 in r28, 0x3d ; 61 26492: de b7 in r29, 0x3e ; 62 26494: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 26496: ce 01 movw r24, r28 26498: 01 96 adiw r24, 0x01 ; 1 2649a: 0f 94 a1 31 call 0x26342 ; 0x26342 thermal_model::enabled = enabled; 2649e: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> thermal_model::setup(); 264a2: 0f 94 10 2f call 0x25e20 ; 0x25e20 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 264a6: ce 01 movw r24, r28 264a8: 01 96 adiw r24, 0x01 ; 1 264aa: 0f 94 94 31 call 0x26328 ; 0x26328 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 264ae: 11 23 and r17, r17 264b0: 41 f0 breq .+16 ; 0x264c2 264b2: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 264b6: 81 11 cpse r24, r1 264b8: 04 c0 rjmp .+8 ; 0x264c2 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 264ba: 8f e9 ldi r24, 0x9F ; 159 264bc: 9e e9 ldi r25, 0x9E ; 158 264be: 0e 94 82 79 call 0xf304 ; 0xf304 } 264c2: 0f 90 pop r0 264c4: df 91 pop r29 264c6: cf 91 pop r28 264c8: 1f 91 pop r17 264ca: 08 95 ret 000264cc : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 264cc: 1f 93 push r17 264ce: cf 93 push r28 264d0: df 93 push r29 264d2: 1f 92 push r1 264d4: cd b7 in r28, 0x3d ; 61 264d6: de b7 in r29, 0x3e ; 62 264d8: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 264da: ce 01 movw r24, r28 264dc: 01 96 adiw r24, 0x01 ; 1 264de: 0f 94 a1 31 call 0x26342 ; 0x26342 thermal_model::enabled = enabled; 264e2: 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 264e6: 81 e0 ldi r24, 0x01 ; 1 264e8: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> warning_state.assert = false; // explicitly clear assertions 264ec: e9 e3 ldi r30, 0x39 ; 57 264ee: f6 e0 ldi r31, 0x06 ; 6 264f0: 80 81 ld r24, Z 264f2: 8d 7f andi r24, 0xFD ; 253 264f4: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 264f6: ce 01 movw r24, r28 264f8: 01 96 adiw r24, 0x01 ; 1 264fa: 0f 94 94 31 call 0x26328 ; 0x26328 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 264fe: 0f 90 pop r0 26500: df 91 pop r29 26502: cf 91 pop r28 26504: 1f 91 pop r17 26506: 08 95 ret 00026508 : /* 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() { 26508: cf 93 push r28 2650a: df 93 push r29 2650c: 1f 92 push r1 2650e: cd b7 in r28, 0x3d ; 61 26510: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 26512: ce 01 movw r24, r28 26514: 01 96 adiw r24, 0x01 ; 1 26516: 0f 94 a1 31 call 0x26342 ; 0x26342 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 2651e: 90 91 18 05 lds r25, 0x0518 ; 0x800518 26522: a0 91 19 05 lds r26, 0x0519 ; 0x800519 26526: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 2652a: 80 93 b0 0d sts 0x0DB0, r24 ; 0x800db0 2652e: 90 93 b1 0d sts 0x0DB1, r25 ; 0x800db1 26532: a0 93 b2 0d sts 0x0DB2, r26 ; 0x800db2 26536: b0 93 b3 0d sts 0x0DB3, r27 ; 0x800db3 current_temperature_bed = current_temperature_bed_isr; 2653a: 80 91 19 06 lds r24, 0x0619 ; 0x800619 2653e: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 26542: a0 91 1b 06 lds r26, 0x061B ; 0x80061b 26546: b0 91 1c 06 lds r27, 0x061C ; 0x80061c 2654a: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee 2654e: 90 93 ef 04 sts 0x04EF, r25 ; 0x8004ef 26552: a0 93 f0 04 sts 0x04F0, r26 ; 0x8004f0 26556: b0 93 f1 04 sts 0x04F1, r27 ; 0x8004f1 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 2655a: 80 91 03 06 lds r24, 0x0603 ; 0x800603 2655e: 90 91 04 06 lds r25, 0x0604 ; 0x800604 26562: a0 91 05 06 lds r26, 0x0605 ; 0x800605 26566: b0 91 06 06 lds r27, 0x0606 ; 0x800606 2656a: 80 93 99 03 sts 0x0399, r24 ; 0x800399 2656e: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 26572: a0 93 9b 03 sts 0x039B, r26 ; 0x80039b 26576: b0 93 9c 03 sts 0x039C, r27 ; 0x80039c #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 2657a: 80 91 20 06 lds r24, 0x0620 ; 0x800620 2657e: 90 91 21 06 lds r25, 0x0621 ; 0x800621 26582: a0 91 22 06 lds r26, 0x0622 ; 0x800622 26586: b0 91 23 06 lds r27, 0x0623 ; 0x800623 2658a: 80 93 56 06 sts 0x0656, r24 ; 0x800656 2658e: 90 93 57 06 sts 0x0657, r25 ; 0x800657 26592: a0 93 58 06 sts 0x0658, r26 ; 0x800658 26596: 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) { 2659a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 2659e: 81 11 cpse r24, r1 265a0: 02 c0 rjmp .+4 ; 0x265a6 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 265a2: 0f 94 9a 13 call 0x22734 ; 0x22734 } temp_meas_ready = false; 265a6: 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; 265aa: ce 01 movw r24, r28 265ac: 01 96 adiw r24, 0x01 ; 1 265ae: 0f 94 94 31 call 0x26328 ; 0x26328 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 265b2: 0f 90 pop r0 265b4: df 91 pop r29 265b6: cf 91 pop r28 265b8: 08 95 ret 000265ba <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 265ba: 1f 92 push r1 265bc: 0f 92 push r0 265be: 0f b6 in r0, 0x3f ; 63 265c0: 0f 92 push r0 265c2: 11 24 eor r1, r1 265c4: 0b b6 in r0, 0x3b ; 59 265c6: 0f 92 push r0 265c8: ff 92 push r15 265ca: 0f 93 push r16 265cc: 1f 93 push r17 265ce: 2f 93 push r18 265d0: 3f 93 push r19 265d2: 4f 93 push r20 265d4: 5f 93 push r21 265d6: 6f 93 push r22 265d8: 7f 93 push r23 265da: 8f 93 push r24 265dc: 9f 93 push r25 265de: af 93 push r26 265e0: bf 93 push r27 265e2: cf 93 push r28 265e4: df 93 push r29 265e6: ef 93 push r30 265e8: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 265ea: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 265ee: 8b 7f andi r24, 0xFB ; 251 265f0: 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(); 265f4: 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) 265f6: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 265fa: 86 fd sbrc r24, 6 265fc: c8 c0 rjmp .+400 ; 0x2678e <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 265fe: 68 ec ldi r22, 0xC8 ; 200 26600: 70 e0 ldi r23, 0x00 ; 0 26602: 8f ed ldi r24, 0xDF ; 223 26604: 95 e0 ldi r25, 0x05 ; 5 26606: 0f 94 ad 29 call 0x2535a ; 0x2535a ::expired_cont(unsigned short)> 2660a: 88 23 and r24, r24 2660c: b9 f0 breq .+46 ; 0x2663c <__vector_14+0x82> buttonBlanking.start(); 2660e: 8f ed ldi r24, 0xDF ; 223 26610: 95 e0 ldi r25, 0x05 ; 5 26612: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> safetyTimer.start(); 26616: 8a ed ldi r24, 0xDA ; 218 26618: 95 e0 ldi r25, 0x05 ; 5 2661a: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 2661e: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 26622: 81 11 cpse r24, r1 26624: a5 c0 rjmp .+330 ; 0x26770 <__vector_14+0x1b6> 26626: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 2662a: 81 11 cpse r24, r1 2662c: a1 c0 rjmp .+322 ; 0x26770 <__vector_14+0x1b6> { longPressTimer.start(); 2662e: 85 ed ldi r24, 0xD5 ; 213 26630: 95 e0 ldi r25, 0x05 ; 5 26632: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> lcd_button_pressed = 1; 26636: 81 e0 ldi r24, 0x01 ; 1 26638: 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); 2663c: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 26640: 82 fb bst r24, 2 26642: 88 27 eor r24, r24 26644: 80 f9 bld r24, 0 26646: 91 e0 ldi r25, 0x01 ; 1 26648: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 2664a: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2664e: 91 ff sbrs r25, 1 26650: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 26652: e0 91 d2 05 lds r30, 0x05D2 ; 0x8005d2 26656: e8 17 cp r30, r24 26658: e1 f0 breq .+56 ; 0x26692 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 2665a: 24 e0 ldi r18, 0x04 ; 4 2665c: e2 9f mul r30, r18 2665e: f0 01 movw r30, r0 26660: 11 24 eor r1, r1 26662: e8 2b or r30, r24 26664: e0 58 subi r30, 0x80 ; 128 26666: f1 46 sbci r31, 0x61 ; 97 26668: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 2666a: 90 91 d1 05 lds r25, 0x05D1 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> 2666e: e9 0f add r30, r25 26670: e0 93 d1 05 sts 0x05D1, r30 ; 0x8005d1 <_ZL16lcd_encoder_diff.lto_priv.539> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 26674: 0e 2e mov r0, r30 26676: 00 0c add r0, r0 26678: ff 0b sbc r31, r31 2667a: f7 ff sbrs r31, 7 2667c: 03 c0 rjmp .+6 ; 0x26684 <__vector_14+0xca> 2667e: f1 95 neg r31 26680: e1 95 neg r30 26682: f1 09 sbc r31, r1 26684: 34 97 sbiw r30, 0x04 ; 4 26686: 1c f0 brlt .+6 ; 0x2668e <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 26688: 91 e0 ldi r25, 0x01 ; 1 2668a: 90 93 d3 05 sts 0x05D3, r25 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> } enc_bits_old = enc_bits; 2668e: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 26692: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 26696: 81 11 cpse r24, r1 26698: 08 c0 rjmp .+16 ; 0x266aa <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 2669a: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 2669e: 80 93 e8 05 sts 0x05E8, r24 ; 0x8005e8 if(soft_pwm_0 > 0) 266a2: 88 23 and r24, r24 266a4: 09 f4 brne .+2 ; 0x266a8 <__vector_14+0xee> 266a6: 87 c0 rjmp .+270 ; 0x267b6 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 266a8: 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) 266aa: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266ae: 8f 70 andi r24, 0x0F ; 15 266b0: a9 f4 brne .+42 ; 0x266dc <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 266b2: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 266b6: 90 e0 ldi r25, 0x00 ; 0 266b8: 24 e0 ldi r18, 0x04 ; 4 266ba: 95 95 asr r25 266bc: 87 95 ror r24 266be: 2a 95 dec r18 266c0: e1 f7 brne .-8 ; 0x266ba <__vector_14+0x100> 266c2: 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); 266c6: 89 2b or r24, r25 266c8: 09 f4 brne .+2 ; 0x266cc <__vector_14+0x112> 266ca: 77 c0 rjmp .+238 ; 0x267ba <__vector_14+0x200> 266cc: 9f b7 in r25, 0x3f ; 63 266ce: f8 94 cli 266d0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 266d4: 88 60 ori r24, 0x08 ; 8 266d6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 266da: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 266dc: 90 91 e8 05 lds r25, 0x05E8 ; 0x8005e8 266e0: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266e4: 98 17 cp r25, r24 266e6: 08 f4 brcc .+2 ; 0x266ea <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 266e8: 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); 266ea: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 266ee: 8f 70 andi r24, 0x0F ; 15 266f0: 90 91 a5 04 lds r25, 0x04A5 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.460> 266f4: 98 17 cp r25, r24 266f6: 40 f4 brcc .+16 ; 0x26708 <__vector_14+0x14e> 266f8: 9f b7 in r25, 0x3f ; 63 266fa: f8 94 cli 266fc: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26700: 87 7f andi r24, 0xF7 ; 247 26702: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 26706: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 26708: 80 91 a4 02 lds r24, 0x02A4 ; 0x8002a4 2670c: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 2670e: 8f 77 andi r24, 0x7F ; 127 26710: 80 93 a4 02 sts 0x02A4, r24 ; 0x8002a4 26714: 10 e0 ldi r17, 0x00 ; 0 26716: 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 26718: e8 01 movw r28, r16 2671a: cc 0f add r28, r28 2671c: dd 1f adc r29, r29 2671e: c7 59 subi r28, 0x97 ; 151 26720: d9 4f sbci r29, 0xF9 ; 249 26722: 88 81 ld r24, Y 26724: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 26726: 18 16 cp r1, r24 26728: 19 06 cpc r1, r25 2672a: 0c f0 brlt .+2 ; 0x2672e <__vector_14+0x174> 2672c: 4c c0 rjmp .+152 ; 0x267c6 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 2672e: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 26730: f8 94 cli babystep(axis,/*fwd*/true); 26732: 61 e0 ldi r22, 0x01 ; 1 26734: 80 2f mov r24, r16 26736: 0f 94 ab 13 call 0x22756 ; 0x22756 babystepsTodo[axis]--; //less to do next time 2673a: 88 81 ld r24, Y 2673c: 99 81 ldd r25, Y+1 ; 0x01 2673e: 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 26740: 99 83 std Y+1, r25 ; 0x01 26742: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 26744: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 26746: 0f 5f subi r16, 0xFF ; 255 26748: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 2674a: 03 30 cpi r16, 0x03 ; 3 2674c: 11 05 cpc r17, r1 2674e: 21 f7 brne .-56 ; 0x26718 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 26750: 80 91 40 18 lds r24, 0x1840 ; 0x801840 <__bss_end+0x20> 26754: 90 91 41 18 lds r25, 0x1841 ; 0x801841 <__bss_end+0x21> 26758: a0 91 42 18 lds r26, 0x1842 ; 0x801842 <__bss_end+0x22> 2675c: b0 91 43 18 lds r27, 0x1843 ; 0x801843 <__bss_end+0x23> 26760: 82 3a cpi r24, 0xA2 ; 162 26762: 92 4a sbci r25, 0xA2 ; 162 26764: a1 05 cpc r26, r1 26766: b1 05 cpc r27, r1 26768: d9 f1 breq .+118 ; 0x267e0 <__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); 2676a: 81 e0 ldi r24, 0x01 ; 1 2676c: 0e 94 5f 67 call 0xcebe ; 0xcebe if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 26770: 68 ee ldi r22, 0xE8 ; 232 26772: 73 e0 ldi r23, 0x03 ; 3 26774: 85 ed ldi r24, 0xD5 ; 213 26776: 95 e0 ldi r25, 0x05 ; 5 26778: 0f 94 85 29 call 0x2530a ; 0x2530a ::expired(unsigned short)> 2677c: 88 23 and r24, r24 2677e: 09 f4 brne .+2 ; 0x26782 <__vector_14+0x1c8> 26780: 5d cf rjmp .-326 ; 0x2663c <__vector_14+0x82> { lcd_long_press_active = 1; 26782: 81 e0 ldi r24, 0x01 ; 1 26784: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 lcd_longpress_trigger = 1; 26788: 80 93 d4 05 sts 0x05D4, r24 ; 0x8005d4 2678c: 57 cf rjmp .-338 ; 0x2663c <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 2678e: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 26792: 88 23 and r24, r24 26794: 09 f4 brne .+2 ; 0x26798 <__vector_14+0x1de> 26796: 52 cf rjmp .-348 ; 0x2663c <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 26798: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 if (!lcd_long_press_active) 2679c: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 267a0: 81 11 cpse r24, r1 267a2: 03 c0 rjmp .+6 ; 0x267aa <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 267a4: 81 e0 ldi r24, 0x01 ; 1 267a6: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 267aa: 81 e0 ldi r24, 0x01 ; 1 267ac: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 <_ZL26lcd_backlight_wake_trigger.lto_priv.538> lcd_long_press_active = 0; 267b0: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 267b4: 43 cf rjmp .-378 ; 0x2663c <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 267b6: 75 98 cbi 0x0e, 5 ; 14 267b8: 78 cf rjmp .-272 ; 0x266aa <__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); 267ba: 9f b7 in r25, 0x3f ; 63 267bc: f8 94 cli 267be: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 267c2: 87 7f andi r24, 0xF7 ; 247 267c4: 88 cf rjmp .-240 ; 0x266d6 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 267c6: 89 2b or r24, r25 267c8: 09 f4 brne .+2 ; 0x267cc <__vector_14+0x212> 267ca: bd cf rjmp .-134 ; 0x26746 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 267cc: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 267ce: f8 94 cli babystep(axis,/*fwd*/false); 267d0: 60 e0 ldi r22, 0x00 ; 0 267d2: 80 2f mov r24, r16 267d4: 0f 94 ab 13 call 0x22756 ; 0x22756 babystepsTodo[axis]++; //less to do next time 267d8: 88 81 ld r24, Y 267da: 99 81 ldd r25, Y+1 ; 0x01 267dc: 01 96 adiw r24, 0x01 ; 1 267de: b0 cf rjmp .-160 ; 0x26740 <__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]) { 267e0: 9c b1 in r25, 0x0c ; 12 267e2: 80 91 e6 05 lds r24, 0x05E6 ; 0x8005e6 267e6: 96 fb bst r25, 6 267e8: 99 27 eor r25, r25 267ea: 90 f9 bld r25, 0 267ec: 98 17 cp r25, r24 267ee: 91 f0 breq .+36 ; 0x26814 <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 267f0: 90 91 6f 06 lds r25, 0x066F ; 0x80066f 267f4: 99 23 and r25, r25 267f6: 51 f0 breq .+20 ; 0x2680c <__vector_14+0x252> 267f8: 20 91 e2 05 lds r18, 0x05E2 ; 0x8005e2 267fc: 30 91 e3 05 lds r19, 0x05E3 ; 0x8005e3 26800: 2f 5f subi r18, 0xFF ; 255 26802: 3f 4f sbci r19, 0xFF ; 255 26804: 30 93 e3 05 sts 0x05E3, r19 ; 0x8005e3 26808: 20 93 e2 05 sts 0x05E2, r18 ; 0x8005e2 fan_state[0] = !fan_state[0]; 2680c: 91 e0 ldi r25, 0x01 ; 1 2680e: 89 27 eor r24, r25 26810: 80 93 e6 05 sts 0x05E6, r24 ; 0x8005e6 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 26814: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 26816: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 2681a: 84 60 ori r24, 0x04 ; 4 2681c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 26820: ff 91 pop r31 26822: ef 91 pop r30 26824: df 91 pop r29 26826: cf 91 pop r28 26828: bf 91 pop r27 2682a: af 91 pop r26 2682c: 9f 91 pop r25 2682e: 8f 91 pop r24 26830: 7f 91 pop r23 26832: 6f 91 pop r22 26834: 5f 91 pop r21 26836: 4f 91 pop r20 26838: 3f 91 pop r19 2683a: 2f 91 pop r18 2683c: 1f 91 pop r17 2683e: 0f 91 pop r16 26840: ff 90 pop r15 26842: 0f 90 pop r0 26844: 0b be out 0x3b, r0 ; 59 26846: 0f 90 pop r0 26848: 0f be out 0x3f, r0 ; 63 2684a: 0f 90 pop r0 2684c: 1f 90 pop r1 2684e: 18 95 reti 00026850 : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 26850: 4f 92 push r4 26852: 5f 92 push r5 26854: 6f 92 push r6 26856: 7f 92 push r7 26858: af 92 push r10 2685a: bf 92 push r11 2685c: cf 92 push r12 2685e: df 92 push r13 26860: ef 92 push r14 26862: ff 92 push r15 26864: 0f 93 push r16 26866: 1f 93 push r17 26868: cf 93 push r28 2686a: df 93 push r29 2686c: 24 e0 ldi r18, 0x04 ; 4 2686e: 30 e0 ldi r19, 0x00 ; 0 26870: 41 e0 ldi r20, 0x01 ; 1 26872: 50 e0 ldi r21, 0x00 ; 0 26874: d9 01 movw r26, r18 26876: ae 5e subi r26, 0xEE ; 238 26878: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 2687a: fd 01 movw r30, r26 2687c: 65 91 lpm r22, Z+ 2687e: 74 91 lpm r23, Z 26880: 86 17 cp r24, r22 26882: 97 07 cpc r25, r23 26884: 0c f0 brlt .+2 ; 0x26888 26886: 66 c0 rjmp .+204 ; 0x26954 { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 26888: 41 50 subi r20, 0x01 ; 1 2688a: 51 09 sbc r21, r1 2688c: 44 0f add r20, r20 2688e: 55 1f adc r21, r21 26890: 44 0f add r20, r20 26892: 55 1f adc r21, r21 26894: ea 01 movw r28, r20 26896: cc 5e subi r28, 0xEC ; 236 26898: d2 46 sbci r29, 0x62 ; 98 2689a: fe 01 movw r30, r28 2689c: 05 91 lpm r16, Z+ 2689e: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 268a0: 4e 5e subi r20, 0xEE ; 238 268a2: 52 46 sbci r21, 0x62 ; 98 268a4: fa 01 movw r30, r20 268a6: 65 91 lpm r22, Z+ 268a8: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 268aa: f9 01 movw r30, r18 268ac: ec 5e subi r30, 0xEC ; 236 268ae: f2 46 sbci r31, 0x62 ; 98 268b0: e5 90 lpm r14, Z+ 268b2: f4 90 lpm r15, Z 268b4: fe 01 movw r30, r28 268b6: c5 90 lpm r12, Z+ 268b8: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 268ba: fd 01 movw r30, r26 268bc: c5 91 lpm r28, Z+ 268be: d4 91 lpm r29, Z 268c0: fa 01 movw r30, r20 268c2: a5 90 lpm r10, Z+ 268c4: 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])) * 268c6: 86 1b sub r24, r22 268c8: 97 0b sbc r25, r23 268ca: bc 01 movw r22, r24 268cc: 99 0f add r25, r25 268ce: 88 0b sbc r24, r24 268d0: 99 0b sbc r25, r25 268d2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 268d6: 2b 01 movw r4, r22 268d8: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 268da: b7 01 movw r22, r14 268dc: 6c 19 sub r22, r12 268de: 7d 09 sbc r23, r13 268e0: 07 2e mov r0, r23 268e2: 00 0c add r0, r0 268e4: 88 0b sbc r24, r24 268e6: 99 0b sbc r25, r25 268e8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 268ec: 9b 01 movw r18, r22 268ee: 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])) * 268f0: c3 01 movw r24, r6 268f2: b2 01 movw r22, r4 268f4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 268f8: 6b 01 movw r12, r22 268fa: 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])); 268fc: be 01 movw r22, r28 268fe: 6a 19 sub r22, r10 26900: 7b 09 sbc r23, r11 26902: 07 2e mov r0, r23 26904: 00 0c add r0, r0 26906: 88 0b sbc r24, r24 26908: 99 0b sbc r25, r25 2690a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2690e: 9b 01 movw r18, r22 26910: 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])) / 26912: c7 01 movw r24, r14 26914: b6 01 movw r22, r12 26916: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 2691a: 6b 01 movw r12, r22 2691c: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 2691e: b8 01 movw r22, r16 26920: 11 0f add r17, r17 26922: 88 0b sbc r24, r24 26924: 99 0b sbc r25, r25 26926: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2692a: 9b 01 movw r18, r22 2692c: ac 01 movw r20, r24 2692e: c7 01 movw r24, r14 26930: b6 01 movw r22, r12 26932: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 26936: df 91 pop r29 26938: cf 91 pop r28 2693a: 1f 91 pop r17 2693c: 0f 91 pop r16 2693e: ff 90 pop r15 26940: ef 90 pop r14 26942: df 90 pop r13 26944: cf 90 pop r12 26946: bf 90 pop r11 26948: af 90 pop r10 2694a: 7f 90 pop r7 2694c: 6f 90 pop r6 2694e: 5f 90 pop r5 26950: 4f 90 pop r4 26952: 08 95 ret 26954: 4f 5f subi r20, 0xFF ; 255 26956: 5f 4f sbci r21, 0xFF ; 255 26958: 2c 5f subi r18, 0xFC ; 252 2695a: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 26962: 88 cf rjmp .-240 ; 0x26874 (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]); 26964: e8 e9 ldi r30, 0x98 ; 152 26966: fd e9 ldi r31, 0x9D ; 157 26968: 65 91 lpm r22, Z+ 2696a: 74 91 lpm r23, Z 2696c: 07 2e mov r0, r23 2696e: 00 0c add r0, r0 26970: 88 0b sbc r24, r24 26972: 99 0b sbc r25, r25 26974: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26978: de cf rjmp .-68 ; 0x26936 0002697a : 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) { 2697a: 4f 92 push r4 2697c: 5f 92 push r5 2697e: 6f 92 push r6 26980: 7f 92 push r7 26982: af 92 push r10 26984: bf 92 push r11 26986: cf 92 push r12 26988: df 92 push r13 2698a: ef 92 push r14 2698c: ff 92 push r15 2698e: 0f 93 push r16 26990: 1f 93 push r17 26992: cf 93 push r28 26994: df 93 push r29 26996: 24 e0 ldi r18, 0x04 ; 4 26998: 30 e0 ldi r19, 0x00 ; 0 2699a: 41 e0 ldi r20, 0x01 ; 1 2699c: 50 e0 ldi r21, 0x00 ; 0 2699e: d9 01 movw r26, r18 269a0: a2 5e subi r26, 0xE2 ; 226 269a2: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 269a4: fd 01 movw r30, r26 269a6: 65 91 lpm r22, Z+ 269a8: 74 91 lpm r23, Z 269aa: 86 17 cp r24, r22 269ac: 97 07 cpc r25, r23 269ae: 0c f0 brlt .+2 ; 0x269b2 269b0: 80 c0 rjmp .+256 ; 0x26ab2 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 269b2: 41 50 subi r20, 0x01 ; 1 269b4: 51 09 sbc r21, r1 269b6: 44 0f add r20, r20 269b8: 55 1f adc r21, r21 269ba: 44 0f add r20, r20 269bc: 55 1f adc r21, r21 269be: 8a 01 movw r16, r20 269c0: 00 5e subi r16, 0xE0 ; 224 269c2: 13 46 sbci r17, 0x63 ; 99 269c4: f8 01 movw r30, r16 269c6: c5 90 lpm r12, Z+ 269c8: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 269ca: 42 5e subi r20, 0xE2 ; 226 269cc: 53 46 sbci r21, 0x63 ; 99 269ce: fa 01 movw r30, r20 269d0: 65 91 lpm r22, Z+ 269d2: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 269d4: f9 01 movw r30, r18 269d6: e0 5e subi r30, 0xE0 ; 224 269d8: f3 46 sbci r31, 0x63 ; 99 269da: c5 91 lpm r28, Z+ 269dc: d4 91 lpm r29, Z 269de: f8 01 movw r30, r16 269e0: 05 91 lpm r16, Z+ 269e2: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 269e4: fd 01 movw r30, r26 269e6: e5 90 lpm r14, Z+ 269e8: f4 90 lpm r15, Z 269ea: fa 01 movw r30, r20 269ec: a5 90 lpm r10, Z+ 269ee: 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])) * 269f0: 86 1b sub r24, r22 269f2: 97 0b sbc r25, r23 269f4: bc 01 movw r22, r24 269f6: 99 0f add r25, r25 269f8: 88 0b sbc r24, r24 269fa: 99 0b sbc r25, r25 269fc: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26a00: 2b 01 movw r4, r22 26a02: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 26a04: be 01 movw r22, r28 26a06: 60 1b sub r22, r16 26a08: 71 0b sbc r23, r17 26a0a: 07 2e mov r0, r23 26a0c: 00 0c add r0, r0 26a0e: 88 0b sbc r24, r24 26a10: 99 0b sbc r25, r25 26a12: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26a16: 9b 01 movw r18, r22 26a18: 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])) * 26a1a: c3 01 movw r24, r6 26a1c: b2 01 movw r22, r4 26a1e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 26a22: 2b 01 movw r4, r22 26a24: 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])); 26a26: b7 01 movw r22, r14 26a28: 6a 19 sub r22, r10 26a2a: 7b 09 sbc r23, r11 26a2c: 07 2e mov r0, r23 26a2e: 00 0c add r0, r0 26a30: 88 0b sbc r24, r24 26a32: 99 0b sbc r25, r25 26a34: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26a38: 9b 01 movw r18, r22 26a3a: 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])) / 26a3c: c3 01 movw r24, r6 26a3e: b2 01 movw r22, r4 26a40: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 26a44: 2b 01 movw r4, r22 26a46: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 26a48: b6 01 movw r22, r12 26a4a: dd 0c add r13, r13 26a4c: 88 0b sbc r24, r24 26a4e: 99 0b sbc r25, r25 26a50: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26a54: 9b 01 movw r18, r22 26a56: ac 01 movw r20, r24 26a58: c3 01 movw r24, r6 26a5a: b2 01 movw r22, r4 26a5c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26a60: 6b 01 movw r12, r22 26a62: 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) 26a64: 20 e0 ldi r18, 0x00 ; 0 26a66: 30 e0 ldi r19, 0x00 ; 0 26a68: 40 e2 ldi r20, 0x20 ; 32 26a6a: 52 e4 ldi r21, 0x42 ; 66 26a6c: c7 01 movw r24, r14 26a6e: b6 01 movw r22, r12 26a70: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 26a74: 87 fd sbrc r24, 7 26a76: 30 c0 rjmp .+96 ; 0x26ad8 26a78: 20 e0 ldi r18, 0x00 ; 0 26a7a: 30 e0 ldi r19, 0x00 ; 0 26a7c: 48 e4 ldi r20, 0x48 ; 72 26a7e: 52 e4 ldi r21, 0x42 ; 66 26a80: c7 01 movw r24, r14 26a82: b6 01 movw r22, r12 26a84: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 26a88: 18 16 cp r1, r24 26a8a: 34 f1 brlt .+76 ; 0x26ad8 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 26a8c: 20 e0 ldi r18, 0x00 ; 0 26a8e: 30 e0 ldi r19, 0x00 ; 0 26a90: 40 e2 ldi r20, 0x20 ; 32 26a92: 52 e4 ldi r21, 0x42 ; 66 26a94: c7 01 movw r24, r14 26a96: b6 01 movw r22, r12 26a98: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 26a9c: 20 e0 ldi r18, 0x00 ; 0 26a9e: 30 e0 ldi r19, 0x00 ; 0 26aa0: 40 e0 ldi r20, 0x00 ; 0 26aa2: 5f e3 ldi r21, 0x3F ; 63 26aa4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 26aa8: 9b 01 movw r18, r22 26aaa: 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; 26aac: c7 01 movw r24, r14 26aae: b6 01 movw r22, r12 26ab0: 43 c0 rjmp .+134 ; 0x26b38 26ab2: 4f 5f subi r20, 0xFF ; 255 26ab4: 5f 4f sbci r21, 0xFF ; 255 26ab6: 2c 5f subi r18, 0xFC ; 252 26ab8: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 26ac0: 6e cf rjmp .-292 ; 0x2699e break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 26ac2: e0 e1 ldi r30, 0x10 ; 16 26ac4: fd e9 ldi r31, 0x9D ; 157 26ac6: 65 91 lpm r22, Z+ 26ac8: 74 91 lpm r23, Z 26aca: 07 2e mov r0, r23 26acc: 00 0c add r0, r0 26ace: 88 0b sbc r24, r24 26ad0: 99 0b sbc r25, r25 26ad2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26ad6: c4 cf rjmp .-120 ; 0x26a60 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 26ad8: 20 e0 ldi r18, 0x00 ; 0 26ada: 30 e0 ldi r19, 0x00 ; 0 26adc: 48 e4 ldi r20, 0x48 ; 72 26ade: 52 e4 ldi r21, 0x42 ; 66 26ae0: c7 01 movw r24, r14 26ae2: b6 01 movw r22, r12 26ae4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 26ae8: 18 16 cp r1, r24 26aea: dc f5 brge .+118 ; 0x26b62 26aec: 20 e0 ldi r18, 0x00 ; 0 26aee: 30 e0 ldi r19, 0x00 ; 0 26af0: 48 ec ldi r20, 0xC8 ; 200 26af2: 52 e4 ldi r21, 0x42 ; 66 26af4: c7 01 movw r24, r14 26af6: b6 01 movw r22, r12 26af8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 26afc: 18 16 cp r1, r24 26afe: 8c f1 brlt .+98 ; 0x26b62 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 26b00: 20 e0 ldi r18, 0x00 ; 0 26b02: 30 e0 ldi r19, 0x00 ; 0 26b04: 40 ea ldi r20, 0xA0 ; 160 26b06: 50 e4 ldi r21, 0x40 ; 64 26b08: c7 01 movw r24, r14 26b0a: b6 01 movw r22, r12 26b0c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 26b10: 2b 01 movw r4, r22 26b12: 3c 01 movw r6, r24 26b14: 20 e0 ldi r18, 0x00 ; 0 26b16: 30 e0 ldi r19, 0x00 ; 0 26b18: 48 e4 ldi r20, 0x48 ; 72 26b1a: 52 e4 ldi r21, 0x42 ; 66 26b1c: c7 01 movw r24, r14 26b1e: b6 01 movw r22, r12 26b20: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 26b24: 2d ec ldi r18, 0xCD ; 205 26b26: 3c ec ldi r19, 0xCC ; 204 26b28: 4c ec ldi r20, 0xCC ; 204 26b2a: 5d e3 ldi r21, 0x3D ; 61 26b2c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 26b30: 9b 01 movw r18, r22 26b32: ac 01 movw r20, r24 26b34: c3 01 movw r24, r6 26b36: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 26b38: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 26b3c: 6b 01 movw r12, r22 26b3e: 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 } 26b40: c7 01 movw r24, r14 26b42: b6 01 movw r22, r12 26b44: df 91 pop r29 26b46: cf 91 pop r28 26b48: 1f 91 pop r17 26b4a: 0f 91 pop r16 26b4c: ff 90 pop r15 26b4e: ef 90 pop r14 26b50: df 90 pop r13 26b52: cf 90 pop r12 26b54: bf 90 pop r11 26b56: af 90 pop r10 26b58: 7f 90 pop r7 26b5a: 6f 90 pop r6 26b5c: 5f 90 pop r5 26b5e: 4f 90 pop r4 26b60: 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) 26b62: 20 e0 ldi r18, 0x00 ; 0 26b64: 30 e0 ldi r19, 0x00 ; 0 26b66: 48 ec ldi r20, 0xC8 ; 200 26b68: 52 e4 ldi r21, 0x42 ; 66 26b6a: c7 01 movw r24, r14 26b6c: b6 01 movw r22, r12 26b6e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 26b72: 18 16 cp r1, r24 26b74: 2c f7 brge .-54 ; 0x26b40 { celsius = celsius + _offset; 26b76: 20 e0 ldi r18, 0x00 ; 0 26b78: 30 e0 ldi r19, 0x00 ; 0 26b7a: 40 e2 ldi r20, 0x20 ; 32 26b7c: 51 e4 ldi r21, 0x41 ; 65 26b7e: 96 cf rjmp .-212 ; 0x26aac 00026b80 : } static void check_temp_raw(); static void temp_mgr_isr() { 26b80: 4f 92 push r4 26b82: 5f 92 push r5 26b84: 6f 92 push r6 26b86: 7f 92 push r7 26b88: af 92 push r10 26b8a: cf 92 push r12 26b8c: df 92 push r13 26b8e: ef 92 push r14 26b90: ff 92 push r15 26b92: 0f 93 push r16 26b94: 1f 93 push r17 26b96: cf 93 push r28 26b98: 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 26b9e: 90 91 0c 06 lds r25, 0x060C ; 0x80060c 26ba2: 0f 94 23 a1 call 0x34246 ; 0x34246 26ba6: 60 93 17 05 sts 0x0517, r22 ; 0x800517 26baa: 70 93 18 05 sts 0x0518, r23 ; 0x800518 26bae: 80 93 19 05 sts 0x0519, r24 ; 0x800519 26bb2: 90 93 1a 05 sts 0x051A, r25 ; 0x80051a current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 26bb6: 60 90 09 06 lds r6, 0x0609 ; 0x800609 26bba: 70 90 0a 06 lds r7, 0x060A ; 0x80060a 26bbe: c3 01 movw r24, r6 26bc0: 0f 94 bd 34 call 0x2697a ; 0x2697a 26bc4: 6b 01 movw r12, r22 26bc6: 7c 01 movw r14, r24 26bc8: c0 92 19 06 sts 0x0619, r12 ; 0x800619 26bcc: d0 92 1a 06 sts 0x061A, r13 ; 0x80061a 26bd0: e0 92 1b 06 sts 0x061B, r14 ; 0x80061b 26bd4: f0 92 1c 06 sts 0x061C, r15 ; 0x80061c #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 26bd8: 80 91 07 06 lds r24, 0x0607 ; 0x800607 26bdc: 90 91 08 06 lds r25, 0x0608 ; 0x800608 26be0: 0f 94 bd 34 call 0x2697a ; 0x2697a 26be4: 60 93 03 06 sts 0x0603, r22 ; 0x800603 26be8: 70 93 04 06 sts 0x0604, r23 ; 0x800604 26bec: 80 93 05 06 sts 0x0605, r24 ; 0x800605 26bf0: 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) 26bf4: c0 91 15 06 lds r28, 0x0615 ; 0x800615 26bf8: d0 91 16 06 lds r29, 0x0616 ; 0x800616 26bfc: ce 01 movw r24, r28 26bfe: 0f 94 28 34 call 0x26850 ; 0x26850 26c02: 60 93 20 06 sts 0x0620, r22 ; 0x800620 26c06: 70 93 21 06 sts 0x0621, r23 ; 0x800621 26c0a: 80 93 22 06 sts 0x0622, r24 ; 0x800622 26c0e: 90 93 23 06 sts 0x0623, r25 ; 0x800623 #endif temp_meas_ready = true; 26c12: 81 e0 ldi r24, 0x01 ; 1 26c14: 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; 26c18: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 26c1c: 8d 7f andi r24, 0xFD ; 253 26c1e: 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]) { 26c22: 20 91 0b 06 lds r18, 0x060B ; 0x80060b 26c26: 30 91 0c 06 lds r19, 0x060C ; 0x80060c 26c2a: 80 91 a1 04 lds r24, 0x04A1 ; 0x8004a1 <_ZL12maxttemp_raw.lto_priv.463> 26c2e: 90 91 a2 04 lds r25, 0x04A2 ; 0x8004a2 <_ZL12maxttemp_raw.lto_priv.463+0x1> 26c32: 82 17 cp r24, r18 26c34: 93 07 cpc r25, r19 26c36: 2c f0 brlt .+10 ; 0x26c42 #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 26c38: 40 e0 ldi r20, 0x00 ; 0 26c3a: 60 e0 ldi r22, 0x00 ; 0 26c3c: 80 e0 ldi r24, 0x00 ; 0 26c3e: 0f 94 3a 2f call 0x25e74 ; 0x25e74 } //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) { 26c42: 80 91 9f 04 lds r24, 0x049F ; 0x80049f <_ZL16bed_maxttemp_raw.lto_priv.464> 26c46: 90 91 a0 04 lds r25, 0x04A0 ; 0x8004a0 <_ZL16bed_maxttemp_raw.lto_priv.464+0x1> 26c4a: 86 15 cp r24, r6 26c4c: 97 05 cpc r25, r7 26c4e: 2c f0 brlt .+10 ; 0x26c5a #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 26c50: 40 e0 ldi r20, 0x00 ; 0 26c52: 60 e0 ldi r22, 0x00 ; 0 26c54: 81 e0 ldi r24, 0x01 ; 1 26c56: 0f 94 3a 2f call 0x25e74 ; 0x25e74 } #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) { 26c5a: 80 91 9d 04 lds r24, 0x049D ; 0x80049d <_ZL20ambient_maxttemp_raw.lto_priv.465> 26c5e: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL20ambient_maxttemp_raw.lto_priv.465+0x1> 26c62: 8c 17 cp r24, r28 26c64: 9d 07 cpc r25, r29 26c66: 2c f0 brlt .+10 ; 0x26c72 #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 26c68: 40 e0 ldi r20, 0x00 ; 0 26c6a: 60 e0 ldi r22, 0x00 ; 0 26c6c: 82 e0 ldi r24, 0x02 ; 2 26c6e: 0f 94 3a 2f call 0x25e74 ; 0x25e74 #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) { 26c72: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.462> 26c76: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.462+0x1> 26c7a: c8 17 cp r28, r24 26c7c: d9 07 cpc r29, r25 26c7e: 2c f0 brlt .+10 ; 0x26c8a #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 26c80: 41 e0 ldi r20, 0x01 ; 1 26c82: 60 e0 ldi r22, 0x00 ; 0 26c84: 82 e0 ldi r24, 0x02 ; 2 26c86: 0f 94 3a 2f call 0x25e74 ; 0x25e74 #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 26c8a: c1 3a cpi r28, 0xA1 ; 161 26c8c: de 43 sbci r29, 0x3E ; 62 26c8e: 0c f4 brge .+2 ; 0x26c92 26c90: cd c1 rjmp .+922 ; 0x2702c { // 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]) { 26c92: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.461> 26c96: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 <_ZL8minttemp.lto_priv.461+0x1> 26c9a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 26c9e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 26ca2: 68 17 cp r22, r24 26ca4: 79 07 cpc r23, r25 26ca6: 0c f0 brlt .+2 ; 0x26caa 26ca8: 55 c0 rjmp .+170 ; 0x26d54 // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 26caa: c0 91 14 06 lds r28, 0x0614 ; 0x800614 26cae: c1 11 cpse r28, r1 26cb0: 18 c0 rjmp .+48 ; 0x26ce2 26cb2: 6b 5f subi r22, 0xFB ; 251 26cb4: 7f 4f sbci r23, 0xFF ; 255 26cb6: 07 2e mov r0, r23 26cb8: 00 0c add r0, r0 26cba: 88 0b sbc r24, r24 26cbc: 99 0b sbc r25, r25 26cbe: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26cc2: 9b 01 movw r18, r22 26cc4: ac 01 movw r20, r24 26cc6: c1 e0 ldi r28, 0x01 ; 1 26cc8: 60 91 17 05 lds r22, 0x0517 ; 0x800517 26ccc: 70 91 18 05 lds r23, 0x0518 ; 0x800518 26cd0: 80 91 19 05 lds r24, 0x0519 ; 0x800519 26cd4: 90 91 1a 05 lds r25, 0x051A ; 0x80051a 26cd8: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 26cdc: 18 16 cp r1, r24 26cde: 0c f0 brlt .+2 ; 0x26ce2 26ce0: c0 e0 ldi r28, 0x00 ; 0 26ce2: c0 93 14 06 sts 0x0614, r28 ; 0x800614 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 26ce6: 68 e9 ldi r22, 0x98 ; 152 26ce8: 7a e3 ldi r23, 0x3A ; 58 26cea: 81 e1 ldi r24, 0x11 ; 17 26cec: 96 e0 ldi r25, 0x06 ; 6 26cee: 0f 94 ad 29 call 0x2535a ; 0x2535a ::expired_cont(unsigned short)> 26cf2: 81 11 cpse r24, r1 26cf4: 02 c0 rjmp .+4 ; 0x26cfa 26cf6: cc 23 and r28, r28 26cf8: 29 f0 breq .+10 ; 0x26d04 bCheckingOnHeater=true; // not necessary 26cfa: 81 e0 ldi r24, 0x01 ; 1 26cfc: 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 26d00: 0f 94 af 2f call 0x25f5e ; 0x25f5e // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 26d04: 80 91 17 06 lds r24, 0x0617 ; 0x800617 26d08: 90 91 18 06 lds r25, 0x0618 ; 0x800618 26d0c: 0b 97 sbiw r24, 0x0b ; 11 26d0e: 4c f1 brlt .+82 ; 0x26d62 // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 26d10: c0 91 10 06 lds r28, 0x0610 ; 0x800610 26d14: c1 11 cpse r28, r1 26d16: 0c c0 rjmp .+24 ; 0x26d30 26d18: c1 e0 ldi r28, 0x01 ; 1 26d1a: 20 e0 ldi r18, 0x00 ; 0 26d1c: 30 e0 ldi r19, 0x00 ; 0 26d1e: 40 e7 ldi r20, 0x70 ; 112 26d20: 51 e4 ldi r21, 0x41 ; 65 26d22: c7 01 movw r24, r14 26d24: b6 01 movw r22, r12 26d26: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 26d2a: 18 16 cp r1, r24 26d2c: 0c f0 brlt .+2 ; 0x26d30 26d2e: c0 e0 ldi r28, 0x00 ; 0 26d30: c0 93 10 06 sts 0x0610, r28 ; 0x800610 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 26d34: 60 e5 ldi r22, 0x50 ; 80 26d36: 73 ec ldi r23, 0xC3 ; 195 26d38: 8d e0 ldi r24, 0x0D ; 13 26d3a: 96 e0 ldi r25, 0x06 ; 6 26d3c: 0f 94 ad 29 call 0x2535a ; 0x2535a ::expired_cont(unsigned short)> 26d40: 81 11 cpse r24, r1 26d42: 02 c0 rjmp .+4 ; 0x26d48 26d44: cc 23 and r28, r28 26d46: 99 f0 breq .+38 ; 0x26d6e bCheckingOnBed=true; // not necessary 26d48: 81 e0 ldi r24, 0x01 ; 1 26d4a: 80 93 10 06 sts 0x0610, r24 ; 0x800610 #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 26d4e: 0f 94 9e 2f call 0x25f3c ; 0x25f3c 26d52: 0d c0 rjmp .+26 ; 0x26d6e check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 26d54: 81 e1 ldi r24, 0x11 ; 17 26d56: 96 e0 ldi r25, 0x06 ; 6 26d58: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> bCheckingOnHeater=false; 26d5c: 10 92 14 06 sts 0x0614, r1 ; 0x800614 26d60: d1 cf rjmp .-94 ; 0x26d04 check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 26d62: 8d e0 ldi r24, 0x0D ; 13 26d64: 96 e0 ldi r25, 0x06 ; 6 26d66: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> bCheckingOnBed=false; 26d6a: 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); 26d6e: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 26d72: 70 e0 ldi r23, 0x00 ; 0 26d74: 90 e0 ldi r25, 0x00 ; 0 26d76: 80 e0 ldi r24, 0x00 ; 0 26d78: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 26d7c: 6b 01 movw r12, r22 26d7e: 7c 01 movw r14, r24 26d80: 40 90 17 05 lds r4, 0x0517 ; 0x800517 26d84: 50 90 18 05 lds r5, 0x0518 ; 0x800518 26d88: 60 90 19 05 lds r6, 0x0519 ; 0x800519 26d8c: 70 90 1a 05 lds r7, 0x051A ; 0x80051a 26d90: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 26d94: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 26d98: 07 2e mov r0, r23 26d9a: 00 0c add r0, r0 26d9c: 88 0b sbc r24, r24 26d9e: 99 0b sbc r25, r25 26da0: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26da4: ab 01 movw r20, r22 26da6: bc 01 movw r22, r24 26da8: a1 2c mov r10, r1 26daa: 93 01 movw r18, r6 26dac: 82 01 movw r16, r4 26dae: 81 e0 ldi r24, 0x01 ; 1 26db0: 0f 94 c0 2f call 0x25f80 ; 0x25f80 #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 26db4: 60 91 1d 06 lds r22, 0x061D ; 0x80061d 26db8: 70 e0 ldi r23, 0x00 ; 0 26dba: 90 e0 ldi r25, 0x00 ; 0 26dbc: 80 e0 ldi r24, 0x00 ; 0 26dbe: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 26dc2: 6b 01 movw r12, r22 26dc4: 7c 01 movw r14, r24 26dc6: 40 90 19 06 lds r4, 0x0619 ; 0x800619 26dca: 50 90 1a 06 lds r5, 0x061A ; 0x80061a 26dce: 60 90 1b 06 lds r6, 0x061B ; 0x80061b 26dd2: 70 90 1c 06 lds r7, 0x061C ; 0x80061c 26dd6: 60 91 17 06 lds r22, 0x0617 ; 0x800617 26dda: 70 91 18 06 lds r23, 0x0618 ; 0x800618 26dde: 07 2e mov r0, r23 26de0: 00 0c add r0, r0 26de2: 88 0b sbc r24, r24 26de4: 99 0b sbc r25, r25 26de6: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 26dea: ab 01 movw r20, r22 26dec: bc 01 movw r22, r24 26dee: aa 24 eor r10, r10 26df0: a3 94 inc r10 26df2: 93 01 movw r18, r6 26df4: 82 01 movw r16, r4 26df6: 80 e0 ldi r24, 0x00 ; 0 26df8: 0f 94 c0 2f call 0x25f80 ; 0x25f80 return true; } static void check() { if(!enabled) return; 26dfc: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.456> 26e00: 88 23 and r24, r24 26e02: 09 f4 brne .+2 ; 0x26e06 26e04: bc c0 rjmp .+376 ; 0x26f7e uint8_t heater_pwm = soft_pwm[0]; 26e06: c0 91 16 05 lds r28, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> uint8_t fan_pwm = soft_pwm_fan; 26e0a: d0 91 a5 04 lds r29, 0x04A5 ; 0x8004a5 <_ZL12soft_pwm_fan.lto_priv.460> float heater_temp = current_temperature_isr[0]; 26e0e: 40 90 17 05 lds r4, 0x0517 ; 0x800517 26e12: 50 90 18 05 lds r5, 0x0518 ; 0x800518 26e16: 60 90 19 05 lds r6, 0x0519 ; 0x800519 26e1a: 70 90 1a 05 lds r7, 0x051A ; 0x80051a float ambient_temp = current_temperature_ambient_isr; 26e1e: c0 90 20 06 lds r12, 0x0620 ; 0x800620 26e22: d0 90 21 06 lds r13, 0x0621 ; 0x800621 26e26: e0 90 22 06 lds r14, 0x0622 ; 0x800622 26e2a: 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) 26e2e: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26e32: 80 ff sbrs r24, 0 26e34: 72 c0 rjmp .+228 ; 0x26f1a 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); 26e36: 20 91 e6 12 lds r18, 0x12E6 ; 0x8012e6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x36> 26e3a: 30 91 e7 12 lds r19, 0x12E7 ; 0x8012e7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x37> 26e3e: 40 91 e8 12 lds r20, 0x12E8 ; 0x8012e8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x38> 26e42: 50 91 e9 12 lds r21, 0x12E9 ; 0x8012e9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x39> 26e46: 61 e7 ldi r22, 0x71 ; 113 26e48: 7d e3 ldi r23, 0x3D ; 61 26e4a: 8a e8 ldi r24, 0x8A ; 138 26e4c: 9e e3 ldi r25, 0x3E ; 62 26e4e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 26e52: 60 93 3d 13 sts 0x133D, r22 ; 0x80133d <_ZN13thermal_modelL4dataE.lto_priv.400+0x8d> 26e56: 70 93 3e 13 sts 0x133E, r23 ; 0x80133e <_ZN13thermal_modelL4dataE.lto_priv.400+0x8e> 26e5a: 80 93 3f 13 sts 0x133F, r24 ; 0x80133f <_ZN13thermal_modelL4dataE.lto_priv.400+0x8f> 26e5e: 90 93 40 13 sts 0x1340, r25 ; 0x801340 <_ZN13thermal_modelL4dataE.lto_priv.400+0x90> warn_s = warn * TEMP_MGR_INTV; 26e62: 21 e7 ldi r18, 0x71 ; 113 26e64: 3d e3 ldi r19, 0x3D ; 61 26e66: 4a e8 ldi r20, 0x8A ; 138 26e68: 5e e3 ldi r21, 0x3E ; 62 26e6a: 60 91 34 13 lds r22, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 26e6e: 70 91 35 13 lds r23, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 26e72: 80 91 36 13 lds r24, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 26e76: 90 91 37 13 lds r25, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> 26e7a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 26e7e: 60 93 41 13 sts 0x1341, r22 ; 0x801341 <_ZN13thermal_modelL4dataE.lto_priv.400+0x91> 26e82: 70 93 42 13 sts 0x1342, r23 ; 0x801342 <_ZN13thermal_modelL4dataE.lto_priv.400+0x92> 26e86: 80 93 43 13 sts 0x1343, r24 ; 0x801343 <_ZN13thermal_modelL4dataE.lto_priv.400+0x93> 26e8a: 90 93 44 13 sts 0x1344, r25 ; 0x801344 <_ZN13thermal_modelL4dataE.lto_priv.400+0x94> err_s = err * TEMP_MGR_INTV; 26e8e: 21 e7 ldi r18, 0x71 ; 113 26e90: 3d e3 ldi r19, 0x3D ; 61 26e92: 4a e8 ldi r20, 0x8A ; 138 26e94: 5e e3 ldi r21, 0x3E ; 62 26e96: 60 91 38 13 lds r22, 0x1338 ; 0x801338 <_ZN13thermal_modelL4dataE.lto_priv.400+0x88> 26e9a: 70 91 39 13 lds r23, 0x1339 ; 0x801339 <_ZN13thermal_modelL4dataE.lto_priv.400+0x89> 26e9e: 80 91 3a 13 lds r24, 0x133A ; 0x80133a <_ZN13thermal_modelL4dataE.lto_priv.400+0x8a> 26ea2: 90 91 3b 13 lds r25, 0x133B ; 0x80133b <_ZN13thermal_modelL4dataE.lto_priv.400+0x8b> 26ea6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 26eaa: 60 93 45 13 sts 0x1345, r22 ; 0x801345 <_ZN13thermal_modelL4dataE.lto_priv.400+0x95> 26eae: 70 93 46 13 sts 0x1346, r23 ; 0x801346 <_ZN13thermal_modelL4dataE.lto_priv.400+0x96> 26eb2: 80 93 47 13 sts 0x1347, r24 ; 0x801347 <_ZN13thermal_modelL4dataE.lto_priv.400+0x97> 26eb6: 90 93 48 13 sts 0x1348, r25 ; 0x801348 <_ZN13thermal_modelL4dataE.lto_priv.400+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 26eba: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee <_ZN13thermal_modelL4dataE.lto_priv.400+0x3e> 26ebe: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef <_ZN13thermal_modelL4dataE.lto_priv.400+0x3f> 26ec2: 6e e0 ldi r22, 0x0E ; 14 26ec4: 71 e0 ldi r23, 0x01 ; 1 26ec6: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 26eca: 60 93 d0 12 sts 0x12D0, r22 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.400+0x20> 26ece: e0 eb ldi r30, 0xB0 ; 176 26ed0: f2 e1 ldi r31, 0x12 ; 18 26ed2: 80 ed ldi r24, 0xD0 ; 208 26ed4: 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; 26ed6: 40 e0 ldi r20, 0x00 ; 0 26ed8: 50 e0 ldi r21, 0x00 ; 0 26eda: 60 ec ldi r22, 0xC0 ; 192 26edc: 7f e7 ldi r23, 0x7F ; 127 26ede: 41 93 st Z+, r20 26ee0: 51 93 st Z+, r21 26ee2: 61 93 st Z+, r22 26ee4: 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) 26ee6: 8e 17 cp r24, r30 26ee8: 9f 07 cpc r25, r31 26eea: c9 f7 brne .-14 ; 0x26ede dT_lag_buf[i] = NAN; dT_lag_idx = 0; 26eec: 10 92 d1 12 sts 0x12D1, r1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.400+0x21> dT_err_prev = 0; 26ef0: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 26ef4: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 26ef8: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 26efc: 10 92 d5 12 sts 0x12D5, r1 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> T_prev = NAN; 26f00: 40 93 d6 12 sts 0x12D6, r20 ; 0x8012d6 <_ZN13thermal_modelL4dataE.lto_priv.400+0x26> 26f04: 50 93 d7 12 sts 0x12D7, r21 ; 0x8012d7 <_ZN13thermal_modelL4dataE.lto_priv.400+0x27> 26f08: 60 93 d8 12 sts 0x12D8, r22 ; 0x8012d8 <_ZN13thermal_modelL4dataE.lto_priv.400+0x28> 26f0c: 70 93 d9 12 sts 0x12D9, r23 ; 0x8012d9 <_ZN13thermal_modelL4dataE.lto_priv.400+0x29> // clear the initialization flag flag_bits.uninitialized = false; 26f10: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26f14: 8e 7f andi r24, 0xFE ; 254 26f16: 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); 26f1a: 87 01 movw r16, r14 26f1c: 76 01 movw r14, r12 26f1e: a3 01 movw r20, r6 26f20: 92 01 movw r18, r4 26f22: 6d 2f mov r22, r29 26f24: 8c 2f mov r24, r28 26f26: 0e 94 3a e5 call 0x1ca74 ; 0x1ca74 // handle errors if(data.flag_bits.error) 26f2a: 80 91 3c 13 lds r24, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26f2e: 81 ff sbrs r24, 1 26f30: 05 c0 rjmp .+10 ; 0x26f3c set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 26f32: 44 e0 ldi r20, 0x04 ; 4 26f34: 60 e0 ldi r22, 0x00 ; 0 26f36: 80 e0 ldi r24, 0x00 ; 0 26f38: 0f 94 3a 2f call 0x25e74 ; 0x25e74 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 26f3c: 90 91 3c 13 lds r25, 0x133C ; 0x80133c <_ZN13thermal_modelL4dataE.lto_priv.400+0x8c> 26f40: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26f44: 92 fb bst r25, 2 26f46: 81 f9 bld r24, 1 26f48: 80 93 39 06 sts 0x0639, r24 ; 0x800639 if(warning_state.assert) { 26f4c: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26f50: 81 ff sbrs r24, 1 26f52: 15 c0 rjmp .+42 ; 0x26f7e warning_state.warning = true; 26f54: 80 91 39 06 lds r24, 0x0639 ; 0x800639 26f58: 81 60 ori r24, 0x01 ; 1 26f5a: 80 93 39 06 sts 0x0639, r24 ; 0x800639 warning_state.dT_err = thermal_model::data.dT_err_prev; 26f5e: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 <_ZN13thermal_modelL4dataE.lto_priv.400+0x22> 26f62: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 <_ZN13thermal_modelL4dataE.lto_priv.400+0x23> 26f66: a0 91 d4 12 lds r26, 0x12D4 ; 0x8012d4 <_ZN13thermal_modelL4dataE.lto_priv.400+0x24> 26f6a: b0 91 d5 12 lds r27, 0x12D5 ; 0x8012d5 <_ZN13thermal_modelL4dataE.lto_priv.400+0x25> 26f6e: 80 93 35 06 sts 0x0635, r24 ; 0x800635 26f72: 90 93 36 06 sts 0x0636, r25 ; 0x800636 26f76: a0 93 37 06 sts 0x0637, r26 ; 0x800637 26f7a: 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; 26f7e: 80 91 34 06 lds r24, 0x0634 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 26f82: 88 23 and r24, r24 26f84: 09 f4 brne .+2 ; 0x26f88 26f86: 3f c0 rjmp .+126 ; 0x27006 uint32_t stamp = _millis(); 26f88: 0f 94 53 29 call 0x252a6 ; 0x252a6 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 26f8c: c0 90 24 06 lds r12, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 26f90: d0 90 25 06 lds r13, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 26f94: e0 90 26 06 lds r14, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 26f98: f0 90 27 06 lds r15, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> log_buf.entry.stamp = stamp; 26f9c: 60 93 24 06 sts 0x0624, r22 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.537> 26fa0: 70 93 25 06 sts 0x0625, r23 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x1> 26fa4: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x2> 26fa8: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x3> ++log_buf.entry.counter; 26fac: 20 91 29 06 lds r18, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> 26fb0: 2f 5f subi r18, 0xFF ; 255 26fb2: 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); 26fb6: 6c 19 sub r22, r12 26fb8: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 26fba: 60 93 28 06 sts 0x0628, r22 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 26fbe: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 26fc2: 80 93 2a 06 sts 0x062A, r24 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 26fc6: 80 91 17 05 lds r24, 0x0517 ; 0x800517 26fca: 90 91 18 05 lds r25, 0x0518 ; 0x800518 26fce: a0 91 19 05 lds r26, 0x0519 ; 0x800519 26fd2: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 26fd6: 80 93 2b 06 sts 0x062B, r24 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x7> 26fda: 90 93 2c 06 sts 0x062C, r25 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x8> 26fde: a0 93 2d 06 sts 0x062D, r26 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x9> 26fe2: b0 93 2e 06 sts 0x062E, r27 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 26fe6: 80 91 20 06 lds r24, 0x0620 ; 0x800620 26fea: 90 91 21 06 lds r25, 0x0621 ; 0x800621 26fee: a0 91 22 06 lds r26, 0x0622 ; 0x800622 26ff2: b0 91 23 06 lds r27, 0x0623 ; 0x800623 26ff6: 80 93 2f 06 sts 0x062F, r24 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xb> 26ffa: 90 93 30 06 sts 0x0630, r25 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xc> 26ffe: a0 93 31 06 sts 0x0631, r26 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xd> 27002: 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) 27006: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> 2700a: 88 23 and r24, r24 2700c: 91 f0 breq .+36 ; 0x27032 temp_mgr_pid(); } 2700e: df 91 pop r29 27010: cf 91 pop r28 27012: 1f 91 pop r17 27014: 0f 91 pop r16 27016: ff 90 pop r15 27018: ef 90 pop r14 2701a: df 90 pop r13 2701c: cf 90 pop r12 2701e: af 90 pop r10 27020: 7f 90 pop r7 27022: 6f 90 pop r6 27024: 5f 90 pop r5 27026: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 27028: 0d 94 d7 10 jmp 0x221ae ; 0x221ae // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 2702c: 0f 94 af 2f call 0x25f5e ; 0x25f5e 27030: 8e ce rjmp .-740 ; 0x26d4e #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 27032: df 91 pop r29 27034: cf 91 pop r28 27036: 1f 91 pop r17 27038: 0f 91 pop r16 2703a: ff 90 pop r15 2703c: ef 90 pop r14 2703e: df 90 pop r13 27040: cf 90 pop r12 27042: af 90 pop r10 27044: 7f 90 pop r7 27046: 6f 90 pop r6 27048: 5f 90 pop r5 2704a: 4f 90 pop r4 2704c: 08 95 ret 0002704e <__vector_47>: ISR(TIMERx_COMPA_vect) { 2704e: 1f 92 push r1 27050: 0f 92 push r0 27052: 0f b6 in r0, 0x3f ; 63 27054: 0f 92 push r0 27056: 11 24 eor r1, r1 27058: 0b b6 in r0, 0x3b ; 59 2705a: 0f 92 push r0 2705c: 2f 93 push r18 2705e: 3f 93 push r19 27060: 4f 93 push r20 27062: 5f 93 push r21 27064: 6f 93 push r22 27066: 7f 93 push r23 27068: 8f 93 push r24 2706a: 9f 93 push r25 2706c: af 93 push r26 2706e: bf 93 push r27 27070: ef 93 push r30 27072: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 27074: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> 27078: 88 23 and r24, r24 2707a: 91 f0 breq .+36 ; 0x270a0 <__vector_47+0x52> adc_values_ready = false; 2707c: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.457> adc_start_cycle(); 27080: 0e 94 de 8d call 0x11bbc ; 0x11bbc // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 27084: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 27088: 8d 7f andi r24, 0xFD ; 253 2708a: 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(); 2708e: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 27090: 0f 94 c0 35 call 0x26b80 ; 0x26b80 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 27094: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 27096: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 2709a: 82 60 ori r24, 0x02 ; 2 2709c: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 270a0: ff 91 pop r31 270a2: ef 91 pop r30 270a4: bf 91 pop r27 270a6: af 91 pop r26 270a8: 9f 91 pop r25 270aa: 8f 91 pop r24 270ac: 7f 91 pop r23 270ae: 6f 91 pop r22 270b0: 5f 91 pop r21 270b2: 4f 91 pop r20 270b4: 3f 91 pop r19 270b6: 2f 91 pop r18 270b8: 0f 90 pop r0 270ba: 0b be out 0x3b, r0 ; 59 270bc: 0f 90 pop r0 270be: 0f be out 0x3f, r0 ; 63 270c0: 0f 90 pop r0 270c2: 1f 90 pop r1 270c4: 18 95 reti 000270c6 : } void handle_temp_error(); void manage_heater() { 270c6: 6f 92 push r6 270c8: 7f 92 push r7 270ca: 8f 92 push r8 270cc: 9f 92 push r9 270ce: af 92 push r10 270d0: bf 92 push r11 270d2: cf 92 push r12 270d4: df 92 push r13 270d6: ef 92 push r14 270d8: ff 92 push r15 270da: 0f 93 push r16 270dc: 1f 93 push r17 270de: cf 93 push r28 270e0: df 93 push r29 270e2: 1f 92 push r1 270e4: cd b7 in r28, 0x3d ; 61 270e6: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 270e8: 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) 270ea: 80 91 02 06 lds r24, 0x0602 ; 0x800602 270ee: 88 23 and r24, r24 270f0: 09 f4 brne .+2 ; 0x270f4 270f2: bb c0 rjmp .+374 ; 0x2726a return; // syncronize temperatures with isr updateTemperatures(); 270f4: 0f 94 84 32 call 0x26508 ; 0x26508 #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 270f8: 80 91 39 06 lds r24, 0x0639 ; 0x800639 270fc: 80 ff sbrs r24, 0 270fe: 51 c0 rjmp .+162 ; 0x271a2 } static void handle_warning() { // update values float warn = data.warn; 27100: 10 91 34 13 lds r17, 0x1334 ; 0x801334 <_ZN13thermal_modelL4dataE.lto_priv.400+0x84> 27104: 00 91 35 13 lds r16, 0x1335 ; 0x801335 <_ZN13thermal_modelL4dataE.lto_priv.400+0x85> 27108: b0 90 36 13 lds r11, 0x1336 ; 0x801336 <_ZN13thermal_modelL4dataE.lto_priv.400+0x86> 2710c: a0 90 37 13 lds r10, 0x1337 ; 0x801337 <_ZN13thermal_modelL4dataE.lto_priv.400+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 27110: ce 01 movw r24, r28 27112: 01 96 adiw r24, 0x01 ; 1 27114: 0f 94 a1 31 call 0x26342 ; 0x26342 dT_err = warning_state.dT_err; 27118: c0 90 35 06 lds r12, 0x0635 ; 0x800635 2711c: d0 90 36 06 lds r13, 0x0636 ; 0x800636 27120: e0 90 37 06 lds r14, 0x0637 ; 0x800637 27124: f0 90 38 06 lds r15, 0x0638 ; 0x800638 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 27128: ce 01 movw r24, r28 2712a: 01 96 adiw r24, 0x01 ; 1 2712c: 0f 94 94 31 call 0x26328 ; 0x26328 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); 27130: af 92 push r10 27132: bf 92 push r11 27134: 0f 93 push r16 27136: 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 27138: 21 e7 ldi r18, 0x71 ; 113 2713a: 3d e3 ldi r19, 0x3D ; 61 2713c: 4a e8 ldi r20, 0x8A ; 138 2713e: 5e e3 ldi r21, 0x3E ; 62 27140: c7 01 movw r24, r14 27142: b6 01 movw r22, r12 27144: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 27148: 9f 93 push r25 2714a: 8f 93 push r24 2714c: 7f 93 push r23 2714e: 6f 93 push r22 27150: 8b e0 ldi r24, 0x0B ; 11 27152: 9c e9 ldi r25, 0x9C ; 156 27154: 9f 93 push r25 27156: 8f 93 push r24 27158: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca static bool first = true; if(warning_state.assert) { 2715c: 90 91 39 06 lds r25, 0x0639 ; 0x800639 27160: 0f b6 in r0, 0x3f ; 63 27162: f8 94 cli 27164: de bf out 0x3e, r29 ; 62 27166: 0f be out 0x3f, r0 ; 63 27168: cd bf out 0x3d, r28 ; 61 2716a: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.455> 2716e: 91 ff sbrs r25, 1 27170: 93 c0 rjmp .+294 ; 0x27298 if (first) { 27172: 90 91 a3 02 lds r25, 0x02A3 ; 0x8002a3 27176: 99 23 and r25, r25 27178: 09 f4 brne .+2 ; 0x2717c 2717a: 87 c0 rjmp .+270 ; 0x2728a if(warn_beep) { 2717c: 88 23 and r24, r24 2717e: 79 f0 breq .+30 ; 0x2719e lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 27180: 8e ea ldi r24, 0xAE ; 174 27182: 9d e4 ldi r25, 0x4D ; 77 27184: 0e 94 b3 72 call 0xe566 ; 0xe566 27188: 61 e0 ldi r22, 0x01 ; 1 2718a: 0e 94 24 f1 call 0x1e248 ; 0x1e248 WRITE(BEEPER, HIGH); 2718e: 9f b7 in r25, 0x3f ; 63 27190: f8 94 cli 27192: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27196: 84 60 ori r24, 0x04 ; 4 27198: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2719c: 9f bf out 0x3f, r25 ; 63 } first = false; 2719e: 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) 271a2: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 271a6: 88 23 and r24, r24 271a8: 89 f0 breq .+34 ; 0x271cc #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 271aa: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 271ae: 82 95 swap r24 271b0: 86 95 lsr r24 271b2: 87 70 andi r24, 0x07 ; 7 271b4: 84 30 cpi r24, 0x04 ; 4 271b6: 08 f0 brcs .+2 ; 0x271ba 271b8: 82 c0 rjmp .+260 ; 0x272be 271ba: 82 30 cpi r24, 0x02 ; 2 271bc: 08 f0 brcs .+2 ; 0x271c0 271be: 1d c1 rjmp .+570 ; 0x273fa 271c0: 88 23 and r24, r24 271c2: 09 f4 brne .+2 ; 0x271c6 271c4: f4 c0 rjmp .+488 ; 0x273ae 271c6: 81 30 cpi r24, 0x01 ; 1 271c8: 09 f4 brne .+2 ; 0x271cc 271ca: 94 c0 rjmp .+296 ; 0x272f4 // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 271cc: 0e 94 09 80 call 0x10012 ; 0x10012 } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 271d0: 80 91 34 06 lds r24, 0x0634 ; 0x800634 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x10> 271d4: 88 23 and r24, r24 271d6: 09 f4 brne .+2 ; 0x271da 271d8: 48 c0 rjmp .+144 ; 0x2726a uint8_t counter = log_buf.entry.counter; 271da: 80 91 29 06 lds r24, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> if (counter == log_buf.serial) return; 271de: 70 90 33 06 lds r7, 0x0633 ; 0x800633 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xf> 271e2: 87 15 cp r24, r7 271e4: 09 f4 brne .+2 ; 0x271e8 271e6: 41 c0 rjmp .+130 ; 0x2726a // 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; 271e8: ce 01 movw r24, r28 271ea: 01 96 adiw r24, 0x01 ; 1 271ec: 0f 94 a1 31 call 0x26342 ; 0x26342 delta_ms = log_buf.entry.delta_ms; 271f0: 00 91 28 06 lds r16, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x4> counter = log_buf.entry.counter; 271f4: 10 91 29 06 lds r17, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x5> cur_pwm = log_buf.entry.cur_pwm; 271f8: 60 90 2a 06 lds r6, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x6> cur_temp = log_buf.entry.cur_temp; 271fc: c0 90 2b 06 lds r12, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x7> 27200: d0 90 2c 06 lds r13, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x8> 27204: e0 90 2d 06 lds r14, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.537+0x9> 27208: f0 90 2e 06 lds r15, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xa> cur_amb = log_buf.entry.cur_amb; 2720c: 80 90 2f 06 lds r8, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xb> 27210: 90 90 30 06 lds r9, 0x0630 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xc> 27214: a0 90 31 06 lds r10, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.537+0xd> 27218: 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; 2721c: ce 01 movw r24, r28 2721e: 01 96 adiw r24, 0x01 ; 1 27220: 0f 94 94 31 call 0x26328 ; 0x26328 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; 27224: 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, 27228: bf 92 push r11 2722a: af 92 push r10 2722c: 9f 92 push r9 2722e: 8f 92 push r8 27230: ff 92 push r15 27232: ef 92 push r14 27234: df 92 push r13 27236: cf 92 push r12 27238: 1f 92 push r1 2723a: 6f 92 push r6 2723c: 80 2f mov r24, r16 2723e: 00 0f add r16, r16 27240: 99 0b sbc r25, r25 27242: 01 96 adiw r24, 0x01 ; 1 27244: 9f 93 push r25 27246: 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; 27248: 81 2f mov r24, r17 2724a: 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, 2724c: 81 50 subi r24, 0x01 ; 1 2724e: 99 0b sbc r25, r25 27250: 9f 93 push r25 27252: 8f 93 push r24 27254: 8e e8 ldi r24, 0x8E ; 142 27256: 9b e9 ldi r25, 0x9B ; 155 27258: 9f 93 push r25 2725a: 8f 93 push r24 2725c: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 27260: 0f b6 in r0, 0x3f ; 63 27262: f8 94 cli 27264: de bf out 0x3e, r29 ; 62 27266: 0f be out 0x3f, r0 ; 63 27268: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 2726a: 0f 90 pop r0 2726c: df 91 pop r29 2726e: cf 91 pop r28 27270: 1f 91 pop r17 27272: 0f 91 pop r16 27274: ff 90 pop r15 27276: ef 90 pop r14 27278: df 90 pop r13 2727a: cf 90 pop r12 2727c: bf 90 pop r11 2727e: af 90 pop r10 27280: 9f 90 pop r9 27282: 8f 90 pop r8 27284: 7f 90 pop r7 27286: 6f 90 pop r6 27288: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 2728a: 88 23 and r24, r24 2728c: 09 f4 brne .+2 ; 0x27290 2728e: 89 cf rjmp .-238 ; 0x271a2 27290: 84 e0 ldi r24, 0x04 ; 4 27292: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 27296: 85 cf rjmp .-246 ; 0x271a2 } } else { // warning cleared, reset state warning_state.warning = false; 27298: 90 91 39 06 lds r25, 0x0639 ; 0x800639 2729c: 9e 7f andi r25, 0xFE ; 254 2729e: 90 93 39 06 sts 0x0639, r25 ; 0x800639 if(warn_beep) WRITE(BEEPER, LOW); 272a2: 88 23 and r24, r24 272a4: 41 f0 breq .+16 ; 0x272b6 272a6: 9f b7 in r25, 0x3f ; 63 272a8: f8 94 cli 272aa: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272ae: 8b 7f andi r24, 0xFB ; 251 272b0: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272b4: 9f bf out 0x3f, r25 ; 63 first = true; 272b6: 81 e0 ldi r24, 0x01 ; 1 272b8: 80 93 a3 02 sts 0x02A3, r24 ; 0x8002a3 272bc: 72 cf rjmp .-284 ; 0x271a2 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 272be: 84 30 cpi r24, 0x04 ; 4 272c0: 09 f0 breq .+2 ; 0x272c4 272c2: 84 cf rjmp .-248 ; 0x271cc #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 272c4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 272c8: 81 ff sbrs r24, 1 272ca: b4 c0 rjmp .+360 ; 0x27434 if(IsStopped() == false) { 272cc: 80 91 11 05 lds r24, 0x0511 ; 0x800511 272d0: 81 11 cpse r24, r1 272d2: 04 c0 rjmp .+8 ; 0x272dc SERIAL_ECHOLNPGM("TM: error triggered!"); 272d4: 86 ef ldi r24, 0xF6 ; 246 272d6: 9b e9 ldi r25, 0x9B ; 155 272d8: 0e 94 82 79 call 0xf304 ; 0xf304 } ThermalStop(true); 272dc: 81 e0 ldi r24, 0x01 ; 1 272de: 0e 94 b3 79 call 0xf366 ; 0xf366 WRITE(BEEPER, HIGH); 272e2: 9f b7 in r25, 0x3f ; 63 272e4: f8 94 cli 272e6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272ea: 84 60 ori r24, 0x04 ; 4 272ec: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 272f0: 9f bf out 0x3f, r25 ; 63 272f2: 6c cf rjmp .-296 ; 0x271cc void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 272f4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 272f8: 86 95 lsr r24 272fa: 86 95 lsr r24 272fc: 83 70 andi r24, 0x03 ; 3 272fe: 81 30 cpi r24, 0x01 ; 1 27300: d9 f1 breq .+118 ; 0x27378 27302: 58 f0 brcs .+22 ; 0x2731a 27304: 82 30 cpi r24, 0x02 ; 2 27306: 09 f0 breq .+2 ; 0x2730a 27308: 61 cf rjmp .-318 ; 0x271cc } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 2730a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2730e: 81 11 cpse r24, r1 27310: 14 c0 rjmp .+40 ; 0x2733a temp_error_messagepgm(PSTR("MINTEMP AMB")); 27312: 61 e0 ldi r22, 0x01 ; 1 27314: 88 eb ldi r24, 0xB8 ; 184 27316: 9b e9 ldi r25, 0x9B ; 155 27318: 0e c0 rjmp .+28 ; 0x27336 // 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) { 2731a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 2731e: 81 ff sbrs r24, 1 27320: 10 c0 rjmp .+32 ; 0x27342 min_temp_error(temp_error_state.index); 27322: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27326: 62 95 swap r22 27328: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 2732a: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2732e: 81 11 cpse r24, r1 27330: 04 c0 rjmp .+8 ; 0x2733a temp_error_messagepgm(err, e); 27332: 84 ea ldi r24, 0xA4 ; 164 27334: 9b e9 ldi r25, 0x9B ; 155 27336: 0f 94 04 2c call 0x25808 ; 0x25808 prusa_statistics(92); } ThermalStop(); 2733a: 80 e0 ldi r24, 0x00 ; 0 2733c: 0e 94 b3 79 call 0xf366 ; 0xf366 27340: 45 cf rjmp .-374 ; 0x271cc // 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); 27342: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 <_ZL8minttemp.lto_priv.461> 27346: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 <_ZL8minttemp.lto_priv.461+0x1> 2734a: 6b 5f subi r22, 0xFB ; 251 2734c: 7f 4f sbci r23, 0xFF ; 255 2734e: 07 2e mov r0, r23 27350: 00 0c add r0, r0 27352: 88 0b sbc r24, r24 27354: 99 0b sbc r25, r25 27356: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2735a: 8b 01 movw r16, r22 2735c: 9c 01 movw r18, r24 2735e: 40 91 b0 0d lds r20, 0x0DB0 ; 0x800db0 27362: 50 91 b1 0d lds r21, 0x0DB1 ; 0x800db1 27366: 60 91 b2 0d lds r22, 0x0DB2 ; 0x800db2 2736a: 70 91 b3 0d lds r23, 0x0DB3 ; 0x800db3 2736e: 8f e9 ldi r24, 0x9F ; 159 27370: 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); 27372: 0f 94 08 1f call 0x23e10 ; 0x23e10 27376: 2a cf rjmp .-428 ; 0x271cc // 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) { 27378: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 2737c: 81 ff sbrs r24, 1 2737e: 08 c0 rjmp .+16 ; 0x27390 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 27380: 80 91 11 05 lds r24, 0x0511 ; 0x800511 27384: 81 11 cpse r24, r1 27386: d9 cf rjmp .-78 ; 0x2733a temp_error_messagepgm(err); 27388: 61 e0 ldi r22, 0x01 ; 1 2738a: 8c ea ldi r24, 0xAC ; 172 2738c: 9b e9 ldi r25, 0x9B ; 155 2738e: d3 cf rjmp .-90 ; 0x27336 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); 27390: 40 91 ee 04 lds r20, 0x04EE ; 0x8004ee 27394: 50 91 ef 04 lds r21, 0x04EF ; 0x8004ef 27398: 60 91 f0 04 lds r22, 0x04F0 ; 0x8004f0 2739c: 70 91 f1 04 lds r23, 0x04F1 ; 0x8004f1 273a0: 00 e0 ldi r16, 0x00 ; 0 273a2: 10 e0 ldi r17, 0x00 ; 0 273a4: 20 e7 ldi r18, 0x70 ; 112 273a6: 31 e4 ldi r19, 0x41 ; 65 273a8: 8b e9 ldi r24, 0x9B ; 155 273aa: 92 e0 ldi r25, 0x02 ; 2 273ac: e2 cf rjmp .-60 ; 0x27372 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 273ae: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 273b2: 86 95 lsr r24 273b4: 86 95 lsr r24 273b6: 83 70 andi r24, 0x03 ; 3 273b8: 81 30 cpi r24, 0x01 ; 1 273ba: b9 f0 breq .+46 ; 0x273ea 273bc: 58 f0 brcs .+22 ; 0x273d4 273be: 82 30 cpi r24, 0x02 ; 2 273c0: 09 f0 breq .+2 ; 0x273c4 273c2: 04 cf rjmp .-504 ; 0x271cc } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 273c4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 273c8: 81 11 cpse r24, r1 273ca: b7 cf rjmp .-146 ; 0x2733a temp_error_messagepgm(PSTR("MAXTEMP AMB")); 273cc: 61 e0 ldi r22, 0x01 ; 1 273ce: 88 ed ldi r24, 0xD8 ; 216 273d0: 9b e9 ldi r25, 0x9B ; 155 273d2: b1 cf rjmp .-158 ; 0x27336 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 273d4: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 273d8: 62 95 swap r22 273da: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 273dc: 80 91 11 05 lds r24, 0x0511 ; 0x800511 273e0: 81 11 cpse r24, r1 273e2: ab cf rjmp .-170 ; 0x2733a temp_error_messagepgm(PSTR("MAXTEMP"), e); 273e4: 84 ec ldi r24, 0xC4 ; 196 273e6: 9b e9 ldi r25, 0x9B ; 155 273e8: a6 cf rjmp .-180 ; 0x27336 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 273ea: 80 91 11 05 lds r24, 0x0511 ; 0x800511 273ee: 81 11 cpse r24, r1 273f0: a4 cf rjmp .-184 ; 0x2733a temp_error_messagepgm(PSTR("MAXTEMP BED")); 273f2: 61 e0 ldi r22, 0x01 ; 1 273f4: 8c ec ldi r24, 0xCC ; 204 273f6: 9b e9 ldi r25, 0x9B ; 155 273f8: 9e cf rjmp .-196 ; 0x27336 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 273fa: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 273fe: 86 95 lsr r24 27400: 86 95 lsr r24 27402: 83 70 andi r24, 0x03 ; 3 27404: 82 30 cpi r24, 0x02 ; 2 27406: 08 f0 brcs .+2 ; 0x2740a 27408: e1 ce rjmp .-574 ; 0x271cc case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 2740a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 2740e: 86 95 lsr r24 27410: 86 95 lsr r24 27412: 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), 27414: 90 91 1b 05 lds r25, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27418: 92 95 swap r25 2741a: 96 95 lsr r25 2741c: 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( 2741e: 61 e0 ldi r22, 0x01 ; 1 27420: 81 30 cpi r24, 0x01 ; 1 27422: 09 f0 breq .+2 ; 0x27426 27424: 60 e0 ldi r22, 0x00 ; 0 27426: 81 e0 ldi r24, 0x01 ; 1 27428: 92 30 cpi r25, 0x02 ; 2 2742a: 09 f0 breq .+2 ; 0x2742e 2742c: 80 e0 ldi r24, 0x00 ; 0 2742e: 0f 94 41 1f call 0x23e82 ; 0x23e82 27432: cc ce rjmp .-616 ; 0x271cc SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 27434: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16temp_error_state.lto_priv.454> WRITE(BEEPER, LOW); 27438: 9f b7 in r25, 0x3f ; 63 2743a: f8 94 cli 2743c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27440: 8b 7f andi r24, 0xFB ; 251 27442: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 27446: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 27448: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2744c: 90 91 73 06 lds r25, 0x0673 ; 0x800673 27450: 89 2b or r24, r25 27452: 39 f4 brne .+14 ; 0x27462 target_temperature_bed = saved_bed_temperature; 27454: 80 91 ae 05 lds r24, 0x05AE ; 0x8005ae 27458: 90 e0 ldi r25, 0x00 ; 0 2745a: 90 93 73 06 sts 0x0673, r25 ; 0x800673 2745e: 80 93 72 06 sts 0x0672, r24 ; 0x800672 SERIAL_ECHOLNPGM("TM: error cleared"); 27462: 84 ee ldi r24, 0xE4 ; 228 27464: 9b e9 ldi r25, 0x9B ; 155 27466: 0e 94 82 79 call 0xf304 ; 0xf304 2746a: b0 ce rjmp .-672 ; 0x271cc 0002746c : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 2746c: 4f 92 push r4 2746e: 5f 92 push r5 27470: 6f 92 push r6 27472: 7f 92 push r7 27474: 8f 92 push r8 27476: 9f 92 push r9 27478: af 92 push r10 2747a: bf 92 push r11 2747c: cf 92 push r12 2747e: df 92 push r13 27480: ef 92 push r14 27482: ff 92 push r15 27484: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 27486: 0f 94 53 29 call 0x252a6 ; 0x252a6 2748a: 28 ee ldi r18, 0xE8 ; 232 2748c: 33 e0 ldi r19, 0x03 ; 3 2748e: 40 e0 ldi r20, 0x00 ; 0 27490: 50 e0 ldi r21, 0x00 ; 0 27492: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 27496: 29 01 movw r4, r18 27498: 3a 01 movw r6, r20 lcd_consume_click(); 2749a: 0e 94 ff 70 call 0xe1fe ; 0xe1fe KEEPALIVE_STATE(PAUSED_FOR_USER); 2749e: 84 e0 ldi r24, 0x04 ; 4 274a0: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 274a4: f1 2c mov r15, r1 274a6: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 274a8: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 274ac: 81 e0 ldi r24, 0x01 ; 1 274ae: 0e 94 b6 8a call 0x1156c ; 0x1156c bDelayed = ((_millis()/1000-nTime0) > nDelay); 274b2: 0f 94 53 29 call 0x252a6 ; 0x252a6 274b6: 28 ee ldi r18, 0xE8 ; 232 274b8: 33 e0 ldi r19, 0x03 ; 3 274ba: 40 e0 ldi r20, 0x00 ; 0 274bc: 50 e0 ldi r21, 0x00 ; 0 274be: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 274c2: 49 01 movw r8, r18 274c4: 5a 01 movw r10, r20 274c6: 84 18 sub r8, r4 274c8: 95 08 sbc r9, r5 274ca: a6 08 sbc r10, r6 274cc: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 274ce: 0e 94 04 71 call 0xe208 ; 0xe208 274d2: 81 11 cpse r24, r1 274d4: 07 c0 rjmp .+14 ; 0x274e4 274d6: c8 14 cp r12, r8 274d8: d9 04 cpc r13, r9 274da: ea 04 cpc r14, r10 274dc: fb 04 cpc r15, r11 274de: 20 f7 brcc .-56 ; 0x274a8 274e0: 81 e0 ldi r24, 0x01 ; 1 274e2: 07 c0 rjmp .+14 ; 0x274f2 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 274e4: 81 e0 ldi r24, 0x01 ; 1 274e6: c8 14 cp r12, r8 274e8: d9 04 cpc r13, r9 274ea: ea 04 cpc r14, r10 274ec: fb 04 cpc r15, r11 274ee: 08 f0 brcs .+2 ; 0x274f2 274f0: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 274f2: 92 e0 ldi r25, 0x02 ; 2 274f4: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be return(!bDelayed); } } } 274f8: 91 e0 ldi r25, 0x01 ; 1 274fa: 89 27 eor r24, r25 274fc: ff 90 pop r15 274fe: ef 90 pop r14 27500: df 90 pop r13 27502: cf 90 pop r12 27504: bf 90 pop r11 27506: af 90 pop r10 27508: 9f 90 pop r9 2750a: 8f 90 pop r8 2750c: 7f 90 pop r7 2750e: 6f 90 pop r6 27510: 5f 90 pop r5 27512: 4f 90 pop r4 27514: 08 95 ret 00027516 : #endif } static void waiting_handler() { manage_heater(); 27516: 0f 94 63 38 call 0x270c6 ; 0x270c6 host_keepalive(); 2751a: 0e 94 ae 7f call 0xff5c ; 0xff5c host_autoreport(); 2751e: 0e 94 5f 79 call 0xf2be ; 0xf2be checkFans(); 27522: 0e 94 09 80 call 0x10012 ; 0x10012 lcd_update(0); 27526: 80 e0 ldi r24, 0x00 ; 0 27528: 0c 94 ae 6e jmp 0xdd5c ; 0xdd5c 0002752c : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 2752c: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 27530: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 27534: 65 50 subi r22, 0x05 ; 5 27536: 71 09 sbc r23, r1 27538: 07 2e mov r0, r23 2753a: 00 0c add r0, r0 2753c: 88 0b sbc r24, r24 2753e: 99 0b sbc r25, r25 27540: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 27544: 9b 01 movw r18, r22 27546: ac 01 movw r20, r24 27548: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 2754c: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 27550: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 27554: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 27558: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2755c: 87 ff sbrs r24, 7 2755e: 07 c0 rjmp .+14 ; 0x2756e if(temp_error_state.v) break; 27560: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 27564: 81 11 cpse r24, r1 27566: 03 c0 rjmp .+6 ; 0x2756e waiting_handler(); 27568: 0f 94 8b 3a call 0x27516 ; 0x27516 2756c: df cf rjmp .-66 ; 0x2752c } } 2756e: 08 95 ret 00027570 : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 27570: cf 92 push r12 27572: df 92 push r13 27574: ef 92 push r14 27576: ff 92 push r15 27578: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 2757a: 0f 94 53 29 call 0x252a6 ; 0x252a6 2757e: 9b 01 movw r18, r22 27580: ac 01 movw r20, r24 27582: 2e 0d add r18, r14 27584: 3f 1d adc r19, r15 27586: 41 1d adc r20, r1 27588: 51 1d adc r21, r1 2758a: 69 01 movw r12, r18 2758c: 7a 01 movw r14, r20 while(_millis() < mark) { 2758e: 0f 94 53 29 call 0x252a6 ; 0x252a6 27592: 6c 15 cp r22, r12 27594: 7d 05 cpc r23, r13 27596: 8e 05 cpc r24, r14 27598: 9f 05 cpc r25, r15 2759a: 38 f4 brcc .+14 ; 0x275aa if(temp_error_state.v) break; 2759c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.454> 275a0: 81 11 cpse r24, r1 275a2: 03 c0 rjmp .+6 ; 0x275aa waiting_handler(); 275a4: 0f 94 8b 3a call 0x27516 ; 0x27516 275a8: f2 cf rjmp .-28 ; 0x2758e } } 275aa: ff 90 pop r15 275ac: ef 90 pop r14 275ae: df 90 pop r13 275b0: cf 90 pop r12 275b2: 08 95 ret 000275b4 : 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; 275b4: 20 91 2a 0e lds r18, 0x0E2A ; 0x800e2a 275b8: 30 91 2b 0e lds r19, 0x0E2B ; 0x800e2b 275bc: 40 91 2c 0e lds r20, 0x0E2C ; 0x800e2c 275c0: 50 91 2d 0e lds r21, 0x0E2D ; 0x800e2d 275c4: 60 e0 ldi r22, 0x00 ; 0 275c6: 70 e0 ldi r23, 0x00 ; 0 275c8: 8f e7 ldi r24, 0x7F ; 127 275ca: 93 e4 ldi r25, 0x43 ; 67 275cc: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 275d0: 60 93 af 04 sts 0x04AF, r22 ; 0x8004af <_ZL14iState_sum_max.lto_priv.469> 275d4: 70 93 b0 04 sts 0x04B0, r23 ; 0x8004b0 <_ZL14iState_sum_max.lto_priv.469+0x1> 275d8: 80 93 b1 04 sts 0x04B1, r24 ; 0x8004b1 <_ZL14iState_sum_max.lto_priv.469+0x2> 275dc: 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; 275e0: 20 91 36 0e lds r18, 0x0E36 ; 0x800e36 275e4: 30 91 37 0e lds r19, 0x0E37 ; 0x800e37 275e8: 40 91 38 0e lds r20, 0x0E38 ; 0x800e38 275ec: 50 91 39 0e lds r21, 0x0E39 ; 0x800e39 275f0: 60 e0 ldi r22, 0x00 ; 0 275f2: 70 e0 ldi r23, 0x00 ; 0 275f4: 8f e7 ldi r24, 0x7F ; 127 275f6: 93 e4 ldi r25, 0x43 ; 67 275f8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 275fc: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL19temp_iState_max_bed.lto_priv.467> 27600: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL19temp_iState_max_bed.lto_priv.467+0x1> 27604: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL19temp_iState_max_bed.lto_priv.467+0x2> 27608: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL19temp_iState_max_bed.lto_priv.467+0x3> #endif } 2760c: 08 95 ret 0002760e : #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) { 2760e: 2f 92 push r2 27610: 3f 92 push r3 27612: 4f 92 push r4 27614: 5f 92 push r5 27616: 6f 92 push r6 27618: 7f 92 push r7 2761a: 8f 92 push r8 2761c: 9f 92 push r9 2761e: af 92 push r10 27620: bf 92 push r11 27622: cf 92 push r12 27624: df 92 push r13 27626: ef 92 push r14 27628: ff 92 push r15 2762a: 0f 93 push r16 2762c: 1f 93 push r17 2762e: cf 93 push r28 27630: df 93 push r29 27632: cd b7 in r28, 0x3d ; 61 27634: de b7 in r29, 0x3e ; 62 27636: e0 97 sbiw r28, 0x30 ; 48 27638: 0f b6 in r0, 0x3f ; 63 2763a: f8 94 cli 2763c: de bf out 0x3e, r29 ; 62 2763e: 0f be out 0x3f, r0 ; 63 27640: cd bf out 0x3d, r28 ; 61 27642: 6a 87 std Y+10, r22 ; 0x0a 27644: 7b 87 std Y+11, r23 ; 0x0b 27646: 8c 87 std Y+12, r24 ; 0x0c 27648: 9d 87 std Y+13, r25 ; 0x0d 2764a: 1a 01 movw r2, r20 2764c: 3a a7 std Y+42, r19 ; 0x2a 2764e: 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(); 27650: 0f 94 1f 2f call 0x25e3e ; 0x25e3e pid_tuning_finished = false; 27654: 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; 27658: 29 a5 ldd r18, Y+41 ; 0x29 2765a: 3a a5 ldd r19, Y+42 ; 0x2a 2765c: 30 93 48 06 sts 0x0648, r19 ; 0x800648 27660: 20 93 47 06 sts 0x0647, r18 ; 0x800647 float input = 0.0; pid_cycle=0; 27664: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27668: 10 92 49 06 sts 0x0649, r1 ; 0x800649 bool heating = true; unsigned long temp_millis = _millis(); 2766c: 0f 94 53 29 call 0x252a6 ; 0x252a6 27670: 6e 83 std Y+6, r22 ; 0x06 27672: 7f 83 std Y+7, r23 ; 0x07 27674: 88 87 std Y+8, r24 ; 0x08 27676: 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 27678: 37 fe sbrs r3, 7 2767a: ff c0 rjmp .+510 ; 0x2787a 2767c: 3d e2 ldi r19, 0x2D ; 45 2767e: 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(); 27680: 0f 94 53 29 call 0x252a6 ; 0x252a6 27684: 6c a3 std Y+36, r22 ; 0x24 27686: 7d a3 std Y+37, r23 ; 0x25 27688: 8e a3 std Y+38, r24 ; 0x26 2768a: 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."); 2768c: 84 e6 ldi r24, 0x64 ; 100 2768e: 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) 27690: 12 14 cp r1, r2 27692: 13 04 cpc r1, r3 27694: 0c f4 brge .+2 ; 0x27698 27696: 8a c2 rjmp .+1300 ; 0x27bac pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 27698: 81 e5 ldi r24, 0x51 ; 81 2769a: 9b e9 ldi r25, 0x9B ; 155 2769c: 0e 94 82 79 call 0xf304 ; 0xf304 276a0: 6a 85 ldd r22, Y+10 ; 0x0a 276a2: 7b 85 ldd r23, Y+11 ; 0x0b 276a4: 8c 85 ldd r24, Y+12 ; 0x0c 276a6: 9d 85 ldd r25, Y+13 ; 0x0d 276a8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 276ac: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 276ae: 21 14 cp r2, r1 276b0: 31 04 cpc r3, r1 276b2: 09 f4 brne .+2 ; 0x276b6 276b4: e5 c0 rjmp .+458 ; 0x27880 { soft_pwm_bed = (MAX_BED_POWER)/2; 276b6: 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 276ba: 70 93 73 06 sts 0x0673, r23 ; 0x800673 276be: 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 276c2: 8e 81 ldd r24, Y+6 ; 0x06 276c4: 9f 81 ldd r25, Y+7 ; 0x07 276c6: a8 85 ldd r26, Y+8 ; 0x08 276c8: b9 85 ldd r27, Y+9 ; 0x09 276ca: 8e 87 std Y+14, r24 ; 0x0e 276cc: 9f 87 std Y+15, r25 ; 0x0f 276ce: a8 8b std Y+16, r26 ; 0x10 276d0: b9 8b std Y+17, r27 ; 0x11 276d2: 88 a3 std Y+32, r24 ; 0x20 276d4: 99 a3 std Y+33, r25 ; 0x21 276d6: aa a3 std Y+34, r26 ; 0x22 276d8: bb a3 std Y+35, r27 ; 0x23 276da: 1a 8a std Y+18, r1 ; 0x12 276dc: 90 e4 ldi r25, 0x40 ; 64 276de: 9b 8b std Y+19, r25 ; 0x13 276e0: ac e1 ldi r26, 0x1C ; 28 276e2: ac 8b std Y+20, r26 ; 0x14 276e4: b6 e4 ldi r27, 0x46 ; 70 276e6: bd 8b std Y+21, r27 ; 0x15 276e8: 1e 8a std Y+22, r1 ; 0x16 276ea: 1f 8a std Y+23, r1 ; 0x17 276ec: 18 8e std Y+24, r1 ; 0x18 276ee: 19 8e std Y+25, r1 ; 0x19 276f0: 6f e7 ldi r22, 0x7F ; 127 276f2: c6 2e mov r12, r22 276f4: d1 2c mov r13, r1 276f6: e1 2c mov r14, r1 276f8: f1 2c mov r15, r1 276fa: 00 e0 ldi r16, 0x00 ; 0 276fc: 10 e0 ldi r17, 0x00 ; 0 276fe: 18 aa std Y+48, r1 ; 0x30 27700: 1f a6 std Y+47, r1 ; 0x2f 27702: 1d 82 std Y+5, r1 ; 0x05 27704: 2f e7 ldi r18, 0x7F ; 127 27706: 30 e0 ldi r19, 0x00 ; 0 27708: 40 e0 ldi r20, 0x00 ; 0 2770a: 50 e0 ldi r21, 0x00 ; 0 2770c: 29 83 std Y+1, r18 ; 0x01 2770e: 3a 83 std Y+2, r19 ; 0x02 27710: 4b 83 std Y+3, r20 ; 0x03 27712: 5c 83 std Y+4, r21 ; 0x04 27714: 1b 8e std Y+27, r1 ; 0x1b 27716: 1c 8e std Y+28, r1 ; 0x1c 27718: 1d 8e std Y+29, r1 ; 0x1d 2771a: 1e 8e std Y+30, r1 ; 0x1e 2771c: 31 e0 ldi r19, 0x01 ; 1 2771e: 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(); 27720: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 27722: 40 91 02 06 lds r20, 0x0602 ; 0x800602 27726: 48 a7 std Y+40, r20 ; 0x28 27728: 44 23 and r20, r20 2772a: 09 f4 brne .+2 ; 0x2772e 2772c: 2c c2 rjmp .+1112 ; 0x27b86 updateTemperatures(); 2772e: 0f 94 84 32 call 0x26508 ; 0x26508 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 27732: 21 14 cp r2, r1 27734: 31 04 cpc r3, r1 27736: 09 f0 breq .+2 ; 0x2773a 27738: aa c0 rjmp .+340 ; 0x2788e 2773a: 00 91 b0 0d lds r16, 0x0DB0 ; 0x800db0 2773e: 10 91 b1 0d lds r17, 0x0DB1 ; 0x800db1 27742: 50 91 b2 0d lds r21, 0x0DB2 ; 0x800db2 27746: 58 ab std Y+48, r21 ; 0x30 27748: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 2774c: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2774e: 2e 89 ldd r18, Y+22 ; 0x16 27750: 3f 89 ldd r19, Y+23 ; 0x17 27752: 48 8d ldd r20, Y+24 ; 0x18 27754: 59 8d ldd r21, Y+25 ; 0x19 27756: b8 01 movw r22, r16 27758: 88 a9 ldd r24, Y+48 ; 0x30 2775a: 9f a5 ldd r25, Y+47 ; 0x2f 2775c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 27760: 87 fd sbrc r24, 7 27762: 06 c0 rjmp .+12 ; 0x27770 27764: 0e 8b std Y+22, r16 ; 0x16 27766: 1f 8b std Y+23, r17 ; 0x17 27768: b8 a9 ldd r27, Y+48 ; 0x30 2776a: b8 8f std Y+24, r27 ; 0x18 2776c: 2f a5 ldd r18, Y+47 ; 0x2f 2776e: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 27770: 2a 89 ldd r18, Y+18 ; 0x12 27772: 3b 89 ldd r19, Y+19 ; 0x13 27774: 4c 89 ldd r20, Y+20 ; 0x14 27776: 5d 89 ldd r21, Y+21 ; 0x15 27778: b8 01 movw r22, r16 2777a: 88 a9 ldd r24, Y+48 ; 0x30 2777c: 9f a5 ldd r25, Y+47 ; 0x2f 2777e: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 27782: 18 16 cp r1, r24 27784: 34 f0 brlt .+12 ; 0x27792 27786: 0a 8b std Y+18, r16 ; 0x12 27788: 1b 8b std Y+19, r17 ; 0x13 2778a: 38 a9 ldd r19, Y+48 ; 0x30 2778c: 3c 8b std Y+20, r19 ; 0x14 2778e: 4f a5 ldd r20, Y+47 ; 0x2f 27790: 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) { 27792: 0f 94 53 29 call 0x252a6 ; 0x252a6 27796: 2c a1 ldd r18, Y+36 ; 0x24 27798: 3d a1 ldd r19, Y+37 ; 0x25 2779a: 4e a1 ldd r20, Y+38 ; 0x26 2779c: 5f a1 ldd r21, Y+39 ; 0x27 2779e: 62 1b sub r22, r18 277a0: 73 0b sbc r23, r19 277a2: 84 0b sbc r24, r20 277a4: 95 0b sbc r25, r21 277a6: 65 3c cpi r22, 0xC5 ; 197 277a8: 79 40 sbci r23, 0x09 ; 9 277aa: 81 05 cpc r24, r1 277ac: 91 05 cpc r25, r1 277ae: 40 f0 brcs .+16 ; 0x277c0 checkExtruderAutoFans(); 277b0: 0e 94 ae 75 call 0xeb5c ; 0xeb5c extruder_autofan_last_check = _millis(); 277b4: 0f 94 53 29 call 0x252a6 ; 0x252a6 277b8: 6c a3 std Y+36, r22 ; 0x24 277ba: 7d a3 std Y+37, r23 ; 0x25 277bc: 8e a3 std Y+38, r24 ; 0x26 277be: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 277c0: 4a 8d ldd r20, Y+26 ; 0x1a 277c2: 44 23 and r20, r20 277c4: 09 f4 brne .+2 ; 0x277c8 277c6: 4c c0 rjmp .+152 ; 0x27860 277c8: 2a 85 ldd r18, Y+10 ; 0x0a 277ca: 3b 85 ldd r19, Y+11 ; 0x0b 277cc: 4c 85 ldd r20, Y+12 ; 0x0c 277ce: 5d 85 ldd r21, Y+13 ; 0x0d 277d0: b8 01 movw r22, r16 277d2: 88 a9 ldd r24, Y+48 ; 0x30 277d4: 9f a5 ldd r25, Y+47 ; 0x2f 277d6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 277da: 18 16 cp r1, r24 277dc: 0c f0 brlt .+2 ; 0x277e0 277de: d3 c1 rjmp .+934 ; 0x27b86 if(_millis() - t2 > 5000) { 277e0: 0f 94 53 29 call 0x252a6 ; 0x252a6 277e4: 2e 85 ldd r18, Y+14 ; 0x0e 277e6: 3f 85 ldd r19, Y+15 ; 0x0f 277e8: 48 89 ldd r20, Y+16 ; 0x10 277ea: 59 89 ldd r21, Y+17 ; 0x11 277ec: 62 1b sub r22, r18 277ee: 73 0b sbc r23, r19 277f0: 84 0b sbc r24, r20 277f2: 95 0b sbc r25, r21 277f4: 69 38 cpi r22, 0x89 ; 137 277f6: 73 41 sbci r23, 0x13 ; 19 277f8: 81 05 cpc r24, r1 277fa: 91 05 cpc r25, r1 277fc: 08 f4 brcc .+2 ; 0x27800 277fe: c3 c1 rjmp .+902 ; 0x27b86 27800: d7 01 movw r26, r14 27802: c6 01 movw r24, r12 27804: 29 81 ldd r18, Y+1 ; 0x01 27806: 3a 81 ldd r19, Y+2 ; 0x02 27808: 4b 81 ldd r20, Y+3 ; 0x03 2780a: 5c 81 ldd r21, Y+4 ; 0x04 2780c: 82 1b sub r24, r18 2780e: 93 0b sbc r25, r19 27810: a4 0b sbc r26, r20 27812: b5 0b sbc r27, r21 27814: b5 95 asr r27 27816: a7 95 ror r26 27818: 97 95 ror r25 2781a: 87 95 ror r24 heating=false; if (extruder<0) { 2781c: 21 14 cp r2, r1 2781e: 31 04 cpc r3, r1 27820: 09 f4 brne .+2 ; 0x27824 27822: 40 c0 rjmp .+128 ; 0x278a4 soft_pwm_bed = (bias - d) >> 1; 27824: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 27828: 0f 94 53 29 call 0x252a6 ; 0x252a6 2782c: 6e 83 std Y+6, r22 ; 0x06 2782e: 7f 83 std Y+7, r23 ; 0x07 27830: 88 87 std Y+8, r24 ; 0x08 27832: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 27834: dc 01 movw r26, r24 27836: cb 01 movw r24, r22 27838: 2e 85 ldd r18, Y+14 ; 0x0e 2783a: 3f 85 ldd r19, Y+15 ; 0x0f 2783c: 48 89 ldd r20, Y+16 ; 0x10 2783e: 59 89 ldd r21, Y+17 ; 0x11 27840: 82 1b sub r24, r18 27842: 93 0b sbc r25, r19 27844: a4 0b sbc r26, r20 27846: b5 0b sbc r27, r21 27848: 8b 8f std Y+27, r24 ; 0x1b 2784a: 9c 8f std Y+28, r25 ; 0x1c 2784c: ad 8f std Y+29, r26 ; 0x1d 2784e: be 8f std Y+30, r27 ; 0x1e max=temp; 27850: 3a 85 ldd r19, Y+10 ; 0x0a 27852: 3e 8b std Y+22, r19 ; 0x16 27854: 4b 85 ldd r20, Y+11 ; 0x0b 27856: 4f 8b std Y+23, r20 ; 0x17 27858: 5c 85 ldd r21, Y+12 ; 0x0c 2785a: 58 8f std Y+24, r21 ; 0x18 2785c: 8d 85 ldd r24, Y+13 ; 0x0d 2785e: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 27860: 2a 85 ldd r18, Y+10 ; 0x0a 27862: 3b 85 ldd r19, Y+11 ; 0x0b 27864: 4c 85 ldd r20, Y+12 ; 0x0c 27866: 5d 85 ldd r21, Y+13 ; 0x0d 27868: b8 01 movw r22, r16 2786a: 88 a9 ldd r24, Y+48 ; 0x30 2786c: 9f a5 ldd r25, Y+47 ; 0x2f 2786e: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 27872: 87 fd sbrc r24, 7 27874: 1a c0 rjmp .+52 ; 0x278aa if(_millis() - t1 > 5000) { 27876: 1a 8e std Y+26, r1 ; 0x1a 27878: 86 c1 rjmp .+780 ; 0x27b86 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 2787a: 4a e0 ldi r20, 0x0A ; 10 2787c: 4f 8f std Y+31, r20 ; 0x1f 2787e: 00 cf rjmp .-512 ; 0x27680 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; 27880: 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 27884: 70 93 b7 0d sts 0x0DB7, r23 ; 0x800db7 27888: 60 93 b6 0d sts 0x0DB6, r22 ; 0x800db6 2788c: 1a cf rjmp .-460 ; 0x276c2 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2788e: 00 91 ee 04 lds r16, 0x04EE ; 0x8004ee 27892: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 27896: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 2789a: 98 ab std Y+48, r25 ; 0x30 2789c: a0 91 f1 04 lds r26, 0x04F1 ; 0x8004f1 278a0: af a7 std Y+47, r26 ; 0x2f 278a2: 55 cf rjmp .-342 ; 0x2774e heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 278a4: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 278a8: bf cf rjmp .-130 ; 0x27828 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 278aa: 0f 94 53 29 call 0x252a6 ; 0x252a6 278ae: 2e 81 ldd r18, Y+6 ; 0x06 278b0: 3f 81 ldd r19, Y+7 ; 0x07 278b2: 48 85 ldd r20, Y+8 ; 0x08 278b4: 59 85 ldd r21, Y+9 ; 0x09 278b6: 62 1b sub r22, r18 278b8: 73 0b sbc r23, r19 278ba: 84 0b sbc r24, r20 278bc: 95 0b sbc r25, r21 278be: 69 38 cpi r22, 0x89 ; 137 278c0: 73 41 sbci r23, 0x13 ; 19 278c2: 81 05 cpc r24, r1 278c4: 91 05 cpc r25, r1 278c6: b8 f2 brcs .-82 ; 0x27876 heating=true; t2=_millis(); 278c8: 0f 94 53 29 call 0x252a6 ; 0x252a6 278cc: 6e 87 std Y+14, r22 ; 0x0e 278ce: 7f 87 std Y+15, r23 ; 0x0f 278d0: 88 8b std Y+16, r24 ; 0x10 278d2: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 278d4: 80 91 49 06 lds r24, 0x0649 ; 0x800649 278d8: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 278dc: 18 16 cp r1, r24 278de: 19 06 cpc r1, r25 278e0: 0c f0 brlt .+2 ; 0x278e4 278e2: 2c c1 rjmp .+600 ; 0x27b3c } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 278e4: 8e 85 ldd r24, Y+14 ; 0x0e 278e6: 9f 85 ldd r25, Y+15 ; 0x0f 278e8: a8 89 ldd r26, Y+16 ; 0x10 278ea: b9 89 ldd r27, Y+17 ; 0x11 278ec: 2e 81 ldd r18, Y+6 ; 0x06 278ee: 3f 81 ldd r19, Y+7 ; 0x07 278f0: 48 85 ldd r20, Y+8 ; 0x08 278f2: 59 85 ldd r21, Y+9 ; 0x09 278f4: 82 1b sub r24, r18 278f6: 93 0b sbc r25, r19 278f8: a4 0b sbc r26, r20 278fa: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 278fc: 4b 8c ldd r4, Y+27 ; 0x1b 278fe: 5c 8c ldd r5, Y+28 ; 0x1c 27900: 6d 8c ldd r6, Y+29 ; 0x1d 27902: 7e 8c ldd r7, Y+30 ; 0x1e 27904: 48 0e add r4, r24 27906: 59 1e adc r5, r25 27908: 6a 1e adc r6, r26 2790a: 7b 1e adc r7, r27 2790c: 2b 8d ldd r18, Y+27 ; 0x1b 2790e: 3c 8d ldd r19, Y+28 ; 0x1c 27910: 4d 8d ldd r20, Y+29 ; 0x1d 27912: 5e 8d ldd r21, Y+30 ; 0x1e 27914: 28 1b sub r18, r24 27916: 39 0b sbc r19, r25 27918: 4a 0b sbc r20, r26 2791a: 5b 0b sbc r21, r27 2791c: 69 81 ldd r22, Y+1 ; 0x01 2791e: 7a 81 ldd r23, Y+2 ; 0x02 27920: 8b 81 ldd r24, Y+3 ; 0x03 27922: 9c 81 ldd r25, Y+4 ; 0x04 27924: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 27928: a3 01 movw r20, r6 2792a: 92 01 movw r18, r4 2792c: 0f 94 14 dd call 0x3ba28 ; 0x3ba28 <__divmodsi4> 27930: da 01 movw r26, r20 27932: c9 01 movw r24, r18 27934: 8c 0d add r24, r12 27936: 9d 1d adc r25, r13 27938: ae 1d adc r26, r14 2793a: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2793c: 84 31 cpi r24, 0x14 ; 20 2793e: 91 05 cpc r25, r1 27940: a1 05 cpc r26, r1 27942: b1 05 cpc r27, r1 27944: 0c f4 brge .+2 ; 0x27948 27946: 3c c1 rjmp .+632 ; 0x27bc0 27948: 6c 01 movw r12, r24 2794a: 7d 01 movw r14, r26 2794c: 3c ee ldi r19, 0xEC ; 236 2794e: c3 16 cp r12, r19 27950: d1 04 cpc r13, r1 27952: e1 04 cpc r14, r1 27954: f1 04 cpc r15, r1 27956: 2c f0 brlt .+10 ; 0x27962 27958: 4b ee ldi r20, 0xEB ; 235 2795a: c4 2e mov r12, r20 2795c: d1 2c mov r13, r1 2795e: e1 2c mov r14, r1 27960: 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; 27962: 80 38 cpi r24, 0x80 ; 128 27964: 91 05 cpc r25, r1 27966: a1 05 cpc r26, r1 27968: b1 05 cpc r27, r1 2796a: 0c f4 brge .+2 ; 0x2796e 2796c: 37 c1 rjmp .+622 ; 0x27bdc 2796e: 8e ef ldi r24, 0xFE ; 254 27970: 90 e0 ldi r25, 0x00 ; 0 27972: a0 e0 ldi r26, 0x00 ; 0 27974: b0 e0 ldi r27, 0x00 ; 0 27976: 8c 19 sub r24, r12 27978: 9d 09 sbc r25, r13 2797a: ae 09 sbc r26, r14 2797c: bf 09 sbc r27, r15 2797e: 89 83 std Y+1, r24 ; 0x01 27980: 9a 83 std Y+2, r25 ; 0x02 27982: ab 83 std Y+3, r26 ; 0x03 27984: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 27986: 89 e4 ldi r24, 0x49 ; 73 27988: 9b e9 ldi r25, 0x9B ; 155 2798a: 0e 94 57 77 call 0xeeae ; 0xeeae 2798e: c7 01 movw r24, r14 27990: b6 01 movw r22, r12 27992: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 27996: 84 e4 ldi r24, 0x44 ; 68 27998: 9b e9 ldi r25, 0x9B ; 155 2799a: 0e 94 57 77 call 0xeeae ; 0xeeae 2799e: 69 81 ldd r22, Y+1 ; 0x01 279a0: 7a 81 ldd r23, Y+2 ; 0x02 279a2: 8b 81 ldd r24, Y+3 ; 0x03 279a4: 9c 81 ldd r25, Y+4 ; 0x04 279a6: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 279aa: 8d e3 ldi r24, 0x3D ; 61 279ac: 9b e9 ldi r25, 0x9B ; 155 279ae: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 279b2: 42 e0 ldi r20, 0x02 ; 2 279b4: 6a 89 ldd r22, Y+18 ; 0x12 279b6: 7b 89 ldd r23, Y+19 ; 0x13 279b8: 8c 89 ldd r24, Y+20 ; 0x14 279ba: 9d 89 ldd r25, Y+21 ; 0x15 279bc: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 279c0: 86 e3 ldi r24, 0x36 ; 54 279c2: 9b e9 ldi r25, 0x9B ; 155 279c4: 0e 94 57 77 call 0xeeae ; 0xeeae 279c8: 6e 89 ldd r22, Y+22 ; 0x16 279ca: 7f 89 ldd r23, Y+23 ; 0x17 279cc: 88 8d ldd r24, Y+24 ; 0x18 279ce: 99 8d ldd r25, Y+25 ; 0x19 279d0: 0f 94 bb 74 call 0x2e976 ; 0x2e976 if(pid_cycle > 2) { 279d4: 80 91 49 06 lds r24, 0x0649 ; 0x800649 279d8: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 279dc: 03 97 sbiw r24, 0x03 ; 3 279de: 0c f4 brge .+2 ; 0x279e2 279e0: ad c0 rjmp .+346 ; 0x27b3c Ku = (4.0*d)/(3.14159*(max-min)/2.0); 279e2: 69 81 ldd r22, Y+1 ; 0x01 279e4: 7a 81 ldd r23, Y+2 ; 0x02 279e6: 8b 81 ldd r24, Y+3 ; 0x03 279e8: 9c 81 ldd r25, Y+4 ; 0x04 279ea: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 279ee: 20 e0 ldi r18, 0x00 ; 0 279f0: 30 e0 ldi r19, 0x00 ; 0 279f2: 40 e8 ldi r20, 0x80 ; 128 279f4: 50 e4 ldi r21, 0x40 ; 64 279f6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 279fa: 4b 01 movw r8, r22 279fc: 5c 01 movw r10, r24 279fe: 2a 89 ldd r18, Y+18 ; 0x12 27a00: 3b 89 ldd r19, Y+19 ; 0x13 27a02: 4c 89 ldd r20, Y+20 ; 0x14 27a04: 5d 89 ldd r21, Y+21 ; 0x15 27a06: 6e 89 ldd r22, Y+22 ; 0x16 27a08: 7f 89 ldd r23, Y+23 ; 0x17 27a0a: 88 8d ldd r24, Y+24 ; 0x18 27a0c: 99 8d ldd r25, Y+25 ; 0x19 27a0e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 27a12: 20 ed ldi r18, 0xD0 ; 208 27a14: 3f e0 ldi r19, 0x0F ; 15 27a16: 49 e4 ldi r20, 0x49 ; 73 27a18: 50 e4 ldi r21, 0x40 ; 64 27a1a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 27a1e: 20 e0 ldi r18, 0x00 ; 0 27a20: 30 e0 ldi r19, 0x00 ; 0 27a22: 40 e0 ldi r20, 0x00 ; 0 27a24: 5f e3 ldi r21, 0x3F ; 63 27a26: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 27a2a: 9b 01 movw r18, r22 27a2c: ac 01 movw r20, r24 27a2e: c5 01 movw r24, r10 27a30: b4 01 movw r22, r8 27a32: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 27a36: 4b 01 movw r8, r22 27a38: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 27a3a: c3 01 movw r24, r6 27a3c: b2 01 movw r22, r4 27a3e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 27a42: 20 e0 ldi r18, 0x00 ; 0 27a44: 30 e0 ldi r19, 0x00 ; 0 27a46: 4a e7 ldi r20, 0x7A ; 122 27a48: 54 e4 ldi r21, 0x44 ; 68 27a4a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 27a4e: 2b 01 movw r4, r22 27a50: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 27a52: 80 e3 ldi r24, 0x30 ; 48 27a54: 9b e9 ldi r25, 0x9B ; 155 27a56: 0e 94 57 77 call 0xeeae ; 0xeeae 27a5a: 42 e0 ldi r20, 0x02 ; 2 27a5c: c5 01 movw r24, r10 27a5e: b4 01 movw r22, r8 27a60: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 27a64: 8a e2 ldi r24, 0x2A ; 42 27a66: 9b e9 ldi r25, 0x9B ; 155 27a68: 0e 94 57 77 call 0xeeae ; 0xeeae 27a6c: c3 01 movw r24, r6 27a6e: b2 01 movw r22, r4 27a70: 0f 94 bb 74 call 0x2e976 ; 0x2e976 _Kp = 0.6*Ku; 27a74: 2a e9 ldi r18, 0x9A ; 154 27a76: 39 e9 ldi r19, 0x99 ; 153 27a78: 49 e1 ldi r20, 0x19 ; 25 27a7a: 5f e3 ldi r21, 0x3F ; 63 27a7c: c5 01 movw r24, r10 27a7e: b4 01 movw r22, r8 27a80: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 27a84: 4b 01 movw r8, r22 27a86: 5c 01 movw r10, r24 27a88: 80 92 f3 03 sts 0x03F3, r8 ; 0x8003f3 <_Kp> 27a8c: 90 92 f4 03 sts 0x03F4, r9 ; 0x8003f4 <_Kp+0x1> 27a90: a0 92 f5 03 sts 0x03F5, r10 ; 0x8003f5 <_Kp+0x2> 27a94: b0 92 f6 03 sts 0x03F6, r11 ; 0x8003f6 <_Kp+0x3> _Ki = 2*_Kp/Tu; 27a98: ac 01 movw r20, r24 27a9a: 9b 01 movw r18, r22 27a9c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 27aa0: a3 01 movw r20, r6 27aa2: 92 01 movw r18, r4 27aa4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 27aa8: 60 93 ef 03 sts 0x03EF, r22 ; 0x8003ef <_Ki> 27aac: 70 93 f0 03 sts 0x03F0, r23 ; 0x8003f0 <_Ki+0x1> 27ab0: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 <_Ki+0x2> 27ab4: 90 93 f2 03 sts 0x03F2, r25 ; 0x8003f2 <_Ki+0x3> _Kd = _Kp*Tu/8; 27ab8: a3 01 movw r20, r6 27aba: 92 01 movw r18, r4 27abc: c5 01 movw r24, r10 27abe: b4 01 movw r22, r8 27ac0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 27ac4: 20 e0 ldi r18, 0x00 ; 0 27ac6: 30 e0 ldi r19, 0x00 ; 0 27ac8: 40 e0 ldi r20, 0x00 ; 0 27aca: 5e e3 ldi r21, 0x3E ; 62 27acc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 27ad0: 60 93 eb 03 sts 0x03EB, r22 ; 0x8003eb <_Kd> 27ad4: 70 93 ec 03 sts 0x03EC, r23 ; 0x8003ec <_Kd+0x1> 27ad8: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed <_Kd+0x2> 27adc: 90 93 ee 03 sts 0x03EE, r25 ; 0x8003ee <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 27ae0: 8c e1 ldi r24, 0x1C ; 28 27ae2: 9b e9 ldi r25, 0x9B ; 155 27ae4: 0e 94 82 79 call 0xf304 ; 0xf304 SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 27ae8: 86 e1 ldi r24, 0x16 ; 22 27aea: 9b e9 ldi r25, 0x9B ; 155 27aec: 0e 94 57 77 call 0xeeae ; 0xeeae 27af0: 60 91 f3 03 lds r22, 0x03F3 ; 0x8003f3 <_Kp> 27af4: 70 91 f4 03 lds r23, 0x03F4 ; 0x8003f4 <_Kp+0x1> 27af8: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 <_Kp+0x2> 27afc: 90 91 f6 03 lds r25, 0x03F6 ; 0x8003f6 <_Kp+0x3> 27b00: 0f 94 bb 74 call 0x2e976 ; 0x2e976 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 27b04: 80 e1 ldi r24, 0x10 ; 16 27b06: 9b e9 ldi r25, 0x9B ; 155 27b08: 0e 94 57 77 call 0xeeae ; 0xeeae 27b0c: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Ki> 27b10: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Ki+0x1> 27b14: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Ki+0x2> 27b18: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Ki+0x3> 27b1c: 0f 94 bb 74 call 0x2e976 ; 0x2e976 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 27b20: 8a e0 ldi r24, 0x0A ; 10 27b22: 9b e9 ldi r25, 0x9B ; 155 27b24: 0e 94 57 77 call 0xeeae ; 0xeeae 27b28: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Kd> 27b2c: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Kd+0x1> 27b30: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kd+0x2> 27b34: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Kd+0x3> 27b38: 0f 94 bb 74 call 0x2e976 ; 0x2e976 27b3c: 89 81 ldd r24, Y+1 ; 0x01 27b3e: 9a 81 ldd r25, Y+2 ; 0x02 27b40: ab 81 ldd r26, Y+3 ; 0x03 27b42: bc 81 ldd r27, Y+4 ; 0x04 27b44: 8c 0d add r24, r12 27b46: 9d 1d adc r25, r13 27b48: ae 1d adc r26, r14 27b4a: bf 1d adc r27, r15 27b4c: b5 95 asr r27 27b4e: a7 95 ror r26 27b50: 97 95 ror r25 27b52: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 27b54: 21 14 cp r2, r1 27b56: 31 04 cpc r3, r1 27b58: 09 f4 brne .+2 ; 0x27b5c 27b5a: 45 c0 rjmp .+138 ; 0x27be6 { soft_pwm_bed = (bias + d) >> 1; 27b5c: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 27b60: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27b64: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27b68: 01 96 adiw r24, 0x01 ; 1 27b6a: 90 93 4a 06 sts 0x064A, r25 ; 0x80064a 27b6e: 80 93 49 06 sts 0x0649, r24 ; 0x800649 min=temp; 27b72: 3a 85 ldd r19, Y+10 ; 0x0a 27b74: 3a 8b std Y+18, r19 ; 0x12 27b76: 4b 85 ldd r20, Y+11 ; 0x0b 27b78: 4b 8b std Y+19, r20 ; 0x13 27b7a: 5c 85 ldd r21, Y+12 ; 0x0c 27b7c: 5c 8b std Y+20, r21 ; 0x14 27b7e: 8d 85 ldd r24, Y+13 ; 0x0d 27b80: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 27b82: 98 a5 ldd r25, Y+40 ; 0x28 27b84: 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)) { 27b86: 20 e0 ldi r18, 0x00 ; 0 27b88: 30 e0 ldi r19, 0x00 ; 0 27b8a: 40 ef ldi r20, 0xF0 ; 240 27b8c: 51 e4 ldi r21, 0x41 ; 65 27b8e: 6a 85 ldd r22, Y+10 ; 0x0a 27b90: 7b 85 ldd r23, Y+11 ; 0x0b 27b92: 8c 85 ldd r24, Y+12 ; 0x0c 27b94: 9d 85 ldd r25, Y+13 ; 0x0d 27b96: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 27b9a: 98 01 movw r18, r16 27b9c: 48 a9 ldd r20, Y+48 ; 0x30 27b9e: 5f a5 ldd r21, Y+47 ; 0x2f 27ba0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 27ba4: 87 ff sbrs r24, 7 27ba6: 22 c0 rjmp .+68 ; 0x27bec SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 27ba8: 80 ee ldi r24, 0xE0 ; 224 27baa: 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"); 27bac: 0e 94 82 79 call 0xf304 ; 0xf304 pid_tuning_finished = true; 27bb0: 81 e0 ldi r24, 0x01 ; 1 27bb2: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> pid_cycle = 0; 27bb6: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27bba: 10 92 49 06 sts 0x0649, r1 ; 0x800649 27bbe: 98 c0 rjmp .+304 ; 0x27cf0 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); 27bc0: 34 e1 ldi r19, 0x14 ; 20 27bc2: c3 2e mov r12, r19 27bc4: d1 2c mov r13, r1 27bc6: e1 2c mov r14, r1 27bc8: f1 2c mov r15, r1 27bca: 24 e1 ldi r18, 0x14 ; 20 27bcc: 30 e0 ldi r19, 0x00 ; 0 27bce: 40 e0 ldi r20, 0x00 ; 0 27bd0: 50 e0 ldi r21, 0x00 ; 0 27bd2: 29 83 std Y+1, r18 ; 0x01 27bd4: 3a 83 std Y+2, r19 ; 0x02 27bd6: 4b 83 std Y+3, r20 ; 0x03 27bd8: 5c 83 std Y+4, r21 ; 0x04 27bda: d5 ce rjmp .-598 ; 0x27986 27bdc: c9 82 std Y+1, r12 ; 0x01 27bde: da 82 std Y+2, r13 ; 0x02 27be0: eb 82 std Y+3, r14 ; 0x03 27be2: fc 82 std Y+4, r15 ; 0x04 27be4: d0 ce rjmp .-608 ; 0x27986 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 27be6: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 27bea: ba cf rjmp .-140 ; 0x27b60 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 27bec: 0f 94 53 29 call 0x252a6 ; 0x252a6 27bf0: 28 a1 ldd r18, Y+32 ; 0x20 27bf2: 39 a1 ldd r19, Y+33 ; 0x21 27bf4: 4a a1 ldd r20, Y+34 ; 0x22 27bf6: 5b a1 ldd r21, Y+35 ; 0x23 27bf8: 62 1b sub r22, r18 27bfa: 73 0b sbc r23, r19 27bfc: 84 0b sbc r24, r20 27bfe: 95 0b sbc r25, r21 27c00: 61 3d cpi r22, 0xD1 ; 209 27c02: 77 40 sbci r23, 0x07 ; 7 27c04: 81 05 cpc r24, r1 27c06: 91 05 cpc r25, r1 27c08: 58 f1 brcs .+86 ; 0x27c60 int p; if (extruder<0){ p=soft_pwm_bed; 27c0a: a0 90 1d 06 lds r10, 0x061D ; 0x80061d 27c0e: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 27c10: 8d ed ldi r24, 0xDD ; 221 27c12: 9a e9 ldi r25, 0x9A ; 154 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 27c14: 21 14 cp r2, r1 27c16: 31 04 cpc r3, r1 27c18: 29 f4 brne .+10 ; 0x27c24 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 27c1a: a0 90 16 05 lds r10, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.459> 27c1e: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 27c20: 8a ed ldi r24, 0xDA ; 218 27c22: 9a e9 ldi r25, 0x9A ; 154 27c24: 0e 94 57 77 call 0xeeae ; 0xeeae 27c28: 42 e0 ldi r20, 0x02 ; 2 27c2a: b8 01 movw r22, r16 27c2c: 88 a9 ldd r24, Y+48 ; 0x30 27c2e: 9f a5 ldd r25, Y+47 ; 0x2f 27c30: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 27c34: 86 ed ldi r24, 0xD6 ; 214 27c36: 9a e9 ldi r25, 0x9A ; 154 27c38: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_PROTOCOLLN(p); 27c3c: c5 01 movw r24, r10 27c3e: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 if (safety_check_cycles == 0) { //save ambient temp 27c42: 4d 81 ldd r20, Y+5 ; 0x05 27c44: 44 23 and r20, r20 27c46: 09 f4 brne .+2 ; 0x27c4a 27c48: 6c c0 rjmp .+216 ; 0x27d22 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 27c4a: 5f 8d ldd r21, Y+31 ; 0x1f 27c4c: 45 17 cp r20, r21 27c4e: 70 f5 brcc .+92 ; 0x27cac safety_check_cycles++; 27c50: 4f 5f subi r20, 0xFF ; 255 27c52: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 27c54: 0f 94 53 29 call 0x252a6 ; 0x252a6 27c58: 68 a3 std Y+32, r22 ; 0x20 27c5a: 79 a3 std Y+33, r23 ; 0x21 27c5c: 8a a3 std Y+34, r24 ; 0x22 27c5e: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 27c60: 0f 94 53 29 call 0x252a6 ; 0x252a6 27c64: 4b 01 movw r8, r22 27c66: 5c 01 movw r10, r24 27c68: 0f 94 53 29 call 0x252a6 ; 0x252a6 27c6c: 4e 80 ldd r4, Y+6 ; 0x06 27c6e: 5f 80 ldd r5, Y+7 ; 0x07 27c70: 68 84 ldd r6, Y+8 ; 0x08 27c72: 79 84 ldd r7, Y+9 ; 0x09 27c74: 2e 85 ldd r18, Y+14 ; 0x0e 27c76: 3f 85 ldd r19, Y+15 ; 0x0f 27c78: 48 89 ldd r20, Y+16 ; 0x10 27c7a: 59 89 ldd r21, Y+17 ; 0x11 27c7c: 42 0e add r4, r18 27c7e: 53 1e adc r5, r19 27c80: 64 1e adc r6, r20 27c82: 75 1e adc r7, r21 27c84: 84 18 sub r8, r4 27c86: 95 08 sbc r9, r5 27c88: a6 08 sbc r10, r6 27c8a: b7 08 sbc r11, r7 27c8c: 86 0e add r8, r22 27c8e: 97 1e adc r9, r23 27c90: a8 1e adc r10, r24 27c92: b9 1e adc r11, r25 27c94: 31 e8 ldi r19, 0x81 ; 129 27c96: 83 16 cp r8, r19 27c98: 3f e4 ldi r19, 0x4F ; 79 27c9a: 93 06 cpc r9, r19 27c9c: 32 e1 ldi r19, 0x12 ; 18 27c9e: a3 06 cpc r10, r19 27ca0: b1 04 cpc r11, r1 27ca2: 08 f4 brcc .+2 ; 0x27ca6 27ca4: 47 c0 rjmp .+142 ; 0x27d34 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 27ca6: 89 eb ldi r24, 0xB9 ; 185 27ca8: 9a e9 ldi r25, 0x9A ; 154 27caa: 80 cf rjmp .-256 ; 0x27bac 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 27cac: 8d 81 ldd r24, Y+5 ; 0x05 27cae: 9f 8d ldd r25, Y+31 ; 0x1f 27cb0: 89 13 cpse r24, r25 27cb2: d0 cf rjmp .-96 ; 0x27c54 safety_check_cycles++; 27cb4: 8f 5f subi r24, 0xFF ; 255 27cb6: 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) { 27cb8: 2b a5 ldd r18, Y+43 ; 0x2b 27cba: 3c a5 ldd r19, Y+44 ; 0x2c 27cbc: 4d a5 ldd r20, Y+45 ; 0x2d 27cbe: 5e a5 ldd r21, Y+46 ; 0x2e 27cc0: b8 01 movw r22, r16 27cc2: 88 a9 ldd r24, Y+48 ; 0x30 27cc4: 9f a5 ldd r25, Y+47 ; 0x2f 27cc6: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 27cca: 9f 77 andi r25, 0x7F ; 127 27ccc: 20 e0 ldi r18, 0x00 ; 0 27cce: 30 e0 ldi r19, 0x00 ; 0 27cd0: 40 ea ldi r20, 0xA0 ; 160 27cd2: 50 e4 ldi r21, 0x40 ; 64 27cd4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 27cd8: 87 ff sbrs r24, 7 27cda: bc cf rjmp .-136 ; 0x27c54 temp_runaway_stop(false, (extruder<0)); 27cdc: 63 2d mov r22, r3 27cde: 66 1f adc r22, r22 27ce0: 66 27 eor r22, r22 27ce2: 66 1f adc r22, r22 27ce4: 80 e0 ldi r24, 0x00 ; 0 27ce6: 0f 94 41 1f call 0x23e82 ; 0x23e82 pid_tuning_finished = true; 27cea: 81 e0 ldi r24, 0x01 ; 1 27cec: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.458> pid_cycle = 0; return; } lcd_update(0); } } 27cf0: e0 96 adiw r28, 0x30 ; 48 27cf2: 0f b6 in r0, 0x3f ; 63 27cf4: f8 94 cli 27cf6: de bf out 0x3e, r29 ; 62 27cf8: 0f be out 0x3f, r0 ; 63 27cfa: cd bf out 0x3d, r28 ; 61 27cfc: df 91 pop r29 27cfe: cf 91 pop r28 27d00: 1f 91 pop r17 27d02: 0f 91 pop r16 27d04: ff 90 pop r15 27d06: ef 90 pop r14 27d08: df 90 pop r13 27d0a: cf 90 pop r12 27d0c: bf 90 pop r11 27d0e: af 90 pop r10 27d10: 9f 90 pop r9 27d12: 8f 90 pop r8 27d14: 7f 90 pop r7 27d16: 6f 90 pop r6 27d18: 5f 90 pop r5 27d1a: 4f 90 pop r4 27d1c: 3f 90 pop r3 27d1e: 2f 90 pop r2 27d20: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 27d22: 0b a7 std Y+43, r16 ; 0x2b 27d24: 1c a7 std Y+44, r17 ; 0x2c 27d26: a8 a9 ldd r26, Y+48 ; 0x30 27d28: ad a7 std Y+45, r26 ; 0x2d 27d2a: bf a5 ldd r27, Y+47 ; 0x2f 27d2c: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 27d2e: 21 e0 ldi r18, 0x01 ; 1 27d30: 2d 83 std Y+5, r18 ; 0x05 27d32: 90 cf rjmp .-224 ; 0x27c54 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 27d34: 80 91 49 06 lds r24, 0x0649 ; 0x800649 27d38: 90 91 4a 06 lds r25, 0x064A ; 0x80064a 27d3c: 49 a5 ldd r20, Y+41 ; 0x29 27d3e: 5a a5 ldd r21, Y+42 ; 0x2a 27d40: 48 17 cp r20, r24 27d42: 59 07 cpc r21, r25 27d44: 1c f4 brge .+6 ; 0x27d4c SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 27d46: 8d e5 ldi r24, 0x5D ; 93 27d48: 9a e9 ldi r25, 0x9A ; 154 27d4a: 30 cf rjmp .-416 ; 0x27bac pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 27d4c: 80 e0 ldi r24, 0x00 ; 0 27d4e: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 27d52: e6 cc rjmp .-1588 ; 0x27720 00027d54 : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 27d54: 0f 93 push r16 27d56: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27d58: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 27d5c: 81 30 cpi r24, 0x01 ; 1 27d5e: 19 f5 brne .+70 ; 0x27da6 27d60: 0f 94 53 29 call 0x252a6 ; 0x252a6 27d64: 00 91 a7 05 lds r16, 0x05A7 ; 0x8005a7 27d68: 10 91 a8 05 lds r17, 0x05A8 ; 0x8005a8 27d6c: 20 91 a9 05 lds r18, 0x05A9 ; 0x8005a9 27d70: 30 91 aa 05 lds r19, 0x05AA ; 0x8005aa 27d74: 60 1b sub r22, r16 27d76: 71 0b sbc r23, r17 27d78: 82 0b sbc r24, r18 27d7a: 93 0b sbc r25, r19 27d7c: 28 ee ldi r18, 0xE8 ; 232 27d7e: 33 e0 ldi r19, 0x03 ; 3 27d80: 40 e0 ldi r20, 0x00 ; 0 27d82: 50 e0 ldi r21, 0x00 ; 0 27d84: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 27d88: 60 91 a3 05 lds r22, 0x05A3 ; 0x8005a3 27d8c: 70 91 a4 05 lds r23, 0x05A4 ; 0x8005a4 27d90: 80 91 a5 05 lds r24, 0x05A5 ; 0x8005a5 27d94: 90 91 a6 05 lds r25, 0x05A6 ; 0x8005a6 27d98: 62 0f add r22, r18 27d9a: 73 1f adc r23, r19 27d9c: 84 1f adc r24, r20 27d9e: 95 1f adc r25, r21 } 27da0: 1f 91 pop r17 27da2: 0f 91 pop r16 27da4: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 27da6: 60 91 52 06 lds r22, 0x0652 ; 0x800652 27daa: 70 91 53 06 lds r23, 0x0653 ; 0x800653 27dae: 80 91 54 06 lds r24, 0x0654 ; 0x800654 27db2: 90 91 55 06 lds r25, 0x0655 ; 0x800655 27db6: d6 cf rjmp .-84 ; 0x27d64 00027db8 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 27db8: 4f 92 push r4 27dba: 5f 92 push r5 27dbc: 6f 92 push r6 27dbe: 7f 92 push r7 27dc0: 8f 92 push r8 27dc2: 9f 92 push r9 27dc4: af 92 push r10 27dc6: bf 92 push r11 27dc8: cf 92 push r12 27dca: df 92 push r13 27dcc: ef 92 push r14 27dce: ff 92 push r15 27dd0: 0f 93 push r16 27dd2: 1f 93 push r17 27dd4: cf 93 push r28 27dd6: df 93 push r29 27dd8: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 27ddc: 0e 94 97 67 call 0xcf2e ; 0xcf2e 27de0: 88 23 and r24, r24 27de2: 09 f4 brne .+2 ; 0x27de6 27de4: 6e c0 rjmp .+220 ; 0x27ec2 { const float _met = ((float)total_filament_used) / (100000.f); 27de6: 60 91 65 06 lds r22, 0x0665 ; 0x800665 27dea: 70 91 66 06 lds r23, 0x0666 ; 0x800666 27dee: 80 91 67 06 lds r24, 0x0667 ; 0x800667 27df2: 90 91 68 06 lds r25, 0x0668 ; 0x800668 27df6: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 27dfa: 20 e0 ldi r18, 0x00 ; 0 27dfc: 30 e5 ldi r19, 0x50 ; 80 27dfe: 43 ec ldi r20, 0xC3 ; 195 27e00: 57 e4 ldi r21, 0x47 ; 71 27e02: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 27e06: 56 2e mov r5, r22 27e08: 47 2e mov r4, r23 27e0a: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 27e0c: 0f 94 aa 3e call 0x27d54 ; 0x27d54 27e10: 6b 01 movw r12, r22 27e12: 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(); 27e14: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(_N( 27e18: 83 ec ldi r24, 0xC3 ; 195 27e1a: 90 e5 ldi r25, 0x50 ; 80 27e1c: 0e 94 b3 72 call 0xe566 ; 0xe566 27e20: 18 2f mov r17, r24 27e22: 09 2f mov r16, r25 27e24: 83 eb ldi r24, 0xB3 ; 179 27e26: 90 e5 ldi r25, 0x50 ; 80 27e28: 0e 94 b3 72 call 0xe566 ; 0xe566 27e2c: 78 2e mov r7, r24 27e2e: 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; 27e30: 8c e3 ldi r24, 0x3C ; 60 27e32: 88 2e mov r8, r24 27e34: 91 2c mov r9, r1 27e36: a1 2c mov r10, r1 27e38: b1 2c mov r11, r1 27e3a: c7 01 movw r24, r14 27e3c: b6 01 movw r22, r12 27e3e: a5 01 movw r20, r10 27e40: 94 01 movw r18, r8 27e42: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 27e46: 7f 93 push r23 27e48: 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; 27e4a: ca 01 movw r24, r20 27e4c: b9 01 movw r22, r18 27e4e: a5 01 movw r20, r10 27e50: 94 01 movw r18, r8 27e52: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 27e56: 7f 93 push r23 27e58: 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; 27e5a: c7 01 movw r24, r14 27e5c: b6 01 movw r22, r12 27e5e: 20 e1 ldi r18, 0x10 ; 16 27e60: 3e e0 ldi r19, 0x0E ; 14 27e62: 40 e0 ldi r20, 0x00 ; 0 27e64: 50 e0 ldi r21, 0x00 ; 0 27e66: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 27e6a: 5f 93 push r21 27e6c: 4f 93 push r20 27e6e: 3f 93 push r19 27e70: 2f 93 push r18 27e72: 0f 93 push r16 27e74: 1f 93 push r17 27e76: df 93 push r29 27e78: cf 93 push r28 27e7a: 4f 92 push r4 27e7c: 5f 92 push r5 27e7e: 6f 92 push r6 27e80: 7f 92 push r7 27e82: 8c e7 ldi r24, 0x7C ; 124 27e84: 9f e6 ldi r25, 0x6F ; 111 27e86: 9f 93 push r25 27e88: 8f 93 push r24 27e8a: 0e 94 c0 6e call 0xdd80 ; 0xdd80 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 27e8e: 8d b7 in r24, 0x3d ; 61 27e90: 9e b7 in r25, 0x3e ; 62 27e92: 42 96 adiw r24, 0x12 ; 18 27e94: 0f b6 in r0, 0x3f ; 63 27e96: f8 94 cli 27e98: 9e bf out 0x3e, r25 ; 62 27e9a: 0f be out 0x3f, r0 ; 63 27e9c: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 27e9e: df 91 pop r29 27ea0: cf 91 pop r28 27ea2: 1f 91 pop r17 27ea4: 0f 91 pop r16 27ea6: ff 90 pop r15 27ea8: ef 90 pop r14 27eaa: df 90 pop r13 27eac: cf 90 pop r12 27eae: bf 90 pop r11 27eb0: af 90 pop r10 27eb2: 9f 90 pop r9 27eb4: 8f 90 pop r8 27eb6: 7f 90 pop r7 27eb8: 6f 90 pop r6 27eba: 5f 90 pop r5 27ebc: 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(); 27ebe: 0d 94 07 d5 jmp 0x3aa0e ; 0x3aa0e _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 27ec2: 81 ef ldi r24, 0xF1 ; 241 27ec4: 9f e0 ldi r25, 0x0F ; 15 27ec6: 0f 94 2b dc call 0x3b856 ; 0x3b856 27eca: 2b 01 movw r4, r22 27ecc: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 27ece: 8d ee ldi r24, 0xED ; 237 27ed0: 9f e0 ldi r25, 0x0F ; 15 27ed2: 0f 94 2b dc call 0x3b856 ; 0x3b856 27ed6: 6b 01 movw r12, r22 27ed8: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 27eda: 0e 94 13 6f call 0xde26 ; 0xde26 lcd_printf_P(_N( 27ede: 80 ea ldi r24, 0xA0 ; 160 27ee0: 90 e5 ldi r25, 0x50 ; 80 27ee2: 0e 94 b3 72 call 0xe566 ; 0xe566 27ee6: 98 2e mov r9, r24 27ee8: 89 2e mov r8, r25 27eea: 8f e8 ldi r24, 0x8F ; 143 27eec: 90 e5 ldi r25, 0x50 ; 80 27eee: 0e 94 b3 72 call 0xe566 ; 0xe566 27ef2: b8 2e mov r11, r24 27ef4: 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; 27ef6: c7 01 movw r24, r14 27ef8: b6 01 movw r22, r12 27efa: 2c e3 ldi r18, 0x3C ; 60 27efc: 30 e0 ldi r19, 0x00 ; 0 27efe: 40 e0 ldi r20, 0x00 ; 0 27f00: 50 e0 ldi r21, 0x00 ; 0 27f02: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 27f06: 7f 93 push r23 27f08: 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; 27f0a: ca 01 movw r24, r20 27f0c: b9 01 movw r22, r18 27f0e: 28 e1 ldi r18, 0x18 ; 24 27f10: 30 e0 ldi r19, 0x00 ; 0 27f12: 40 e0 ldi r20, 0x00 ; 0 27f14: 50 e0 ldi r21, 0x00 ; 0 27f16: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27f1a: 7f 93 push r23 27f1c: 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; 27f1e: c7 01 movw r24, r14 27f20: b6 01 movw r22, r12 27f22: 20 ea ldi r18, 0xA0 ; 160 27f24: 35 e0 ldi r19, 0x05 ; 5 27f26: 40 e0 ldi r20, 0x00 ; 0 27f28: 50 e0 ldi r21, 0x00 ; 0 27f2a: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27f2e: 5f 93 push r21 27f30: 4f 93 push r20 27f32: 3f 93 push r19 27f34: 2f 93 push r18 27f36: 8f 92 push r8 27f38: 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; 27f3a: c3 01 movw r24, r6 27f3c: b2 01 movw r22, r4 27f3e: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 27f42: 20 e0 ldi r18, 0x00 ; 0 27f44: 30 e0 ldi r19, 0x00 ; 0 27f46: 48 ec ldi r20, 0xC8 ; 200 27f48: 52 e4 ldi r21, 0x42 ; 66 27f4a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 27f4e: 9f 93 push r25 27f50: 8f 93 push r24 27f52: 7f 93 push r23 27f54: 6f 93 push r22 27f56: af 92 push r10 27f58: bf 92 push r11 27f5a: 88 e5 ldi r24, 0x58 ; 88 27f5c: 9f e6 ldi r25, 0x6F ; 111 27f5e: 9f 93 push r25 27f60: 8f 93 push r24 27f62: 0e 94 c0 6e call 0xdd80 ; 0xdd80 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 27f66: 8d b7 in r24, 0x3d ; 61 27f68: 9e b7 in r25, 0x3e ; 62 27f6a: 42 96 adiw r24, 0x12 ; 18 27f6c: 0f b6 in r0, 0x3f ; 63 27f6e: f8 94 cli 27f70: 9e bf out 0x3e, r25 ; 62 27f72: 0f be out 0x3f, r0 ; 63 27f74: 8d bf out 0x3d, r24 ; 61 27f76: 93 cf rjmp .-218 ; 0x27e9e 00027f78 : 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()") { 27f78: cf 92 push r12 27f7a: df 92 push r13 27f7c: ef 92 push r14 27f7e: ff 92 push r15 27f80: 0f 93 push r16 27f82: 1f 93 push r17 27f84: cf 93 push r28 27f86: df 93 push r29 27f88: 00 d0 rcall .+0 ; 0x27f8a 27f8a: 00 d0 rcall .+0 ; 0x27f8c 27f8c: 1f 92 push r1 27f8e: 1f 92 push r1 27f90: cd b7 in r28, 0x3d ; 61 27f92: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 27f94: 80 91 70 06 lds r24, 0x0670 ; 0x800670 27f98: 90 91 71 06 lds r25, 0x0671 ; 0x800671 27f9c: 00 97 sbiw r24, 0x00 ; 0 27f9e: e1 f1 breq .+120 ; 0x28018 { const int16_t initial_feedmultiply = feedmultiply; 27fa0: 20 91 39 02 lds r18, 0x0239 ; 0x800239 27fa4: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 27fa8: 24 36 cpi r18, 0x64 ; 100 27faa: 31 05 cpc r19, r1 27fac: 4c f4 brge .+18 ; 0x27fc0 27fae: ac 01 movw r20, r24 27fb0: 42 0f add r20, r18 27fb2: 53 1f adc r21, r19 27fb4: 45 36 cpi r20, 0x65 ; 101 27fb6: 51 05 cpc r21, r1 27fb8: 6c f4 brge .+26 ; 0x27fd4 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; 27fba: 82 0f add r24, r18 27fbc: 93 1f adc r25, r19 27fbe: 0c c0 rjmp .+24 ; 0x27fd8 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 27fc0: 24 36 cpi r18, 0x64 ; 100 27fc2: 31 05 cpc r19, r1 27fc4: 09 f4 brne .+2 ; 0x27fc8 27fc6: 55 c0 rjmp .+170 ; 0x28072 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 27fc8: ac 01 movw r20, r24 27fca: 42 0f add r20, r18 27fcc: 53 1f adc r21, r19 27fce: 44 36 cpi r20, 0x64 ; 100 27fd0: 51 05 cpc r21, r1 27fd2: 9c f7 brge .-26 ; 0x27fba { feedmultiply = 100; 27fd4: 84 e6 ldi r24, 0x64 ; 100 27fd6: 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; 27fd8: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 27fdc: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 27fe0: 80 91 39 02 lds r24, 0x0239 ; 0x800239 27fe4: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 27fe8: 82 17 cp r24, r18 27fea: 93 07 cpc r25, r19 27fec: a9 f0 breq .+42 ; 0x28018 feedmultiply = constrain(feedmultiply, 10, 999); 27fee: 88 3e cpi r24, 0xE8 ; 232 27ff0: 53 e0 ldi r21, 0x03 ; 3 27ff2: 95 07 cpc r25, r21 27ff4: 14 f0 brlt .+4 ; 0x27ffa 27ff6: 87 ee ldi r24, 0xE7 ; 231 27ff8: 93 e0 ldi r25, 0x03 ; 3 27ffa: 8a 30 cpi r24, 0x0A ; 10 27ffc: 91 05 cpc r25, r1 27ffe: 14 f4 brge .+4 ; 0x28004 28000: 8a e0 ldi r24, 0x0A ; 10 28002: 90 e0 ldi r25, 0x00 ; 0 28004: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 28008: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 2800c: 10 92 71 06 sts 0x0671, r1 ; 0x800671 28010: 10 92 70 06 sts 0x0670, r1 ; 0x800670 refresh_saved_feedrate_multiplier_in_ram(); 28014: 0e 94 ea 64 call 0xc9d4 ; 0xc9d4 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 28018: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2801c: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2801e: 10 92 51 06 sts 0x0651, r1 ; 0x800651 } if (lcd_status_update_delay) 28022: 10 91 51 06 lds r17, 0x0651 ; 0x800651 28026: 11 23 and r17, r17 28028: 91 f1 breq .+100 ; 0x2808e lcd_status_update_delay--; 2802a: 2f ef ldi r18, 0xFF ; 255 2802c: 21 0f add r18, r17 2802e: 20 93 51 06 sts 0x0651, r18 ; 0x800651 if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 28032: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 28036: 81 11 cpse r24, r1 28038: 0d c0 rjmp .+26 ; 0x28054 2803a: 0e 94 04 71 call 0xe208 ; 0xe208 2803e: 88 23 and r24, r24 28040: 49 f0 breq .+18 ; 0x28054 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 28042: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_main_menu); 28046: 60 e0 ldi r22, 0x00 ; 0 28048: 8e ed ldi r24, 0xDE ; 222 2804a: 94 ed ldi r25, 0xD4 ; 212 2804c: 0f 94 0a d3 call 0x3a614 ; 0x3a614 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 28050: 0e 94 93 6f call 0xdf26 ; 0xdf26 } } 28054: 28 96 adiw r28, 0x08 ; 8 28056: 0f b6 in r0, 0x3f ; 63 28058: f8 94 cli 2805a: de bf out 0x3e, r29 ; 62 2805c: 0f be out 0x3f, r0 ; 63 2805e: cd bf out 0x3d, r28 ; 61 28060: df 91 pop r29 28062: cf 91 pop r28 28064: 1f 91 pop r17 28066: 0f 91 pop r16 28068: ff 90 pop r15 2806a: ef 90 pop r14 2806c: df 90 pop r13 2806e: cf 90 pop r12 28070: 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) { 28072: 8b 30 cpi r24, 0x0B ; 11 28074: 91 05 cpc r25, r1 28076: 1c f0 brlt .+6 ; 0x2807e feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 28078: 86 5a subi r24, 0xA6 ; 166 2807a: 9f 4f sbci r25, 0xFF ; 255 2807c: ad cf rjmp .-166 ; 0x27fd8 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2807e: 86 3f cpi r24, 0xF6 ; 246 28080: 4f ef ldi r20, 0xFF ; 255 28082: 94 07 cpc r25, r20 28084: 0c f0 brlt .+2 ; 0x28088 28086: ac cf rjmp .-168 ; 0x27fe0 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 28088: 82 59 subi r24, 0x92 ; 146 2808a: 9f 4f sbci r25, 0xFF ; 255 2808c: a5 cf rjmp .-182 ; 0x27fd8 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; 2808e: 6a e0 ldi r22, 0x0A ; 10 28090: 60 93 51 06 sts 0x0651, r22 ; 0x800651 ReInitLCD++; 28094: 80 91 50 06 lds r24, 0x0650 ; 0x800650 28098: 8f 5f subi r24, 0xFF ; 255 2809a: 80 93 50 06 sts 0x0650, r24 ; 0x800650 if (ReInitLCD == 30) 2809e: 8e 31 cpi r24, 0x1E ; 30 280a0: 09 f0 breq .+2 ; 0x280a4 280a2: 9f c0 rjmp .+318 ; 0x281e2 { ReInitLCD = 0 ; 280a4: 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(); 280a8: 0e 94 93 6f call 0xdf26 ; 0xdf26 lcd_status_message_idx = 0; // Re-draw message from beginning 280ac: 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(); 280b0: 0e 94 9b 6e call 0xdd36 ; 0xdd36 lcd_home(); //line 0 280b4: 0e 94 13 6f call 0xde26 ; 0xde26 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 280b8: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 280bc: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 280c0: 07 2e mov r0, r23 280c2: 00 0c add r0, r0 280c4: 88 0b sbc r24, r24 280c6: 99 0b sbc r25, r25 280c8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__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)); 280cc: 20 e0 ldi r18, 0x00 ; 0 280ce: 30 e0 ldi r19, 0x00 ; 0 280d0: 40 e0 ldi r20, 0x00 ; 0 280d2: 5f e3 ldi r21, 0x3F ; 63 280d4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 280d8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 280dc: 6b 01 movw r12, r22 280de: 20 e0 ldi r18, 0x00 ; 0 280e0: 30 e0 ldi r19, 0x00 ; 0 280e2: 40 e0 ldi r20, 0x00 ; 0 280e4: 5f e3 ldi r21, 0x3F ; 63 280e6: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 280ea: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 280ee: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 280f2: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 280f6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 280fa: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 280fe: a6 01 movw r20, r12 28100: 82 e8 ldi r24, 0x82 ; 130 28102: 0f 94 80 21 call 0x24300 ; 0x24300 lcd_space(3); //3 spaces 28106: 83 e0 ldi r24, 0x03 ; 3 28108: 0e 94 dd 6e call 0xddba ; 0xddba } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2810c: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 28110: 81 30 cpi r24, 0x01 ; 1 28112: 09 f0 breq .+2 ; 0x28116 28114: 6e c0 rjmp .+220 ; 0x281f2 lcd_puts_P(_N("Z --- ")); 28116: 87 eb ldi r24, 0xB7 ; 183 28118: 9e e6 ldi r25, 0x6E ; 110 2811a: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2811e: 61 e0 ldi r22, 0x01 ; 1 28120: 80 e0 ldi r24, 0x00 ; 0 28122: 0e 94 e7 6e call 0xddce ; 0xddce }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 28126: 60 91 72 06 lds r22, 0x0672 ; 0x800672 2812a: 70 91 73 06 lds r23, 0x0673 ; 0x800673 2812e: 07 2e mov r0, r23 28130: 00 0c add r0, r0 28132: 88 0b sbc r24, r24 28134: 99 0b sbc r25, r25 28136: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2813a: 20 e0 ldi r18, 0x00 ; 0 2813c: 30 e0 ldi r19, 0x00 ; 0 2813e: 40 e0 ldi r20, 0x00 ; 0 28140: 5f e3 ldi r21, 0x3F ; 63 28142: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 28146: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2814a: 6b 01 movw r12, r22 2814c: 20 e0 ldi r18, 0x00 ; 0 2814e: 30 e0 ldi r19, 0x00 ; 0 28150: 40 e0 ldi r20, 0x00 ; 0 28152: 5f e3 ldi r21, 0x3F ; 63 28154: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 28158: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2815c: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 28160: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 28164: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 28168: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2816c: a6 01 movw r20, r12 2816e: 80 e8 ldi r24, 0x80 ; 128 28170: 0f 94 80 21 call 0x24300 ; 0x24300 lcd_space(3); //3 spaces 28174: 83 e0 ldi r24, 0x03 ; 3 28176: 0e 94 dd 6e call 0xddba ; 0xddba #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2817a: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2817e: 8f 93 push r24 28180: 80 91 39 02 lds r24, 0x0239 ; 0x800239 28184: 8f 93 push r24 28186: 80 ec ldi r24, 0xC0 ; 192 28188: 9e e6 ldi r25, 0x6E ; 110 2818a: 9f 93 push r25 2818c: 8f 93 push r24 2818e: 0e 94 c0 6e call 0xdd80 ; 0xdd80 lcd_space(8 - chars); 28192: 98 e0 ldi r25, 0x08 ; 8 28194: 98 1b sub r25, r24 28196: 89 2f mov r24, r25 28198: 0e 94 dd 6e call 0xddba ; 0xddba #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2819c: 62 e0 ldi r22, 0x02 ; 2 2819e: 80 e0 ldi r24, 0x00 ; 0 281a0: 0e 94 e7 6e call 0xddce ; 0xddce } // 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(" ")); 281a4: 0f 90 pop r0 281a6: 0f 90 pop r0 281a8: 0f 90 pop r0 281aa: 0f 90 pop r0 281ac: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 281b0: e0 90 90 14 lds r14, 0x1490 ; 0x801490 281b4: 81 11 cpse r24, r1 281b6: 3e c0 rjmp .+124 ; 0x28234 281b8: 23 ed ldi r18, 0xD3 ; 211 281ba: c2 2e mov r12, r18 281bc: 2e e6 ldi r18, 0x6E ; 110 281be: d2 2e mov r13, r18 281c0: e1 10 cpse r14, r1 281c2: 3c c0 rjmp .+120 ; 0x2823c 281c4: 87 ed ldi r24, 0xD7 ; 215 281c6: c8 2e mov r12, r24 281c8: 8e e6 ldi r24, 0x6E ; 110 281ca: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 281cc: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 281d0: f8 2e mov r15, r24 281d2: 88 23 and r24, r24 281d4: e1 f1 breq .+120 ; 0x2824e 281d6: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 281da: 8f 3f cpi r24, 0xFF ; 255 281dc: 89 f5 brne .+98 ; 0x28240 281de: f1 2c mov r15, r1 281e0: 36 c0 rjmp .+108 ; 0x2824e ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 281e2: 0f 94 de dc call 0x3b9bc ; 0x3b9bc <__divmodqi4> 281e6: 91 11 cpse r25, r1 281e8: 63 cf rjmp .-314 ; 0x280b0 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 281ea: 80 e0 ldi r24, 0x00 ; 0 281ec: 0e 94 52 6f call 0xdea4 ; 0xdea4 281f0: 5d cf rjmp .-326 ; 0x280ac 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]?' ':'?'); 281f2: 80 91 91 06 lds r24, 0x0691 ; 0x800691 281f6: 88 23 and r24, r24 281f8: d9 f0 breq .+54 ; 0x28230 281fa: 80 e2 ldi r24, 0x20 ; 32 281fc: 1f 92 push r1 281fe: 8f 93 push r24 28200: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 28204: 8f 93 push r24 28206: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2820a: 8f 93 push r24 2820c: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 28210: 8f 93 push r24 28212: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 28216: 8f 93 push r24 28218: 8e ea ldi r24, 0xAE ; 174 2821a: 9e e6 ldi r25, 0x6E ; 110 2821c: 9f 93 push r25 2821e: 8f 93 push r24 28220: 0e 94 c0 6e call 0xdd80 ; 0xdd80 28224: 0f b6 in r0, 0x3f ; 63 28226: f8 94 cli 28228: de bf out 0x3e, r29 ; 62 2822a: 0f be out 0x3f, r0 ; 63 2822c: cd bf out 0x3d, r28 ; 61 2822e: 77 cf rjmp .-274 ; 0x2811e 28230: 8f e3 ldi r24, 0x3F ; 63 28232: e4 cf rjmp .-56 ; 0x281fc } // 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(" ")); 28234: 9b ed ldi r25, 0xDB ; 219 28236: c9 2e mov r12, r25 28238: 9e e6 ldi r25, 0x6E ; 110 2823a: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2823c: ee 20 and r14, r14 2823e: 31 f2 breq .-116 ; 0x281cc if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 28240: 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)); 28244: ff 24 eor r15, r15 28246: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 28248: 88 23 and r24, r24 2824a: 09 f4 brne .+2 ; 0x2824e 2824c: bb c0 rjmp .+374 ; 0x283c4 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2824e: 81 ea ldi r24, 0xA1 ; 161 28250: 9d e0 ldi r25, 0x0D ; 13 28252: 0f 94 23 dc call 0x3b846 ; 0x3b846 28256: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 28258: 0e 94 56 76 call 0xecac ; 0xecac if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2825c: 87 fd sbrc r24, 7 2825e: b2 c0 rjmp .+356 ; 0x283c4 28260: 08 17 cp r16, r24 28262: 09 f4 brne .+2 ; 0x28266 28264: af c0 rjmp .+350 ; 0x283c4 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 28266: 9b e0 ldi r25, 0x0B ; 11 28268: 09 02 muls r16, r25 2826a: b0 01 movw r22, r0 2826c: 11 24 eor r1, r1 2826e: 67 5b subi r22, 0xB7 ; 183 28270: 72 4f sbci r23, 0xF2 ; 242 28272: 47 e0 ldi r20, 0x07 ; 7 28274: 50 e0 ldi r21, 0x00 ; 0 28276: 8e 01 movw r16, r28 28278: 0f 5f subi r16, 0xFF ; 255 2827a: 1f 4f sbci r17, 0xFF ; 255 2827c: c8 01 movw r24, r16 2827e: 0f 94 13 dc call 0x3b826 ; 0x3b826 sheet[7] = '\0'; 28282: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 28284: 1f 93 push r17 28286: 0f 93 push r16 28288: 88 e8 ldi r24, 0x88 ; 136 2828a: 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()); 2828c: 9f 93 push r25 2828e: 8f 93 push r24 28290: 0e 94 c0 6e call 0xdd80 ; 0xdd80 28294: 0f 90 pop r0 28296: 0f 90 pop r0 28298: 0f 90 pop r0 2829a: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2829c: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 282a0: 81 30 cpi r24, 0x01 ; 1 282a2: 09 f0 breq .+2 ; 0x282a6 282a4: e9 c0 rjmp .+466 ; 0x28478 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 282a6: 0f 94 4f 21 call 0x2429e ; 0x2429e 282aa: 95 e0 ldi r25, 0x05 ; 5 282ac: 98 1b sub r25, r24 282ae: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 282b0: 0e 94 dd 6e call 0xddba ; 0xddba 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()) { 282b4: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 282b8: 88 23 and r24, r24 282ba: 09 f4 brne .+2 ; 0x282be 282bc: fa c0 rjmp .+500 ; 0x284b2 uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 282be: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 282c2: 88 23 and r24, r24 282c4: 09 f4 brne .+2 ; 0x282c8 282c6: da c0 rjmp .+436 ; 0x2847c if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 282c8: c0 90 b5 02 lds r12, 0x02B5 ; 0x8002b5 282cc: 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) 282d0: e0 90 b3 02 lds r14, 0x02B3 ; 0x8002b3 282d4: f0 90 b4 02 lds r15, 0x02B4 ; 0x8002b4 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 282d8: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 282dc: 8a 30 cpi r24, 0x0A ; 10 282de: 11 f4 brne .+4 ; 0x282e4 clock_interval = 0; 282e0: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f clock_interval++; 282e4: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 282e8: 8f 5f subi r24, 0xFF ; 255 282ea: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 282ee: 2f ef ldi r18, 0xFF ; 255 282f0: e2 16 cp r14, r18 282f2: f2 06 cpc r15, r18 282f4: 21 f0 breq .+8 ; 0x282fe 282f6: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 282f8: 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) { 282fa: 86 30 cpi r24, 0x06 ; 6 282fc: 70 f4 brcc .+28 ; 0x2831a print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 282fe: 3f ef ldi r19, 0xFF ; 255 28300: c3 16 cp r12, r19 28302: d3 06 cpc r13, r19 28304: 09 f0 breq .+2 ; 0x28308 28306: c3 c0 rjmp .+390 ; 0x2848e print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 28308: 0f 94 aa 3e call 0x27d54 ; 0x27d54 2830c: 2c e3 ldi r18, 0x3C ; 60 2830e: 30 e0 ldi r19, 0x00 ; 0 28310: 40 e0 ldi r20, 0x00 ; 0 28312: 50 e0 ldi r21, 0x00 ; 0 28314: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__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 = ' '; 28318: 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)) { 2831a: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2831e: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 28322: 44 36 cpi r20, 0x64 ; 100 28324: 51 05 cpc r21, r1 28326: 09 f4 brne .+2 ; 0x2832a 28328: b5 c0 rjmp .+362 ; 0x28494 2832a: c2 16 cp r12, r18 2832c: d3 06 cpc r13, r19 2832e: 21 f0 breq .+8 ; 0x28338 28330: e2 16 cp r14, r18 28332: f3 06 cpc r15, r19 28334: 09 f0 breq .+2 ; 0x28338 28336: ae c0 rjmp .+348 ; 0x28494 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); 28338: a4 e6 ldi r26, 0x64 ; 100 2833a: b0 e0 ldi r27, 0x00 ; 0 2833c: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 28340: 9a 01 movw r18, r20 28342: 55 0f add r21, r21 28344: 44 0b sbc r20, r20 28346: 55 0b sbc r21, r21 28348: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2834c: 4f e3 ldi r20, 0x3F ; 63 2834e: e4 2e mov r14, r20 28350: 04 2e mov r0, r20 28352: 00 0c add r0, r0 28354: ff 08 sbc r15, r15 28356: e1 2f mov r30, r17 28358: 01 2e mov r0, r17 2835a: 00 0c add r0, r0 2835c: ff 0b sbc r31, r31 2835e: c9 01 movw r24, r18 28360: 6c e3 ldi r22, 0x3C ; 60 28362: 70 e0 ldi r23, 0x00 ; 0 28364: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__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 28368: 20 37 cpi r18, 0x70 ; 112 2836a: 37 41 sbci r19, 0x17 ; 23 2836c: 08 f0 brcs .+2 ; 0x28370 2836e: 94 c0 rjmp .+296 ; 0x28498 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 28370: ff 92 push r15 28372: 4f 93 push r20 28374: ff 93 push r31 28376: 1f 93 push r17 28378: 9f 93 push r25 2837a: 8f 93 push r24 2837c: 7f 93 push r23 2837e: 6f 93 push r22 28380: 8a ee ldi r24, 0xEA ; 234 28382: 9e e6 ldi r25, 0x6E ; 110 28384: 9f 93 push r25 28386: 8f 93 push r24 28388: 0e 94 c0 6e call 0xdd80 ; 0xdd80 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2838c: 0f b6 in r0, 0x3f ; 63 2838e: f8 94 cli 28390: de bf out 0x3e, r29 ; 62 28392: 0f be out 0x3f, r0 ; 63 28394: 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); 28396: 98 e0 ldi r25, 0x08 ; 8 28398: 98 1b sub r25, r24 2839a: 89 2f mov r24, r25 2839c: 0e 94 dd 6e call 0xddba ; 0xddba #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 283a0: 63 e0 ldi r22, 0x03 ; 3 283a2: 80 e0 ldi r24, 0x00 ; 0 283a4: 0e 94 e7 6e call 0xddce ; 0xddce #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 283a8: 0f 94 7a 2a call 0x254f4 ; 0x254f4 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 283ac: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 283b0: 88 23 and r24, r24 283b2: 09 f4 brne .+2 ; 0x283b6 283b4: 3e ce rjmp .-900 ; 0x28032 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) { 283b6: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 283ba: 81 11 cpse r24, r1 283bc: 3a ce rjmp .-908 ; 0x28032 283be: 0f 94 93 06 call 0x20d26 ; 0x20d26 283c2: 37 ce rjmp .-914 ; 0x28032 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 283c4: e1 10 cpse r14, r1 283c6: 04 c0 rjmp .+8 ; 0x283d0 283c8: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.450> 283cc: 81 11 cpse r24, r1 283ce: 4a c0 rjmp .+148 ; 0x28464 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 283d0: df 92 push r13 283d2: cf 92 push r12 283d4: 84 e8 ldi r24, 0x84 ; 132 283d6: 90 ea ldi r25, 0xA0 ; 160 283d8: 9f 93 push r25 283da: 8f 93 push r24 283dc: 0e 94 c0 6e call 0xdd80 ; 0xdd80 283e0: 0f 90 pop r0 283e2: 0f 90 pop r0 283e4: 0f 90 pop r0 283e6: 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) 283e8: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 283ec: 81 11 cpse r24, r1 283ee: 04 c0 rjmp .+8 ; 0x283f8 283f0: 80 91 ae 02 lds r24, 0x02AE ; 0x8002ae 283f4: 85 36 cpi r24, 0x65 ; 101 283f6: f0 f1 brcs .+124 ; 0x28474 { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 283f8: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad 283fc: 85 36 cpi r24, 0x65 ; 101 283fe: d0 f1 brcs .+116 ; 0x28474 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;}; 28400: 80 91 23 17 lds r24, 0x1723 ; 0x801723 28404: 88 23 and r24, r24 28406: 19 f1 breq .+70 ; 0x2844e 28408: 80 91 9d 17 lds r24, 0x179D ; 0x80179d 2840c: 90 91 9e 17 lds r25, 0x179E ; 0x80179e 28410: a0 91 9f 17 lds r26, 0x179F ; 0x80179f 28414: b0 91 a0 17 lds r27, 0x17A0 ; 0x8017a0 28418: 00 97 sbiw r24, 0x00 ; 0 2841a: a1 05 cpc r26, r1 2841c: b1 05 cpc r27, r1 2841e: b9 f0 breq .+46 ; 0x2844e 28420: bc 01 movw r22, r24 28422: cd 01 movw r24, r26 28424: 6d 59 subi r22, 0x9D ; 157 28426: 7f 4f sbci r23, 0xFF ; 255 28428: 8f 4f sbci r24, 0xFF ; 255 2842a: 9f 4f sbci r25, 0xFF ; 255 2842c: 24 e6 ldi r18, 0x64 ; 100 2842e: 30 e0 ldi r19, 0x00 ; 0 28430: 40 e0 ldi r20, 0x00 ; 0 28432: 50 e0 ldi r21, 0x00 ; 0 28434: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 28438: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 2843c: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 28440: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 28444: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 28448: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 2844c: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2844e: 21 2f mov r18, r17 28450: 30 e0 ldi r19, 0x00 ; 0 28452: 8d ec ldi r24, 0xCD ; 205 28454: 9e e6 ldi r25, 0x6E ; 110 28456: f1 10 cpse r15, r1 28458: 02 c0 rjmp .+4 ; 0x2845e 2845a: 87 ec ldi r24, 0xC7 ; 199 2845c: 9e e6 ldi r25, 0x6E ; 110 2845e: 3f 93 push r19 28460: 2f 93 push r18 28462: 14 cf rjmp .-472 ; 0x2828c if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 28464: 81 e0 ldi r24, 0x01 ; 1 28466: 0e 94 dd 6e call 0xddba ; 0xddba lcd_print(hostName); // Two characters 2846a: 8c e4 ldi r24, 0x4C ; 76 2846c: 96 e0 ldi r25, 0x06 ; 6 2846e: 0e 94 ee 70 call 0xe1dc ; 0xe1dc 28472: ba cf rjmp .-140 ; 0x283e8 28474: 18 2f mov r17, r24 28476: eb cf rjmp .-42 ; 0x2844e lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 28478: 85 e0 ldi r24, 0x05 ; 5 2847a: 1a cf rjmp .-460 ; 0x282b0 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) 2847c: c0 90 b1 02 lds r12, 0x02B1 ; 0x8002b1 28480: 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) 28484: e0 90 af 02 lds r14, 0x02AF ; 0x8002af 28488: f0 90 b0 02 lds r15, 0x02B0 ; 0x8002b0 2848c: 25 cf rjmp .-438 ; 0x282d8 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) { 2848e: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 28490: 12 e5 ldi r17, 0x52 ; 82 28492: 43 cf rjmp .-378 ; 0x2831a 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 = ' '; 28494: 40 e2 ldi r20, 0x20 ; 32 28496: 5b cf rjmp .-330 ; 0x2834e } 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); 28498: ff 92 push r15 2849a: 4f 93 push r20 2849c: ff 93 push r31 2849e: 1f 93 push r17 284a0: 7f 93 push r23 284a2: 6f 93 push r22 284a4: 8f ed ldi r24, 0xDF ; 223 284a6: 9e e6 ldi r25, 0x6E ; 110 284a8: 9f 93 push r25 284aa: 8f 93 push r24 284ac: 0e 94 c0 6e call 0xdd80 ; 0xdd80 284b0: 6d cf rjmp .-294 ; 0x2838c } 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); 284b2: 85 ea ldi r24, 0xA5 ; 165 284b4: 9d e0 ldi r25, 0x0D ; 13 284b6: 0f 94 31 dc call 0x3b862 ; 0x3b862 284ba: bc 01 movw r22, r24 284bc: 90 e0 ldi r25, 0x00 ; 0 284be: 80 e0 ldi r24, 0x00 ; 0 284c0: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 284c4: 20 e0 ldi r18, 0x00 ; 0 284c6: 30 e0 ldi r19, 0x00 ; 0 284c8: 4a e7 ldi r20, 0x7A ; 122 284ca: 54 e4 ldi r21, 0x44 ; 68 284cc: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 284d0: 9f 93 push r25 284d2: 8f 93 push r24 284d4: 7f 93 push r23 284d6: 6f 93 push r22 284d8: 8d e8 ldi r24, 0x8D ; 141 284da: 90 ea ldi r25, 0xA0 ; 160 284dc: 9f 93 push r25 284de: 8f 93 push r24 284e0: 0e 94 c0 6e call 0xdd80 ; 0xdd80 284e4: 0f 90 pop r0 284e6: 0f 90 pop r0 284e8: 0f 90 pop r0 284ea: 0f 90 pop r0 284ec: 0f 90 pop r0 284ee: 0f 90 pop r0 284f0: 52 cf rjmp .-348 ; 0x28396 000284f2 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 284f2: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d startTimestamp = 0; 284f6: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 284fa: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 284fe: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 28502: 10 92 aa 05 sts 0x05AA, r1 ; 0x8005aa stopTimestamp = 0; 28506: 10 92 52 06 sts 0x0652, r1 ; 0x800652 2850a: 10 92 53 06 sts 0x0653, r1 ; 0x800653 2850e: 10 92 54 06 sts 0x0654, r1 ; 0x800654 28512: 10 92 55 06 sts 0x0655, r1 ; 0x800655 accumulator = 0; 28516: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2851a: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 2851e: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 28522: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 } 28526: 08 95 ret 00028528 : /** * @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; } 28528: 80 91 9d 03 lds r24, 0x039D ; 0x80039d } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2852c: 81 30 cpi r24, 0x01 ; 1 2852e: f1 f0 breq .+60 ; 0x2856c if (isPaused()) accumulator = duration(); 28530: 82 30 cpi r24, 0x02 ; 2 28532: c9 f4 brne .+50 ; 0x28566 28534: 0f 94 aa 3e call 0x27d54 ; 0x27d54 28538: 60 93 a3 05 sts 0x05A3, r22 ; 0x8005a3 2853c: 70 93 a4 05 sts 0x05A4, r23 ; 0x8005a4 28540: 80 93 a5 05 sts 0x05A5, r24 ; 0x8005a5 28544: 90 93 a6 05 sts 0x05A6, r25 ; 0x8005a6 else reset(); state = RUNNING; 28548: 81 e0 ldi r24, 0x01 ; 1 2854a: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d startTimestamp = _millis(); 2854e: 0f 94 53 29 call 0x252a6 ; 0x252a6 28552: 60 93 a7 05 sts 0x05A7, r22 ; 0x8005a7 28556: 70 93 a8 05 sts 0x05A8, r23 ; 0x8005a8 2855a: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 2855e: 90 93 aa 05 sts 0x05AA, r25 ; 0x8005aa 28562: 81 e0 ldi r24, 0x01 ; 1 28564: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 28566: 0f 94 79 42 call 0x284f2 ; 0x284f2 2856a: ee cf rjmp .-36 ; 0x28548 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2856c: 80 e0 ldi r24, 0x00 ; 0 } 2856e: 08 95 ret 00028570 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 28570: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 28574: 81 50 subi r24, 0x01 ; 1 28576: 82 30 cpi r24, 0x02 ; 2 28578: 70 f4 brcc .+28 ; 0x28596 state = STOPPED; 2857a: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d stopTimestamp = _millis(); 2857e: 0f 94 53 29 call 0x252a6 ; 0x252a6 28582: 60 93 52 06 sts 0x0652, r22 ; 0x800652 28586: 70 93 53 06 sts 0x0653, r23 ; 0x800653 2858a: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2858e: 90 93 55 06 sts 0x0655, r25 ; 0x800655 28592: 81 e0 ldi r24, 0x01 ; 1 28594: 08 95 ret return true; } else return false; 28596: 80 e0 ldi r24, 0x00 ; 0 } 28598: 08 95 ret 0002859a : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2859a: 2f b7 in r18, 0x3f ; 63 2859c: f8 94 cli count_pos = count_position[axis]; 2859e: 94 e0 ldi r25, 0x04 ; 4 285a0: 89 9f mul r24, r25 285a2: f0 01 movw r30, r0 285a4: 11 24 eor r1, r1 285a6: ed 54 subi r30, 0x4D ; 77 285a8: f9 4f sbci r31, 0xF9 ; 249 285aa: 60 81 ld r22, Z 285ac: 71 81 ldd r23, Z+1 ; 0x01 285ae: 82 81 ldd r24, Z+2 ; 0x02 285b0: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 285b2: 2f bf out 0x3f, r18 ; 63 return count_pos; } 285b4: 08 95 ret 000285b6 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 285b6: cf 93 push r28 285b8: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 285ba: 0f 94 cd 42 call 0x2859a ; 0x2859a 285be: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 285c2: 24 e0 ldi r18, 0x04 ; 4 285c4: c2 9f mul r28, r18 285c6: f0 01 movw r30, r0 285c8: 11 24 eor r1, r1 285ca: ee 53 subi r30, 0x3E ; 62 285cc: f2 4f sbci r31, 0xF2 ; 242 285ce: 20 81 ld r18, Z 285d0: 31 81 ldd r19, Z+1 ; 0x01 285d2: 42 81 ldd r20, Z+2 ; 0x02 285d4: 53 81 ldd r21, Z+3 ; 0x03 285d6: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> } 285da: cf 91 pop r28 285dc: 08 95 ret 000285de : } // Block until all buffered steps are executed void st_synchronize() { 285de: cf 93 push r28 285e0: df 93 push r29 285e2: 00 d0 rcall .+0 ; 0x285e4 285e4: 1f 92 push r1 285e6: cd b7 in r28, 0x3d ; 61 285e8: 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); 285ea: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 285ee: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while(blocks_queued()) 285f2: 98 17 cp r25, r24 285f4: 09 f4 brne .+2 ; 0x285f8 285f6: 46 c0 rjmp .+140 ; 0x28684 { #ifdef TMC2130 manage_heater(); 285f8: 0f 94 63 38 call 0x270c6 ; 0x270c6 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 285fc: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.473> 28600: 84 30 cpi r24, 0x04 ; 4 28602: 38 f0 brcs .+14 ; 0x28612 // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 28604: 81 e0 ldi r24, 0x01 ; 1 28606: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 2860a: 80 e0 ldi r24, 0x00 ; 0 2860c: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 28610: ec cf rjmp .-40 ; 0x285ea { uint32_t val32 = 0; 28612: 19 82 std Y+1, r1 ; 0x01 28614: 1a 82 std Y+2, r1 ; 0x02 28616: 1b 82 std Y+3, r1 ; 0x03 28618: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2861a: ae 01 movw r20, r28 2861c: 4f 5f subi r20, 0xFF ; 255 2861e: 5f 4f sbci r21, 0xFF ; 255 28620: 6f e6 ldi r22, 0x6F ; 111 28622: 0f 94 f8 23 call 0x247f0 ; 0x247f0 tmc2130_sg_measure_val += (val32 & 0x3ff); 28626: 89 81 ldd r24, Y+1 ; 0x01 28628: 9a 81 ldd r25, Y+2 ; 0x02 2862a: ab 81 ldd r26, Y+3 ; 0x03 2862c: bc 81 ldd r27, Y+4 ; 0x04 2862e: 93 70 andi r25, 0x03 ; 3 28630: aa 27 eor r26, r26 28632: bb 27 eor r27, r27 28634: 40 91 d1 03 lds r20, 0x03D1 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 28638: 50 91 d2 03 lds r21, 0x03D2 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 2863c: 60 91 d3 03 lds r22, 0x03D3 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 28640: 70 91 d4 03 lds r23, 0x03D4 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> 28644: 84 0f add r24, r20 28646: 95 1f adc r25, r21 28648: a6 1f adc r26, r22 2864a: b7 1f adc r27, r23 2864c: 80 93 d1 03 sts 0x03D1, r24 ; 0x8003d1 <_ZL22tmc2130_sg_measure_val.lto_priv.474> 28650: 90 93 d2 03 sts 0x03D2, r25 ; 0x8003d2 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x1> 28654: a0 93 d3 03 sts 0x03D3, r26 ; 0x8003d3 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x2> 28658: b0 93 d4 03 sts 0x03D4, r27 ; 0x8003d4 <_ZL22tmc2130_sg_measure_val.lto_priv.474+0x3> tmc2130_sg_measure_cnt++; 2865c: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 28660: 90 91 ce 03 lds r25, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 28664: a0 91 cf 03 lds r26, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 28668: b0 91 d0 03 lds r27, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 2866c: 01 96 adiw r24, 0x01 ; 1 2866e: a1 1d adc r26, r1 28670: b1 1d adc r27, r1 28672: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL22tmc2130_sg_measure_cnt.lto_priv.475> 28676: 90 93 ce 03 sts 0x03CE, r25 ; 0x8003ce <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x1> 2867a: a0 93 cf 03 sts 0x03CF, r26 ; 0x8003cf <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x2> 2867e: b0 93 d0 03 sts 0x03D0, r27 ; 0x8003d0 <_ZL22tmc2130_sg_measure_cnt.lto_priv.475+0x3> 28682: b3 cf rjmp .-154 ; 0x285ea #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 28684: 0f 90 pop r0 28686: 0f 90 pop r0 28688: 0f 90 pop r0 2868a: 0f 90 pop r0 2868c: df 91 pop r29 2868e: cf 91 pop r28 28690: 08 95 ret 00028692 : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 28692: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 28694: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 28698: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2869c: 80 ed ldi r24, 0xD0 ; 208 2869e: 97 e0 ldi r25, 0x07 ; 7 286a0: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 286a4: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 286a8: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 286ac: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 286b0: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 286b4: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 286b8: 01 97 sbiw r24, 0x01 ; 1 286ba: 8e 3f cpi r24, 0xFE ; 254 286bc: 9f 4f sbci r25, 0xFF ; 255 286be: 20 f4 brcc .+8 ; 0x286c8 nextAdvanceISR = 0; 286c0: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 286c4: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> #endif } 286c8: 08 95 ret 000286ca <__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) { 286ca: 1f 92 push r1 286cc: 0f 92 push r0 286ce: 0f b6 in r0, 0x3f ; 63 286d0: 0f 92 push r0 286d2: 11 24 eor r1, r1 286d4: 0b b6 in r0, 0x3b ; 59 286d6: 0f 92 push r0 286d8: 6f 92 push r6 286da: 7f 92 push r7 286dc: 8f 92 push r8 286de: cf 92 push r12 286e0: df 92 push r13 286e2: ef 92 push r14 286e4: ff 92 push r15 286e6: 0f 93 push r16 286e8: 1f 93 push r17 286ea: 2f 93 push r18 286ec: 3f 93 push r19 286ee: 4f 93 push r20 286f0: 5f 93 push r21 286f2: 6f 93 push r22 286f4: 7f 93 push r23 286f6: 8f 93 push r24 286f8: 9f 93 push r25 286fa: af 93 push r26 286fc: bf 93 push r27 286fe: cf 93 push r28 28700: df 93 push r29 28702: ef 93 push r30 28704: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 28706: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 2870a: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2870e: 9c 01 movw r18, r24 28710: 21 50 subi r18, 0x01 ; 1 28712: 31 09 sbc r19, r1 28714: 2e 3f cpi r18, 0xFE ; 254 28716: 3f 4f sbci r19, 0xFF ; 255 28718: 90 f4 brcc .+36 ; 0x2873e <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2871a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2871e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28722: 28 17 cp r18, r24 28724: 39 07 cpc r19, r25 28726: 08 f0 brcs .+2 ; 0x2872a <__vector_17+0x60> 28728: f9 c0 rjmp .+498 ; 0x2891c <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2872a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2872e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28732: 82 1b sub r24, r18 28734: 93 0b sbc r25, r19 28736: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2873a: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2873e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 28742: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 28746: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2874a: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 2874e: 28 17 cp r18, r24 28750: 39 07 cpc r19, r25 28752: 08 f0 brcs .+2 ; 0x28756 <__vector_17+0x8c> 28754: e8 c0 rjmp .+464 ; 0x28926 <__vector_17+0x25c> nextMainISR -= OCR1A; 28756: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2875a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2875e: 82 1b sub r24, r18 28760: 93 0b sbc r25, r19 28762: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28766: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2876a: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2876e: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28772: 89 2b or r24, r25 28774: 11 f0 breq .+4 ; 0x2877a <__vector_17+0xb0> 28776: 0d 94 b5 4c jmp 0x2996a ; 0x2996a <__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) 2877a: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 2877e: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28782: 30 97 sbiw r30, 0x00 ; 0 28784: 09 f0 breq .+2 ; 0x28788 <__vector_17+0xbe> 28786: 87 c1 rjmp .+782 ; 0x28a96 <__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) { 28788: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 2878c: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 28790: 98 17 cp r25, r24 28792: 09 f4 brne .+2 ; 0x28796 <__vector_17+0xcc> 28794: f9 c1 rjmp .+1010 ; 0x28b88 <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 28796: c0 91 a6 0d lds r28, 0x0DA6 ; 0x800da6 2879a: 2c 2f mov r18, r28 2879c: 30 e0 ldi r19, 0x00 ; 0 2879e: 5e e6 ldi r21, 0x6E ; 110 287a0: c5 9f mul r28, r21 287a2: e0 01 movw r28, r0 287a4: 11 24 eor r1, r1 287a6: cb 53 subi r28, 0x3B ; 59 287a8: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 287aa: fe 01 movw r30, r28 287ac: e9 5b subi r30, 0xB9 ; 185 287ae: ff 4f sbci r31, 0xFF ; 255 287b0: 41 e0 ldi r20, 0x01 ; 1 287b2: 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(); 287b4: d0 93 a2 05 sts 0x05A2, r29 ; 0x8005a2 287b8: c0 93 a1 05 sts 0x05A1, r28 ; 0x8005a1 if (current_block != NULL) { 287bc: 20 97 sbiw r28, 0x00 ; 0 287be: 09 f4 brne .+2 ; 0x287c2 <__vector_17+0xf8> 287c0: e3 c1 rjmp .+966 ; 0x28b88 <__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; 287c2: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 287c6: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 287ca: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f 287ce: 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; 287d2: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c acc_step_rate = uint16_t(current_block->initial_rate); 287d6: 8a ad ldd r24, Y+58 ; 0x3a 287d8: 9b ad ldd r25, Y+59 ; 0x3b 287da: 90 93 9b 05 sts 0x059B, r25 ; 0x80059b 287de: 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; 287e2: 81 34 cpi r24, 0x41 ; 65 287e4: ec e9 ldi r30, 0x9C ; 156 287e6: 9e 07 cpc r25, r30 287e8: 08 f0 brcs .+2 ; 0x287ec <__vector_17+0x122> 287ea: a2 c0 rjmp .+324 ; 0x28930 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 287ec: 81 32 cpi r24, 0x21 ; 33 287ee: fe e4 ldi r31, 0x4E ; 78 287f0: 9f 07 cpc r25, r31 287f2: 08 f4 brcc .+2 ; 0x287f6 <__vector_17+0x12c> 287f4: a0 c0 rjmp .+320 ; 0x28936 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 287f6: 96 95 lsr r25 287f8: 87 95 ror r24 287fa: 96 95 lsr r25 287fc: 87 95 ror r24 step_loops = 4; 287fe: 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; 28800: 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 28804: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 28806: 81 15 cp r24, r1 28808: e8 e0 ldi r30, 0x08 ; 8 2880a: 9e 07 cpc r25, r30 2880c: 08 f4 brcc .+2 ; 0x28810 <__vector_17+0x146> 2880e: a4 c0 rjmp .+328 ; 0x28958 <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 28810: e9 2f mov r30, r25 28812: ff 27 eor r31, r31 28814: ee 0f add r30, r30 28816: ff 1f adc r31, r31 28818: ee 0f add r30, r30 2881a: ff 1f adc r31, r31 2881c: af 01 movw r20, r30 2881e: 43 5a subi r20, 0xA3 ; 163 28820: 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); 28822: fa 01 movw r30, r20 28824: 32 96 adiw r30, 0x02 ; 2 28826: a5 91 lpm r26, Z+ 28828: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2882a: fa 01 movw r30, r20 2882c: 45 91 lpm r20, Z+ 2882e: 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. ); 28830: b8 9f mul r27, r24 28832: b0 01 movw r22, r0 28834: a8 9f mul r26, r24 28836: 00 0c add r0, r0 28838: 61 1d adc r22, r1 2883a: 11 24 eor r1, r1 2883c: 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); 2883e: ca 01 movw r24, r20 28840: 86 1b sub r24, r22 28842: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 28844: 84 36 cpi r24, 0x64 ; 100 28846: 91 05 cpc r25, r1 28848: 10 f4 brcc .+4 ; 0x2884e <__vector_17+0x184> 2884a: 84 e6 ldi r24, 0x64 ; 100 2884c: 90 e0 ldi r25, 0x00 ; 0 2884e: b0 e0 ldi r27, 0x00 ; 0 28850: a0 e0 ldi r26, 0x00 ; 0 28852: 80 93 95 05 sts 0x0595, r24 ; 0x800595 28856: 90 93 96 05 sts 0x0596, r25 ; 0x800596 2885a: a0 93 97 05 sts 0x0597, r26 ; 0x800597 2885e: b0 93 98 05 sts 0x0598, r27 ; 0x800598 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 28862: 4e e6 ldi r20, 0x6E ; 110 28864: 42 9f mul r20, r18 28866: c0 01 movw r24, r0 28868: 43 9f mul r20, r19 2886a: 90 0d add r25, r0 2886c: 11 24 eor r1, r1 2886e: 8b 53 subi r24, 0x3B ; 59 28870: 99 4f sbci r25, 0xF9 ; 249 28872: fc 01 movw r30, r24 28874: e4 5b subi r30, 0xB4 ; 180 28876: ff 4f sbci r31, 0xFF ; 255 28878: 40 81 ld r20, Z 2887a: 44 23 and r20, r20 2887c: 49 f0 breq .+18 ; 0x28890 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 2887e: 81 5b subi r24, 0xB1 ; 177 28880: 9f 4f sbci r25, 0xFF ; 255 28882: fc 01 movw r30, r24 28884: 80 81 ld r24, Z 28886: 91 81 ldd r25, Z+1 ; 0x01 28888: 90 93 94 05 sts 0x0594, r25 ; 0x800594 2888c: 80 93 93 05 sts 0x0593, r24 ; 0x800593 } e_steps = 0; 28890: 10 92 92 05 sts 0x0592, r1 ; 0x800592 nextAdvanceISR = ADV_NEVER; 28894: 8f ef ldi r24, 0xFF ; 255 28896: 9f ef ldi r25, 0xFF ; 255 28898: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2889c: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> LA_phase = -1; 288a0: 80 93 91 05 sts 0x0591, r24 ; 0x800591 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 288a4: 8e e6 ldi r24, 0x6E ; 110 288a6: 82 9f mul r24, r18 288a8: f0 01 movw r30, r0 288aa: 83 9f mul r24, r19 288ac: f0 0d add r31, r0 288ae: 11 24 eor r1, r1 288b0: eb 53 subi r30, 0x3B ; 59 288b2: f9 4f sbci r31, 0xF9 ; 249 288b4: 85 a9 ldd r24, Z+53 ; 0x35 288b6: 84 ff sbrs r24, 4 288b8: 08 c0 rjmp .+16 ; 0x288ca <__vector_17+0x200> count_position[E_AXIS] = 0; 288ba: 10 92 bf 06 sts 0x06BF, r1 ; 0x8006bf 288be: 10 92 c0 06 sts 0x06C0, r1 ; 0x8006c0 288c2: 10 92 c1 06 sts 0x06C1, r1 ; 0x8006c1 288c6: 10 92 c2 06 sts 0x06C2, r1 ; 0x8006c2 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 288ca: 83 ff sbrs r24, 3 288cc: 66 c0 rjmp .+204 ; 0x2899a <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 288ce: 8e e6 ldi r24, 0x6E ; 110 288d0: 82 9f mul r24, r18 288d2: f0 01 movw r30, r0 288d4: 83 9f mul r24, r19 288d6: f0 0d add r31, r0 288d8: 11 24 eor r1, r1 288da: eb 53 subi r30, 0x3B ; 59 288dc: f9 4f sbci r31, 0xF9 ; 249 288de: 80 89 ldd r24, Z+16 ; 0x10 288e0: 91 89 ldd r25, Z+17 ; 0x11 288e2: 96 95 lsr r25 288e4: 87 95 ror r24 288e6: 91 95 neg r25 288e8: 81 95 neg r24 288ea: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 288ec: 90 93 82 05 sts 0x0582, r25 ; 0x800582 288f0: 80 93 81 05 sts 0x0581, r24 ; 0x800581 288f4: 90 93 86 05 sts 0x0586, r25 ; 0x800586 288f8: 80 93 85 05 sts 0x0585, r24 ; 0x800585 288fc: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28900: 80 93 89 05 sts 0x0589, r24 ; 0x800589 28904: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28908: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2890c: 81 e0 ldi r24, 0x01 ; 1 2890e: 24 85 ldd r18, Z+12 ; 0x0c 28910: 35 85 ldd r19, Z+13 ; 0x0d 28912: 23 2b or r18, r19 28914: 09 f0 breq .+2 ; 0x28918 <__vector_17+0x24e> 28916: 82 c0 rjmp .+260 ; 0x28a1c <__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; 28918: 80 e0 ldi r24, 0x00 ; 0 2891a: 80 c0 rjmp .+256 ; 0x28a1c <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2891c: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28920: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 28924: 0c cf rjmp .-488 ; 0x2873e <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 28926: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 2892a: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2892e: 1d cf rjmp .-454 ; 0x2876a <__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; 28930: 80 e4 ldi r24, 0x40 ; 64 28932: 9c e9 ldi r25, 0x9C ; 156 28934: 60 cf rjmp .-320 ; 0x287f6 <__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 28936: 81 31 cpi r24, 0x11 ; 17 28938: 57 e2 ldi r21, 0x27 ; 39 2893a: 95 07 cpc r25, r21 2893c: 20 f0 brcs .+8 ; 0x28946 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 2893e: 96 95 lsr r25 28940: 87 95 ror r24 step_loops = 2; 28942: 42 e0 ldi r20, 0x02 ; 2 28944: 5d cf rjmp .-326 ; 0x28800 <__vector_17+0x136> } else { step_loops = 1; 28946: 40 93 99 05 sts 0x0599, r20 ; 0x800599 2894a: 80 32 cpi r24, 0x20 ; 32 2894c: 91 05 cpc r25, r1 2894e: 08 f0 brcs .+2 ; 0x28952 <__vector_17+0x288> 28950: 59 cf rjmp .-334 ; 0x28804 <__vector_17+0x13a> 28952: 80 e2 ldi r24, 0x20 ; 32 28954: 90 e0 ldi r25, 0x00 ; 0 28956: 56 cf rjmp .-340 ; 0x28804 <__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; 28958: ac 01 movw r20, r24 2895a: 56 95 lsr r21 2895c: 47 95 ror r20 2895e: 4c 7f andi r20, 0xFC ; 252 28960: 43 5a subi r20, 0xA3 ; 163 28962: 5d 46 sbci r21, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 28964: fa 01 movw r30, r20 28966: 65 91 lpm r22, Z+ 28968: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2896a: fa 01 movw r30, r20 2896c: 32 96 adiw r30, 0x02 ; 2 2896e: a5 91 lpm r26, Z+ 28970: b4 91 lpm r27, Z 28972: ac 01 movw r20, r24 28974: 47 70 andi r20, 0x07 ; 7 28976: 55 27 eor r21, r21 28978: 4a 9f mul r20, r26 2897a: c0 01 movw r24, r0 2897c: 4b 9f mul r20, r27 2897e: 90 0d add r25, r0 28980: 5a 9f mul r21, r26 28982: 90 0d add r25, r0 28984: 11 24 eor r1, r1 28986: e3 e0 ldi r30, 0x03 ; 3 28988: 96 95 lsr r25 2898a: 87 95 ror r24 2898c: ea 95 dec r30 2898e: e1 f7 brne .-8 ; 0x28988 <__vector_17+0x2be> 28990: ab 01 movw r20, r22 28992: 48 1b sub r20, r24 28994: 59 0b sbc r21, r25 28996: ca 01 movw r24, r20 28998: 55 cf rjmp .-342 ; 0x28844 <__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); 2899a: 8e e6 ldi r24, 0x6E ; 110 2899c: 82 9f mul r24, r18 2899e: f0 01 movw r30, r0 289a0: 83 9f mul r24, r19 289a2: f0 0d add r31, r0 289a4: 11 24 eor r1, r1 289a6: eb 53 subi r30, 0x3B ; 59 289a8: f9 4f sbci r31, 0xF9 ; 249 289aa: 80 89 ldd r24, Z+16 ; 0x10 289ac: 91 89 ldd r25, Z+17 ; 0x11 289ae: a2 89 ldd r26, Z+18 ; 0x12 289b0: b3 89 ldd r27, Z+19 ; 0x13 289b2: b6 95 lsr r27 289b4: a7 95 ror r26 289b6: 97 95 ror r25 289b8: 87 95 ror r24 289ba: b0 95 com r27 289bc: a0 95 com r26 289be: 90 95 com r25 289c0: 81 95 neg r24 289c2: 9f 4f sbci r25, 0xFF ; 255 289c4: af 4f sbci r26, 0xFF ; 255 289c6: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 289c8: 80 93 81 05 sts 0x0581, r24 ; 0x800581 289cc: 90 93 82 05 sts 0x0582, r25 ; 0x800582 289d0: a0 93 83 05 sts 0x0583, r26 ; 0x800583 289d4: b0 93 84 05 sts 0x0584, r27 ; 0x800584 289d8: 80 93 85 05 sts 0x0585, r24 ; 0x800585 289dc: 90 93 86 05 sts 0x0586, r25 ; 0x800586 289e0: a0 93 87 05 sts 0x0587, r26 ; 0x800587 289e4: b0 93 88 05 sts 0x0588, r27 ; 0x800588 289e8: 80 93 89 05 sts 0x0589, r24 ; 0x800589 289ec: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 289f0: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 289f4: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c 289f8: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 289fc: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28a00: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 28a04: b0 93 90 05 sts 0x0590, r27 ; 0x800590 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 28a08: 81 e0 ldi r24, 0x01 ; 1 28a0a: 44 85 ldd r20, Z+12 ; 0x0c 28a0c: 55 85 ldd r21, Z+13 ; 0x0d 28a0e: 66 85 ldd r22, Z+14 ; 0x0e 28a10: 77 85 ldd r23, Z+15 ; 0x0f 28a12: 45 2b or r20, r21 28a14: 46 2b or r20, r22 28a16: 47 2b or r20, r23 28a18: 09 f4 brne .+2 ; 0x28a1c <__vector_17+0x352> 28a1a: 7e cf rjmp .-260 ; 0x28918 <__vector_17+0x24e> 28a1c: 80 93 80 05 sts 0x0580, r24 ; 0x800580 #endif } step_events_completed.wide = 0; 28a20: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 28a24: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 28a28: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 28a2c: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f // Set directions. out_bits = current_block->direction_bits; 28a30: 88 8d ldd r24, Y+24 ; 0x18 28a32: 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); 28a3a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28a3e: 81 60 ori r24, 0x01 ; 1 28a40: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 28a44: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 28a46: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } if((out_bits & (1< 28a4e: 81 ff sbrs r24, 1 28a50: 8b c0 rjmp .+278 ; 0x28b68 <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 28a52: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28a56: 8d 7f andi r24, 0xFD ; 253 28a58: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 28a5c: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 28a5e: 80 93 98 02 sts 0x0298, r24 ; 0x800298 } if ((out_bits & (1< 28a66: 82 ff sbrs r24, 2 28a68: 86 c0 rjmp .+268 ; 0x28b76 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 28a6a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 28a6e: 84 60 ori r24, 0x04 ; 4 28a70: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 28a74: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 28a76: 80 93 99 02 sts 0x0299, r24 ; 0x800299 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 28a7a: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 28a7e: 83 ff sbrs r24, 3 28a80: 81 c0 rjmp .+258 ; 0x28b84 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 28a82: 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; 28a84: 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) 28a88: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28a8c: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28a90: 30 97 sbiw r30, 0x00 ; 0 28a92: 09 f4 brne .+2 ; 0x28a96 <__vector_17+0x3cc> 28a94: 3d c7 rjmp .+3706 ; 0x29910 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 28a96: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 28a9a: 50 91 78 05 lds r21, 0x0578 ; 0x800578 28a9e: 88 23 and r24, r24 28aa0: 09 f4 brne .+2 ; 0x28aa4 <__vector_17+0x3da> 28aa2: cb c0 rjmp .+406 ; 0x28c3a <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 28aa4: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> uint8_t _endstop = endstop; 28aa8: 80 91 7a 05 lds r24, 0x057A ; 0x80057a uint8_t _old_endstop = old_endstop; 28aac: 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))); 28ab4: 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))); 28abc: 42 fd sbrc r20, 2 28abe: 83 c0 rjmp .+262 ; 0x28bc6 <__vector_17+0x4fc> 28ac0: 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)) { 28ac2: 49 2f mov r20, r25 28ac4: 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)){ 28ac6: 48 23 and r20, r24 28ac8: b1 f0 breq .+44 ; 0x28af6 <__vector_17+0x42c> 28aca: c0 80 ld r12, Z 28acc: d1 80 ldd r13, Z+1 ; 0x01 28ace: e2 80 ldd r14, Z+2 ; 0x02 28ad0: f3 80 ldd r15, Z+3 ; 0x03 28ad2: 1c 14 cp r1, r12 28ad4: 1d 04 cpc r1, r13 28ad6: 1e 04 cpc r1, r14 28ad8: 1f 04 cpc r1, r15 28ada: 6c f4 brge .+26 ; 0x28af6 <__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); 28adc: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 28ade: c0 88 ldd r12, Z+16 ; 0x10 28ae0: d1 88 ldd r13, Z+17 ; 0x11 28ae2: e2 88 ldd r14, Z+18 ; 0x12 28ae4: f3 88 ldd r15, Z+19 ; 0x13 28ae6: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28aea: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28aee: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28af2: 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))); 28af6: 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))); 28afe: 47 fd sbrc r20, 7 28b00: 6c c0 rjmp .+216 ; 0x28bda <__vector_17+0x510> 28b02: 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)) { 28b04: 49 2f mov r20, r25 28b06: 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)){ 28b08: 48 23 and r20, r24 28b0a: b1 f0 breq .+44 ; 0x28b38 <__vector_17+0x46e> 28b0c: c4 80 ldd r12, Z+4 ; 0x04 28b0e: d5 80 ldd r13, Z+5 ; 0x05 28b10: e6 80 ldd r14, Z+6 ; 0x06 28b12: f7 80 ldd r15, Z+7 ; 0x07 28b14: 1c 14 cp r1, r12 28b16: 1d 04 cpc r1, r13 28b18: 1e 04 cpc r1, r14 28b1a: 1f 04 cpc r1, r15 28b1c: 6c f4 brge .+26 ; 0x28b38 <__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); 28b1e: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 28b20: c0 88 ldd r12, Z+16 ; 0x10 28b22: d1 88 ldd r13, Z+17 ; 0x11 28b24: e2 88 ldd r14, Z+18 ; 0x12 28b26: f3 88 ldd r15, Z+19 ; 0x13 28b28: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28b2c: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28b30: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28b34: 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) { 28b3c: 51 11 cpse r21, r1 28b3e: 77 c0 rjmp .+238 ; 0x28c2e <__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)) 28b40: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28b44: 31 30 cpi r19, 0x01 ; 1 28b46: 09 f0 breq .+2 ; 0x28b4a <__vector_17+0x480> 28b48: 52 c0 rjmp .+164 ; 0x28bee <__vector_17+0x524> 28b4a: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28b4e: 32 fd sbrc r19, 2 28b50: 4e c0 rjmp .+156 ; 0x28bee <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28b52: 1c 9b sbis 0x03, 4 ; 3 28b54: 52 c0 rjmp .+164 ; 0x28bfa <__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))); 28b56: 84 60 ori r24, 0x04 ; 4 28b58: 51 c0 rjmp .+162 ; 0x28bfc <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 28b5e: 8e 7f andi r24, 0xFE ; 254 28b60: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 28b64: 81 e0 ldi r24, 0x01 ; 1 28b66: 6f cf rjmp .-290 ; 0x28a46 <__vector_17+0x37c> } if((out_bits & (1< 28b6c: 82 60 ori r24, 0x02 ; 2 28b6e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 28b72: 81 e0 ldi r24, 0x01 ; 1 28b74: 74 cf rjmp .-280 ; 0x28a5e <__vector_17+0x394> } if ((out_bits & (1< 28b7a: 8b 7f andi r24, 0xFB ; 251 28b7c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 28b80: 81 e0 ldi r24, 0x01 ; 1 28b82: 79 cf rjmp .-270 ; 0x28a76 <__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; 28b84: 81 e0 ldi r24, 0x01 ; 1 28b86: 7e cf rjmp .-260 ; 0x28a84 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 28b88: 80 ed ldi r24, 0xD0 ; 208 28b8a: 97 e0 ldi r25, 0x07 ; 7 28b8c: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 28b90: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 28b94: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 28b98: 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; 28b9c: 8f ef ldi r24, 0xFF ; 255 28b9e: 9f ef ldi r25, 0xFF ; 255 28ba0: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 28ba4: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> e_steps = 0; 28ba8: 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) 28bac: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 28bb0: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 28bb4: 00 97 sbiw r24, 0x00 ; 0 28bb6: 09 f4 brne .+2 ; 0x28bba <__vector_17+0x4f0> 28bb8: 67 cf rjmp .-306 ; 0x28a88 <__vector_17+0x3be> --current_adv_steps; 28bba: 01 97 sbiw r24, 0x01 ; 1 28bbc: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 28bc0: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 28bc4: 61 cf rjmp .-318 ; 0x28a88 <__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))); 28bc6: 8e 7f andi r24, 0xFE ; 254 28bc8: 7c cf rjmp .-264 ; 0x28ac2 <__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))); 28bca: 42 fd sbrc r20, 2 28bcc: 04 c0 rjmp .+8 ; 0x28bd6 <__vector_17+0x50c> 28bce: 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)){ 28bd0: 49 2f mov r20, r25 28bd2: 40 71 andi r20, 0x10 ; 16 28bd4: 78 cf rjmp .-272 ; 0x28ac6 <__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))); 28bd6: 8f 7e andi r24, 0xEF ; 239 28bd8: fb cf rjmp .-10 ; 0x28bd0 <__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))); 28bda: 8d 7f andi r24, 0xFD ; 253 28bdc: 93 cf rjmp .-218 ; 0x28b04 <__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))); 28bde: 47 fd sbrc r20, 7 28be0: 04 c0 rjmp .+8 ; 0x28bea <__vector_17+0x520> 28be2: 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)){ 28be4: 49 2f mov r20, r25 28be6: 40 72 andi r20, 0x20 ; 32 28be8: 8f cf rjmp .-226 ; 0x28b08 <__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))); 28bea: 8f 7d andi r24, 0xDF ; 223 28bec: fb cf rjmp .-10 ; 0x28be4 <__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))); 28bee: 1c 99 sbic 0x03, 4 ; 3 28bf0: b2 cf rjmp .-156 ; 0x28b56 <__vector_17+0x48c> 28bf2: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28bf6: 36 ff sbrs r19, 6 28bf8: ae cf rjmp .-164 ; 0x28b56 <__vector_17+0x48c> 28bfa: 8b 7f andi r24, 0xFB ; 251 #else SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 28bfc: 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)) { 28bfe: 98 23 and r25, r24 28c00: b1 f0 breq .+44 ; 0x28c2e <__vector_17+0x564> 28c02: c0 84 ldd r12, Z+8 ; 0x08 28c04: d1 84 ldd r13, Z+9 ; 0x09 28c06: e2 84 ldd r14, Z+10 ; 0x0a 28c08: f3 84 ldd r15, Z+11 ; 0x0b 28c0a: 1c 14 cp r1, r12 28c0c: 1d 04 cpc r1, r13 28c0e: 1e 04 cpc r1, r14 28c10: 1f 04 cpc r1, r15 28c12: 6c f4 brge .+26 ; 0x28c2e <__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); 28c14: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28c16: c0 88 ldd r12, Z+16 ; 0x10 28c18: d1 88 ldd r13, Z+17 ; 0x11 28c1a: e2 88 ldd r14, Z+18 ; 0x12 28c1c: f3 88 ldd r15, Z+19 ; 0x13 28c1e: c0 92 7c 05 sts 0x057C, r12 ; 0x80057c 28c22: d0 92 7d 05 sts 0x057D, r13 ; 0x80057d 28c26: e0 92 7e 05 sts 0x057E, r14 ; 0x80057e 28c2a: f0 92 7f 05 sts 0x057F, r15 ; 0x80057f } #endif } endstop = _endstop; 28c2e: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a old_endstop = _endstop; //apply current endstop state to the old endstop 28c32: 80 93 79 05 sts 0x0579, r24 ; 0x800579 endstop_hit = _endstop_hit; 28c36: 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) { 28c3a: 55 23 and r21, r21 28c3c: 09 f4 brne .+2 ; 0x28c40 <__vector_17+0x576> 28c3e: 40 c0 rjmp .+128 ; 0x28cc0 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 28c40: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> uint8_t _endstop = endstop; 28c44: 80 91 7a 05 lds r24, 0x057A ; 0x80057a uint8_t _old_endstop = old_endstop; 28c48: 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)) 28c4c: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28c50: 31 30 cpi r19, 0x01 ; 1 28c52: c9 f4 brne .+50 ; 0x28c86 <__vector_17+0x5bc> 28c54: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28c58: 32 fd sbrc r19, 2 28c5a: 15 c0 rjmp .+42 ; 0x28c86 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 28c5c: 1c 9b sbis 0x03, 4 ; 3 28c5e: 19 c0 rjmp .+50 ; 0x28c92 <__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))); 28c60: 84 60 ori r24, 0x04 ; 4 28c62: 18 c0 rjmp .+48 ; 0x28c94 <__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)) 28c64: 30 91 8c 06 lds r19, 0x068C ; 0x80068c 28c68: 31 30 cpi r19, 0x01 ; 1 28c6a: 31 f4 brne .+12 ; 0x28c78 <__vector_17+0x5ae> 28c6c: 30 91 43 06 lds r19, 0x0643 ; 0x800643 28c70: 32 fd sbrc r19, 2 28c72: 02 c0 rjmp .+4 ; 0x28c78 <__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))); 28c74: 8f 7b andi r24, 0xBF ; 191 28c76: 05 c0 rjmp .+10 ; 0x28c82 <__vector_17+0x5b8> 28c78: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28c7c: 36 fd sbrc r19, 6 28c7e: fa cf rjmp .-12 ; 0x28c74 <__vector_17+0x5aa> 28c80: 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)) { 28c82: 90 74 andi r25, 0x40 ; 64 28c84: bc cf rjmp .-136 ; 0x28bfe <__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))); 28c86: 1c 99 sbic 0x03, 4 ; 3 28c88: eb cf rjmp .-42 ; 0x28c60 <__vector_17+0x596> 28c8a: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 28c8e: 36 ff sbrs r19, 6 28c90: e7 cf rjmp .-50 ; 0x28c60 <__vector_17+0x596> 28c92: 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)) { 28c94: 94 70 andi r25, 0x04 ; 4 28c96: 98 23 and r25, r24 28c98: 69 f0 breq .+26 ; 0x28cb4 <__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); 28c9a: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 28c9c: 40 89 ldd r20, Z+16 ; 0x10 28c9e: 51 89 ldd r21, Z+17 ; 0x11 28ca0: 62 89 ldd r22, Z+18 ; 0x12 28ca2: 73 89 ldd r23, Z+19 ; 0x13 28ca4: 40 93 7c 05 sts 0x057C, r20 ; 0x80057c 28ca8: 50 93 7d 05 sts 0x057D, r21 ; 0x80057d 28cac: 60 93 7e 05 sts 0x057E, r22 ; 0x80057e 28cb0: 70 93 7f 05 sts 0x057F, r23 ; 0x80057f } endstop = _endstop; 28cb4: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a old_endstop = _endstop; //apply current endstop state to the old endstop 28cb8: 80 93 79 05 sts 0x0579, r24 ; 0x800579 endstop_hit = _endstop_hit; 28cbc: 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) 28cc0: 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) 28cc2: 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); 28cc4: 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); 28cc6: 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); 28cc8: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 28cca: 83 ff sbrs r24, 3 28ccc: 08 c1 rjmp .+528 ; 0x28ede <__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) 28cce: 80 91 99 05 lds r24, 0x0599 ; 0x800599 28cd2: c8 17 cp r28, r24 28cd4: 08 f0 brcs .+2 ; 0x28cd8 <__vector_17+0x60e> 28cd6: 72 c2 rjmp .+1252 ; 0x291bc <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28cd8: 0f 94 1c 14 call 0x22838 ; 0x22838 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 28cdc: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28ce0: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28ce4: 80 81 ld r24, Z 28ce6: 91 81 ldd r25, Z+1 ; 0x01 28ce8: 20 91 81 05 lds r18, 0x0581 ; 0x800581 28cec: 30 91 82 05 lds r19, 0x0582 ; 0x800582 28cf0: 82 0f add r24, r18 28cf2: 93 1f adc r25, r19 28cf4: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28cf8: 80 93 81 05 sts 0x0581, r24 ; 0x800581 if (counter[X_AXIS].lo > 0) { 28cfc: 18 16 cp r1, r24 28cfe: 19 06 cpc r1, r25 28d00: 64 f5 brge .+88 ; 0x28d5a <__vector_17+0x690> STEP_NC_HI(X_AXIS); 28d02: 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; 28d04: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28d08: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28d0c: 80 91 81 05 lds r24, 0x0581 ; 0x800581 28d10: 90 91 82 05 lds r25, 0x0582 ; 0x800582 28d14: 20 89 ldd r18, Z+16 ; 0x10 28d16: 31 89 ldd r19, Z+17 ; 0x11 28d18: 82 1b sub r24, r18 28d1a: 93 0b sbc r25, r19 28d1c: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28d20: 80 93 81 05 sts 0x0581, r24 ; 0x800581 count_position[X_AXIS]+=count_direction[X_AXIS]; 28d24: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28d28: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 28d2c: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 28d30: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 28d34: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 28d38: 89 2f mov r24, r25 28d3a: 99 0f add r25, r25 28d3c: 99 0b sbc r25, r25 28d3e: aa 0b sbc r26, r26 28d40: bb 0b sbc r27, r27 28d42: 84 0f add r24, r20 28d44: 95 1f adc r25, r21 28d46: a6 1f adc r26, r22 28d48: b7 1f adc r27, r23 28d4a: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 28d4e: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 28d52: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 28d56: 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; 28d5a: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28d5e: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28d62: 84 81 ldd r24, Z+4 ; 0x04 28d64: 95 81 ldd r25, Z+5 ; 0x05 28d66: 20 91 85 05 lds r18, 0x0585 ; 0x800585 28d6a: 30 91 86 05 lds r19, 0x0586 ; 0x800586 28d6e: 82 0f add r24, r18 28d70: 93 1f adc r25, r19 28d72: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28d76: 80 93 85 05 sts 0x0585, r24 ; 0x800585 if (counter[Y_AXIS].lo > 0) { 28d7a: 18 16 cp r1, r24 28d7c: 19 06 cpc r1, r25 28d7e: 44 f5 brge .+80 ; 0x28dd0 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 28d80: 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; 28d82: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28d86: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28d8a: 20 89 ldd r18, Z+16 ; 0x10 28d8c: 31 89 ldd r19, Z+17 ; 0x11 28d8e: 82 1b sub r24, r18 28d90: 93 0b sbc r25, r19 28d92: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28d96: 80 93 85 05 sts 0x0585, r24 ; 0x800585 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 28d9a: 90 91 98 02 lds r25, 0x0298 ; 0x800298 28d9e: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 28da2: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 28da6: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 28daa: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 28dae: 89 2f mov r24, r25 28db0: 99 0f add r25, r25 28db2: 99 0b sbc r25, r25 28db4: aa 0b sbc r26, r26 28db6: bb 0b sbc r27, r27 28db8: 84 0f add r24, r20 28dba: 95 1f adc r25, r21 28dbc: a6 1f adc r26, r22 28dbe: b7 1f adc r27, r23 28dc0: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 28dc4: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 28dc8: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 28dcc: 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; 28dd0: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28dd4: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28dd8: 80 85 ldd r24, Z+8 ; 0x08 28dda: 91 85 ldd r25, Z+9 ; 0x09 28ddc: 20 91 89 05 lds r18, 0x0589 ; 0x800589 28de0: 30 91 8a 05 lds r19, 0x058A ; 0x80058a 28de4: 82 0f add r24, r18 28de6: 93 1f adc r25, r19 28de8: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28dec: 80 93 89 05 sts 0x0589, r24 ; 0x800589 if (counter[Z_AXIS].lo > 0) { 28df0: 18 16 cp r1, r24 28df2: 19 06 cpc r1, r25 28df4: 44 f5 brge .+80 ; 0x28e46 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 28df6: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 28df8: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28dfc: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28e00: 20 89 ldd r18, Z+16 ; 0x10 28e02: 31 89 ldd r19, Z+17 ; 0x11 28e04: 82 1b sub r24, r18 28e06: 93 0b sbc r25, r19 28e08: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 28e0c: 80 93 89 05 sts 0x0589, r24 ; 0x800589 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 28e10: 90 91 99 02 lds r25, 0x0299 ; 0x800299 28e14: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 28e18: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 28e1c: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 28e20: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 28e24: 89 2f mov r24, r25 28e26: 99 0f add r25, r25 28e28: 99 0b sbc r25, r25 28e2a: aa 0b sbc r26, r26 28e2c: bb 0b sbc r27, r27 28e2e: 84 0f add r24, r20 28e30: 95 1f adc r25, r21 28e32: a6 1f adc r26, r22 28e34: b7 1f adc r27, r23 28e36: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 28e3a: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 28e3e: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 28e42: 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; 28e46: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28e4a: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28e4e: 80 91 8d 05 lds r24, 0x058D ; 0x80058d 28e52: 90 91 8e 05 lds r25, 0x058E ; 0x80058e 28e56: 24 85 ldd r18, Z+12 ; 0x0c 28e58: 35 85 ldd r19, Z+13 ; 0x0d 28e5a: 82 0f add r24, r18 28e5c: 93 1f adc r25, r19 28e5e: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28e62: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 28e66: 20 89 ldd r18, Z+16 ; 0x10 28e68: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 28e6a: 18 16 cp r1, r24 28e6c: 19 06 cpc r1, r25 28e6e: 44 f5 brge .+80 ; 0x28ec0 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 28e70: 82 1b sub r24, r18 28e72: 93 0b sbc r25, r19 28e74: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 28e78: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d count_position[E_AXIS] += count_direction[E_AXIS]; 28e7c: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 28e80: 40 91 bf 06 lds r20, 0x06BF ; 0x8006bf 28e84: 50 91 c0 06 lds r21, 0x06C0 ; 0x8006c0 28e88: 60 91 c1 06 lds r22, 0x06C1 ; 0x8006c1 28e8c: 70 91 c2 06 lds r23, 0x06C2 ; 0x8006c2 28e90: 89 2f mov r24, r25 28e92: 99 0f add r25, r25 28e94: 99 0b sbc r25, r25 28e96: aa 0b sbc r26, r26 28e98: bb 0b sbc r27, r27 28e9a: 84 0f add r24, r20 28e9c: 95 1f adc r25, r21 28e9e: a6 1f adc r26, r22 28ea0: b7 1f adc r27, r23 28ea2: 80 93 bf 06 sts 0x06BF, r24 ; 0x8006bf 28ea6: 90 93 c0 06 sts 0x06C0, r25 ; 0x8006c0 28eaa: a0 93 c1 06 sts 0x06C1, r26 ; 0x8006c1 28eae: b0 93 c2 06 sts 0x06C2, r27 ; 0x8006c2 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 28eb2: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 28eb6: 80 91 92 05 lds r24, 0x0592 ; 0x800592 28eba: 89 0f add r24, r25 28ebc: 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) 28ec0: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 28ec4: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 28ec8: 01 96 adiw r24, 0x01 ; 1 28eca: 90 93 7d 05 sts 0x057D, r25 ; 0x80057d 28ece: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c 28ed2: 82 17 cp r24, r18 28ed4: 93 07 cpc r25, r19 28ed6: 08 f0 brcs .+2 ; 0x28eda <__vector_17+0x810> 28ed8: 71 c1 rjmp .+738 ; 0x291bc <__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) 28eda: cf 5f subi r28, 0xFF ; 255 28edc: f8 ce rjmp .-528 ; 0x28cce <__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) 28ede: 80 91 99 05 lds r24, 0x0599 ; 0x800599 28ee2: c8 17 cp r28, r24 28ee4: 08 f0 brcs .+2 ; 0x28ee8 <__vector_17+0x81e> 28ee6: 6a c1 rjmp .+724 ; 0x291bc <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 28ee8: 0f 94 1c 14 call 0x22838 ; 0x22838 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 28eec: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28ef0: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28ef4: 80 81 ld r24, Z 28ef6: 91 81 ldd r25, Z+1 ; 0x01 28ef8: a2 81 ldd r26, Z+2 ; 0x02 28efa: b3 81 ldd r27, Z+3 ; 0x03 28efc: 40 91 81 05 lds r20, 0x0581 ; 0x800581 28f00: 50 91 82 05 lds r21, 0x0582 ; 0x800582 28f04: 60 91 83 05 lds r22, 0x0583 ; 0x800583 28f08: 70 91 84 05 lds r23, 0x0584 ; 0x800584 28f0c: 84 0f add r24, r20 28f0e: 95 1f adc r25, r21 28f10: a6 1f adc r26, r22 28f12: b7 1f adc r27, r23 28f14: 80 93 81 05 sts 0x0581, r24 ; 0x800581 28f18: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28f1c: a0 93 83 05 sts 0x0583, r26 ; 0x800583 28f20: b0 93 84 05 sts 0x0584, r27 ; 0x800584 if (counter[X_AXIS].wide > 0) { 28f24: 18 16 cp r1, r24 28f26: 19 06 cpc r1, r25 28f28: 1a 06 cpc r1, r26 28f2a: 1b 06 cpc r1, r27 28f2c: c4 f5 brge .+112 ; 0x28f9e <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 28f2e: 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; 28f30: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28f34: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28f38: 80 91 81 05 lds r24, 0x0581 ; 0x800581 28f3c: 90 91 82 05 lds r25, 0x0582 ; 0x800582 28f40: a0 91 83 05 lds r26, 0x0583 ; 0x800583 28f44: b0 91 84 05 lds r27, 0x0584 ; 0x800584 28f48: 40 89 ldd r20, Z+16 ; 0x10 28f4a: 51 89 ldd r21, Z+17 ; 0x11 28f4c: 62 89 ldd r22, Z+18 ; 0x12 28f4e: 73 89 ldd r23, Z+19 ; 0x13 28f50: 84 1b sub r24, r20 28f52: 95 0b sbc r25, r21 28f54: a6 0b sbc r26, r22 28f56: b7 0b sbc r27, r23 28f58: 80 93 81 05 sts 0x0581, r24 ; 0x800581 28f5c: 90 93 82 05 sts 0x0582, r25 ; 0x800582 28f60: a0 93 83 05 sts 0x0583, r26 ; 0x800583 28f64: b0 93 84 05 sts 0x0584, r27 ; 0x800584 count_position[X_AXIS]+=count_direction[X_AXIS]; 28f68: 90 91 97 02 lds r25, 0x0297 ; 0x800297 28f6c: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 28f70: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 28f74: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 28f78: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 28f7c: 89 2f mov r24, r25 28f7e: 99 0f add r25, r25 28f80: 99 0b sbc r25, r25 28f82: aa 0b sbc r26, r26 28f84: bb 0b sbc r27, r27 28f86: 84 0f add r24, r20 28f88: 95 1f adc r25, r21 28f8a: a6 1f adc r26, r22 28f8c: b7 1f adc r27, r23 28f8e: 80 93 b3 06 sts 0x06B3, r24 ; 0x8006b3 28f92: 90 93 b4 06 sts 0x06B4, r25 ; 0x8006b4 28f96: a0 93 b5 06 sts 0x06B5, r26 ; 0x8006b5 28f9a: 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; 28f9e: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28fa2: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28fa6: 84 81 ldd r24, Z+4 ; 0x04 28fa8: 95 81 ldd r25, Z+5 ; 0x05 28faa: a6 81 ldd r26, Z+6 ; 0x06 28fac: b7 81 ldd r27, Z+7 ; 0x07 28fae: 40 91 85 05 lds r20, 0x0585 ; 0x800585 28fb2: 50 91 86 05 lds r21, 0x0586 ; 0x800586 28fb6: 60 91 87 05 lds r22, 0x0587 ; 0x800587 28fba: 70 91 88 05 lds r23, 0x0588 ; 0x800588 28fbe: 84 0f add r24, r20 28fc0: 95 1f adc r25, r21 28fc2: a6 1f adc r26, r22 28fc4: b7 1f adc r27, r23 28fc6: 80 93 85 05 sts 0x0585, r24 ; 0x800585 28fca: 90 93 86 05 sts 0x0586, r25 ; 0x800586 28fce: a0 93 87 05 sts 0x0587, r26 ; 0x800587 28fd2: b0 93 88 05 sts 0x0588, r27 ; 0x800588 if (counter[Y_AXIS].wide > 0) { 28fd6: 18 16 cp r1, r24 28fd8: 19 06 cpc r1, r25 28fda: 1a 06 cpc r1, r26 28fdc: 1b 06 cpc r1, r27 28fde: 84 f5 brge .+96 ; 0x29040 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 28fe0: 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; 28fe2: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 28fe6: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 28fea: 40 89 ldd r20, Z+16 ; 0x10 28fec: 51 89 ldd r21, Z+17 ; 0x11 28fee: 62 89 ldd r22, Z+18 ; 0x12 28ff0: 73 89 ldd r23, Z+19 ; 0x13 28ff2: 84 1b sub r24, r20 28ff4: 95 0b sbc r25, r21 28ff6: a6 0b sbc r26, r22 28ff8: b7 0b sbc r27, r23 28ffa: 80 93 85 05 sts 0x0585, r24 ; 0x800585 28ffe: 90 93 86 05 sts 0x0586, r25 ; 0x800586 29002: a0 93 87 05 sts 0x0587, r26 ; 0x800587 29006: b0 93 88 05 sts 0x0588, r27 ; 0x800588 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2900a: 90 91 98 02 lds r25, 0x0298 ; 0x800298 2900e: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 29012: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 29016: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 2901a: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 2901e: 89 2f mov r24, r25 29020: 99 0f add r25, r25 29022: 99 0b sbc r25, r25 29024: aa 0b sbc r26, r26 29026: bb 0b sbc r27, r27 29028: 84 0f add r24, r20 2902a: 95 1f adc r25, r21 2902c: a6 1f adc r26, r22 2902e: b7 1f adc r27, r23 29030: 80 93 b7 06 sts 0x06B7, r24 ; 0x8006b7 29034: 90 93 b8 06 sts 0x06B8, r25 ; 0x8006b8 29038: a0 93 b9 06 sts 0x06B9, r26 ; 0x8006b9 2903c: 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; 29040: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29044: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 29048: 80 85 ldd r24, Z+8 ; 0x08 2904a: 91 85 ldd r25, Z+9 ; 0x09 2904c: a2 85 ldd r26, Z+10 ; 0x0a 2904e: b3 85 ldd r27, Z+11 ; 0x0b 29050: 40 91 89 05 lds r20, 0x0589 ; 0x800589 29054: 50 91 8a 05 lds r21, 0x058A ; 0x80058a 29058: 60 91 8b 05 lds r22, 0x058B ; 0x80058b 2905c: 70 91 8c 05 lds r23, 0x058C ; 0x80058c 29060: 84 0f add r24, r20 29062: 95 1f adc r25, r21 29064: a6 1f adc r26, r22 29066: b7 1f adc r27, r23 29068: 80 93 89 05 sts 0x0589, r24 ; 0x800589 2906c: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 29070: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 29074: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c if (counter[Z_AXIS].wide > 0) { 29078: 18 16 cp r1, r24 2907a: 19 06 cpc r1, r25 2907c: 1a 06 cpc r1, r26 2907e: 1b 06 cpc r1, r27 29080: 84 f5 brge .+96 ; 0x290e2 <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 29082: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 29084: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 29088: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 2908c: 40 89 ldd r20, Z+16 ; 0x10 2908e: 51 89 ldd r21, Z+17 ; 0x11 29090: 62 89 ldd r22, Z+18 ; 0x12 29092: 73 89 ldd r23, Z+19 ; 0x13 29094: 84 1b sub r24, r20 29096: 95 0b sbc r25, r21 29098: a6 0b sbc r26, r22 2909a: b7 0b sbc r27, r23 2909c: 80 93 89 05 sts 0x0589, r24 ; 0x800589 290a0: 90 93 8a 05 sts 0x058A, r25 ; 0x80058a 290a4: a0 93 8b 05 sts 0x058B, r26 ; 0x80058b 290a8: b0 93 8c 05 sts 0x058C, r27 ; 0x80058c count_position[Z_AXIS]+=count_direction[Z_AXIS]; 290ac: 90 91 99 02 lds r25, 0x0299 ; 0x800299 290b0: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 290b4: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 290b8: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 290bc: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 290c0: 89 2f mov r24, r25 290c2: 99 0f add r25, r25 290c4: 99 0b sbc r25, r25 290c6: aa 0b sbc r26, r26 290c8: bb 0b sbc r27, r27 290ca: 84 0f add r24, r20 290cc: 95 1f adc r25, r21 290ce: a6 1f adc r26, r22 290d0: b7 1f adc r27, r23 290d2: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 290d6: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 290da: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 290de: 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; 290e2: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 290e6: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 290ea: 80 91 8d 05 lds r24, 0x058D ; 0x80058d 290ee: 90 91 8e 05 lds r25, 0x058E ; 0x80058e 290f2: a0 91 8f 05 lds r26, 0x058F ; 0x80058f 290f6: b0 91 90 05 lds r27, 0x0590 ; 0x800590 290fa: 44 85 ldd r20, Z+12 ; 0x0c 290fc: 55 85 ldd r21, Z+13 ; 0x0d 290fe: 66 85 ldd r22, Z+14 ; 0x0e 29100: 77 85 ldd r23, Z+15 ; 0x0f 29102: 84 0f add r24, r20 29104: 95 1f adc r25, r21 29106: a6 1f adc r26, r22 29108: b7 1f adc r27, r23 2910a: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 2910e: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 29112: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 29116: b0 93 90 05 sts 0x0590, r27 ; 0x800590 2911a: 40 89 ldd r20, Z+16 ; 0x10 2911c: 51 89 ldd r21, Z+17 ; 0x11 2911e: 62 89 ldd r22, Z+18 ; 0x12 29120: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 29122: 18 16 cp r1, r24 29124: 19 06 cpc r1, r25 29126: 1a 06 cpc r1, r26 29128: 1b 06 cpc r1, r27 2912a: 74 f5 brge .+92 ; 0x29188 <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 2912c: 84 1b sub r24, r20 2912e: 95 0b sbc r25, r21 29130: a6 0b sbc r26, r22 29132: b7 0b sbc r27, r23 29134: 80 93 8d 05 sts 0x058D, r24 ; 0x80058d 29138: 90 93 8e 05 sts 0x058E, r25 ; 0x80058e 2913c: a0 93 8f 05 sts 0x058F, r26 ; 0x80058f 29140: b0 93 90 05 sts 0x0590, r27 ; 0x800590 count_position[E_AXIS] += count_direction[E_AXIS]; 29144: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 29148: c0 90 bf 06 lds r12, 0x06BF ; 0x8006bf 2914c: d0 90 c0 06 lds r13, 0x06C0 ; 0x8006c0 29150: e0 90 c1 06 lds r14, 0x06C1 ; 0x8006c1 29154: f0 90 c2 06 lds r15, 0x06C2 ; 0x8006c2 29158: 89 2f mov r24, r25 2915a: 99 0f add r25, r25 2915c: 99 0b sbc r25, r25 2915e: aa 0b sbc r26, r26 29160: bb 0b sbc r27, r27 29162: 8c 0d add r24, r12 29164: 9d 1d adc r25, r13 29166: ae 1d adc r26, r14 29168: bf 1d adc r27, r15 2916a: 80 93 bf 06 sts 0x06BF, r24 ; 0x8006bf 2916e: 90 93 c0 06 sts 0x06C0, r25 ; 0x8006c0 29172: a0 93 c1 06 sts 0x06C1, r26 ; 0x8006c1 29176: b0 93 c2 06 sts 0x06C2, r27 ; 0x8006c2 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2917a: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 2917e: 80 91 92 05 lds r24, 0x0592 ; 0x800592 29182: 89 0f add r24, r25 29184: 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) 29188: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2918c: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 29190: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 29194: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 29198: 01 96 adiw r24, 0x01 ; 1 2919a: a1 1d adc r26, r1 2919c: b1 1d adc r27, r1 2919e: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c 291a2: 90 93 7d 05 sts 0x057D, r25 ; 0x80057d 291a6: a0 93 7e 05 sts 0x057E, r26 ; 0x80057e 291aa: b0 93 7f 05 sts 0x057F, r27 ; 0x80057f 291ae: 84 17 cp r24, r20 291b0: 95 07 cpc r25, r21 291b2: a6 07 cpc r26, r22 291b4: b7 07 cpc r27, r23 291b6: 10 f4 brcc .+4 ; 0x291bc <__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) 291b8: cf 5f subi r28, 0xFF ; 255 291ba: 91 ce rjmp .-734 ; 0x28ede <__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); 291bc: 80 91 92 05 lds r24, 0x0592 ; 0x800592 291c0: 88 23 and r24, r24 291c2: 39 f0 breq .+14 ; 0x291d2 <__vector_17+0xb08> 291c4: 87 fd sbrc r24, 7 291c6: ee c0 rjmp .+476 ; 0x293a4 <__vector_17+0xcda> 291c8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 291cc: 80 64 ori r24, 0x40 ; 64 291ce: 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) { 291d2: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 291d6: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 291da: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 291de: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 291e2: c0 91 a1 05 lds r28, 0x05A1 ; 0x8005a1 291e6: d0 91 a2 05 lds r29, 0x05A2 ; 0x8005a2 291ea: 89 8d ldd r24, Y+25 ; 0x19 291ec: 9a 8d ldd r25, Y+26 ; 0x1a 291ee: ab 8d ldd r26, Y+27 ; 0x1b 291f0: bc 8d ldd r27, Y+28 ; 0x1c 291f2: 84 17 cp r24, r20 291f4: 95 07 cpc r25, r21 291f6: a6 07 cpc r26, r22 291f8: b7 07 cpc r27, r23 291fa: 08 f4 brcc .+2 ; 0x291fe <__vector_17+0xb34> 291fc: 34 c1 rjmp .+616 ; 0x29466 <__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); 291fe: 40 91 95 05 lds r20, 0x0595 ; 0x800595 29202: 50 91 96 05 lds r21, 0x0596 ; 0x800596 29206: 60 91 97 05 lds r22, 0x0597 ; 0x800597 2920a: 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. ); 2920e: cc 88 ldd r12, Y+20 ; 0x14 29210: dd 88 ldd r13, Y+21 ; 0x15 29212: ee 88 ldd r14, Y+22 ; 0x16 29214: aa 27 eor r26, r26 29216: 4d 9d mul r20, r13 29218: b1 2d mov r27, r1 2921a: 5e 9d mul r21, r14 2921c: c0 01 movw r24, r0 2921e: 6e 9d mul r22, r14 29220: 90 0d add r25, r0 29222: 6d 9d mul r22, r13 29224: 80 0d add r24, r0 29226: 91 1d adc r25, r1 29228: 4e 9d mul r20, r14 2922a: b0 0d add r27, r0 2922c: 81 1d adc r24, r1 2922e: 9a 1f adc r25, r26 29230: 5d 9d mul r21, r13 29232: b0 0d add r27, r0 29234: 81 1d adc r24, r1 29236: 9a 1f adc r25, r26 29238: 6c 9d mul r22, r12 2923a: b0 0d add r27, r0 2923c: 81 1d adc r24, r1 2923e: 9a 1f adc r25, r26 29240: 5c 9d mul r21, r12 29242: b1 0d add r27, r1 29244: 8a 1f adc r24, r26 29246: 9a 1f adc r25, r26 29248: bb 0f add r27, r27 2924a: 8a 1f adc r24, r26 2924c: 9a 1f adc r25, r26 2924e: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 29250: 2a ad ldd r18, Y+58 ; 0x3a 29252: 3b ad ldd r19, Y+59 ; 0x3b 29254: 82 0f add r24, r18 29256: 93 1f adc r25, r19 29258: 90 93 9b 05 sts 0x059B, r25 ; 0x80059b 2925c: 80 93 9a 05 sts 0x059A, r24 ; 0x80059a // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 29260: 2e a9 ldd r18, Y+54 ; 0x36 29262: 3f a9 ldd r19, Y+55 ; 0x37 29264: 28 17 cp r18, r24 29266: 39 07 cpc r19, r25 29268: 20 f4 brcc .+8 ; 0x29272 <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2926a: 30 93 9b 05 sts 0x059B, r19 ; 0x80059b 2926e: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 29272: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 29276: 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; 2927a: 81 34 cpi r24, 0x41 ; 65 2927c: fc e9 ldi r31, 0x9C ; 156 2927e: 9f 07 cpc r25, r31 29280: 08 f0 brcs .+2 ; 0x29284 <__vector_17+0xbba> 29282: 94 c0 rjmp .+296 ; 0x293ac <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29284: 81 32 cpi r24, 0x21 ; 33 29286: 2e e4 ldi r18, 0x4E ; 78 29288: 92 07 cpc r25, r18 2928a: 08 f4 brcc .+2 ; 0x2928e <__vector_17+0xbc4> 2928c: 92 c0 rjmp .+292 ; 0x293b2 <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2928e: 96 95 lsr r25 29290: 87 95 ror r24 29292: 96 95 lsr r25 29294: 87 95 ror r24 step_loops = 4; 29296: 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; 29298: 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 2929c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2929e: 81 15 cp r24, r1 292a0: f8 e0 ldi r31, 0x08 ; 8 292a2: 9f 07 cpc r25, r31 292a4: 08 f4 brcc .+2 ; 0x292a8 <__vector_17+0xbde> 292a6: 97 c0 rjmp .+302 ; 0x293d6 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 292a8: e9 2f mov r30, r25 292aa: ff 27 eor r31, r31 292ac: ee 0f add r30, r30 292ae: ff 1f adc r31, r31 292b0: ee 0f add r30, r30 292b2: ff 1f adc r31, r31 292b4: 9f 01 movw r18, r30 292b6: 23 5a subi r18, 0xA3 ; 163 292b8: 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); 292ba: f9 01 movw r30, r18 292bc: 32 96 adiw r30, 0x02 ; 2 292be: a5 91 lpm r26, Z+ 292c0: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 292c2: f9 01 movw r30, r18 292c4: 25 91 lpm r18, Z+ 292c6: 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. ); 292c8: b8 9f mul r27, r24 292ca: f0 01 movw r30, r0 292cc: a8 9f mul r26, r24 292ce: 00 0c add r0, r0 292d0: e1 1d adc r30, r1 292d2: 11 24 eor r1, r1 292d4: 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); 292d6: c9 01 movw r24, r18 292d8: 8e 1b sub r24, r30 292da: 9f 0b sbc r25, r31 292dc: 84 36 cpi r24, 0x64 ; 100 292de: 91 05 cpc r25, r1 292e0: 10 f4 brcc .+4 ; 0x292e6 <__vector_17+0xc1c> 292e2: 84 e6 ldi r24, 0x64 ; 100 292e4: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 292e6: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 292ea: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 292ee: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 292f2: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> acceleration_time += timer; 292f6: 48 0f add r20, r24 292f8: 59 1f adc r21, r25 292fa: 61 1d adc r22, r1 292fc: 71 1d adc r23, r1 292fe: 40 93 95 05 sts 0x0595, r20 ; 0x800595 29302: 50 93 96 05 sts 0x0596, r21 ; 0x800596 29306: 60 93 97 05 sts 0x0597, r22 ; 0x800597 2930a: 70 93 98 05 sts 0x0598, r23 ; 0x800598 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2930e: fe 01 movw r30, r28 29310: e4 5b subi r30, 0xB4 ; 180 29312: ff 4f sbci r31, 0xFF ; 255 29314: 80 81 ld r24, Z 29316: 81 11 cpse r24, r1 29318: 7d c0 rjmp .+250 ; 0x29414 <__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; 2931a: 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) { 2931c: 80 ff sbrs r24, 0 2931e: 16 c0 rjmp .+44 ; 0x2934c <__vector_17+0xc82> LA_phase = -1; 29320: 9f ef ldi r25, 0xFF ; 255 29322: 90 93 91 05 sts 0x0591, r25 ; 0x800591 if (current_adv_steps == target_adv_steps) { 29326: e0 91 df 04 lds r30, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 2932a: f0 91 e0 04 lds r31, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 2932e: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29332: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29336: e2 17 cp r30, r18 29338: f3 07 cpc r31, r19 2933a: 09 f0 breq .+2 ; 0x2933e <__vector_17+0xc74> 2933c: 24 c2 rjmp .+1096 ; 0x29786 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2933e: 8f ef ldi r24, 0xFF ; 255 29340: 9f ef ldi r25, 0xFF ; 255 29342: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29346: 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; 2934a: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2934c: 80 fd sbrc r24, 0 2934e: 07 c0 rjmp .+14 ; 0x2935e <__vector_17+0xc94> 29350: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29354: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29358: 01 96 adiw r24, 0x01 ; 1 2935a: 09 f4 brne .+2 ; 0x2935e <__vector_17+0xc94> 2935c: b2 c2 rjmp .+1380 ; 0x298c2 <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2935e: e0 91 e1 04 lds r30, 0x04E1 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> 29362: 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; 29366: 80 91 72 05 lds r24, 0x0572 ; 0x800572 2936a: 90 91 73 05 lds r25, 0x0573 ; 0x800573 2936e: a0 91 74 05 lds r26, 0x0574 ; 0x800574 29372: b0 91 75 05 lds r27, 0x0575 ; 0x800575 29376: 8e 0f add r24, r30 29378: 9f 1f adc r25, r31 2937a: a1 1d adc r26, r1 2937c: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2937e: c3 5b subi r28, 0xB3 ; 179 29380: df 4f sbci r29, 0xFF ; 255 29382: 08 81 ld r16, Y 29384: 19 81 ldd r17, Y+1 ; 0x01 29386: 30 e0 ldi r19, 0x00 ; 0 29388: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2938a: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2938c: 80 17 cp r24, r16 2938e: 91 07 cpc r25, r17 29390: a2 07 cpc r26, r18 29392: b3 07 cpc r27, r19 29394: 08 f4 brcc .+2 ; 0x29398 <__vector_17+0xcce> 29396: 27 c2 rjmp .+1102 ; 0x297e6 <__vector_17+0x111c> { ++ticks; 29398: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2939a: 80 1b sub r24, r16 2939c: 91 0b sbc r25, r17 2939e: a2 0b sbc r26, r18 293a0: b3 0b sbc r27, r19 293a2: f4 cf rjmp .-24 ; 0x2938c <__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); 293a4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 293a8: 8f 7b andi r24, 0xBF ; 191 293aa: 11 cf rjmp .-478 ; 0x291ce <__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; 293ac: 80 e4 ldi r24, 0x40 ; 64 293ae: 9c e9 ldi r25, 0x9C ; 156 293b0: 6e cf rjmp .-292 ; 0x2928e <__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 293b2: 81 31 cpi r24, 0x11 ; 17 293b4: e7 e2 ldi r30, 0x27 ; 39 293b6: 9e 07 cpc r25, r30 293b8: 20 f0 brcs .+8 ; 0x293c2 <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 293ba: 96 95 lsr r25 293bc: 87 95 ror r24 step_loops = 2; 293be: 22 e0 ldi r18, 0x02 ; 2 293c0: 6b cf rjmp .-298 ; 0x29298 <__vector_17+0xbce> } else { step_loops = 1; 293c2: 21 e0 ldi r18, 0x01 ; 1 293c4: 20 93 99 05 sts 0x0599, r18 ; 0x800599 293c8: 80 32 cpi r24, 0x20 ; 32 293ca: 91 05 cpc r25, r1 293cc: 08 f0 brcs .+2 ; 0x293d0 <__vector_17+0xd06> 293ce: 66 cf rjmp .-308 ; 0x2929c <__vector_17+0xbd2> 293d0: 80 e2 ldi r24, 0x20 ; 32 293d2: 90 e0 ldi r25, 0x00 ; 0 293d4: 63 cf rjmp .-314 ; 0x2929c <__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; 293d6: 9c 01 movw r18, r24 293d8: 36 95 lsr r19 293da: 27 95 ror r18 293dc: 2c 7f andi r18, 0xFC ; 252 293de: 23 5a subi r18, 0xA3 ; 163 293e0: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 293e2: f9 01 movw r30, r18 293e4: a5 91 lpm r26, Z+ 293e6: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 293e8: f9 01 movw r30, r18 293ea: 32 96 adiw r30, 0x02 ; 2 293ec: 05 91 lpm r16, Z+ 293ee: 14 91 lpm r17, Z 293f0: 87 70 andi r24, 0x07 ; 7 293f2: 99 27 eor r25, r25 293f4: 80 9f mul r24, r16 293f6: 90 01 movw r18, r0 293f8: 81 9f mul r24, r17 293fa: 30 0d add r19, r0 293fc: 90 9f mul r25, r16 293fe: 30 0d add r19, r0 29400: 11 24 eor r1, r1 29402: f3 e0 ldi r31, 0x03 ; 3 29404: 36 95 lsr r19 29406: 27 95 ror r18 29408: fa 95 dec r31 2940a: e1 f7 brne .-8 ; 0x29404 <__vector_17+0xd3a> 2940c: cd 01 movw r24, r26 2940e: 82 1b sub r24, r18 29410: 93 0b sbc r25, r19 29412: 64 cf rjmp .-312 ; 0x292dc <__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) { 29414: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 29418: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 2941c: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 29420: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 29424: 80 91 99 05 lds r24, 0x0599 ; 0x800599 29428: 90 e0 ldi r25, 0x00 ; 0 2942a: b0 e0 ldi r27, 0x00 ; 0 2942c: a0 e0 ldi r26, 0x00 ; 0 2942e: 84 17 cp r24, r20 29430: 95 07 cpc r25, r21 29432: a6 07 cpc r26, r22 29434: b7 07 cpc r27, r23 29436: 08 f4 brcc .+2 ; 0x2943a <__vector_17+0xd70> 29438: 70 cf rjmp .-288 ; 0x2931a <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2943a: 80 91 80 05 lds r24, 0x0580 ; 0x800580 2943e: 81 11 cpse r24, r1 29440: 02 c0 rjmp .+4 ; 0x29446 <__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; 29442: 83 e0 ldi r24, 0x03 ; 3 29444: 6b cf rjmp .-298 ; 0x2931c <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 29446: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 2944a: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 2944e: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29452: 30 91 94 05 lds r19, 0x0594 ; 0x800594 29456: 28 17 cp r18, r24 29458: 39 07 cpc r19, r25 2945a: 98 f7 brcc .-26 ; 0x29442 <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2945c: 90 93 94 05 sts 0x0594, r25 ; 0x800594 29460: 80 93 93 05 sts 0x0593, r24 ; 0x800593 29464: ee cf rjmp .-36 ; 0x29442 <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 29466: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2946a: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 2946e: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 29472: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 29476: 4d 8d ldd r20, Y+29 ; 0x1d 29478: 5e 8d ldd r21, Y+30 ; 0x1e 2947a: 6f 8d ldd r22, Y+31 ; 0x1f 2947c: 78 a1 ldd r23, Y+32 ; 0x20 2947e: 48 17 cp r20, r24 29480: 59 07 cpc r21, r25 29482: 6a 07 cpc r22, r26 29484: 7b 07 cpc r23, r27 29486: 08 f0 brcs .+2 ; 0x2948a <__vector_17+0xdc0> 29488: e3 c0 rjmp .+454 ; 0x29650 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2948a: c0 90 9d 05 lds r12, 0x059D ; 0x80059d 2948e: d0 90 9e 05 lds r13, 0x059E ; 0x80059e 29492: e0 90 9f 05 lds r14, 0x059F ; 0x80059f 29496: 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. ); 2949a: 6c 88 ldd r6, Y+20 ; 0x14 2949c: 7d 88 ldd r7, Y+21 ; 0x15 2949e: 8e 88 ldd r8, Y+22 ; 0x16 294a0: aa 27 eor r26, r26 294a2: c7 9c mul r12, r7 294a4: b1 2d mov r27, r1 294a6: d8 9c mul r13, r8 294a8: f0 01 movw r30, r0 294aa: e8 9c mul r14, r8 294ac: f0 0d add r31, r0 294ae: e7 9c mul r14, r7 294b0: e0 0d add r30, r0 294b2: f1 1d adc r31, r1 294b4: c8 9c mul r12, r8 294b6: b0 0d add r27, r0 294b8: e1 1d adc r30, r1 294ba: fa 1f adc r31, r26 294bc: d7 9c mul r13, r7 294be: b0 0d add r27, r0 294c0: e1 1d adc r30, r1 294c2: fa 1f adc r31, r26 294c4: e6 9c mul r14, r6 294c6: b0 0d add r27, r0 294c8: e1 1d adc r30, r1 294ca: fa 1f adc r31, r26 294cc: d6 9c mul r13, r6 294ce: b1 0d add r27, r1 294d0: ea 1f adc r30, r26 294d2: fa 1f adc r31, r26 294d4: bb 0f add r27, r27 294d6: ea 1f adc r30, r26 294d8: fa 1f adc r31, r26 294da: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 294dc: 20 91 9a 05 lds r18, 0x059A ; 0x80059a 294e0: 30 91 9b 05 lds r19, 0x059B ; 0x80059b 294e4: 8e ad ldd r24, Y+62 ; 0x3e 294e6: 9f ad ldd r25, Y+63 ; 0x3f 294e8: 2e 17 cp r18, r30 294ea: 3f 07 cpc r19, r31 294ec: 30 f0 brcs .+12 ; 0x294fa <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 294ee: 2e 1b sub r18, r30 294f0: 3f 0b sbc r19, r31 294f2: 82 17 cp r24, r18 294f4: 93 07 cpc r25, r19 294f6: 08 f4 brcc .+2 ; 0x294fa <__vector_17+0xe30> 294f8: 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; 294fa: 81 34 cpi r24, 0x41 ; 65 294fc: 2c e9 ldi r18, 0x9C ; 156 294fe: 92 07 cpc r25, r18 29500: 08 f0 brcs .+2 ; 0x29504 <__vector_17+0xe3a> 29502: 75 c0 rjmp .+234 ; 0x295ee <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29504: 81 32 cpi r24, 0x21 ; 33 29506: ee e4 ldi r30, 0x4E ; 78 29508: 9e 07 cpc r25, r30 2950a: 08 f4 brcc .+2 ; 0x2950e <__vector_17+0xe44> 2950c: 73 c0 rjmp .+230 ; 0x295f4 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2950e: 96 95 lsr r25 29510: 87 95 ror r24 29512: 96 95 lsr r25 29514: 87 95 ror r24 step_loops = 4; 29516: 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; 29518: 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 2951c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2951e: 81 15 cp r24, r1 29520: 28 e0 ldi r18, 0x08 ; 8 29522: 92 07 cpc r25, r18 29524: 08 f4 brcc .+2 ; 0x29528 <__vector_17+0xe5e> 29526: 78 c0 rjmp .+240 ; 0x29618 <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 29528: e9 2f mov r30, r25 2952a: ff 27 eor r31, r31 2952c: ee 0f add r30, r30 2952e: ff 1f adc r31, r31 29530: ee 0f add r30, r30 29532: ff 1f adc r31, r31 29534: 9f 01 movw r18, r30 29536: 23 5a subi r18, 0xA3 ; 163 29538: 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); 2953a: f9 01 movw r30, r18 2953c: 32 96 adiw r30, 0x02 ; 2 2953e: a5 91 lpm r26, Z+ 29540: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 29542: f9 01 movw r30, r18 29544: 25 91 lpm r18, Z+ 29546: 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. ); 29548: b8 9f mul r27, r24 2954a: f0 01 movw r30, r0 2954c: a8 9f mul r26, r24 2954e: 00 0c add r0, r0 29550: e1 1d adc r30, r1 29552: 11 24 eor r1, r1 29554: 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); 29556: 2e 1b sub r18, r30 29558: 3f 0b sbc r19, r31 2955a: c9 01 movw r24, r18 2955c: 24 36 cpi r18, 0x64 ; 100 2955e: 31 05 cpc r19, r1 29560: 10 f4 brcc .+4 ; 0x29566 <__vector_17+0xe9c> 29562: 84 e6 ldi r24, 0x64 ; 100 29564: 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); 29566: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 2956a: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2956e: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 29572: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> deceleration_time += timer; 29576: c8 0e add r12, r24 29578: d9 1e adc r13, r25 2957a: e1 1c adc r14, r1 2957c: f1 1c adc r15, r1 2957e: c0 92 9d 05 sts 0x059D, r12 ; 0x80059d 29582: d0 92 9e 05 sts 0x059E, r13 ; 0x80059e 29586: e0 92 9f 05 sts 0x059F, r14 ; 0x80059f 2958a: f0 92 a0 05 sts 0x05A0, r15 ; 0x8005a0 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2958e: fe 01 movw r30, r28 29590: e4 5b subi r30, 0xB4 ; 180 29592: ff 4f sbci r31, 0xFF ; 255 29594: 80 81 ld r24, Z 29596: 88 23 and r24, r24 29598: 09 f4 brne .+2 ; 0x2959c <__vector_17+0xed2> 2959a: bf ce rjmp .-642 ; 0x2931a <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2959c: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 295a0: 90 91 7d 05 lds r25, 0x057D ; 0x80057d 295a4: a0 91 7e 05 lds r26, 0x057E ; 0x80057e 295a8: b0 91 7f 05 lds r27, 0x057F ; 0x80057f 295ac: 20 91 99 05 lds r18, 0x0599 ; 0x800599 295b0: 42 0f add r20, r18 295b2: 51 1d adc r21, r1 295b4: 61 1d adc r22, r1 295b6: 71 1d adc r23, r1 295b8: 48 17 cp r20, r24 295ba: 59 07 cpc r21, r25 295bc: 6a 07 cpc r22, r26 295be: 7b 07 cpc r23, r27 295c0: 08 f4 brcc .+2 ; 0x295c4 <__vector_17+0xefa> 295c2: ab ce rjmp .-682 ; 0x2931a <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 295c4: 35 96 adiw r30, 0x05 ; 5 295c6: 20 81 ld r18, Z 295c8: 31 81 ldd r19, Z+1 ; 0x01 295ca: 30 93 94 05 sts 0x0594, r19 ; 0x800594 295ce: 20 93 93 05 sts 0x0593, r18 ; 0x800593 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 295d2: 80 91 80 05 lds r24, 0x0580 ; 0x800580 295d6: 88 23 and r24, r24 295d8: 09 f4 brne .+2 ; 0x295dc <__vector_17+0xf12> 295da: 33 cf rjmp .-410 ; 0x29442 <__vector_17+0xd78> 295dc: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 295e0: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 295e4: 82 17 cp r24, r18 295e6: 93 07 cpc r25, r19 295e8: 08 f0 brcs .+2 ; 0x295ec <__vector_17+0xf22> 295ea: 2b cf rjmp .-426 ; 0x29442 <__vector_17+0xd78> 295ec: 37 cf rjmp .-402 ; 0x2945c <__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; 295ee: 80 e4 ldi r24, 0x40 ; 64 295f0: 9c e9 ldi r25, 0x9C ; 156 295f2: 8d cf rjmp .-230 ; 0x2950e <__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 295f4: 81 31 cpi r24, 0x11 ; 17 295f6: f7 e2 ldi r31, 0x27 ; 39 295f8: 9f 07 cpc r25, r31 295fa: 20 f0 brcs .+8 ; 0x29604 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 295fc: 96 95 lsr r25 295fe: 87 95 ror r24 step_loops = 2; 29600: 22 e0 ldi r18, 0x02 ; 2 29602: 8a cf rjmp .-236 ; 0x29518 <__vector_17+0xe4e> } else { step_loops = 1; 29604: 21 e0 ldi r18, 0x01 ; 1 29606: 20 93 99 05 sts 0x0599, r18 ; 0x800599 2960a: 80 32 cpi r24, 0x20 ; 32 2960c: 91 05 cpc r25, r1 2960e: 08 f0 brcs .+2 ; 0x29612 <__vector_17+0xf48> 29610: 85 cf rjmp .-246 ; 0x2951c <__vector_17+0xe52> 29612: 80 e2 ldi r24, 0x20 ; 32 29614: 90 e0 ldi r25, 0x00 ; 0 29616: 82 cf rjmp .-252 ; 0x2951c <__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; 29618: dc 01 movw r26, r24 2961a: b6 95 lsr r27 2961c: a7 95 ror r26 2961e: ac 7f andi r26, 0xFC ; 252 29620: a3 5a subi r26, 0xA3 ; 163 29622: bd 46 sbci r27, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 29624: fd 01 movw r30, r26 29626: 25 91 lpm r18, Z+ 29628: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2962a: fd 01 movw r30, r26 2962c: 32 96 adiw r30, 0x02 ; 2 2962e: a5 91 lpm r26, Z+ 29630: b4 91 lpm r27, Z 29632: 87 70 andi r24, 0x07 ; 7 29634: 99 27 eor r25, r25 29636: 8a 9f mul r24, r26 29638: f0 01 movw r30, r0 2963a: 8b 9f mul r24, r27 2963c: f0 0d add r31, r0 2963e: 9a 9f mul r25, r26 29640: f0 0d add r31, r0 29642: 11 24 eor r1, r1 29644: a3 e0 ldi r26, 0x03 ; 3 29646: f6 95 lsr r31 29648: e7 95 ror r30 2964a: aa 95 dec r26 2964c: e1 f7 brne .-8 ; 0x29646 <__vector_17+0xf7c> 2964e: 83 cf rjmp .-250 ; 0x29556 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 29650: 80 91 9c 05 lds r24, 0x059C ; 0x80059c 29654: 88 23 and r24, r24 29656: 71 f0 breq .+28 ; 0x29674 <__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; 29658: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2965a: 20 91 76 05 lds r18, 0x0576 ; 0x800576 2965e: 30 91 77 05 lds r19, 0x0577 ; 0x800577 29662: 30 93 e6 04 sts 0x04E6, r19 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 29666: 20 93 e5 04 sts 0x04E5, r18 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 2966a: 30 93 e2 04 sts 0x04E2, r19 ; 0x8004e2 <_ZL9main_Rate.lto_priv.478+0x1> 2966e: 20 93 e1 04 sts 0x04E1, r18 ; 0x8004e1 <_ZL9main_Rate.lto_priv.478> 29672: 54 ce rjmp .-856 ; 0x2931c <__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); 29674: 8e a9 ldd r24, Y+54 ; 0x36 29676: 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; 29678: 81 34 cpi r24, 0x41 ; 65 2967a: 4c e9 ldi r20, 0x9C ; 156 2967c: 94 07 cpc r25, r20 2967e: 08 f0 brcs .+2 ; 0x29682 <__vector_17+0xfb8> 29680: 4e c0 rjmp .+156 ; 0x2971e <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 29682: 81 32 cpi r24, 0x21 ; 33 29684: 5e e4 ldi r21, 0x4E ; 78 29686: 95 07 cpc r25, r21 29688: 08 f4 brcc .+2 ; 0x2968c <__vector_17+0xfc2> 2968a: 4c c0 rjmp .+152 ; 0x29724 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2968c: 96 95 lsr r25 2968e: 87 95 ror r24 29690: 96 95 lsr r25 29692: 87 95 ror r24 step_loops = 4; 29694: 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; 29696: 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 2969a: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2969c: 81 15 cp r24, r1 2969e: f8 e0 ldi r31, 0x08 ; 8 296a0: 9f 07 cpc r25, r31 296a2: 08 f4 brcc .+2 ; 0x296a6 <__vector_17+0xfdc> 296a4: 51 c0 rjmp .+162 ; 0x29748 <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 296a6: e9 2f mov r30, r25 296a8: ff 27 eor r31, r31 296aa: ee 0f add r30, r30 296ac: ff 1f adc r31, r31 296ae: ee 0f add r30, r30 296b0: ff 1f adc r31, r31 296b2: 9f 01 movw r18, r30 296b4: 23 5a subi r18, 0xA3 ; 163 296b6: 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); 296b8: f9 01 movw r30, r18 296ba: 32 96 adiw r30, 0x02 ; 2 296bc: 65 91 lpm r22, Z+ 296be: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 296c0: f9 01 movw r30, r18 296c2: 25 91 lpm r18, Z+ 296c4: 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. ); 296c6: 78 9f mul r23, r24 296c8: a0 01 movw r20, r0 296ca: 68 9f mul r22, r24 296cc: 00 0c add r0, r0 296ce: 41 1d adc r20, r1 296d0: 11 24 eor r1, r1 296d2: 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); 296d4: c9 01 movw r24, r18 296d6: 84 1b sub r24, r20 296d8: 95 0b sbc r25, r21 296da: 84 36 cpi r24, 0x64 ; 100 296dc: 91 05 cpc r25, r1 296de: 10 f4 brcc .+4 ; 0x296e4 <__vector_17+0x101a> 296e0: 84 e6 ldi r24, 0x64 ; 100 296e2: 90 e0 ldi r25, 0x00 ; 0 296e4: 90 93 77 05 sts 0x0577, r25 ; 0x800577 296e8: 80 93 76 05 sts 0x0576, r24 ; 0x800576 step_loops_nominal = step_loops; 296ec: 80 91 99 05 lds r24, 0x0599 ; 0x800599 296f0: 80 93 9c 05 sts 0x059C, r24 ; 0x80059c #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 296f4: fe 01 movw r30, r28 296f6: e4 5b subi r30, 0xB4 ; 180 296f8: ff 4f sbci r31, 0xFF ; 255 296fa: 80 81 ld r24, Z 296fc: 88 23 and r24, r24 296fe: 09 f4 brne .+2 ; 0x29702 <__vector_17+0x1038> 29700: ab cf rjmp .-170 ; 0x29658 <__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) 29702: 80 91 80 05 lds r24, 0x0580 ; 0x800580 29706: 88 23 and r24, r24 29708: 41 f0 breq .+16 ; 0x2971a <__vector_17+0x1050> target_adv_steps = current_adv_steps; 2970a: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 2970e: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29712: 90 93 94 05 sts 0x0594, r25 ; 0x800594 29716: 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; 2971a: 81 e0 ldi r24, 0x01 ; 1 2971c: 9e cf rjmp .-196 ; 0x2965a <__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; 2971e: 80 e4 ldi r24, 0x40 ; 64 29720: 9c e9 ldi r25, 0x9C ; 156 29722: b4 cf rjmp .-152 ; 0x2968c <__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 29724: 81 31 cpi r24, 0x11 ; 17 29726: e7 e2 ldi r30, 0x27 ; 39 29728: 9e 07 cpc r25, r30 2972a: 20 f0 brcs .+8 ; 0x29734 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2972c: 96 95 lsr r25 2972e: 87 95 ror r24 step_loops = 2; 29730: 22 e0 ldi r18, 0x02 ; 2 29732: b1 cf rjmp .-158 ; 0x29696 <__vector_17+0xfcc> } else { step_loops = 1; 29734: 21 e0 ldi r18, 0x01 ; 1 29736: 20 93 99 05 sts 0x0599, r18 ; 0x800599 2973a: 80 32 cpi r24, 0x20 ; 32 2973c: 91 05 cpc r25, r1 2973e: 08 f0 brcs .+2 ; 0x29742 <__vector_17+0x1078> 29740: ac cf rjmp .-168 ; 0x2969a <__vector_17+0xfd0> 29742: 80 e2 ldi r24, 0x20 ; 32 29744: 90 e0 ldi r25, 0x00 ; 0 29746: a9 cf rjmp .-174 ; 0x2969a <__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; 29748: 9c 01 movw r18, r24 2974a: 36 95 lsr r19 2974c: 27 95 ror r18 2974e: 2c 7f andi r18, 0xFC ; 252 29750: 23 5a subi r18, 0xA3 ; 163 29752: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 29754: f9 01 movw r30, r18 29756: 45 91 lpm r20, Z+ 29758: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2975a: f9 01 movw r30, r18 2975c: 32 96 adiw r30, 0x02 ; 2 2975e: 65 91 lpm r22, Z+ 29760: 74 91 lpm r23, Z 29762: 87 70 andi r24, 0x07 ; 7 29764: 99 27 eor r25, r25 29766: 86 9f mul r24, r22 29768: 90 01 movw r18, r0 2976a: 87 9f mul r24, r23 2976c: 30 0d add r19, r0 2976e: 96 9f mul r25, r22 29770: 30 0d add r19, r0 29772: 11 24 eor r1, r1 29774: a3 e0 ldi r26, 0x03 ; 3 29776: 36 95 lsr r19 29778: 27 95 ror r18 2977a: aa 95 dec r26 2977c: e1 f7 brne .-8 ; 0x29776 <__vector_17+0x10ac> 2977e: ca 01 movw r24, r20 29780: 82 1b sub r24, r18 29782: 93 0b sbc r25, r19 29784: aa cf rjmp .-172 ; 0x296da <__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; 29786: de 01 movw r26, r28 29788: a3 5b subi r26, 0xB3 ; 179 2978a: bf 4f sbci r27, 0xFF ; 255 2978c: 4d 91 ld r20, X+ 2978e: 5c 91 ld r21, X 29790: 11 97 sbiw r26, 0x01 ; 1 29792: 70 e0 ldi r23, 0x00 ; 0 29794: 60 e0 ldi r22, 0x00 ; 0 29796: 40 93 72 05 sts 0x0572, r20 ; 0x800572 2979a: 50 93 73 05 sts 0x0573, r21 ; 0x800573 2979e: 60 93 74 05 sts 0x0574, r22 ; 0x800574 297a2: 70 93 75 05 sts 0x0575, r23 ; 0x800575 e_step_loops = current_block->advance_step_loops; 297a6: 16 96 adiw r26, 0x06 ; 6 297a8: 9c 91 ld r25, X 297aa: 90 93 71 05 sts 0x0571, r25 ; 0x800571 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 297ae: 98 2f mov r25, r24 297b0: 92 70 andi r25, 0x02 ; 2 297b2: 09 f4 brne .+2 ; 0x297b6 <__vector_17+0x10ec> 297b4: cb cd rjmp .-1130 ; 0x2934c <__vector_17+0xc82> 297b6: 90 91 80 05 lds r25, 0x0580 ; 0x800580 297ba: 99 23 and r25, r25 297bc: 09 f4 brne .+2 ; 0x297c0 <__vector_17+0x10f6> 297be: c6 cd rjmp .-1140 ; 0x2934c <__vector_17+0xc82> 297c0: 2e 17 cp r18, r30 297c2: 3f 07 cpc r19, r31 297c4: 08 f0 brcs .+2 ; 0x297c8 <__vector_17+0x10fe> 297c6: c2 cd rjmp .-1148 ; 0x2934c <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 297c8: 44 0f add r20, r20 297ca: 55 1f adc r21, r21 297cc: 66 1f adc r22, r22 297ce: 77 1f adc r23, r23 297d0: 40 93 72 05 sts 0x0572, r20 ; 0x800572 297d4: 50 93 73 05 sts 0x0573, r21 ; 0x800573 297d8: 60 93 74 05 sts 0x0574, r22 ; 0x800574 297dc: 70 93 75 05 sts 0x0575, r23 ; 0x800575 LA_phase = 0; 297e0: 10 92 91 05 sts 0x0591, r1 ; 0x800591 297e4: b3 cd rjmp .-1178 ; 0x2934c <__vector_17+0xc82> 297e6: 80 93 72 05 sts 0x0572, r24 ; 0x800572 297ea: 90 93 73 05 sts 0x0573, r25 ; 0x800573 297ee: a0 93 74 05 sts 0x0574, r26 ; 0x800574 297f2: b0 93 75 05 sts 0x0575, r27 ; 0x800575 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 297f6: 61 11 cpse r22, r1 297f8: 1b c0 rjmp .+54 ; 0x29830 <__vector_17+0x1166> { eISR_Rate = timer; 297fa: f0 93 70 05 sts 0x0570, r31 ; 0x800570 297fe: e0 93 6f 05 sts 0x056F, r30 ; 0x80056f nextAdvanceISR = timer; 29802: f0 93 e4 04 sts 0x04E4, r31 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29806: 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) { 2980a: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2980e: 87 fd sbrc r24, 7 29810: 58 c0 rjmp .+176 ; 0x298c2 <__vector_17+0x11f8> if (step_loops == e_step_loops) 29812: 80 91 99 05 lds r24, 0x0599 ; 0x800599 29816: 10 91 71 05 lds r17, 0x0571 ; 0x800571 2981a: 28 81 ld r18, Y 2981c: 39 81 ldd r19, Y+1 ; 0x01 2981e: 81 13 cpse r24, r17 29820: 35 c0 rjmp .+106 ; 0x2988c <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 29822: 81 e0 ldi r24, 0x01 ; 1 29824: 2e 17 cp r18, r30 29826: 3f 07 cpc r19, r31 29828: 08 f4 brcc .+2 ; 0x2982c <__vector_17+0x1162> 2982a: 49 c0 rjmp .+146 ; 0x298be <__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); 2982c: 80 e0 ldi r24, 0x00 ; 0 2982e: 47 c0 rjmp .+142 ; 0x298be <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 29830: 64 30 cpi r22, 0x04 ; 4 29832: 28 f5 brcc .+74 ; 0x2987e <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 29834: 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); 29836: 63 30 cpi r22, 0x03 ; 3 29838: a9 f0 breq .+42 ; 0x29864 <__vector_17+0x119a> 2983a: 66 95 lsr r22 2983c: af 01 movw r20, r30 2983e: 02 c0 rjmp .+4 ; 0x29844 <__vector_17+0x117a> 29840: 56 95 lsr r21 29842: 47 95 ror r20 29844: 6a 95 dec r22 29846: e2 f7 brpl .-8 ; 0x29840 <__vector_17+0x1176> 29848: 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); 2984a: 70 93 70 05 sts 0x0570, r23 ; 0x800570 2984e: 60 93 6f 05 sts 0x056F, r22 ; 0x80056f } nextAdvanceISR = eISR_Rate; 29852: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 29856: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2985a: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 2985e: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29862: d3 cf rjmp .-90 ; 0x2980a <__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; 29864: 9f 01 movw r18, r30 29866: ab ea ldi r26, 0xAB ; 171 29868: ba ea ldi r27, 0xAA ; 170 2986a: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 2986e: 41 e1 ldi r20, 0x11 ; 17 29870: 96 95 lsr r25 29872: 87 95 ror r24 29874: 77 95 ror r23 29876: 67 95 ror r22 29878: 4a 95 dec r20 2987a: d1 f7 brne .-12 ; 0x29870 <__vector_17+0x11a6> 2987c: e6 cf rjmp .-52 ; 0x2984a <__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); 2987e: 70 e0 ldi r23, 0x00 ; 0 29880: 6f 5f subi r22, 0xFF ; 255 29882: 7f 4f sbci r23, 0xFF ; 255 29884: cf 01 movw r24, r30 29886: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2988a: df cf rjmp .-66 ; 0x2984a <__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); 2988c: 83 30 cpi r24, 0x03 ; 3 2988e: 09 f4 brne .+2 ; 0x29892 <__vector_17+0x11c8> 29890: cf c0 rjmp .+414 ; 0x29a30 <__vector_17+0x1366> 29892: 86 95 lsr r24 29894: a9 01 movw r20, r18 29896: 02 c0 rjmp .+4 ; 0x2989c <__vector_17+0x11d2> 29898: 56 95 lsr r21 2989a: 47 95 ror r20 2989c: 8a 95 dec r24 2989e: e2 f7 brpl .-8 ; 0x29898 <__vector_17+0x11ce> 298a0: 13 30 cpi r17, 0x03 ; 3 298a2: 09 f4 brne .+2 ; 0x298a6 <__vector_17+0x11dc> 298a4: d3 c0 rjmp .+422 ; 0x29a4c <__vector_17+0x1382> 298a6: 16 95 lsr r17 298a8: bf 01 movw r22, r30 298aa: 02 c0 rjmp .+4 ; 0x298b0 <__vector_17+0x11e6> 298ac: 76 95 lsr r23 298ae: 67 95 ror r22 298b0: 1a 95 dec r17 298b2: e2 f7 brpl .-8 ; 0x298ac <__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); 298b4: 81 e0 ldi r24, 0x01 ; 1 298b6: 46 17 cp r20, r22 298b8: 57 07 cpc r21, r23 298ba: 08 f0 brcs .+2 ; 0x298be <__vector_17+0x11f4> 298bc: b7 cf rjmp .-146 ; 0x2982c <__vector_17+0x1162> 298be: 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(); 298c2: 0f 94 1c 14 call 0x22838 ; 0x22838 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 298c6: 40 91 7c 05 lds r20, 0x057C ; 0x80057c 298ca: 50 91 7d 05 lds r21, 0x057D ; 0x80057d 298ce: 60 91 7e 05 lds r22, 0x057E ; 0x80057e 298d2: 70 91 7f 05 lds r23, 0x057F ; 0x80057f 298d6: e0 91 a1 05 lds r30, 0x05A1 ; 0x8005a1 298da: f0 91 a2 05 lds r31, 0x05A2 ; 0x8005a2 298de: 80 89 ldd r24, Z+16 ; 0x10 298e0: 91 89 ldd r25, Z+17 ; 0x11 298e2: a2 89 ldd r26, Z+18 ; 0x12 298e4: b3 89 ldd r27, Z+19 ; 0x13 298e6: 48 17 cp r20, r24 298e8: 59 07 cpc r21, r25 298ea: 6a 07 cpc r22, r26 298ec: 7b 07 cpc r23, r27 298ee: 80 f0 brcs .+32 ; 0x29910 <__vector_17+0x1246> current_block = NULL; 298f0: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 298f4: 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) { 298f8: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 298fc: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 29900: 98 17 cp r25, r24 29902: 31 f0 breq .+12 ; 0x29910 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 29904: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 29908: 8f 5f subi r24, 0xFF ; 255 2990a: 8f 70 andi r24, 0x0F ; 15 2990c: 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) 29910: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 29914: 81 30 cpi r24, 0x01 ; 1 29916: 49 f1 breq .+82 ; 0x2996a <__vector_17+0x12a0> 29918: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2991c: 88 23 and r24, r24 2991e: 29 f1 breq .+74 ; 0x2996a <__vector_17+0x12a0> 29920: 80 91 43 06 lds r24, 0x0643 ; 0x800643 29924: 81 11 cpse r24, r1 29926: 21 c0 rjmp .+66 ; 0x2996a <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 29928: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2992c: 81 e0 ldi r24, 0x01 ; 1 2992e: 29 2f mov r18, r25 29930: 24 70 andi r18, 0x04 ; 4 29932: 92 fd sbrc r25, 2 29934: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 29936: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2993a: 82 60 ori r24, 0x02 ; 2 2993c: 97 ff sbrs r25, 7 2993e: 03 c0 rjmp .+6 ; 0x29946 <__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) { 29940: 21 11 cpse r18, r1 29942: 13 c0 rjmp .+38 ; 0x2996a <__vector_17+0x12a0> 29944: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 29946: 80 93 0d 05 sts 0x050D, r24 ; 0x80050d tmc2130_sg_stop_on_crash = false; 2994a: 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 2994e: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.481+0x8> 29952: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.481+0x9> 29956: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.481+0xa> 2995a: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.481+0xb> 2995e: 20 e0 ldi r18, 0x00 ; 0 29960: 30 e0 ldi r19, 0x00 ; 0 29962: 40 e8 ldi r20, 0x80 ; 128 29964: 5f eb ldi r21, 0xBF ; 191 29966: 0e 94 3e 89 call 0x1127c ; 0x1127c WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2996a: 60 91 e3 04 lds r22, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 2996e: 70 91 e4 04 lds r23, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> if (eisr) 29972: 61 15 cp r22, r1 29974: 71 05 cpc r23, r1 29976: 09 f0 breq .+2 ; 0x2997a <__vector_17+0x12b0> 29978: 46 c0 rjmp .+140 ; 0x29a06 <__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) { 2997a: 40 91 df 04 lds r20, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 2997e: 50 91 e0 04 lds r21, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29982: 20 91 93 05 lds r18, 0x0593 ; 0x800593 29986: 30 91 94 05 lds r19, 0x0594 ; 0x800594 2998a: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2998e: 24 17 cp r18, r20 29990: 35 07 cpc r19, r21 29992: 08 f0 brcs .+2 ; 0x29996 <__vector_17+0x12cc> 29994: 6c c0 rjmp .+216 ; 0x29a6e <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 29996: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2999a: 91 30 cpi r25, 0x01 ; 1 2999c: 41 f0 breq .+16 ; 0x299ae <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 2999e: 42 1b sub r20, r18 299a0: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 299a2: 94 17 cp r25, r20 299a4: 15 06 cpc r1, r21 299a6: 19 f0 breq .+6 ; 0x299ae <__vector_17+0x12e4> 299a8: 10 f0 brcs .+4 ; 0x299ae <__vector_17+0x12e4> e_step_loops = d_steps; 299aa: 40 93 71 05 sts 0x0571, r20 ; 0x800571 } e_steps -= e_step_loops; 299ae: 90 91 71 05 lds r25, 0x0571 ; 0x800571 299b2: 89 1b sub r24, r25 299b4: 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); 299b8: 88 23 and r24, r24 299ba: 39 f0 breq .+14 ; 0x299ca <__vector_17+0x1300> 299bc: 87 fd sbrc r24, 7 299be: 53 c0 rjmp .+166 ; 0x29a66 <__vector_17+0x139c> 299c0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 299c4: 80 64 ori r24, 0x40 ; 64 299c6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 299ca: 20 91 71 05 lds r18, 0x0571 ; 0x800571 299ce: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 299d2: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 299d6: 82 1b sub r24, r18 299d8: 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; 299da: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 299de: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> } if (current_adv_steps == target_adv_steps) { 299e2: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 299e6: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 299ea: 80 91 93 05 lds r24, 0x0593 ; 0x800593 299ee: 90 91 94 05 lds r25, 0x0594 ; 0x800594 299f2: 28 17 cp r18, r24 299f4: 39 07 cpc r19, r25 299f6: 09 f0 breq .+2 ; 0x299fa <__vector_17+0x1330> 299f8: 66 c0 rjmp .+204 ; 0x29ac6 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 299fa: 8f ef ldi r24, 0xFF ; 255 299fc: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 299fe: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29a02: 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)) { 29a06: 40 91 92 05 lds r20, 0x0592 ; 0x800592 29a0a: 41 11 cpse r20, r1 29a0c: 61 c0 rjmp .+194 ; 0x29ad0 <__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) 29a0e: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> 29a12: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 29a16: 20 91 e5 04 lds r18, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.476> 29a1a: 30 91 e6 04 lds r19, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.476+0x1> 29a1e: 8f 3f cpi r24, 0xFF ; 255 29a20: 98 07 cpc r25, r24 29a22: 09 f0 breq .+2 ; 0x29a26 <__vector_17+0x135c> 29a24: 98 c0 rjmp .+304 ; 0x29b56 <__vector_17+0x148c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 29a26: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29a2a: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29a2e: 9e c0 rjmp .+316 ; 0x29b6c <__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; 29a30: ab ea ldi r26, 0xAB ; 171 29a32: ba ea ldi r27, 0xAA ; 170 29a34: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 29a38: ab 01 movw r20, r22 29a3a: bc 01 movw r22, r24 29a3c: 31 e1 ldi r19, 0x11 ; 17 29a3e: 76 95 lsr r23 29a40: 67 95 ror r22 29a42: 57 95 ror r21 29a44: 47 95 ror r20 29a46: 3a 95 dec r19 29a48: d1 f7 brne .-12 ; 0x29a3e <__vector_17+0x1374> 29a4a: 2a cf rjmp .-428 ; 0x298a0 <__vector_17+0x11d6> 29a4c: 9f 01 movw r18, r30 29a4e: ab ea ldi r26, 0xAB ; 171 29a50: ba ea ldi r27, 0xAA ; 170 29a52: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 29a56: 21 e1 ldi r18, 0x11 ; 17 29a58: 96 95 lsr r25 29a5a: 87 95 ror r24 29a5c: 77 95 ror r23 29a5e: 67 95 ror r22 29a60: 2a 95 dec r18 29a62: d1 f7 brne .-12 ; 0x29a58 <__vector_17+0x138e> 29a64: 27 cf rjmp .-434 ; 0x298b4 <__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); 29a66: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29a6a: 8f 7b andi r24, 0xBF ; 191 29a6c: ac cf rjmp .-168 ; 0x299c6 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 29a6e: 42 17 cp r20, r18 29a70: 53 07 cpc r21, r19 29a72: 08 f0 brcs .+2 ; 0x29a76 <__vector_17+0x13ac> 29a74: b6 cf rjmp .-148 ; 0x299e2 <__vector_17+0x1318> // compression if (e_step_loops != 1) { 29a76: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29a7a: 91 30 cpi r25, 0x01 ; 1 29a7c: 41 f0 breq .+16 ; 0x29a8e <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 29a7e: 24 1b sub r18, r20 29a80: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 29a82: 92 17 cp r25, r18 29a84: 13 06 cpc r1, r19 29a86: 19 f0 breq .+6 ; 0x29a8e <__vector_17+0x13c4> 29a88: 10 f0 brcs .+4 ; 0x29a8e <__vector_17+0x13c4> e_step_loops = d_steps; 29a8a: 20 93 71 05 sts 0x0571, r18 ; 0x800571 } e_steps += e_step_loops; 29a8e: 90 91 71 05 lds r25, 0x0571 ; 0x800571 29a92: 89 0f add r24, r25 29a94: 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); 29a98: 88 23 and r24, r24 29a9a: 39 f0 breq .+14 ; 0x29aaa <__vector_17+0x13e0> 29a9c: 87 fd sbrc r24, 7 29a9e: 0f c0 rjmp .+30 ; 0x29abe <__vector_17+0x13f4> 29aa0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29aa4: 80 64 ori r24, 0x40 ; 64 29aa6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 29aaa: 80 91 71 05 lds r24, 0x0571 ; 0x800571 29aae: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> 29ab2: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 29ab6: 82 0f add r24, r18 29ab8: 93 2f mov r25, r19 29aba: 91 1d adc r25, r1 29abc: 8e cf rjmp .-228 ; 0x299da <__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); 29abe: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 29ac2: 8f 7b andi r24, 0xBF ; 191 29ac4: f0 cf rjmp .-32 ; 0x29aa6 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 29ac6: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 29aca: 90 91 70 05 lds r25, 0x0570 ; 0x800570 29ace: 97 cf rjmp .-210 ; 0x299fe <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 29ad0: 80 91 91 05 lds r24, 0x0591 ; 0x800591 29ad4: 87 fd sbrc r24, 7 29ad6: 0e c0 rjmp .+28 ; 0x29af4 <__vector_17+0x142a> 29ad8: 08 2e mov r0, r24 29ada: 00 0c add r0, r0 29adc: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 29ade: 21 e0 ldi r18, 0x01 ; 1 29ae0: 30 e0 ldi r19, 0x00 ; 0 29ae2: 61 15 cp r22, r1 29ae4: 71 05 cpc r23, r1 29ae6: 11 f0 breq .+4 ; 0x29aec <__vector_17+0x1422> 29ae8: 30 e0 ldi r19, 0x00 ; 0 29aea: 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)) { 29aec: 82 17 cp r24, r18 29aee: 93 07 cpc r25, r19 29af0: 09 f0 breq .+2 ; 0x29af4 <__vector_17+0x142a> 29af2: 8d cf rjmp .-230 ; 0x29a0e <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 29af4: 20 91 71 05 lds r18, 0x0571 ; 0x800571 29af8: 67 2b or r22, r23 29afa: 11 f0 breq .+4 ; 0x29b00 <__vector_17+0x1436> 29afc: 20 91 99 05 lds r18, 0x0599 ; 0x800599 max_ticks = min(abs(e_steps), max_ticks); 29b00: 84 2f mov r24, r20 29b02: 04 2e mov r0, r20 29b04: 00 0c add r0, r0 29b06: 99 0b sbc r25, r25 29b08: 97 ff sbrs r25, 7 29b0a: 03 c0 rjmp .+6 ; 0x29b12 <__vector_17+0x1448> 29b0c: 91 95 neg r25 29b0e: 81 95 neg r24 29b10: 91 09 sbc r25, r1 29b12: 30 e0 ldi r19, 0x00 ; 0 29b14: 28 17 cp r18, r24 29b16: 39 07 cpc r19, r25 29b18: 0c f4 brge .+2 ; 0x29b1c <__vector_17+0x1452> 29b1a: c9 01 movw r24, r18 29b1c: 47 ff sbrs r20, 7 29b1e: 17 c0 rjmp .+46 ; 0x29b4e <__vector_17+0x1484> 29b20: 61 e0 ldi r22, 0x01 ; 1 29b22: 4f ef ldi r20, 0xFF ; 255 29b24: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 29b26: 78 e0 ldi r23, 0x08 ; 8 29b28: 76 b9 out 0x06, r23 ; 6 e_steps += (rev? 1: -1); 29b2a: 90 91 92 05 lds r25, 0x0592 ; 0x800592 29b2e: 96 0f add r25, r22 29b30: 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; 29b34: 20 91 bb 17 lds r18, 0x17BB ; 0x8017bb 29b38: 30 91 bc 17 lds r19, 0x17BC ; 0x8017bc 29b3c: 24 0f add r18, r20 29b3e: 35 1f adc r19, r21 29b40: 30 93 bc 17 sts 0x17BC, r19 ; 0x8017bc 29b44: 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); 29b48: 81 50 subi r24, 0x01 ; 1 29b4a: 71 f7 brne .-36 ; 0x29b28 <__vector_17+0x145e> 29b4c: 60 cf rjmp .-320 ; 0x29a0e <__vector_17+0x1344> 29b4e: 6f ef ldi r22, 0xFF ; 255 29b50: 41 e0 ldi r20, 0x01 ; 1 29b52: 50 e0 ldi r21, 0x00 ; 0 29b54: e8 cf rjmp .-48 ; 0x29b26 <__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) 29b56: ac 01 movw r20, r24 29b58: 48 5d subi r20, 0xD8 ; 216 29b5a: 5f 4f sbci r21, 0xFF ; 255 29b5c: 42 17 cp r20, r18 29b5e: 53 07 cpc r21, r19 29b60: 08 f0 brcs .+2 ; 0x29b64 <__vector_17+0x149a> 29b62: 61 cf rjmp .-318 ; 0x29a26 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 29b64: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29b68: 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) { 29b6c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 29b70: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29b74: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29b78: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29b7c: 40 96 adiw r24, 0x10 ; 16 29b7e: 28 17 cp r18, r24 29b80: 39 07 cpc r19, r25 29b82: 48 f4 brcc .+18 ; 0x29b96 <__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; 29b84: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 29b88: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 29b8c: 40 96 adiw r24, 0x10 ; 16 29b8e: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 29b92: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 29b96: ff 91 pop r31 29b98: ef 91 pop r30 29b9a: df 91 pop r29 29b9c: cf 91 pop r28 29b9e: bf 91 pop r27 29ba0: af 91 pop r26 29ba2: 9f 91 pop r25 29ba4: 8f 91 pop r24 29ba6: 7f 91 pop r23 29ba8: 6f 91 pop r22 29baa: 5f 91 pop r21 29bac: 4f 91 pop r20 29bae: 3f 91 pop r19 29bb0: 2f 91 pop r18 29bb2: 1f 91 pop r17 29bb4: 0f 91 pop r16 29bb6: ff 90 pop r15 29bb8: ef 90 pop r14 29bba: df 90 pop r13 29bbc: cf 90 pop r12 29bbe: 8f 90 pop r8 29bc0: 7f 90 pop r7 29bc2: 6f 90 pop r6 29bc4: 0f 90 pop r0 29bc6: 0b be out 0x3b, r0 ; 59 29bc8: 0f 90 pop r0 29bca: 0f be out 0x3f, r0 ; 63 29bcc: 0f 90 pop r0 29bce: 1f 90 pop r1 29bd0: 18 95 reti 00029bd2 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 29bd2: 90 91 78 05 lds r25, 0x0578 ; 0x800578 check_z_endstop = check; 29bd6: 80 93 78 05 sts 0x0578, r24 ; 0x800578 CRITICAL_SECTION_START; 29bda: 2f b7 in r18, 0x3f ; 63 29bdc: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29bde: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> 29be2: 8b 7f andi r24, 0xFB ; 251 29be4: 80 93 0b 05 sts 0x050B, r24 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_END; 29be8: 2f bf out 0x3f, r18 ; 63 return old; } 29bea: 89 2f mov r24, r25 29bec: 08 95 ret 00029bee : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 29bee: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_START; 29bf2: 2f b7 in r18, 0x3f ; 63 29bf4: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 29bf6: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> 29bfa: 9b 7f andi r25, 0xFB ; 251 29bfc: 90 93 0b 05 sts 0x050B, r25 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> CRITICAL_SECTION_END; 29c00: 2f bf out 0x3f, r18 ; 63 return hit; } 29c02: 82 fb bst r24, 2 29c04: 88 27 eor r24, r24 29c06: 80 f9 bld r24, 0 29c08: 08 95 ret 00029c0a : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 29c0a: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.480> endstop_hit = 0; 29c0e: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.480> return old; 29c12: 81 e0 ldi r24, 0x01 ; 1 29c14: 91 11 cpse r25, r1 29c16: 01 c0 rjmp .+2 ; 0x29c1a 29c18: 80 e0 ldi r24, 0x00 ; 0 } 29c1a: 08 95 ret 00029c1c : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 29c1c: 90 91 de 04 lds r25, 0x04DE ; 0x8004de 29c20: 91 30 cpi r25, 0x01 ; 1 29c22: a1 f0 breq .+40 ; 0x29c4c 29c24: 28 f0 brcs .+10 ; 0x29c30 29c26: 92 30 cpi r25, 0x02 ; 2 29c28: a9 f0 breq .+42 ; 0x29c54 29c2a: 93 30 cpi r25, 0x03 ; 3 29c2c: c1 f0 breq .+48 ; 0x29c5e 29c2e: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 29c30: 81 11 cpse r24, r1 29c32: 02 c0 rjmp .+4 ; 0x29c38 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(); 29c34: 0d 94 84 14 jmp 0x22908 ; 0x22908 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29c38: 82 30 cpi r24, 0x02 ; 2 29c3a: 11 f4 brne .+4 ; 0x29c40 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 29c3c: 0d 94 76 1f jmp 0x23eec ; 0x23eec 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) 29c40: 85 30 cpi r24, 0x05 ; 5 29c42: 09 f0 breq .+2 ; 0x29c46 29c44: 50 c0 rjmp .+160 ; 0x29ce6 Sound_DoSound_Alert(false); 29c46: 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); 29c48: 0d 94 62 14 jmp 0x228c4 ; 0x228c4 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) 29c4c: 88 23 and r24, r24 29c4e: 91 f3 breq .-28 ; 0x29c34 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29c50: 82 30 cpi r24, 0x02 ; 2 29c52: a1 f3 breq .-24 ; 0x29c3c Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29c54: 85 30 cpi r24, 0x05 ; 5 29c56: 09 f0 breq .+2 ; 0x29c5a 29c58: 46 c0 rjmp .+140 ; 0x29ce6 Sound_DoSound_Alert(true); 29c5a: 81 e0 ldi r24, 0x01 ; 1 29c5c: f5 cf rjmp .-22 ; 0x29c48 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) 29c5e: 88 23 and r24, r24 29c60: 49 f3 breq .-46 ; 0x29c34 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 29c62: 82 30 cpi r24, 0x02 ; 2 29c64: 59 f3 breq .-42 ; 0x29c3c Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 29c66: 85 30 cpi r24, 0x05 ; 5 29c68: 71 f3 breq .-36 ; 0x29c46 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 29c6a: 86 30 cpi r24, 0x06 ; 6 29c6c: e1 f4 brne .+56 ; 0x29ca6 29c6e: 85 e0 ldi r24, 0x05 ; 5 29c70: 27 e2 ldi r18, 0x27 ; 39 29c72: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 29c74: 4f b7 in r20, 0x3f ; 63 29c76: f8 94 cli 29c78: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c7c: 94 60 ori r25, 0x04 ; 4 29c7e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c82: 4f bf out 0x3f, r20 ; 63 29c84: f9 01 movw r30, r18 29c86: 31 97 sbiw r30, 0x01 ; 1 29c88: f1 f7 brne .-4 ; 0x29c86 delayMicroseconds(75); WRITE(BEEPER,LOW); 29c8a: 4f b7 in r20, 0x3f ; 63 29c8c: f8 94 cli 29c8e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c92: 9b 7f andi r25, 0xFB ; 251 29c94: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29c98: 4f bf out 0x3f, r20 ; 63 29c9a: f9 01 movw r30, r18 29c9c: 31 97 sbiw r30, 0x01 ; 1 29c9e: f1 f7 brne .-4 ; 0x29c9c 29ca0: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 29ca2: 41 f7 brne .-48 ; 0x29c74 29ca4: 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) 29ca6: 87 30 cpi r24, 0x07 ; 7 29ca8: f1 f4 brne .+60 ; 0x29ce6 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 29caa: 81 e0 ldi r24, 0x01 ; 1 29cac: 0e 94 74 8a call 0x114e8 ; 0x114e8 29cb0: 84 e1 ldi r24, 0x14 ; 20 29cb2: 23 e7 ldi r18, 0x73 ; 115 29cb4: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 29cb6: 4f b7 in r20, 0x3f ; 63 29cb8: f8 94 cli 29cba: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cbe: 94 60 ori r25, 0x04 ; 4 29cc0: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cc4: 4f bf out 0x3f, r20 ; 63 29cc6: f9 01 movw r30, r18 29cc8: 31 97 sbiw r30, 0x01 ; 1 29cca: f1 f7 brne .-4 ; 0x29cc8 delayMicroseconds(94); WRITE(BEEPER,LOW); 29ccc: 4f b7 in r20, 0x3f ; 63 29cce: f8 94 cli 29cd0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cd4: 9b 7f andi r25, 0xFB ; 251 29cd6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cda: 4f bf out 0x3f, r20 ; 63 29cdc: f9 01 movw r30, r18 29cde: 31 97 sbiw r30, 0x01 ; 1 29ce0: f1 f7 brne .-4 ; 0x29cde 29ce2: 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++) 29ce4: 41 f7 brne .-48 ; 0x29cb6 Sound_DoSound_Blind_Alert(); break; default: break; } } 29ce6: 08 95 ret 00029ce8 : //! @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 ) { 29ce8: 2f 92 push r2 29cea: 3f 92 push r3 29cec: 4f 92 push r4 29cee: 5f 92 push r5 29cf0: 6f 92 push r6 29cf2: 7f 92 push r7 29cf4: 8f 92 push r8 29cf6: 9f 92 push r9 29cf8: af 92 push r10 29cfa: bf 92 push r11 29cfc: cf 92 push r12 29cfe: df 92 push r13 29d00: ef 92 push r14 29d02: ff 92 push r15 29d04: 0f 93 push r16 29d06: 1f 93 push r17 29d08: cf 93 push r28 29d0a: df 93 push r29 29d0c: 00 d0 rcall .+0 ; 0x29d0e 29d0e: 00 d0 rcall .+0 ; 0x29d10 29d10: cd b7 in r28, 0x3d ; 61 29d12: de b7 in r29, 0x3e ; 62 29d14: 5c 01 movw r10, r24 29d16: 6c 83 std Y+4, r22 ; 0x04 29d18: 34 2e mov r3, r20 29d1a: 3b 83 std Y+3, r19 ; 0x03 29d1c: 2a 83 std Y+2, r18 ; 0x02 29d1e: 48 01 movw r8, r16 29d20: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 29d22: 00 97 sbiw r24, 0x00 ; 0 29d24: 09 f0 breq .+2 ; 0x29d28 29d26: 51 c0 rjmp .+162 ; 0x29dca 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); 29d28: 87 01 movw r16, r14 29d2a: 22 2d mov r18, r2 29d2c: a4 01 movw r20, r8 29d2e: 6a 81 ldd r22, Y+2 ; 0x02 29d30: 7b 81 ldd r23, Y+3 ; 0x03 29d32: 83 2d mov r24, r3 29d34: 0f 94 9a 1f call 0x23f34 ; 0x23f34 29d38: d1 2c mov r13, r1 29d3a: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 29d3c: 0f 94 53 29 call 0x252a6 ; 0x252a6 29d40: 2b 01 movw r4, r22 29d42: 3c 01 movw r6, r24 lcd_consume_click(); 29d44: 0e 94 ff 70 call 0xe1fe ; 0xe1fe KEEPALIVE_STATE(PAUSED_FOR_USER); 29d48: 84 e0 ldi r24, 0x04 ; 4 29d4a: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 29d4e: de 82 std Y+6, r13 ; 0x06 29d50: cd 82 std Y+5, r12 ; 0x05 29d52: 24 e6 ldi r18, 0x64 ; 100 29d54: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 29d56: 82 e3 ldi r24, 0x32 ; 50 29d58: 90 e0 ldi r25, 0x00 ; 0 29d5a: 0e 94 eb 8c call 0x119d6 ; 0x119d6 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 29d5e: 3c 81 ldd r19, Y+4 ; 0x04 29d60: 31 11 cpse r19, r1 29d62: 3a c0 rjmp .+116 ; 0x29dd8 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 29d64: 80 91 70 06 lds r24, 0x0670 ; 0x800670 29d68: 90 91 71 06 lds r25, 0x0671 ; 0x800671 29d6c: 00 97 sbiw r24, 0x00 ; 0 29d6e: 09 f0 breq .+2 ; 0x29d72 29d70: 42 c0 rjmp .+132 ; 0x29df6 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 29d72: 0e 94 04 71 call 0xe208 ; 0xe208 29d76: 88 23 and r24, r24 29d78: 09 f4 brne .+2 ; 0x29d7c 29d7a: 67 c0 rjmp .+206 ; 0x29e4a if (msg_next == NULL) { 29d7c: 8d 81 ldd r24, Y+5 ; 0x05 29d7e: 9e 81 ldd r25, Y+6 ; 0x06 29d80: 89 2b or r24, r25 29d82: 09 f0 breq .+2 ; 0x29d86 29d84: 5e c0 rjmp .+188 ; 0x29e42 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 29d86: 82 e0 ldi r24, 0x02 ; 2 29d88: 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; 29d8c: 91 e0 ldi r25, 0x01 ; 1 29d8e: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 29d92: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 29d96: 83 2d mov r24, r3 29d98: 26 96 adiw r28, 0x06 ; 6 29d9a: 0f b6 in r0, 0x3f ; 63 29d9c: f8 94 cli 29d9e: de bf out 0x3e, r29 ; 62 29da0: 0f be out 0x3f, r0 ; 63 29da2: cd bf out 0x3d, r28 ; 61 29da4: df 91 pop r29 29da6: cf 91 pop r28 29da8: 1f 91 pop r17 29daa: 0f 91 pop r16 29dac: ff 90 pop r15 29dae: ef 90 pop r14 29db0: df 90 pop r13 29db2: cf 90 pop r12 29db4: bf 90 pop r11 29db6: af 90 pop r10 29db8: 9f 90 pop r9 29dba: 8f 90 pop r8 29dbc: 7f 90 pop r7 29dbe: 6f 90 pop r6 29dc0: 5f 90 pop r5 29dc2: 4f 90 pop r4 29dc4: 3f 90 pop r3 29dc6: 2f 90 pop r2 29dc8: 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; 29dca: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 29dce: 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) { 29dd0: 89 2b or r24, r25 29dd2: 09 f0 breq .+2 ; 0x29dd6 29dd4: b3 cf rjmp .-154 ; 0x29d3c 29dd6: a8 cf rjmp .-176 ; 0x29d28 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) { 29dd8: 0f 94 53 29 call 0x252a6 ; 0x252a6 29ddc: 64 19 sub r22, r4 29dde: 75 09 sbc r23, r5 29de0: 86 09 sbc r24, r6 29de2: 97 09 sbc r25, r7 29de4: 61 33 cpi r22, 0x31 ; 49 29de6: 75 47 sbci r23, 0x75 ; 117 29de8: 81 05 cpc r24, r1 29dea: 91 05 cpc r25, r1 29dec: 08 f4 brcc .+2 ; 0x29df0 29dee: ba cf rjmp .-140 ; 0x29d64 current_selection = LCD_BUTTON_TIMEOUT; 29df0: 33 24 eor r3, r3 29df2: 3a 94 dec r3 29df4: c8 cf rjmp .-112 ; 0x29d86 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 29df6: 2d 81 ldd r18, Y+5 ; 0x05 29df8: 3e 81 ldd r19, Y+6 ; 0x06 29dfa: 23 2b or r18, r19 29dfc: f9 f4 brne .+62 ; 0x29e3c if (third_choice) { // third_choice is not nullptr, safe to dereference 29dfe: e1 14 cp r14, r1 29e00: f1 04 cpc r15, r1 29e02: b1 f0 breq .+44 ; 0x29e30 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 29e04: 97 ff sbrs r25, 7 29e06: 0f c0 rjmp .+30 ; 0x29e26 29e08: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 29e0a: 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); 29e0c: 87 01 movw r16, r14 29e0e: 22 2d mov r18, r2 29e10: a4 01 movw r20, r8 29e12: 6a 81 ldd r22, Y+2 ; 0x02 29e14: 7b 81 ldd r23, Y+3 ; 0x03 29e16: 83 2d mov r24, r3 29e18: 0f 94 9a 1f call 0x23f34 ; 0x23f34 lcd_encoder = 0; 29e1c: 10 92 71 06 sts 0x0671, r1 ; 0x800671 29e20: 10 92 70 06 sts 0x0670, r1 ; 0x800670 29e24: a6 cf rjmp .-180 ; 0x29d72 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) { 29e26: 32 e0 ldi r19, 0x02 ; 2 29e28: 33 16 cp r3, r19 29e2a: 81 f3 breq .-32 ; 0x29e0c // Rotating knob clockwise current_selection++; 29e2c: 33 94 inc r3 29e2e: ee cf rjmp .-36 ; 0x29e0c } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 29e30: 39 2e mov r3, r25 29e32: 30 94 com r3 29e34: 33 1c adc r3, r3 29e36: 33 24 eor r3, r3 29e38: 33 1c adc r3, r3 29e3a: e8 cf rjmp .-48 ; 0x29e0c } } 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); 29e3c: 87 e0 ldi r24, 0x07 ; 7 29e3e: 0f 94 0e 4e call 0x29c1c ; 0x29c1c goto exit; } else break; } } if (multi_screen) { 29e42: c1 14 cp r12, r1 29e44: d1 04 cpc r13, r1 29e46: 79 f4 brne .+30 ; 0x29e66 29e48: 84 cf rjmp .-248 ; 0x29d52 29e4a: 99 81 ldd r25, Y+1 ; 0x01 29e4c: 91 50 subi r25, 0x01 ; 1 29e4e: 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) { 29e50: 91 11 cpse r25, r1 29e52: 81 cf rjmp .-254 ; 0x29d56 goto exit; } else break; } } if (multi_screen) { 29e54: c1 14 cp r12, r1 29e56: d1 04 cpc r13, r1 29e58: 61 f0 breq .+24 ; 0x29e72 if (msg_next == NULL) { 29e5a: 2d 81 ldd r18, Y+5 ; 0x05 29e5c: 3e 81 ldd r19, Y+6 ; 0x06 29e5e: 23 2b or r18, r19 29e60: 11 f4 brne .+4 ; 0x29e66 29e62: be 82 std Y+6, r11 ; 0x06 29e64: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 29e66: 8d 81 ldd r24, Y+5 ; 0x05 29e68: 9e 81 ldd r25, Y+6 ; 0x06 29e6a: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 29e6e: 9e 83 std Y+6, r25 ; 0x06 29e70: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 29e72: 8d 81 ldd r24, Y+5 ; 0x05 29e74: 9e 81 ldd r25, Y+6 ; 0x06 29e76: 89 2b or r24, r25 29e78: 09 f0 breq .+2 ; 0x29e7c 29e7a: 6b cf rjmp .-298 ; 0x29d52 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 29e7c: 87 01 movw r16, r14 29e7e: 22 2d mov r18, r2 29e80: a4 01 movw r20, r8 29e82: 6a 81 ldd r22, Y+2 ; 0x02 29e84: 7b 81 ldd r23, Y+3 ; 0x03 29e86: 83 2d mov r24, r3 29e88: 0f 94 9a 1f call 0x23f34 ; 0x23f34 29e8c: 62 cf rjmp .-316 ; 0x29d52 00029e8e : //! @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) { 29e8e: bf 92 push r11 29e90: cf 92 push r12 29e92: df 92 push r13 29e94: ef 92 push r14 29e96: ff 92 push r15 29e98: 0f 93 push r16 29e9a: 1f 93 push r17 29e9c: cf 93 push r28 29e9e: df 93 push r29 29ea0: ec 01 movw r28, r24 29ea2: d6 2e mov r13, r22 29ea4: 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); 29ea6: 87 e5 ldi r24, 0x57 ; 87 29ea8: 98 e4 ldi r25, 0x48 ; 72 29eaa: 0e 94 b3 72 call 0xe566 ; 0xe566 29eae: 8c 01 movw r16, r24 29eb0: 81 e5 ldi r24, 0x51 ; 81 29eb2: 98 e4 ldi r25, 0x48 ; 72 29eb4: 0e 94 b3 72 call 0xe566 ; 0xe566 29eb8: 2a e0 ldi r18, 0x0A ; 10 29eba: c2 2e mov r12, r18 29ebc: f1 2c mov r15, r1 29ebe: e1 2c mov r14, r1 29ec0: 9c 01 movw r18, r24 29ec2: 4b 2d mov r20, r11 29ec4: 6d 2d mov r22, r13 29ec6: ce 01 movw r24, r28 29ec8: 0f 94 74 4e call 0x29ce8 ; 0x29ce8 } 29ecc: df 91 pop r29 29ece: cf 91 pop r28 29ed0: 1f 91 pop r17 29ed2: 0f 91 pop r16 29ed4: ff 90 pop r15 29ed6: ef 90 pop r14 29ed8: df 90 pop r13 29eda: cf 90 pop r12 29edc: bf 90 pop r11 29ede: 08 95 ret 00029ee0 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 29ee0: cf 92 push r12 29ee2: ef 92 push r14 29ee4: ff 92 push r15 29ee6: 0f 93 push r16 29ee8: 1f 93 push r17 29eea: cf 93 push r28 29eec: 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); 29eee: 8a e3 ldi r24, 0x3A ; 58 29ef0: 90 e5 ldi r25, 0x50 ; 80 29ef2: 0e 94 b3 72 call 0xe566 ; 0xe566 29ef6: 7c 01 movw r14, r24 29ef8: 87 e5 ldi r24, 0x57 ; 87 29efa: 98 e4 ldi r25, 0x48 ; 72 29efc: 0e 94 b3 72 call 0xe566 ; 0xe566 29f00: 8c 01 movw r16, r24 29f02: 81 e5 ldi r24, 0x51 ; 81 29f04: 98 e4 ldi r25, 0x48 ; 72 29f06: 0e 94 b3 72 call 0xe566 ; 0xe566 29f0a: ec 01 movw r28, r24 29f0c: 8f e0 ldi r24, 0x0F ; 15 29f0e: 90 e5 ldi r25, 0x50 ; 80 29f10: 0e 94 b3 72 call 0xe566 ; 0xe566 29f14: 28 e0 ldi r18, 0x08 ; 8 29f16: c2 2e mov r12, r18 29f18: 9e 01 movw r18, r28 29f1a: 40 e0 ldi r20, 0x00 ; 0 29f1c: 60 e0 ldi r22, 0x00 ; 0 29f1e: 0f 94 74 4e call 0x29ce8 ; 0x29ce8 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 29f22: 81 30 cpi r24, 0x01 ; 1 29f24: 29 f4 brne .+10 ; 0x29f30 load_filament_final_feed(); 29f26: 0e 94 9a 64 call 0xc934 ; 0xc934 st_synchronize(); 29f2a: 0f 94 ef 42 call 0x285de ; 0x285de 29f2e: df cf rjmp .-66 ; 0x29eee 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) { 29f30: 82 30 cpi r24, 0x02 ; 2 29f32: 61 f4 brne .+24 ; 0x29f4c unload_filament(FILAMENTCHANGE_FINALRETRACT); 29f34: 60 e0 ldi r22, 0x00 ; 0 29f36: 70 e0 ldi r23, 0x00 ; 0 29f38: cb 01 movw r24, r22 } } 29f3a: df 91 pop r29 29f3c: cf 91 pop r28 29f3e: 1f 91 pop r17 29f40: 0f 91 pop r16 29f42: ff 90 pop r15 29f44: ef 90 pop r14 29f46: 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); 29f48: 0c 94 56 f8 jmp 0x1f0ac ; 0x1f0ac } } 29f4c: df 91 pop r29 29f4e: cf 91 pop r28 29f50: 1f 91 pop r17 29f52: 0f 91 pop r16 29f54: ff 90 pop r15 29f56: ef 90 pop r14 29f58: cf 90 pop r12 29f5a: 08 95 ret 00029f5c : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 29f5c: 0f 93 push r16 29f5e: 1f 93 push r17 29f60: cf 93 push r28 29f62: df 93 push r29 29f64: 8c 01 movw r16, r24 29f66: eb 01 movw r28, r22 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 29f68: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 29f6c: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 29f70: 0f 94 3b 16 call 0x22c76 ; 0x22c76 29f74: 81 11 cpse r24, r1 29f76: 04 c0 rjmp .+8 ; 0x29f80 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 29f78: d0 93 73 06 sts 0x0673, r29 ; 0x800673 29f7c: c0 93 72 06 sts 0x0672, r28 ; 0x800672 { const FilamentAction action = eFilamentAction; 29f80: c0 91 a7 03 lds r28, 0x03A7 ; 0x8003a7 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 29f84: 87 ef ldi r24, 0xF7 ; 247 29f86: 8c 0f add r24, r28 29f88: 82 30 cpi r24, 0x02 ; 2 29f8a: f8 f4 brcc .+62 ; 0x29fca { lcd_return_to_status(); 29f8c: 0f 94 ad 1e call 0x23d5a ; 0x23d5a if (action == FilamentAction::Lay1Cal) 29f90: ca 30 cpi r28, 0x0A ; 10 29f92: 41 f4 brne .+16 ; 0x29fa4 { lcd_commands_type = LcdCommands::Layer1Cal; 29f94: 84 e0 ldi r24, 0x04 ; 4 29f96: 80 93 b4 0d sts 0x0DB4, r24 ; 0x800db4 } menu_back(); clearFilamentAction(); } } } 29f9a: df 91 pop r29 29f9c: cf 91 pop r28 29f9e: 1f 91 pop r17 29fa0: 0f 91 pop r16 29fa2: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 29fa4: 60 e0 ldi r22, 0x00 ; 0 29fa6: 70 e0 ldi r23, 0x00 ; 0 29fa8: 80 e2 ldi r24, 0x20 ; 32 29faa: 91 e4 ldi r25, 0x41 ; 65 29fac: 0e 94 67 6e call 0xdcce ; 0xdcce if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 29fb0: 8f e5 ldi r24, 0x5F ; 95 29fb2: 9f e0 ldi r25, 0x0F ; 15 29fb4: 0f 94 23 dc call 0x3b846 ; 0x3b846 29fb8: 88 23 and r24, r24 29fba: 79 f3 breq .-34 ; 0x29f9a lcd_wizard(WizState::LoadFilHot); 29fbc: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 29fbe: df 91 pop r29 29fc0: cf 91 pop r28 29fc2: 1f 91 pop r17 29fc4: 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); 29fc6: 0c 94 02 f9 jmp 0x1f204 ; 0x1f204 29fca: 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) 29fce: 80 91 64 06 lds r24, 0x0664 ; 0x800664 29fd2: 81 11 cpse r24, r1 29fd4: 12 c0 rjmp .+36 ; 0x29ffa 29fd6: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 29fda: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 29fde: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 29fe2: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 29fe6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 29fea: 60 1b sub r22, r16 29fec: 71 0b sbc r23, r17 29fee: 6c 5f subi r22, 0xFC ; 252 29ff0: 7f 4f sbci r23, 0xFF ; 255 29ff2: 69 30 cpi r22, 0x09 ; 9 29ff4: 71 05 cpc r23, r1 29ff6: 08 f0 brcs .+2 ; 0x29ffa 29ff8: 60 c0 rjmp .+192 ; 0x2a0ba { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 29ffa: c1 50 subi r28, 0x01 ; 1 29ffc: c8 30 cpi r28, 0x08 ; 8 29ffe: 88 f5 brcc .+98 ; 0x2a062 2a000: ec 2f mov r30, r28 2a002: f0 e0 ldi r31, 0x00 ; 0 2a004: 88 27 eor r24, r24 2a006: e8 5f subi r30, 0xF8 ; 248 2a008: ff 4a sbci r31, 0xAF ; 175 2a00a: 8e 4f sbci r24, 0xFE ; 254 2a00c: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 2a010: c2 3a cpi r28, 0xA2 ; 162 2a012: c2 3a cpi r28, 0xA2 ; 162 2a014: c2 3a cpi r28, 0xA2 ; 162 2a016: d6 39 cpi r29, 0x96 ; 150 2a018: 8a 39 cpi r24, 0x9A ; 154 2a01a: 9a 39 cpi r25, 0x9A ; 154 2a01c: e8 3a cpi r30, 0xA8 ; 168 2a01e: 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; 2a020: c6 e6 ldi r28, 0x66 ; 102 2a022: d1 ee ldi r29, 0xE1 ; 225 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2a024: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a028: 88 23 and r24, r24 2a02a: 29 f0 breq .+10 ; 0x2a036 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2a02c: 82 e0 ldi r24, 0x02 ; 2 2a02e: 0f 94 0e 4e call 0x29c1c ; 0x29c1c bFilamentWaitingFlag = false; 2a032: 10 92 62 06 sts 0x0662, r1 ; 0x800662 } if (filamentActionMenu) { 2a036: 20 97 sbiw r28, 0x00 ; 0 2a038: 09 f4 brne .+2 ; 0x2a03c 2a03a: af cf rjmp .-162 ; 0x29f9a // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2a03c: 0f 94 c8 1c call 0x23990 ; 0x23990 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2a040: 61 e0 ldi r22, 0x01 ; 1 2a042: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2a044: df 91 pop r29 2a046: cf 91 pop r28 2a048: 1f 91 pop r17 2a04a: 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); 2a04c: 0d 94 0a d3 jmp 0x3a614 ; 0x3a614 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2a050: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a054: 88 23 and r24, r24 2a056: 41 f0 breq .+16 ; 0x2a068 2a058: 61 e0 ldi r22, 0x01 ; 1 2a05a: 8a e7 ldi r24, 0x7A ; 122 2a05c: 9a e3 ldi r25, 0x3A ; 58 2a05e: 0f 94 0a d3 call 0x3a614 ; 0x3a614 // 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; 2a062: d0 e0 ldi r29, 0x00 ; 0 2a064: c0 e0 ldi r28, 0x00 ; 0 2a066: de cf rjmp .-68 ; 0x2a024 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2a068: 0f 94 c8 1c call 0x23990 ; 0x23990 if (eFilamentAction == FilamentAction::AutoLoad) { 2a06c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2a070: 82 30 cpi r24, 0x02 ; 2 2a072: 19 f4 brne .+6 ; 0x2a07a // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2a074: 81 e0 ldi r24, 0x01 ; 1 2a076: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (eFilamentAction == FilamentAction::Load) 2a07a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2a07e: 81 30 cpi r24, 0x01 ; 1 2a080: 31 f4 brne .+12 ; 0x2a08e enquecommand_P(MSG_M701); // load filament 2a082: 61 e0 ldi r22, 0x01 ; 1 2a084: 83 e5 ldi r24, 0x53 ; 83 2a086: 9f e6 ldi r25, 0x6F ; 111 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2a088: 0e 94 27 88 call 0x1104e ; 0x1104e 2a08c: ea cf rjmp .-44 ; 0x2a062 eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2a08e: 83 30 cpi r24, 0x03 ; 3 2a090: 41 f7 brne .-48 ; 0x2a062 enquecommand_P(MSG_M702); // unload filament 2a092: 61 e0 ldi r22, 0x01 ; 1 2a094: 8b ed ldi r24, 0xDB ; 219 2a096: 9b e6 ldi r25, 0x6B ; 107 2a098: f7 cf rjmp .-18 ; 0x2a088 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2a09a: c0 ee ldi r28, 0xE0 ; 224 2a09c: d0 ee ldi r29, 0xE0 ; 224 2a09e: c2 cf rjmp .-124 ; 0x2a024 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2a0a0: 0f 94 c8 1c call 0x23990 ; 0x23990 MMU2::mmu2.unload(); 2a0a4: 0f 94 44 ad call 0x35a88 ; 0x35a88 // 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(); 2a0a8: 0f 94 9a 20 call 0x24134 ; 0x24134 2a0ac: da cf rjmp .-76 ; 0x2a062 break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2a0ae: ce e5 ldi r28, 0x5E ; 94 2a0b0: d1 ee ldi r29, 0xE1 ; 225 2a0b2: b8 cf rjmp .-144 ; 0x2a024 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2a0b4: c6 e5 ldi r28, 0x56 ; 86 2a0b6: d1 ee ldi r29, 0xE1 ; 225 2a0b8: b5 cf rjmp .-150 ; 0x2a024 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2a0ba: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a0be: 88 23 and r24, r24 2a0c0: 21 f0 breq .+8 ; 0x2a0ca 2a0c2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2a0c6: 88 23 and r24, r24 2a0c8: 71 f1 breq .+92 ; 0x2a126 // 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; 2a0ca: 81 e0 ldi r24, 0x01 ; 1 2a0cc: 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; 2a0d0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2a0d4: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 2a0d8: 80 ec ldi r24, 0xC0 ; 192 2a0da: 9b e3 ldi r25, 0x3B ; 59 2a0dc: 0e 94 b3 72 call 0xe566 ; 0xe566 2a0e0: ac 01 movw r20, r24 2a0e2: 63 e0 ldi r22, 0x03 ; 3 2a0e4: 80 e0 ldi r24, 0x00 ; 0 2a0e6: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(0, 1); 2a0ea: 61 e0 ldi r22, 0x01 ; 1 2a0ec: 80 e0 ldi r24, 0x00 ; 0 2a0ee: 0e 94 e7 6e call 0xddce ; 0xddce switch (eFilamentAction) 2a0f2: e0 91 a7 03 lds r30, 0x03A7 ; 0x8003a7 2a0f6: e1 50 subi r30, 0x01 ; 1 2a0f8: e8 30 cpi r30, 0x08 ; 8 2a0fa: a8 f4 brcc .+42 ; 0x2a126 2a0fc: f0 e0 ldi r31, 0x00 ; 0 2a0fe: 88 27 eor r24, r24 2a100: eb 57 subi r30, 0x7B ; 123 2a102: ff 4a sbci r31, 0xAF ; 175 2a104: 8e 4f sbci r24, 0xFE ; 254 2a106: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 2a10a: 88 3a cpi r24, 0xA8 ; 168 2a10c: 88 3a cpi r24, 0xA8 ; 168 2a10e: 50 39 cpi r21, 0x90 ; 144 2a110: 88 3a cpi r24, 0xA8 ; 168 2a112: 50 39 cpi r21, 0x90 ; 144 2a114: 10 3b cpi r17, 0xB0 ; 176 2a116: ec 39 cpi r30, 0x9C ; 156 2a118: 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)); 2a11a: 8f ee ldi r24, 0xEF ; 239 2a11c: 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)); 2a11e: 0e 94 b3 72 call 0xe566 ; 0xe566 2a122: 0e 94 d2 6e call 0xdda4 ; 0xdda4 // handled earlier break; } } if (bFilamentWaitingFlag) { 2a126: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2a12a: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2a12c: 0f 94 9e 21 call 0x2433c ; 0x2433c } if (lcd_clicked()) 2a130: 0e 94 04 71 call 0xe208 ; 0xe208 2a134: 88 23 and r24, r24 2a136: 09 f4 brne .+2 ; 0x2a13a 2a138: 30 cf rjmp .-416 ; 0x29f9a { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2a13a: 10 92 62 06 sts 0x0662, r1 ; 0x800662 if (!bFilamentPreheatState) 2a13e: 80 91 63 06 lds r24, 0x0663 ; 0x800663 2a142: 81 11 cpse r24, r1 2a144: 0e c0 rjmp .+28 ; 0x2a162 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2a146: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 2a14a: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2a14e: 0e 94 8c 67 call 0xcf18 ; 0xcf18 2a152: 81 11 cpse r24, r1 2a154: 04 c0 rjmp .+8 ; 0x2a15e resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2a156: 10 92 73 06 sts 0x0673, r1 ; 0x800673 2a15a: 10 92 72 06 sts 0x0672, r1 ; 0x800672 menu_back(); 2a15e: 0f 94 65 d4 call 0x3a8ca ; 0x3a8ca } menu_back(); 2a162: 0f 94 65 d4 call 0x3a8ca ; 0x3a8ca clearFilamentAction(); } } } 2a166: df 91 pop r29 2a168: cf 91 pop r28 2a16a: 1f 91 pop r17 2a16c: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2a16e: 0d 94 9a 20 jmp 0x24134 ; 0x24134 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)); 2a172: 88 ed ldi r24, 0xD8 ; 216 2a174: 9f e4 ldi r25, 0x4F ; 79 2a176: d3 cf rjmp .-90 ; 0x2a11e break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2a178: 82 ec ldi r24, 0xC2 ; 194 2a17a: 9f e4 ldi r25, 0x4F ; 79 2a17c: d0 cf rjmp .-96 ; 0x2a11e break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2a17e: 8e ea ldi r24, 0xAE ; 174 2a180: 9f e4 ldi r25, 0x4F ; 79 2a182: cd cf rjmp .-102 ; 0x2a11e 0002a184 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2a184: 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) ); 2a188: 40 91 ba 13 lds r20, 0x13BA ; 0x8013ba 2a18c: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 2a190: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 2a194: 41 30 cpi r20, 0x01 ; 1 2a196: 59 f0 breq .+22 ; 0x2a1ae 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() 2a198: 10 92 64 06 sts 0x0664, r1 ; 0x800664 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2a19c: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2a1a0: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2a1a4: 28 17 cp r18, r24 2a1a6: 39 07 cpc r19, r25 2a1a8: 5c f4 brge .+22 ; 0x2a1c0 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2a1aa: 0d 94 9d 20 jmp 0x2413a ; 0x2413a 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: 90 91 90 13 lds r25, 0x1390 ; 0x801390 2a1b2: 91 11 cpse r25, r1 2a1b4: f1 cf rjmp .-30 ; 0x2a198 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2a1b6: 86 50 subi r24, 0x06 ; 6 2a1b8: 82 30 cpi r24, 0x02 ; 2 2a1ba: 70 f7 brcc .-36 ; 0x2a198 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() 2a1bc: 40 93 64 06 sts 0x0664, r20 ; 0x800664 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2a1c0: 81 e0 ldi r24, 0x01 ; 1 2a1c2: 80 93 63 06 sts 0x0663, r24 ; 0x800663 mFilamentItem(target_temperature[0], target_temperature_bed); 2a1c6: 60 91 72 06 lds r22, 0x0672 ; 0x800672 2a1ca: 70 91 73 06 lds r23, 0x0673 ; 0x800673 2a1ce: c9 01 movw r24, r18 2a1d0: 0f 94 ae 4f call 0x29f5c ; 0x29f5c bFilamentSkipPreheat = false; // Reset flag 2a1d4: 10 92 64 06 sts 0x0664, r1 ; 0x800664 } else { lcd_generic_preheat_menu(); } } 2a1d8: 08 95 ret 0002a1da : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2a1da: 82 e0 ldi r24, 0x02 ; 2 2a1dc: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0002a1e0 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2a1e0: 81 e0 ldi r24, 0x01 ; 1 2a1e2: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0002a1e6 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2a1e6: 83 e0 ldi r24, 0x03 ; 3 2a1e8: 0d 94 c2 50 jmp 0x2a184 ; 0x2a184 0002a1ec : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2a1ec: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2a1f0: 6c e3 ldi r22, 0x3C ; 60 2a1f2: 70 e0 ldi r23, 0x00 ; 0 2a1f4: 87 ed ldi r24, 0xD7 ; 215 2a1f6: 90 e0 ldi r25, 0x00 ; 0 2a1f8: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a1fc : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2a1fc: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2a200: 65 e5 ldi r22, 0x55 ; 85 2a202: 70 e0 ldi r23, 0x00 ; 0 2a204: 86 ee ldi r24, 0xE6 ; 230 2a206: 90 e0 ldi r25, 0x00 ; 0 2a208: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a20c : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2a20c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2a210: 69 e6 ldi r22, 0x69 ; 105 2a212: 70 e0 ldi r23, 0x00 ; 0 2a214: 84 e0 ldi r24, 0x04 ; 4 2a216: 91 e0 ldi r25, 0x01 ; 1 2a218: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a21c : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2a21c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2a220: 6e e6 ldi r22, 0x6E ; 110 2a222: 70 e0 ldi r23, 0x00 ; 0 2a224: 83 e1 ldi r24, 0x13 ; 19 2a226: 91 e0 ldi r25, 0x01 ; 1 2a228: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a22c : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2a22c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2a230: 6b e4 ldi r22, 0x4B ; 75 2a232: 70 e0 ldi r23, 0x00 ; 0 2a234: 87 ed ldi r24, 0xD7 ; 215 2a236: 90 e0 ldi r25, 0x00 ; 0 2a238: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a23c : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2a23c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2a240: 6a e5 ldi r22, 0x5A ; 90 2a242: 70 e0 ldi r23, 0x00 ; 0 2a244: 83 e1 ldi r24, 0x13 ; 19 2a246: 91 e0 ldi r25, 0x01 ; 1 2a248: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a24c : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2a24c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2a250: 64 e6 ldi r22, 0x64 ; 100 2a252: 70 e0 ldi r23, 0x00 ; 0 2a254: 8f ef ldi r24, 0xFF ; 255 2a256: 90 e0 ldi r25, 0x00 ; 0 2a258: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a25c : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2a25c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2a260: 64 e6 ldi r22, 0x64 ; 100 2a262: 70 e0 ldi r23, 0x00 ; 0 2a264: 8c ed ldi r24, 0xDC ; 220 2a266: 90 e0 ldi r25, 0x00 ; 0 2a268: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a26c : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2a26c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2a270: 64 e6 ldi r22, 0x64 ; 100 2a272: 70 e0 ldi r23, 0x00 ; 0 2a274: 8e ef ldi r24, 0xFE ; 254 2a276: 90 e0 ldi r25, 0x00 ; 0 2a278: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a27c : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2a27c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2a280: 62 e3 ldi r22, 0x32 ; 50 2a282: 70 e0 ldi r23, 0x00 ; 0 2a284: 80 ef ldi r24, 0xF0 ; 240 2a286: 90 e0 ldi r25, 0x00 ; 0 2a288: 0d 94 ae 4f jmp 0x29f5c ; 0x29f5c 0002a28c : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a28c: 80 e0 ldi r24, 0x00 ; 0 2a28e: 0f 94 0e 4e call 0x29c1c ; 0x29c1c #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2a292: 0e 94 f1 ed call 0x1dbe2 ; 0x1dbe2 lcd_return_to_status(); 2a296: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 0002a29a : } 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){ 2a29a: cf 92 push r12 2a29c: df 92 push r13 2a29e: ef 92 push r14 2a2a0: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2a2a2: 41 11 cpse r20, r1 2a2a4: 04 c0 rjmp .+8 ; 0x2a2ae 2a2a6: 20 91 de 04 lds r18, 0x04DE ; 0x8004de 2a2aa: 22 30 cpi r18, 0x02 ; 2 2a2ac: d1 f0 breq .+52 ; 0x2a2e2 2a2ae: 9b 01 movw r18, r22 2a2b0: 6c 01 movw r12, r24 2a2b2: f1 2c mov r15, r1 2a2b4: e1 2c mov r14, r1 if(!tone_) { 2a2b6: 67 2b or r22, r23 2a2b8: c9 f4 brne .+50 ; 0x2a2ec WRITE(BEEPER, HIGH); 2a2ba: 9f b7 in r25, 0x3f ; 63 2a2bc: f8 94 cli 2a2be: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2c2: 84 60 ori r24, 0x04 ; 4 2a2c4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2c8: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2a2ca: c7 01 movw r24, r14 2a2cc: b6 01 movw r22, r12 2a2ce: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 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); 2a2d2: 9f b7 in r25, 0x3f ; 63 2a2d4: f8 94 cli 2a2d6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2da: 8b 7f andi r24, 0xFB ; 251 2a2dc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a2e0: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2a2e2: ff 90 pop r15 2a2e4: ef 90 pop r14 2a2e6: df 90 pop r13 2a2e8: cf 90 pop r12 2a2ea: 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); 2a2ec: 22 0f add r18, r18 2a2ee: 33 1f adc r19, r19 2a2f0: 50 e0 ldi r21, 0x00 ; 0 2a2f2: 40 e0 ldi r20, 0x00 ; 0 2a2f4: 60 e0 ldi r22, 0x00 ; 0 2a2f6: 74 e2 ldi r23, 0x24 ; 36 2a2f8: 84 ef ldi r24, 0xF4 ; 244 2a2fa: 90 e0 ldi r25, 0x00 ; 0 2a2fc: 0f 94 14 dd call 0x3ba28 ; 0x3ba28 <__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; 2a300: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2a302: 21 15 cp r18, r1 2a304: 31 05 cpc r19, r1 2a306: 81 e0 ldi r24, 0x01 ; 1 2a308: 48 07 cpc r20, r24 2a30a: 51 05 cpc r21, r1 2a30c: 44 f0 brlt .+16 ; 0x2a31e pwm_freq /= 64; // Increase prescaler to 64 2a30e: 86 e0 ldi r24, 0x06 ; 6 2a310: 56 95 lsr r21 2a312: 47 95 ror r20 2a314: 37 95 ror r19 2a316: 27 95 ror r18 2a318: 8a 95 dec r24 2a31a: d1 f7 brne .-12 ; 0x2a310 prescalarbits = 0b011; 2a31c: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2a31e: 21 50 subi r18, 0x01 ; 1 2a320: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2a322: 4f b7 in r20, 0x3f ; 63 2a324: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2a326: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a32a: 88 7f andi r24, 0xF8 ; 248 2a32c: 89 2b or r24, r25 2a32e: 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); 2a332: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a336: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a33a: 26 9f mul r18, r22 2a33c: c0 01 movw r24, r0 2a33e: 27 9f mul r18, r23 2a340: 90 0d add r25, r0 2a342: 36 9f mul r19, r22 2a344: 90 0d add r25, r0 2a346: 11 24 eor r1, r1 2a348: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a34c: 6f ef ldi r22, 0xFF ; 255 2a34e: 70 e0 ldi r23, 0x00 ; 0 2a350: 51 ff sbrs r21, 1 2a352: 04 c0 rjmp .+8 ; 0x2a35c 2a354: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a358: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a35c: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2a360: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a364: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2a368: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a36c: 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); 2a370: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a374: 83 60 ori r24, 0x03 ; 3 2a376: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a37a: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2a37c: c7 01 movw r24, r14 2a37e: b6 01 movw r22, r12 2a380: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2a384: 2f b7 in r18, 0x3f ; 63 2a386: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2a388: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2a38c: 88 7f andi r24, 0xF8 ; 248 2a38e: 85 60 ori r24, 0x05 ; 5 2a390: 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); 2a394: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2a398: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a39c: 3f ef ldi r19, 0xFF ; 255 2a39e: 34 9f mul r19, r20 2a3a0: c0 01 movw r24, r0 2a3a2: 35 9f mul r19, r21 2a3a4: 90 0d add r25, r0 2a3a6: 11 24 eor r1, r1 2a3a8: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a3ac: 6f ef ldi r22, 0xFF ; 255 2a3ae: 70 e0 ldi r23, 0x00 ; 0 2a3b0: 31 ff sbrs r19, 1 2a3b2: 04 c0 rjmp .+8 ; 0x2a3bc 2a3b4: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2a3b8: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a3bc: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2a3c0: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2a3c4: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2a3c8: 8f ef ldi r24, 0xFF ; 255 2a3ca: 90 e0 ldi r25, 0x00 ; 0 2a3cc: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2a3d0: 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)); 2a3d4: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2a3d8: 8c 7f andi r24, 0xFC ; 252 2a3da: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2a3de: 2f bf out 0x3f, r18 ; 63 2a3e0: 78 cf rjmp .-272 ; 0x2a2d2 0002a3e2 : /// 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() { 2a3e2: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2a3e4: c0 91 de 04 lds r28, 0x04DE ; 0x8004de 2a3e8: c2 30 cpi r28, 0x02 ; 2 2a3ea: 59 f1 breq .+86 ; 0x2a442 // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2a3ec: c1 30 cpi r28, 0x01 ; 1 2a3ee: 69 f4 brne .+26 ; 0x2a40a if (bFirst) return; 2a3f0: 80 91 6e 05 lds r24, 0x056E ; 0x80056e <_ZL6bFirst.lto_priv.495> 2a3f4: 81 11 cpse r24, r1 2a3f6: 25 c0 rjmp .+74 ; 0x2a442 Sound_MakeCustom(80, 0, false); 2a3f8: 40 e0 ldi r20, 0x00 ; 0 2a3fa: 70 e0 ldi r23, 0x00 ; 0 2a3fc: 60 e0 ldi r22, 0x00 ; 0 2a3fe: 80 e5 ldi r24, 0x50 ; 80 2a400: 90 e0 ldi r25, 0x00 ; 0 2a402: 0f 94 4d 51 call 0x2a29a ; 0x2a29a bFirst = true; 2a406: 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)) { 2a40a: 60 ed ldi r22, 0xD0 ; 208 2a40c: 77 e0 ldi r23, 0x07 ; 7 2a40e: 8b e6 ldi r24, 0x6B ; 107 2a410: 95 e0 ldi r25, 0x05 ; 5 2a412: 0f 94 ad 29 call 0x2535a ; 0x2535a ::expired_cont(unsigned short)> 2a416: 88 23 and r24, r24 2a418: a1 f0 breq .+40 ; 0x2a442 beep_timer.start(); 2a41a: 8b e6 ldi r24, 0x6B ; 107 2a41c: 95 e0 ldi r25, 0x05 ; 5 2a41e: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2a422: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2a426: 81 11 cpse r24, r1 2a428: 08 c0 rjmp .+16 ; 0x2a43a Sound_MakeCustom(80, 0, false); 2a42a: 40 e0 ldi r20, 0x00 ; 0 2a42c: 70 e0 ldi r23, 0x00 ; 0 2a42e: 60 e0 ldi r22, 0x00 ; 0 2a430: 80 e5 ldi r24, 0x50 ; 80 2a432: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2a434: 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); 2a436: 0d 94 4d 51 jmp 0x2a29a ; 0x2a29a } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2a43a: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2a43c: 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); 2a43e: 0d 94 0e 4e jmp 0x29c1c ; 0x29c1c } } #endif // BEEPER > 0 } 2a442: cf 91 pop r28 2a444: 08 95 ret 0002a446 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2a446: 82 30 cpi r24, 0x02 ; 2 2a448: b9 f0 breq .+46 ; 0x2a478 2a44a: 83 30 cpi r24, 0x03 ; 3 2a44c: e9 f0 breq .+58 ; 0x2a488 2a44e: 81 30 cpi r24, 0x01 ; 1 2a450: 59 f0 breq .+22 ; 0x2a468 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; 2a452: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a456: 61 30 cpi r22, 0x01 ; 1 2a458: 29 f4 brne .+10 ; 0x2a464 2a45a: 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; 2a45c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2a460: 00 00 nop } 2a462: 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; 2a464: 8e 7f andi r24, 0xFE ; 254 2a466: fa cf rjmp .-12 ; 0x2a45c case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2a468: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a46c: 61 11 cpse r22, r1 2a46e: 02 c0 rjmp .+4 ; 0x2a474 2a470: 82 60 ori r24, 0x02 ; 2 2a472: f4 cf rjmp .-24 ; 0x2a45c 2a474: 8d 7f andi r24, 0xFD ; 253 2a476: f2 cf rjmp .-28 ; 0x2a45c case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2a478: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a47c: 61 30 cpi r22, 0x01 ; 1 2a47e: 11 f4 brne .+4 ; 0x2a484 2a480: 84 60 ori r24, 0x04 ; 4 2a482: ec cf rjmp .-40 ; 0x2a45c 2a484: 8b 7f andi r24, 0xFB ; 251 2a486: ea cf rjmp .-44 ; 0x2a45c case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2a488: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2a48c: 61 11 cpse r22, r1 2a48e: 02 c0 rjmp .+4 ; 0x2a494 2a490: 80 64 ori r24, 0x40 ; 64 2a492: e4 cf rjmp .-56 ; 0x2a45c 2a494: 8f 7b andi r24, 0xBF ; 191 2a496: e2 cf rjmp .-60 ; 0x2a45c 0002a498 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 2a498: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a49a: 0d b4 in r0, 0x2d ; 45 2a49c: 07 fe sbrs r0, 7 2a49e: fd cf rjmp .-6 ; 0x2a49a } 2a4a0: 08 95 ret 0002a4a2 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 2a4a2: 8f ef ldi r24, 0xFF ; 255 2a4a4: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a4a6: 0d b4 in r0, 0x2d ; 45 2a4a8: 07 fe sbrs r0, 7 2a4aa: fd cf rjmp .-6 ; 0x2a4a6 return SPDR; 2a4ac: 8e b5 in r24, 0x2e ; 46 } 2a4ae: 08 95 ret 0002a4b0 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 2a4b0: 8f 92 push r8 2a4b2: 9f 92 push r9 2a4b4: af 92 push r10 2a4b6: bf 92 push r11 2a4b8: ef 92 push r14 2a4ba: ff 92 push r15 2a4bc: 0f 93 push r16 2a4be: 1f 93 push r17 2a4c0: cf 93 push r28 2a4c2: 7c 01 movw r14, r24 2a4c4: c6 2f mov r28, r22 2a4c6: 49 01 movw r8, r18 2a4c8: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 2a4ca: fc 01 movw r30, r24 2a4cc: 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); 2a4ce: 89 2f mov r24, r25 2a4d0: 80 6a ori r24, 0xA0 ; 160 2a4d2: 86 95 lsr r24 2a4d4: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2a4d6: 90 fd sbrc r25, 0 2a4d8: 03 c0 rjmp .+6 ; 0x2a4e0 2a4da: 81 e0 ldi r24, 0x01 ; 1 2a4dc: 96 30 cpi r25, 0x06 ; 6 2a4de: 09 f4 brne .+2 ; 0x2a4e2 2a4e0: 80 e0 ldi r24, 0x00 ; 0 2a4e2: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 2a4e4: 9f b7 in r25, 0x3f ; 63 2a4e6: f8 94 cli 2a4e8: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a4ec: 8f 7b andi r24, 0xBF ; 191 2a4ee: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 2a4f2: 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); 2a4f4: 8c e2 ldi r24, 0x2C ; 44 2a4f6: 91 e0 ldi r25, 0x01 ; 1 2a4f8: 0f 94 cf 74 call 0x2e99e ; 0x2e99e // send command spiSend(cmd | 0x40); 2a4fc: 8c 2f mov r24, r28 2a4fe: 80 64 ori r24, 0x40 ; 64 2a500: 0f 94 4c 52 call 0x2a498 ; 0x2a498 2a504: 08 e1 ldi r16, 0x18 ; 24 2a506: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 2a508: d5 01 movw r26, r10 2a50a: c4 01 movw r24, r8 2a50c: 00 2e mov r0, r16 2a50e: 04 c0 rjmp .+8 ; 0x2a518 2a510: b6 95 lsr r27 2a512: a7 95 ror r26 2a514: 97 95 ror r25 2a516: 87 95 ror r24 2a518: 0a 94 dec r0 2a51a: d2 f7 brpl .-12 ; 0x2a510 2a51c: 0f 94 4c 52 call 0x2a498 ; 0x2a498 2a520: 08 50 subi r16, 0x08 ; 8 2a522: 11 09 sbc r17, r1 2a524: 08 3f cpi r16, 0xF8 ; 248 2a526: ff ef ldi r31, 0xFF ; 255 2a528: 1f 07 cpc r17, r31 2a52a: 71 f7 brne .-36 ; 0x2a508 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 2a52c: 85 e9 ldi r24, 0x95 ; 149 2a52e: cc 23 and r28, r28 2a530: 21 f0 breq .+8 ; 0x2a53a if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 2a532: 87 e8 ldi r24, 0x87 ; 135 2a534: c8 30 cpi r28, 0x08 ; 8 2a536: 09 f0 breq .+2 ; 0x2a53a // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a538: 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); 2a53a: 0f 94 4c 52 call 0x2a498 ; 0x2a498 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 2a53e: cc 30 cpi r28, 0x0C ; 12 2a540: 11 f4 brne .+4 ; 0x2a546 2a542: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 2a546: 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 */ } 2a548: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a54c: f7 01 movw r30, r14 2a54e: 82 83 std Z+2, r24 ; 0x02 2a550: 87 ff sbrs r24, 7 2a552: 04 c0 rjmp .+8 ; 0x2a55c 2a554: cf 3f cpi r28, 0xFF ; 255 2a556: 11 f0 breq .+4 ; 0x2a55c 2a558: cf 5f subi r28, 0xFF ; 255 2a55a: f6 cf rjmp .-20 ; 0x2a548 return status_; } 2a55c: cf 91 pop r28 2a55e: 1f 91 pop r17 2a560: 0f 91 pop r16 2a562: ff 90 pop r15 2a564: ef 90 pop r14 2a566: bf 90 pop r11 2a568: af 90 pop r10 2a56a: 9f 90 pop r9 2a56c: 8f 90 pop r8 2a56e: 08 95 ret 0002a570 : * \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) { 2a570: 0f 93 push r16 2a572: 1f 93 push r17 2a574: cf 93 push r28 2a576: df 93 push r29 2a578: ec 01 movw r28, r24 2a57a: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 2a57c: 8b 81 ldd r24, Y+3 ; 0x03 2a57e: 83 30 cpi r24, 0x03 ; 3 2a580: 39 f0 breq .+14 ; 0x2a590 2a582: 89 e0 ldi r24, 0x09 ; 9 2a584: 44 0f add r20, r20 2a586: 55 1f adc r21, r21 2a588: 66 1f adc r22, r22 2a58a: 77 1f adc r23, r23 2a58c: 8a 95 dec r24 2a58e: d1 f7 brne .-12 ; 0x2a584 if (cardCommand(CMD24, blockNumber)) { 2a590: 9a 01 movw r18, r20 2a592: ab 01 movw r20, r22 2a594: 68 e1 ldi r22, 0x18 ; 24 2a596: ce 01 movw r24, r28 2a598: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 2a59c: 88 23 and r24, r24 2a59e: 19 f0 breq .+6 ; 0x2a5a6 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2a5a0: 86 e0 ldi r24, 0x06 ; 6 2a5a2: 88 83 st Y, r24 2a5a4: 39 c0 rjmp .+114 ; 0x2a618 } //------------------------------------------------------------------------------ /** 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; 2a5a6: 8e ef ldi r24, 0xFE ; 254 2a5a8: 8e bd out 0x2e, r24 ; 46 2a5aa: f8 01 movw r30, r16 2a5ac: c8 01 movw r24, r16 2a5ae: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a5b0: 0d b4 in r0, 0x2d ; 45 2a5b2: 07 fe sbrs r0, 7 2a5b4: fd cf rjmp .-6 ; 0x2a5b0 SPDR = buf[i]; 2a5b6: 20 81 ld r18, Z 2a5b8: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a5ba: 0d b4 in r0, 0x2d ; 45 2a5bc: 07 fe sbrs r0, 7 2a5be: fd cf rjmp .-6 ; 0x2a5ba SPDR = buf[i + 1]; 2a5c0: 21 81 ldd r18, Z+1 ; 0x01 2a5c2: 2e bd out 0x2e, r18 ; 46 2a5c4: 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) { 2a5c6: e8 17 cp r30, r24 2a5c8: f9 07 cpc r31, r25 2a5ca: 91 f7 brne .-28 ; 0x2a5b0 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 */ } 2a5cc: 0d b4 in r0, 0x2d ; 45 2a5ce: 07 fe sbrs r0, 7 2a5d0: fd cf rjmp .-6 ; 0x2a5cc //------------------------------------------------------------------------------ // 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 2a5d2: 8f ef ldi r24, 0xFF ; 255 2a5d4: 0f 94 4c 52 call 0x2a498 ; 0x2a498 spiSend(0xff); // dummy crc 2a5d8: 8f ef ldi r24, 0xFF ; 255 2a5da: 0f 94 4c 52 call 0x2a498 ; 0x2a498 status_ = spiRec(); 2a5de: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a5e2: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 2a5e4: 8f 71 andi r24, 0x1F ; 31 2a5e6: 85 30 cpi r24, 0x05 ; 5 2a5e8: 99 f4 brne .+38 ; 0x2a610 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 2a5ea: 88 e5 ldi r24, 0x58 ; 88 2a5ec: 92 e0 ldi r25, 0x02 ; 2 2a5ee: 0f 94 cf 74 call 0x2e99e ; 0x2e99e 2a5f2: 18 2f mov r17, r24 2a5f4: 87 e1 ldi r24, 0x17 ; 23 2a5f6: 11 23 and r17, r17 2a5f8: a1 f2 breq .-88 ; 0x2a5a2 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 2a5fa: 20 e0 ldi r18, 0x00 ; 0 2a5fc: 30 e0 ldi r19, 0x00 ; 0 2a5fe: a9 01 movw r20, r18 2a600: 6d e0 ldi r22, 0x0D ; 13 2a602: ce 01 movw r24, r28 2a604: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 2a608: 88 23 and r24, r24 2a60a: 51 f0 breq .+20 ; 0x2a620 2a60c: 86 e1 ldi r24, 0x16 ; 22 2a60e: c9 cf rjmp .-110 ; 0x2a5a2 2a610: 83 e1 ldi r24, 0x13 ; 19 2a612: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 2a614: 0f 94 c6 74 call 0x2e98c ; 0x2e98c } chipSelectHigh(); return true; fail: chipSelectHigh(); 2a618: 0f 94 c6 74 call 0x2e98c ; 0x2e98c return false; 2a61c: 10 e0 ldi r17, 0x00 ; 0 2a61e: 06 c0 rjmp .+12 ; 0x2a62c 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()) { 2a620: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a624: 81 11 cpse r24, r1 2a626: f2 cf rjmp .-28 ; 0x2a60c error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 2a628: 0f 94 c6 74 call 0x2e98c ; 0x2e98c return true; fail: chipSelectHigh(); return false; } 2a62c: 81 2f mov r24, r17 2a62e: df 91 pop r29 2a630: cf 91 pop r28 2a632: 1f 91 pop r17 2a634: 0f 91 pop r16 2a636: 08 95 ret 0002a638 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2a638: cf 93 push r28 if (cacheDirty_) { 2a63a: 80 91 99 0e lds r24, 0x0E99 ; 0x800e99 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2a63e: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2a640: 88 23 and r24, r24 2a642: a1 f0 breq .+40 ; 0x2a66c if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2a644: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2a648: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2a64c: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2a650: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2a654: 2d e9 ldi r18, 0x9D ; 157 2a656: 3e e0 ldi r19, 0x0E ; 14 2a658: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a65c: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a660: 0f 94 b8 52 call 0x2a570 ; 0x2a570 2a664: c8 2f mov r28, r24 2a666: 81 11 cpse r24, r1 2a668: 04 c0 rjmp .+8 ; 0x2a672 cacheDirty_ = 0; } return true; fail: return false; 2a66a: c0 e0 ldi r28, 0x00 ; 0 } 2a66c: 8c 2f mov r24, r28 2a66e: cf 91 pop r28 2a670: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2a672: 40 91 95 0e lds r20, 0x0E95 ; 0x800e95 2a676: 50 91 96 0e lds r21, 0x0E96 ; 0x800e96 2a67a: 60 91 97 0e lds r22, 0x0E97 ; 0x800e97 2a67e: 70 91 98 0e lds r23, 0x0E98 ; 0x800e98 2a682: 41 15 cp r20, r1 2a684: 51 05 cpc r21, r1 2a686: 61 05 cpc r22, r1 2a688: 71 05 cpc r23, r1 2a68a: 91 f0 breq .+36 ; 0x2a6b0 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2a68c: 2d e9 ldi r18, 0x9D ; 157 2a68e: 3e e0 ldi r19, 0x0E ; 14 2a690: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a694: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a698: 0f 94 b8 52 call 0x2a570 ; 0x2a570 2a69c: 88 23 and r24, r24 2a69e: 29 f3 breq .-54 ; 0x2a66a goto fail; } cacheMirrorBlock_ = 0; 2a6a0: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2a6a4: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2a6a8: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 2a6ac: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 } cacheDirty_ = 0; 2a6b0: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 2a6b4: db cf rjmp .-74 ; 0x2a66c 0002a6b6 : * \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) { 2a6b6: 2f 92 push r2 2a6b8: 3f 92 push r3 2a6ba: 4f 92 push r4 2a6bc: 5f 92 push r5 2a6be: 6f 92 push r6 2a6c0: 7f 92 push r7 2a6c2: 8f 92 push r8 2a6c4: 9f 92 push r9 2a6c6: af 92 push r10 2a6c8: bf 92 push r11 2a6ca: cf 92 push r12 2a6cc: df 92 push r13 2a6ce: ef 92 push r14 2a6d0: ff 92 push r15 2a6d2: 0f 93 push r16 2a6d4: 1f 93 push r17 2a6d6: cf 93 push r28 2a6d8: df 93 push r29 2a6da: ec 01 movw r28, r24 2a6dc: 2a 01 movw r4, r20 2a6de: 3b 01 movw r6, r22 2a6e0: 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; 2a6e2: 8b 81 ldd r24, Y+3 ; 0x03 2a6e4: 83 30 cpi r24, 0x03 ; 3 2a6e6: 39 f0 breq .+14 ; 0x2a6f6 2a6e8: 69 e0 ldi r22, 0x09 ; 9 2a6ea: 44 0c add r4, r4 2a6ec: 55 1c adc r5, r5 2a6ee: 66 1c adc r6, r6 2a6f0: 77 1c adc r7, r7 2a6f2: 6a 95 dec r22 2a6f4: d1 f7 brne .-12 ; 0x2a6ea retry2: 2a6f6: 43 e0 ldi r20, 0x03 ; 3 2a6f8: 94 2e mov r9, r20 2a6fa: 56 01 movw r10, r12 2a6fc: 81 e0 ldi r24, 0x01 ; 1 2a6fe: a8 1a sub r10, r24 2a700: 8e ef ldi r24, 0xFE ; 254 2a702: b8 0a sbc r11, r24 2a704: 16 01 movw r2, r12 2a706: ee ef ldi r30, 0xFE ; 254 2a708: 3e 1a sub r3, r30 2a70a: 54 e0 ldi r21, 0x04 ; 4 2a70c: 85 2e mov r8, r21 retryCnt --; 2a70e: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 2a710: a3 01 movw r20, r6 2a712: 92 01 movw r18, r4 2a714: 61 e1 ldi r22, 0x11 ; 17 2a716: ce 01 movw r24, r28 2a718: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 2a71c: 88 23 and r24, r24 2a71e: 79 f0 breq .+30 ; 0x2a73e 2a720: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 2a722: 99 20 and r9, r9 2a724: 09 f4 brne .+2 ; 0x2a728 2a726: 7a c0 rjmp .+244 ; 0x2a81c if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 2a728: 0f 94 c6 74 call 0x2e98c ; 0x2e98c cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 2a72c: 20 e0 ldi r18, 0x00 ; 0 2a72e: 30 e0 ldi r19, 0x00 ; 0 2a730: a9 01 movw r20, r18 2a732: 6c e0 ldi r22, 0x0C ; 12 2a734: ce 01 movw r24, r28 2a736: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 errorCode_ = 0; 2a73a: 18 82 st Y, r1 2a73c: e8 cf rjmp .-48 ; 0x2a70e #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 2a73e: 0f 94 53 29 call 0x252a6 ; 0x252a6 2a742: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2a744: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a748: 8a 83 std Y+2, r24 ; 0x02 2a74a: 8f 3f cpi r24, 0xFF ; 255 2a74c: 91 f4 brne .+36 ; 0x2a772 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2a74e: 0f 94 53 29 call 0x252a6 ; 0x252a6 2a752: 60 1b sub r22, r16 2a754: 71 0b sbc r23, r17 2a756: 6d 32 cpi r22, 0x2D ; 45 2a758: 71 40 sbci r23, 0x01 ; 1 2a75a: a0 f3 brcs .-24 ; 0x2a744 2a75c: 81 e1 ldi r24, 0x11 ; 17 2a75e: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 2a760: 0f 94 c6 74 call 0x2e98c ; 0x2e98c // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a764: 8c 81 ldd r24, Y+4 ; 0x04 2a766: 88 23 and r24, r24 2a768: e1 f2 breq .-72 ; 0x2a722 spiSend(0XFF); 2a76a: 8f ef ldi r24, 0xFF ; 255 2a76c: 0f 94 4c 52 call 0x2a498 ; 0x2a498 2a770: d8 cf rjmp .-80 ; 0x2a722 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2a772: 8e 3f cpi r24, 0xFE ; 254 2a774: 11 f0 breq .+4 ; 0x2a77a 2a776: 8f e0 ldi r24, 0x0F ; 15 2a778: f2 cf rjmp .-28 ; 0x2a75e //------------------------------------------------------------------------------ /** 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; 2a77a: 8f ef ldi r24, 0xFF ; 255 2a77c: 8e bd out 0x2e, r24 ; 46 2a77e: d6 01 movw r26, r12 2a780: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a782: 0d b4 in r0, 0x2d ; 45 2a784: 07 fe sbrs r0, 7 2a786: fd cf rjmp .-6 ; 0x2a782 buf[i] = SPDR; 2a788: 9e b5 in r25, 0x2e ; 46 2a78a: 91 93 st Z+, r25 SPDR = 0XFF; 2a78c: 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++) { 2a78e: ea 15 cp r30, r10 2a790: fb 05 cpc r31, r11 2a792: b9 f7 brne .-18 ; 0x2a782 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 2a794: 0d b4 in r0, 0x2d ; 45 2a796: 07 fe sbrs r0, 7 2a798: fd cf rjmp .-6 ; 0x2a794 buf[nbyte] = SPDR; 2a79a: 8e b5 in r24, 0x2e ; 46 2a79c: f5 01 movw r30, r10 2a79e: 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; 2a7a0: f1 2c mov r15, r1 2a7a2: 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); 2a7a4: 8d 91 ld r24, X+ 2a7a6: ef 2d mov r30, r15 2a7a8: ff 27 eor r31, r31 2a7aa: e8 27 eor r30, r24 2a7ac: ee 0f add r30, r30 2a7ae: ff 1f adc r31, r31 2a7b0: ec 5a subi r30, 0xAC ; 172 2a7b2: ff 46 sbci r31, 0x6F ; 111 2a7b4: 85 91 lpm r24, Z+ 2a7b6: 94 91 lpm r25, Z 2a7b8: fe 2c mov r15, r14 2a7ba: ee 24 eor r14, r14 2a7bc: e8 26 eor r14, r24 2a7be: 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++) { 2a7c0: 2a 16 cp r2, r26 2a7c2: 3b 06 cpc r3, r27 2a7c4: 79 f7 brne .-34 ; 0x2a7a4 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 2a7c6: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a7ca: 08 2f mov r16, r24 2a7cc: 10 e0 ldi r17, 0x00 ; 0 2a7ce: 10 2f mov r17, r16 2a7d0: 00 27 eor r16, r16 recvCrc |= spiRec(); 2a7d2: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2a7d6: 08 2b or r16, r24 if (calcCrc != recvCrc) 2a7d8: 0e 15 cp r16, r14 2a7da: 1f 05 cpc r17, r15 2a7dc: 19 f0 breq .+6 ; 0x2a7e4 2a7de: f0 e2 ldi r31, 0x20 ; 32 2a7e0: f8 83 st Y, r31 2a7e2: be cf rjmp .-132 ; 0x2a760 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 2a7e4: 0f 94 c6 74 call 0x2e98c ; 0x2e98c // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 2a7e8: cc 81 ldd r28, Y+4 ; 0x04 2a7ea: cc 23 and r28, r28 2a7ec: d9 f0 breq .+54 ; 0x2a824 spiSend(0XFF); 2a7ee: 8f ef ldi r24, 0xFF ; 255 2a7f0: 0f 94 4c 52 call 0x2a498 ; 0x2a498 #endif fail: chipSelectHigh(); return false; } 2a7f4: 8c 2f mov r24, r28 2a7f6: df 91 pop r29 2a7f8: cf 91 pop r28 2a7fa: 1f 91 pop r17 2a7fc: 0f 91 pop r16 2a7fe: ff 90 pop r15 2a800: ef 90 pop r14 2a802: df 90 pop r13 2a804: cf 90 pop r12 2a806: bf 90 pop r11 2a808: af 90 pop r10 2a80a: 9f 90 pop r9 2a80c: 8f 90 pop r8 2a80e: 7f 90 pop r7 2a810: 6f 90 pop r6 2a812: 5f 90 pop r5 2a814: 4f 90 pop r4 2a816: 3f 90 pop r3 2a818: 2f 90 pop r2 2a81a: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 2a81c: 0f 94 c6 74 call 0x2e98c ; 0x2e98c return false; 2a820: c0 e0 ldi r28, 0x00 ; 0 2a822: e8 cf rjmp .-48 ; 0x2a7f4 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 2a824: c1 e0 ldi r28, 0x01 ; 1 2a826: e6 cf rjmp .-52 ; 0x2a7f4 0002a828 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2a828: cf 92 push r12 2a82a: df 92 push r13 2a82c: ef 92 push r14 2a82e: ff 92 push r15 2a830: cf 93 push r28 2a832: 6b 01 movw r12, r22 2a834: 7c 01 movw r14, r24 2a836: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2a838: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 2a83c: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 2a840: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 2a844: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 2a848: 8c 15 cp r24, r12 2a84a: 9d 05 cpc r25, r13 2a84c: ae 05 cpc r26, r14 2a84e: bf 05 cpc r27, r15 2a850: 01 f1 breq .+64 ; 0x2a892 if (!cacheFlush()) goto fail; 2a852: 0f 94 1c 53 call 0x2a638 ; 0x2a638 2a856: 81 11 cpse r24, r1 2a858: 08 c0 rjmp .+16 ; 0x2a86a } if (dirty) cacheDirty_ = true; return true; fail: return false; 2a85a: c0 e0 ldi r28, 0x00 ; 0 } 2a85c: 8c 2f mov r24, r28 2a85e: cf 91 pop r28 2a860: ff 90 pop r15 2a862: ef 90 pop r14 2a864: df 90 pop r13 2a866: cf 90 pop r12 2a868: 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; 2a86a: 2d e9 ldi r18, 0x9D ; 157 2a86c: 3e e0 ldi r19, 0x0E ; 14 2a86e: b7 01 movw r22, r14 2a870: a6 01 movw r20, r12 2a872: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2a876: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2a87a: 0f 94 5b 53 call 0x2a6b6 ; 0x2a6b6 2a87e: 88 23 and r24, r24 2a880: 61 f3 breq .-40 ; 0x2a85a cacheBlockNumber_ = blockNumber; 2a882: c0 92 91 0e sts 0x0E91, r12 ; 0x800e91 2a886: d0 92 92 0e sts 0x0E92, r13 ; 0x800e92 2a88a: e0 92 93 0e sts 0x0E93, r14 ; 0x800e93 2a88e: f0 92 94 0e sts 0x0E94, r15 ; 0x800e94 } if (dirty) cacheDirty_ = true; 2a892: cc 23 and r28, r28 2a894: 21 f0 breq .+8 ; 0x2a89e 2a896: 81 e0 ldi r24, 0x01 ; 1 2a898: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 2a89c: df cf rjmp .-66 ; 0x2a85c return true; 2a89e: c1 e0 ldi r28, 0x01 ; 1 2a8a0: dd cf rjmp .-70 ; 0x2a85c 0002a8a2 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2a8a2: 4f 92 push r4 2a8a4: 5f 92 push r5 2a8a6: 6f 92 push r6 2a8a8: 7f 92 push r7 2a8aa: 8f 92 push r8 2a8ac: 9f 92 push r9 2a8ae: af 92 push r10 2a8b0: bf 92 push r11 2a8b2: cf 92 push r12 2a8b4: df 92 push r13 2a8b6: ef 92 push r14 2a8b8: ff 92 push r15 2a8ba: 0f 93 push r16 2a8bc: 1f 93 push r17 2a8be: cf 93 push r28 2a8c0: df 93 push r29 2a8c2: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2a8c4: 42 30 cpi r20, 0x02 ; 2 2a8c6: 51 05 cpc r21, r1 2a8c8: 61 05 cpc r22, r1 2a8ca: 71 05 cpc r23, r1 2a8cc: 90 f4 brcc .+36 ; 0x2a8f2 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2a8ce: 80 e0 ldi r24, 0x00 ; 0 } 2a8d0: df 91 pop r29 2a8d2: cf 91 pop r28 2a8d4: 1f 91 pop r17 2a8d6: 0f 91 pop r16 2a8d8: ff 90 pop r15 2a8da: ef 90 pop r14 2a8dc: df 90 pop r13 2a8de: cf 90 pop r12 2a8e0: bf 90 pop r11 2a8e2: af 90 pop r10 2a8e4: 9f 90 pop r9 2a8e6: 8f 90 pop r8 2a8e8: 7f 90 pop r7 2a8ea: 6f 90 pop r6 2a8ec: 5f 90 pop r5 2a8ee: 4f 90 pop r4 2a8f0: 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; 2a8f2: 89 85 ldd r24, Y+9 ; 0x09 2a8f4: 9a 85 ldd r25, Y+10 ; 0x0a 2a8f6: ab 85 ldd r26, Y+11 ; 0x0b 2a8f8: bc 85 ldd r27, Y+12 ; 0x0c 2a8fa: 01 96 adiw r24, 0x01 ; 1 2a8fc: a1 1d adc r26, r1 2a8fe: b1 1d adc r27, r1 2a900: 84 17 cp r24, r20 2a902: 95 07 cpc r25, r21 2a904: a6 07 cpc r26, r22 2a906: b7 07 cpc r27, r23 2a908: 10 f3 brcs .-60 ; 0x2a8ce tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2a90a: 8f 89 ldd r24, Y+23 ; 0x17 2a90c: 80 31 cpi r24, 0x10 ; 16 2a90e: c9 f5 brne .+114 ; 0x2a982 lba = fatStartBlock_ + (cluster >> 8); 2a910: 85 2e mov r8, r21 2a912: 96 2e mov r9, r22 2a914: a7 2e mov r10, r23 2a916: bb 24 eor r11, r11 2a918: 8b 89 ldd r24, Y+19 ; 0x13 2a91a: 9c 89 ldd r25, Y+20 ; 0x14 2a91c: ad 89 ldd r26, Y+21 ; 0x15 2a91e: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2a920: 88 0e add r8, r24 2a922: 99 1e adc r9, r25 2a924: aa 1e adc r10, r26 2a926: bb 1e adc r11, r27 2a928: 28 01 movw r4, r16 2a92a: 39 01 movw r6, r18 2a92c: 6a 01 movw r12, r20 2a92e: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2a930: 41 e0 ldi r20, 0x01 ; 1 2a932: c5 01 movw r24, r10 2a934: b4 01 movw r22, r8 2a936: 0f 94 14 54 call 0x2a828 ; 0x2a828 2a93a: 88 23 and r24, r24 2a93c: 41 f2 breq .-112 ; 0x2a8ce // store entry if (fatType_ == 16) { 2a93e: 9f 89 ldd r25, Y+23 ; 0x17 2a940: 90 31 cpi r25, 0x10 ; 16 2a942: 81 f5 brne .+96 ; 0x2a9a4 cacheBuffer_.fat16[cluster & 0XFF] = value; 2a944: dd 24 eor r13, r13 2a946: ee 24 eor r14, r14 2a948: ff 24 eor r15, r15 2a94a: f6 01 movw r30, r12 2a94c: ee 0f add r30, r30 2a94e: ff 1f adc r31, r31 2a950: e3 56 subi r30, 0x63 ; 99 2a952: f1 4f sbci r31, 0xF1 ; 241 2a954: 11 83 std Z+1, r17 ; 0x01 2a956: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2a958: 9a 89 ldd r25, Y+18 ; 0x12 2a95a: 92 30 cpi r25, 0x02 ; 2 2a95c: 08 f4 brcc .+2 ; 0x2a960 2a95e: b8 cf rjmp .-144 ; 0x2a8d0 2a960: 4d 81 ldd r20, Y+5 ; 0x05 2a962: 5e 81 ldd r21, Y+6 ; 0x06 2a964: 6f 81 ldd r22, Y+7 ; 0x07 2a966: 78 85 ldd r23, Y+8 ; 0x08 2a968: 84 0e add r8, r20 2a96a: 95 1e adc r9, r21 2a96c: a6 1e adc r10, r22 2a96e: b7 1e adc r11, r23 2a970: 80 92 95 0e sts 0x0E95, r8 ; 0x800e95 2a974: 90 92 96 0e sts 0x0E96, r9 ; 0x800e96 2a978: a0 92 97 0e sts 0x0E97, r10 ; 0x800e97 2a97c: b0 92 98 0e sts 0x0E98, r11 ; 0x800e98 2a980: a7 cf rjmp .-178 ; 0x2a8d0 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2a982: 80 32 cpi r24, 0x20 ; 32 2a984: 09 f0 breq .+2 ; 0x2a988 2a986: a3 cf rjmp .-186 ; 0x2a8ce lba = fatStartBlock_ + (cluster >> 7); 2a988: 8b 89 ldd r24, Y+19 ; 0x13 2a98a: 9c 89 ldd r25, Y+20 ; 0x14 2a98c: ad 89 ldd r26, Y+21 ; 0x15 2a98e: be 89 ldd r27, Y+22 ; 0x16 2a990: 4a 01 movw r8, r20 2a992: 5b 01 movw r10, r22 2a994: e7 e0 ldi r30, 0x07 ; 7 2a996: b6 94 lsr r11 2a998: a7 94 ror r10 2a99a: 97 94 ror r9 2a99c: 87 94 ror r8 2a99e: ea 95 dec r30 2a9a0: d1 f7 brne .-12 ; 0x2a996 2a9a2: be cf rjmp .-132 ; 0x2a920 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2a9a4: e8 94 clt 2a9a6: c7 f8 bld r12, 7 2a9a8: dd 24 eor r13, r13 2a9aa: ee 24 eor r14, r14 2a9ac: ff 24 eor r15, r15 2a9ae: f6 01 movw r30, r12 2a9b0: ee 0f add r30, r30 2a9b2: ff 1f adc r31, r31 2a9b4: ee 0f add r30, r30 2a9b6: ff 1f adc r31, r31 2a9b8: e3 56 subi r30, 0x63 ; 99 2a9ba: f1 4f sbci r31, 0xF1 ; 241 2a9bc: 40 82 st Z, r4 2a9be: 51 82 std Z+1, r5 ; 0x01 2a9c0: 62 82 std Z+2, r6 ; 0x02 2a9c2: 73 82 std Z+3, r7 ; 0x03 2a9c4: c9 cf rjmp .-110 ; 0x2a958 0002a9c6 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2a9c6: cf 92 push r12 2a9c8: df 92 push r13 2a9ca: ef 92 push r14 2a9cc: ff 92 push r15 2a9ce: 0f 93 push r16 2a9d0: 1f 93 push r17 2a9d2: cf 93 push r28 2a9d4: df 93 push r29 2a9d6: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2a9d8: 81 85 ldd r24, Z+9 ; 0x09 2a9da: 92 85 ldd r25, Z+10 ; 0x0a 2a9dc: a3 85 ldd r26, Z+11 ; 0x0b 2a9de: b4 85 ldd r27, Z+12 ; 0x0c 2a9e0: 01 96 adiw r24, 0x01 ; 1 2a9e2: a1 1d adc r26, r1 2a9e4: b1 1d adc r27, r1 2a9e6: 84 17 cp r24, r20 2a9e8: 95 07 cpc r25, r21 2a9ea: a6 07 cpc r26, r22 2a9ec: b7 07 cpc r27, r23 2a9ee: 50 f4 brcc .+20 ; 0x2aa04 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2a9f0: 80 e0 ldi r24, 0x00 ; 0 } 2a9f2: df 91 pop r29 2a9f4: cf 91 pop r28 2a9f6: 1f 91 pop r17 2a9f8: 0f 91 pop r16 2a9fa: ff 90 pop r15 2a9fc: ef 90 pop r14 2a9fe: df 90 pop r13 2aa00: cf 90 pop r12 2aa02: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2aa04: 87 89 ldd r24, Z+23 ; 0x17 2aa06: 80 31 cpi r24, 0x10 ; 16 2aa08: a9 f5 brne .+106 ; 0x2aa74 lba = fatStartBlock_ + (cluster >> 8); 2aa0a: bb 27 eor r27, r27 2aa0c: a7 2f mov r26, r23 2aa0e: 96 2f mov r25, r22 2aa10: 85 2f mov r24, r21 2aa12: c3 88 ldd r12, Z+19 ; 0x13 2aa14: d4 88 ldd r13, Z+20 ; 0x14 2aa16: e5 88 ldd r14, Z+21 ; 0x15 2aa18: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2aa1a: 8c 0d add r24, r12 2aa1c: 9d 1d adc r25, r13 2aa1e: ae 1d adc r26, r14 2aa20: bf 1d adc r27, r15 2aa22: e9 01 movw r28, r18 2aa24: 6a 01 movw r12, r20 2aa26: 7b 01 movw r14, r22 2aa28: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2aa2a: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2aa2e: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2aa32: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2aa36: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2aa3a: 84 17 cp r24, r20 2aa3c: 95 07 cpc r25, r21 2aa3e: a6 07 cpc r26, r22 2aa40: b7 07 cpc r27, r23 2aa42: 49 f5 brne .+82 ; 0x2aa96 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2aa44: f8 01 movw r30, r16 2aa46: 87 89 ldd r24, Z+23 ; 0x17 2aa48: 80 31 cpi r24, 0x10 ; 16 2aa4a: 69 f5 brne .+90 ; 0x2aaa6 *value = cacheBuffer_.fat16[cluster & 0XFF]; 2aa4c: b7 01 movw r22, r14 2aa4e: a6 01 movw r20, r12 2aa50: 55 27 eor r21, r21 2aa52: 66 27 eor r22, r22 2aa54: 77 27 eor r23, r23 2aa56: 44 0f add r20, r20 2aa58: 55 1f adc r21, r21 2aa5a: 43 56 subi r20, 0x63 ; 99 2aa5c: 51 4f sbci r21, 0xF1 ; 241 2aa5e: fa 01 movw r30, r20 2aa60: 80 81 ld r24, Z 2aa62: 91 81 ldd r25, Z+1 ; 0x01 2aa64: b0 e0 ldi r27, 0x00 ; 0 2aa66: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2aa68: 88 83 st Y, r24 2aa6a: 99 83 std Y+1, r25 ; 0x01 2aa6c: aa 83 std Y+2, r26 ; 0x02 2aa6e: bb 83 std Y+3, r27 ; 0x03 2aa70: 81 e0 ldi r24, 0x01 ; 1 2aa72: bf cf rjmp .-130 ; 0x2a9f2 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2aa74: 80 32 cpi r24, 0x20 ; 32 2aa76: 09 f0 breq .+2 ; 0x2aa7a 2aa78: bb cf rjmp .-138 ; 0x2a9f0 lba = fatStartBlock_ + (cluster >> 7); 2aa7a: c3 88 ldd r12, Z+19 ; 0x13 2aa7c: d4 88 ldd r13, Z+20 ; 0x14 2aa7e: e5 88 ldd r14, Z+21 ; 0x15 2aa80: f6 88 ldd r15, Z+22 ; 0x16 2aa82: db 01 movw r26, r22 2aa84: ca 01 movw r24, r20 2aa86: c7 e0 ldi r28, 0x07 ; 7 2aa88: b6 95 lsr r27 2aa8a: a7 95 ror r26 2aa8c: 97 95 ror r25 2aa8e: 87 95 ror r24 2aa90: ca 95 dec r28 2aa92: d1 f7 brne .-12 ; 0x2aa88 2aa94: c2 cf rjmp .-124 ; 0x2aa1a } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2aa96: 40 e0 ldi r20, 0x00 ; 0 2aa98: bc 01 movw r22, r24 2aa9a: cd 01 movw r24, r26 2aa9c: 0f 94 14 54 call 0x2a828 ; 0x2a828 2aaa0: 81 11 cpse r24, r1 2aaa2: d0 cf rjmp .-96 ; 0x2aa44 2aaa4: a5 cf rjmp .-182 ; 0x2a9f0 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2aaa6: b7 01 movw r22, r14 2aaa8: a6 01 movw r20, r12 2aaaa: 4f 77 andi r20, 0x7F ; 127 2aaac: 55 27 eor r21, r21 2aaae: 66 27 eor r22, r22 2aab0: 77 27 eor r23, r23 2aab2: 44 0f add r20, r20 2aab4: 55 1f adc r21, r21 2aab6: 44 0f add r20, r20 2aab8: 55 1f adc r21, r21 2aaba: 43 56 subi r20, 0x63 ; 99 2aabc: 51 4f sbci r21, 0xF1 ; 241 2aabe: fa 01 movw r30, r20 2aac0: 80 81 ld r24, Z 2aac2: 91 81 ldd r25, Z+1 ; 0x01 2aac4: a2 81 ldd r26, Z+2 ; 0x02 2aac6: b3 81 ldd r27, Z+3 ; 0x03 2aac8: bf 70 andi r27, 0x0F ; 15 2aaca: ce cf rjmp .-100 ; 0x2aa68 0002aacc : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2aacc: 4f 92 push r4 2aace: 5f 92 push r5 2aad0: 6f 92 push r6 2aad2: 7f 92 push r7 2aad4: af 92 push r10 2aad6: bf 92 push r11 2aad8: cf 92 push r12 2aada: df 92 push r13 2aadc: ef 92 push r14 2aade: ff 92 push r15 2aae0: 0f 93 push r16 2aae2: 1f 93 push r17 2aae4: cf 93 push r28 2aae6: df 93 push r29 2aae8: 00 d0 rcall .+0 ; 0x2aaea 2aaea: 1f 92 push r1 2aaec: cd b7 in r28, 0x3d ; 61 2aaee: de b7 in r29, 0x3e ; 62 2aaf0: 8c 01 movw r16, r24 2aaf2: 49 83 std Y+1, r20 ; 0x01 2aaf4: 5a 83 std Y+2, r21 ; 0x02 2aaf6: 6b 83 std Y+3, r22 ; 0x03 2aaf8: 7c 83 std Y+4, r23 ; 0x04 2aafa: 59 01 movw r10, r18 uint32_t s = 0; 2aafc: c1 2c mov r12, r1 2aafe: d1 2c mov r13, r1 2ab00: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2ab02: 41 2c mov r4, r1 2ab04: 82 e0 ldi r24, 0x02 ; 2 2ab06: 58 2e mov r5, r24 2ab08: 61 2c mov r6, r1 2ab0a: 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; 2ab0c: 49 81 ldd r20, Y+1 ; 0x01 2ab0e: 5a 81 ldd r21, Y+2 ; 0x02 2ab10: 6b 81 ldd r22, Y+3 ; 0x03 2ab12: 7c 81 ldd r23, Y+4 ; 0x04 2ab14: 9e 01 movw r18, r28 2ab16: 2f 5f subi r18, 0xFF ; 255 2ab18: 3f 4f sbci r19, 0xFF ; 255 2ab1a: c8 01 movw r24, r16 2ab1c: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 2ab20: 88 23 and r24, r24 2ab22: 19 f1 breq .+70 ; 0x2ab6a s += 512UL << clusterSizeShift_; 2ab24: f8 01 movw r30, r16 2ab26: 85 85 ldd r24, Z+13 ; 0x0d 2ab28: a3 01 movw r20, r6 2ab2a: 92 01 movw r18, r4 2ab2c: 04 c0 rjmp .+8 ; 0x2ab36 2ab2e: 22 0f add r18, r18 2ab30: 33 1f adc r19, r19 2ab32: 44 1f adc r20, r20 2ab34: 55 1f adc r21, r21 2ab36: 8a 95 dec r24 2ab38: d2 f7 brpl .-12 ; 0x2ab2e 2ab3a: da 01 movw r26, r20 2ab3c: c9 01 movw r24, r18 2ab3e: c8 0e add r12, r24 2ab40: d9 1e adc r13, r25 2ab42: ea 1e adc r14, r26 2ab44: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2ab46: 49 81 ldd r20, Y+1 ; 0x01 2ab48: 5a 81 ldd r21, Y+2 ; 0x02 2ab4a: 6b 81 ldd r22, Y+3 ; 0x03 2ab4c: 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; 2ab4e: 87 89 ldd r24, Z+23 ; 0x17 2ab50: 80 31 cpi r24, 0x10 ; 16 2ab52: f1 f4 brne .+60 ; 0x2ab90 2ab54: 81 e0 ldi r24, 0x01 ; 1 2ab56: 48 3f cpi r20, 0xF8 ; 248 2ab58: 5f 4f sbci r21, 0xFF ; 255 2ab5a: 61 05 cpc r22, r1 2ab5c: 71 05 cpc r23, r1 2ab5e: b0 f2 brcs .-84 ; 0x2ab0c *size = s; 2ab60: f5 01 movw r30, r10 2ab62: c0 82 st Z, r12 2ab64: d1 82 std Z+1, r13 ; 0x01 2ab66: e2 82 std Z+2, r14 ; 0x02 2ab68: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2ab6a: 0f 90 pop r0 2ab6c: 0f 90 pop r0 2ab6e: 0f 90 pop r0 2ab70: 0f 90 pop r0 2ab72: df 91 pop r29 2ab74: cf 91 pop r28 2ab76: 1f 91 pop r17 2ab78: 0f 91 pop r16 2ab7a: ff 90 pop r15 2ab7c: ef 90 pop r14 2ab7e: df 90 pop r13 2ab80: cf 90 pop r12 2ab82: bf 90 pop r11 2ab84: af 90 pop r10 2ab86: 7f 90 pop r7 2ab88: 6f 90 pop r6 2ab8a: 5f 90 pop r5 2ab8c: 4f 90 pop r4 2ab8e: 08 95 ret return cluster >= FAT32EOC_MIN; 2ab90: 81 e0 ldi r24, 0x01 ; 1 2ab92: 48 3f cpi r20, 0xF8 ; 248 2ab94: 5f 4f sbci r21, 0xFF ; 255 2ab96: 6f 4f sbci r22, 0xFF ; 255 2ab98: 7f 40 sbci r23, 0x0F ; 15 2ab9a: 08 f4 brcc .+2 ; 0x2ab9e 2ab9c: b7 cf rjmp .-146 ; 0x2ab0c 2ab9e: e0 cf rjmp .-64 ; 0x2ab60 0002aba0 : * \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) { 2aba0: 0f 93 push r16 2aba2: 1f 93 push r17 2aba4: cf 93 push r28 2aba6: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 2aba8: fc 01 movw r30, r24 2abaa: 23 81 ldd r18, Z+3 ; 0x03 2abac: 22 23 and r18, r18 2abae: 31 f0 breq .+12 ; 0x2abbc dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 2abb0: 80 e0 ldi r24, 0x00 ; 0 } 2abb2: df 91 pop r29 2abb4: cf 91 pop r28 2abb6: 1f 91 pop r17 2abb8: 0f 91 pop r16 2abba: 08 95 ret 2abbc: 8b 01 movw r16, r22 2abbe: ec 01 movw r28, r24 2abc0: fb 01 movw r30, r22 2abc2: 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)) { 2abc4: 80 31 cpi r24, 0x10 ; 16 2abc6: 39 f5 brne .+78 ; 0x2ac16 type_ = FAT_FILE_TYPE_ROOT_FIXED; 2abc8: 82 e0 ldi r24, 0x02 ; 2 2abca: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 2abcc: 1d 8a std Y+21, r1 ; 0x15 2abce: 1e 8a std Y+22, r1 ; 0x16 2abd0: 1f 8a std Y+23, r1 ; 0x17 2abd2: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 2abd4: 80 8d ldd r24, Z+24 ; 0x18 2abd6: 91 8d ldd r25, Z+25 ; 0x19 2abd8: b0 e0 ldi r27, 0x00 ; 0 2abda: a0 e0 ldi r26, 0x00 ; 0 2abdc: 25 e0 ldi r18, 0x05 ; 5 2abde: 88 0f add r24, r24 2abe0: 99 1f adc r25, r25 2abe2: aa 1f adc r26, r26 2abe4: bb 1f adc r27, r27 2abe6: 2a 95 dec r18 2abe8: d1 f7 brne .-12 ; 0x2abde 2abea: 89 8b std Y+17, r24 ; 0x11 2abec: 9a 8b std Y+18, r25 ; 0x12 2abee: ab 8b std Y+19, r26 ; 0x13 2abf0: 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; 2abf2: 1a 8f std Y+26, r17 ; 0x1a 2abf4: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 2abf6: 81 e0 ldi r24, 0x01 ; 1 2abf8: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2abfa: 1c 82 std Y+4, r1 ; 0x04 2abfc: 1d 82 std Y+5, r1 ; 0x05 2abfe: 1e 82 std Y+6, r1 ; 0x06 2ac00: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ac02: 18 86 std Y+8, r1 ; 0x08 2ac04: 19 86 std Y+9, r1 ; 0x09 2ac06: 1a 86 std Y+10, r1 ; 0x0a 2ac08: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 2ac0a: 1c 86 std Y+12, r1 ; 0x0c 2ac0c: 1d 86 std Y+13, r1 ; 0x0d 2ac0e: 1e 86 std Y+14, r1 ; 0x0e 2ac10: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2ac12: 18 8a std Y+16, r1 ; 0x10 2ac14: ce cf rjmp .-100 ; 0x2abb2 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) { 2ac16: 80 32 cpi r24, 0x20 ; 32 2ac18: 59 f6 brne .-106 ; 0x2abb0 type_ = FAT_FILE_TYPE_ROOT32; 2ac1a: 83 e0 ldi r24, 0x03 ; 3 2ac1c: 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_;} 2ac1e: 42 8d ldd r20, Z+26 ; 0x1a 2ac20: 53 8d ldd r21, Z+27 ; 0x1b 2ac22: 64 8d ldd r22, Z+28 ; 0x1c 2ac24: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 2ac26: 4d 8b std Y+21, r20 ; 0x15 2ac28: 5e 8b std Y+22, r21 ; 0x16 2ac2a: 6f 8b std Y+23, r22 ; 0x17 2ac2c: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2ac2e: 9e 01 movw r18, r28 2ac30: 2f 5e subi r18, 0xEF ; 239 2ac32: 3f 4f sbci r19, 0xFF ; 255 2ac34: c8 01 movw r24, r16 2ac36: 0f 94 66 55 call 0x2aacc ; 0x2aacc 2ac3a: 81 11 cpse r24, r1 2ac3c: da cf rjmp .-76 ; 0x2abf2 2ac3e: b8 cf rjmp .-144 ; 0x2abb0 0002ac40 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2ac40: cf 92 push r12 2ac42: df 92 push r13 2ac44: ef 92 push r14 2ac46: ff 92 push r15 2ac48: 1f 93 push r17 2ac4a: cf 93 push r28 2ac4c: df 93 push r29 2ac4e: ec 01 movw r28, r24 2ac50: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2ac52: e1 11 cpse r30, r1 2ac54: 09 c0 rjmp .+18 ; 0x2ac68 2ac56: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2ac58: df 91 pop r29 2ac5a: cf 91 pop r28 2ac5c: 1f 91 pop r17 2ac5e: ff 90 pop r15 2ac60: ef 90 pop r14 2ac62: df 90 pop r13 2ac64: cf 90 pop r12 2ac66: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2ac68: 89 81 ldd r24, Y+1 ; 0x01 2ac6a: 80 ff sbrs r24, 0 2ac6c: f4 cf rjmp .-24 ; 0x2ac56 gfOffset = curPosition_ & 0X1FF; // offset in block 2ac6e: 48 85 ldd r20, Y+8 ; 0x08 2ac70: 59 85 ldd r21, Y+9 ; 0x09 2ac72: 6a 85 ldd r22, Y+10 ; 0x0a 2ac74: 7b 85 ldd r23, Y+11 ; 0x0b 2ac76: 9a 01 movw r18, r20 2ac78: 31 70 andi r19, 0x01 ; 1 2ac7a: 3a a3 std Y+34, r19 ; 0x22 2ac7c: 29 a3 std Y+33, r18 ; 0x21 2ac7e: 89 8d ldd r24, Y+25 ; 0x19 2ac80: 9a 8d ldd r25, Y+26 ; 0x1a 2ac82: 6a 01 movw r12, r20 2ac84: 7b 01 movw r14, r22 2ac86: f9 e0 ldi r31, 0x09 ; 9 2ac88: f6 94 lsr r15 2ac8a: e7 94 ror r14 2ac8c: d7 94 ror r13 2ac8e: c7 94 ror r12 2ac90: fa 95 dec r31 2ac92: d1 f7 brne .-12 ; 0x2ac88 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2ac94: e2 30 cpi r30, 0x02 ; 2 2ac96: 79 f4 brne .+30 ; 0x2acb6 // 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); 2ac98: fc 01 movw r30, r24 2ac9a: 82 8d ldd r24, Z+26 ; 0x1a 2ac9c: 93 8d ldd r25, Z+27 ; 0x1b 2ac9e: a4 8d ldd r26, Z+28 ; 0x1c 2aca0: b5 8d ldd r27, Z+29 ; 0x1d 2aca2: 8c 0d add r24, r12 2aca4: 9d 1d adc r25, r13 2aca6: ae 1d adc r26, r14 2aca8: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2acaa: 8d 8f std Y+29, r24 ; 0x1d 2acac: 9e 8f std Y+30, r25 ; 0x1e 2acae: af 8f std Y+31, r26 ; 0x1f 2acb0: b8 a3 std Y+32, r27 ; 0x20 } return true; 2acb2: 81 e0 ldi r24, 0x01 ; 1 2acb4: d1 cf rjmp .-94 ; 0x2ac58 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);} 2acb6: fc 01 movw r30, r24 2acb8: 14 81 ldd r17, Z+4 ; 0x04 2acba: 11 50 subi r17, 0x01 ; 1 2acbc: 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) { 2acbe: 23 2b or r18, r19 2acc0: 71 f4 brne .+28 ; 0x2acde 2acc2: 11 11 cpse r17, r1 2acc4: 0c c0 rjmp .+24 ; 0x2acde // start of new cluster if (curPosition_ == 0) { 2acc6: 45 2b or r20, r21 2acc8: 46 2b or r20, r22 2acca: 47 2b or r20, r23 2accc: 31 f5 brne .+76 ; 0x2ad1a // use first cluster in file curCluster_ = firstCluster_; 2acce: 8d 89 ldd r24, Y+21 ; 0x15 2acd0: 9e 89 ldd r25, Y+22 ; 0x16 2acd2: af 89 ldd r26, Y+23 ; 0x17 2acd4: b8 8d ldd r27, Y+24 ; 0x18 2acd6: 8c 83 std Y+4, r24 ; 0x04 2acd8: 9d 83 std Y+5, r25 ; 0x05 2acda: ae 83 std Y+6, r26 ; 0x06 2acdc: 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; 2acde: e9 8d ldd r30, Y+25 ; 0x19 2ace0: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2ace2: 8c 81 ldd r24, Y+4 ; 0x04 2ace4: 9d 81 ldd r25, Y+5 ; 0x05 2ace6: ae 81 ldd r26, Y+6 ; 0x06 2ace8: bf 81 ldd r27, Y+7 ; 0x07 2acea: 02 97 sbiw r24, 0x02 ; 2 2acec: a1 09 sbc r26, r1 2acee: b1 09 sbc r27, r1 2acf0: 25 85 ldd r18, Z+13 ; 0x0d 2acf2: 04 c0 rjmp .+8 ; 0x2acfc 2acf4: 88 0f add r24, r24 2acf6: 99 1f adc r25, r25 2acf8: aa 1f adc r26, r26 2acfa: bb 1f adc r27, r27 2acfc: 2a 95 dec r18 2acfe: d2 f7 brpl .-12 ; 0x2acf4 2ad00: 46 85 ldd r20, Z+14 ; 0x0e 2ad02: 57 85 ldd r21, Z+15 ; 0x0f 2ad04: 60 89 ldd r22, Z+16 ; 0x10 2ad06: 71 89 ldd r23, Z+17 ; 0x11 2ad08: 84 0f add r24, r20 2ad0a: 95 1f adc r25, r21 2ad0c: a6 1f adc r26, r22 2ad0e: b7 1f adc r27, r23 2ad10: 81 0f add r24, r17 2ad12: 91 1d adc r25, r1 2ad14: a1 1d adc r26, r1 2ad16: b1 1d adc r27, r1 2ad18: c8 cf rjmp .-112 ; 0x2acaa if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2ad1a: 4c 81 ldd r20, Y+4 ; 0x04 2ad1c: 5d 81 ldd r21, Y+5 ; 0x05 2ad1e: 6e 81 ldd r22, Y+6 ; 0x06 2ad20: 7f 81 ldd r23, Y+7 ; 0x07 2ad22: 9e 01 movw r18, r28 2ad24: 2c 5f subi r18, 0xFC ; 252 2ad26: 3f 4f sbci r19, 0xFF ; 255 2ad28: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 2ad2c: 81 11 cpse r24, r1 2ad2e: d7 cf rjmp .-82 ; 0x2acde 2ad30: 92 cf rjmp .-220 ; 0x2ac56 0002ad32 : * \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) { 2ad32: 8f 92 push r8 2ad34: 9f 92 push r9 2ad36: af 92 push r10 2ad38: bf 92 push r11 2ad3a: cf 92 push r12 2ad3c: df 92 push r13 2ad3e: ef 92 push r14 2ad40: ff 92 push r15 2ad42: 0f 93 push r16 2ad44: 1f 93 push r17 2ad46: cf 93 push r28 2ad48: df 93 push r29 2ad4a: ec 01 movw r28, r24 2ad4c: 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; 2ad4e: 81 11 cpse r24, r1 2ad50: 0e c0 rjmp .+28 ; 0x2ad6e done: return true; fail: return false; 2ad52: 80 e0 ldi r24, 0x00 ; 0 } 2ad54: df 91 pop r29 2ad56: cf 91 pop r28 2ad58: 1f 91 pop r17 2ad5a: 0f 91 pop r16 2ad5c: ff 90 pop r15 2ad5e: ef 90 pop r14 2ad60: df 90 pop r13 2ad62: cf 90 pop r12 2ad64: bf 90 pop r11 2ad66: af 90 pop r10 2ad68: 9f 90 pop r9 2ad6a: 8f 90 pop r8 2ad6c: 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; 2ad6e: 09 89 ldd r16, Y+17 ; 0x11 2ad70: 1a 89 ldd r17, Y+18 ; 0x12 2ad72: 2b 89 ldd r18, Y+19 ; 0x13 2ad74: 3c 89 ldd r19, Y+20 ; 0x14 2ad76: 04 17 cp r16, r20 2ad78: 15 07 cpc r17, r21 2ad7a: 26 07 cpc r18, r22 2ad7c: 37 07 cpc r19, r23 2ad7e: 48 f3 brcs .-46 ; 0x2ad52 2ad80: 4a 01 movw r8, r20 2ad82: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2ad84: 82 30 cpi r24, 0x02 ; 2 2ad86: 31 f4 brne .+12 ; 0x2ad94 curPosition_ = pos; 2ad88: 88 86 std Y+8, r8 ; 0x08 2ad8a: 99 86 std Y+9, r9 ; 0x09 2ad8c: aa 86 std Y+10, r10 ; 0x0a 2ad8e: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2ad90: 81 e0 ldi r24, 0x01 ; 1 2ad92: e0 cf rjmp .-64 ; 0x2ad54 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2ad94: 81 14 cp r8, r1 2ad96: 91 04 cpc r9, r1 2ad98: a1 04 cpc r10, r1 2ad9a: b1 04 cpc r11, r1 2ad9c: 49 f4 brne .+18 ; 0x2adb0 // set position to start of file curCluster_ = 0; 2ad9e: 1c 82 std Y+4, r1 ; 0x04 2ada0: 1d 82 std Y+5, r1 ; 0x05 2ada2: 1e 82 std Y+6, r1 ; 0x06 2ada4: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ada6: 18 86 std Y+8, r1 ; 0x08 2ada8: 19 86 std Y+9, r1 ; 0x09 2adaa: 1a 86 std Y+10, r1 ; 0x0a 2adac: 1b 86 std Y+11, r1 ; 0x0b 2adae: f0 cf rjmp .-32 ; 0x2ad90 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2adb0: 08 85 ldd r16, Y+8 ; 0x08 2adb2: 19 85 ldd r17, Y+9 ; 0x09 2adb4: 2a 85 ldd r18, Y+10 ; 0x0a 2adb6: 3b 85 ldd r19, Y+11 ; 0x0b 2adb8: e9 8d ldd r30, Y+25 ; 0x19 2adba: fa 8d ldd r31, Y+26 ; 0x1a 2adbc: 85 85 ldd r24, Z+13 ; 0x0d 2adbe: 90 e0 ldi r25, 0x00 ; 0 2adc0: 09 96 adiw r24, 0x09 ; 9 2adc2: b9 01 movw r22, r18 2adc4: a8 01 movw r20, r16 2adc6: 41 50 subi r20, 0x01 ; 1 2adc8: 51 09 sbc r21, r1 2adca: 61 09 sbc r22, r1 2adcc: 71 09 sbc r23, r1 2adce: 08 2e mov r0, r24 2add0: 04 c0 rjmp .+8 ; 0x2adda 2add2: 76 95 lsr r23 2add4: 67 95 ror r22 2add6: 57 95 ror r21 2add8: 47 95 ror r20 2adda: 0a 94 dec r0 2addc: d2 f7 brpl .-12 ; 0x2add2 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2adde: 75 01 movw r14, r10 2ade0: 64 01 movw r12, r8 2ade2: e1 e0 ldi r30, 0x01 ; 1 2ade4: ce 1a sub r12, r30 2ade6: d1 08 sbc r13, r1 2ade8: e1 08 sbc r14, r1 2adea: f1 08 sbc r15, r1 2adec: 04 c0 rjmp .+8 ; 0x2adf6 2adee: f6 94 lsr r15 2adf0: e7 94 ror r14 2adf2: d7 94 ror r13 2adf4: c7 94 ror r12 2adf6: 8a 95 dec r24 2adf8: d2 f7 brpl .-12 ; 0x2adee if (nNew < nCur || curPosition_ == 0) { 2adfa: c4 16 cp r12, r20 2adfc: d5 06 cpc r13, r21 2adfe: e6 06 cpc r14, r22 2ae00: f7 06 cpc r15, r23 2ae02: 20 f0 brcs .+8 ; 0x2ae0c 2ae04: 01 2b or r16, r17 2ae06: 02 2b or r16, r18 2ae08: 03 2b or r16, r19 2ae0a: 11 f5 brne .+68 ; 0x2ae50 // must follow chain from first cluster curCluster_ = firstCluster_; 2ae0c: 8d 89 ldd r24, Y+21 ; 0x15 2ae0e: 9e 89 ldd r25, Y+22 ; 0x16 2ae10: af 89 ldd r26, Y+23 ; 0x17 2ae12: b8 8d ldd r27, Y+24 ; 0x18 2ae14: 8c 83 std Y+4, r24 ; 0x04 2ae16: 9d 83 std Y+5, r25 ; 0x05 2ae18: ae 83 std Y+6, r26 ; 0x06 2ae1a: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ae1c: 8e 01 movw r16, r28 2ae1e: 0c 5f subi r16, 0xFC ; 252 2ae20: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2ae22: c1 14 cp r12, r1 2ae24: d1 04 cpc r13, r1 2ae26: e1 04 cpc r14, r1 2ae28: f1 04 cpc r15, r1 2ae2a: 09 f4 brne .+2 ; 0x2ae2e 2ae2c: ad cf rjmp .-166 ; 0x2ad88 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2ae2e: 4c 81 ldd r20, Y+4 ; 0x04 2ae30: 5d 81 ldd r21, Y+5 ; 0x05 2ae32: 6e 81 ldd r22, Y+6 ; 0x06 2ae34: 7f 81 ldd r23, Y+7 ; 0x07 2ae36: 98 01 movw r18, r16 2ae38: 89 8d ldd r24, Y+25 ; 0x19 2ae3a: 9a 8d ldd r25, Y+26 ; 0x1a 2ae3c: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 2ae40: 91 e0 ldi r25, 0x01 ; 1 2ae42: c9 1a sub r12, r25 2ae44: d1 08 sbc r13, r1 2ae46: e1 08 sbc r14, r1 2ae48: f1 08 sbc r15, r1 2ae4a: 81 11 cpse r24, r1 2ae4c: ea cf rjmp .-44 ; 0x2ae22 2ae4e: 81 cf rjmp .-254 ; 0x2ad52 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2ae50: c4 1a sub r12, r20 2ae52: d5 0a sbc r13, r21 2ae54: e6 0a sbc r14, r22 2ae56: f7 0a sbc r15, r23 2ae58: e1 cf rjmp .-62 ; 0x2ae1c 0002ae5a : 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() { 2ae5a: 3f 92 push r3 2ae5c: 4f 92 push r4 2ae5e: 5f 92 push r5 2ae60: 6f 92 push r6 2ae62: 7f 92 push r7 2ae64: 8f 92 push r8 2ae66: 9f 92 push r9 2ae68: af 92 push r10 2ae6a: bf 92 push r11 2ae6c: cf 92 push r12 2ae6e: df 92 push r13 2ae70: ef 92 push r14 2ae72: ff 92 push r15 2ae74: 0f 93 push r16 2ae76: 1f 93 push r17 2ae78: cf 93 push r28 2ae7a: df 93 push r29 2ae7c: cd b7 in r28, 0x3d ; 61 2ae7e: de b7 in r29, 0x3e ; 62 2ae80: 2c 97 sbiw r28, 0x0c ; 12 2ae82: 0f b6 in r0, 0x3f ; 63 2ae84: f8 94 cli 2ae86: de bf out 0x3e, r29 ; 62 2ae88: 0f be out 0x3f, r0 ; 63 2ae8a: cd bf out 0x3d, r28 ; 61 2ae8c: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2ae8e: dc 01 movw r26, r24 2ae90: 59 96 adiw r26, 0x19 ; 25 2ae92: 8d 90 ld r8, X+ 2ae94: 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; 2ae96: f4 01 movw r30, r8 2ae98: 81 85 ldd r24, Z+9 ; 0x09 2ae9a: 92 85 ldd r25, Z+10 ; 0x0a 2ae9c: a3 85 ldd r26, Z+11 ; 0x0b 2ae9e: b4 85 ldd r27, Z+12 ; 0x0c 2aea0: 9c 01 movw r18, r24 2aea2: ad 01 movw r20, r26 2aea4: 2f 5f subi r18, 0xFF ; 255 2aea6: 3f 4f sbci r19, 0xFF ; 255 2aea8: 4f 4f sbci r20, 0xFF ; 255 2aeaa: 5f 4f sbci r21, 0xFF ; 255 2aeac: 29 87 std Y+9, r18 ; 0x09 2aeae: 3a 87 std Y+10, r19 ; 0x0a 2aeb0: 4b 87 std Y+11, r20 ; 0x0b 2aeb2: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 2aeb4: d5 01 movw r26, r10 2aeb6: 14 96 adiw r26, 0x04 ; 4 2aeb8: 4d 90 ld r4, X+ 2aeba: 5d 90 ld r5, X+ 2aebc: 6d 90 ld r6, X+ 2aebe: 7c 90 ld r7, X 2aec0: 17 97 sbiw r26, 0x07 ; 7 2aec2: 41 14 cp r4, r1 2aec4: 51 04 cpc r5, r1 2aec6: 61 04 cpc r6, r1 2aec8: 71 04 cpc r7, r1 2aeca: 09 f4 brne .+2 ; 0x2aece 2aecc: 59 c0 rjmp .+178 ; 0x2af80 // try to make file contiguous bgnCluster = *curCluster + 1; 2aece: bf ef ldi r27, 0xFF ; 255 2aed0: 4b 1a sub r4, r27 2aed2: 5b 0a sbc r5, r27 2aed4: 6b 0a sbc r6, r27 2aed6: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 2aed8: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 2aeda: 73 01 movw r14, r6 2aedc: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2aede: 1d 82 std Y+5, r1 ; 0x05 2aee0: 1e 82 std Y+6, r1 ; 0x06 2aee2: 1f 82 std Y+7, r1 ; 0x07 2aee4: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 2aee6: f4 01 movw r30, r8 2aee8: 81 85 ldd r24, Z+9 ; 0x09 2aeea: 92 85 ldd r25, Z+10 ; 0x0a 2aeec: a3 85 ldd r26, Z+11 ; 0x0b 2aeee: b4 85 ldd r27, Z+12 ; 0x0c 2aef0: 2d 81 ldd r18, Y+5 ; 0x05 2aef2: 3e 81 ldd r19, Y+6 ; 0x06 2aef4: 4f 81 ldd r20, Y+7 ; 0x07 2aef6: 58 85 ldd r21, Y+8 ; 0x08 2aef8: 28 17 cp r18, r24 2aefa: 39 07 cpc r19, r25 2aefc: 4a 07 cpc r20, r26 2aefe: 5b 07 cpc r21, r27 2af00: 08 f0 brcs .+2 ; 0x2af04 2af02: 56 c0 rjmp .+172 ; 0x2afb0 // past end - start from beginning of FAT if (endCluster > fatEnd) { 2af04: 89 85 ldd r24, Y+9 ; 0x09 2af06: 9a 85 ldd r25, Y+10 ; 0x0a 2af08: ab 85 ldd r26, Y+11 ; 0x0b 2af0a: bc 85 ldd r27, Y+12 ; 0x0c 2af0c: 8c 15 cp r24, r12 2af0e: 9d 05 cpc r25, r13 2af10: ae 05 cpc r26, r14 2af12: bf 05 cpc r27, r15 2af14: 50 f4 brcc .+20 ; 0x2af2a bgnCluster = endCluster = 2; 2af16: 82 e0 ldi r24, 0x02 ; 2 2af18: c8 2e mov r12, r24 2af1a: d1 2c mov r13, r1 2af1c: e1 2c mov r14, r1 2af1e: f1 2c mov r15, r1 2af20: 92 e0 ldi r25, 0x02 ; 2 2af22: 49 2e mov r4, r25 2af24: 51 2c mov r5, r1 2af26: 61 2c mov r6, r1 2af28: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 2af2a: 9e 01 movw r18, r28 2af2c: 2f 5f subi r18, 0xFF ; 255 2af2e: 3f 4f sbci r19, 0xFF ; 255 2af30: b7 01 movw r22, r14 2af32: a6 01 movw r20, r12 2af34: c4 01 movw r24, r8 2af36: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 2af3a: 88 23 and r24, r24 2af3c: c9 f1 breq .+114 ; 0x2afb0 if (f != 0) { 2af3e: 89 81 ldd r24, Y+1 ; 0x01 2af40: 9a 81 ldd r25, Y+2 ; 0x02 2af42: ab 81 ldd r26, Y+3 ; 0x03 2af44: bc 81 ldd r27, Y+4 ; 0x04 2af46: 89 2b or r24, r25 2af48: 8a 2b or r24, r26 2af4a: 8b 2b or r24, r27 2af4c: 01 f1 breq .+64 ; 0x2af8e // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2af4e: 26 01 movw r4, r12 2af50: 37 01 movw r6, r14 2af52: 9f ef ldi r25, 0xFF ; 255 2af54: 49 1a sub r4, r25 2af56: 59 0a sbc r5, r25 2af58: 69 0a sbc r6, r25 2af5a: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 2af5c: 2d 81 ldd r18, Y+5 ; 0x05 2af5e: 3e 81 ldd r19, Y+6 ; 0x06 2af60: 4f 81 ldd r20, Y+7 ; 0x07 2af62: 58 85 ldd r21, Y+8 ; 0x08 2af64: 2f 5f subi r18, 0xFF ; 255 2af66: 3f 4f sbci r19, 0xFF ; 255 2af68: 4f 4f sbci r20, 0xFF ; 255 2af6a: 5f 4f sbci r21, 0xFF ; 255 2af6c: 2d 83 std Y+5, r18 ; 0x05 2af6e: 3e 83 std Y+6, r19 ; 0x06 2af70: 4f 83 std Y+7, r20 ; 0x07 2af72: 58 87 std Y+8, r21 ; 0x08 2af74: 3f ef ldi r19, 0xFF ; 255 2af76: c3 1a sub r12, r19 2af78: d3 0a sbc r13, r19 2af7a: e3 0a sbc r14, r19 2af7c: f3 0a sbc r15, r19 2af7e: b3 cf rjmp .-154 ; 0x2aee6 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2af80: 40 80 ld r4, Z 2af82: 51 80 ldd r5, Z+1 ; 0x01 2af84: 62 80 ldd r6, Z+2 ; 0x02 2af86: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 2af88: 33 24 eor r3, r3 2af8a: 33 94 inc r3 2af8c: a6 cf rjmp .-180 ; 0x2aeda 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) { 2af8e: c4 14 cp r12, r4 2af90: d5 04 cpc r13, r5 2af92: e6 04 cpc r14, r6 2af94: f7 04 cpc r15, r7 2af96: 11 f7 brne .-60 ; 0x2af5c 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); 2af98: 0f ef ldi r16, 0xFF ; 255 2af9a: 1f ef ldi r17, 0xFF ; 255 2af9c: 2f ef ldi r18, 0xFF ; 255 2af9e: 3f e0 ldi r19, 0x0F ; 15 2afa0: b7 01 movw r22, r14 2afa2: a6 01 movw r20, r12 2afa4: c4 01 movw r24, r8 2afa6: 0f 94 51 54 call 0x2a8a2 ; 0x2a8a2 2afaa: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 2afac: 81 11 cpse r24, r1 2afae: 1a c0 rjmp .+52 ; 0x2afe4 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 2afb0: 71 2c mov r7, r1 } 2afb2: 87 2d mov r24, r7 2afb4: 2c 96 adiw r28, 0x0c ; 12 2afb6: 0f b6 in r0, 0x3f ; 63 2afb8: f8 94 cli 2afba: de bf out 0x3e, r29 ; 62 2afbc: 0f be out 0x3f, r0 ; 63 2afbe: cd bf out 0x3d, r28 ; 61 2afc0: df 91 pop r29 2afc2: cf 91 pop r28 2afc4: 1f 91 pop r17 2afc6: 0f 91 pop r16 2afc8: ff 90 pop r15 2afca: ef 90 pop r14 2afcc: df 90 pop r13 2afce: cf 90 pop r12 2afd0: bf 90 pop r11 2afd2: af 90 pop r10 2afd4: 9f 90 pop r9 2afd6: 8f 90 pop r8 2afd8: 7f 90 pop r7 2afda: 6f 90 pop r6 2afdc: 5f 90 pop r5 2afde: 4f 90 pop r4 2afe0: 3f 90 pop r3 2afe2: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 2afe4: f5 01 movw r30, r10 2afe6: 44 81 ldd r20, Z+4 ; 0x04 2afe8: 55 81 ldd r21, Z+5 ; 0x05 2afea: 66 81 ldd r22, Z+6 ; 0x06 2afec: 77 81 ldd r23, Z+7 ; 0x07 2afee: 41 15 cp r20, r1 2aff0: 51 05 cpc r21, r1 2aff2: 61 05 cpc r22, r1 2aff4: 71 05 cpc r23, r1 2aff6: 39 f0 breq .+14 ; 0x2b006 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 2aff8: 97 01 movw r18, r14 2affa: 86 01 movw r16, r12 2affc: c4 01 movw r24, r8 2affe: 0f 94 51 54 call 0x2a8a2 ; 0x2a8a2 2b002: 88 23 and r24, r24 2b004: a9 f2 breq .-86 ; 0x2afb0 } // return first cluster number to caller *curCluster = bgnCluster; 2b006: d5 01 movw r26, r10 2b008: 14 96 adiw r26, 0x04 ; 4 2b00a: cd 92 st X+, r12 2b00c: dd 92 st X+, r13 2b00e: ed 92 st X+, r14 2b010: fc 92 st X, r15 2b012: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 2b014: 33 20 and r3, r3 2b016: 51 f0 breq .+20 ; 0x2b02c 2b018: d7 01 movw r26, r14 2b01a: c6 01 movw r24, r12 2b01c: 01 96 adiw r24, 0x01 ; 1 2b01e: a1 1d adc r26, r1 2b020: b1 1d adc r27, r1 2b022: f4 01 movw r30, r8 2b024: 80 83 st Z, r24 2b026: 91 83 std Z+1, r25 ; 0x01 2b028: a2 83 std Z+2, r26 ; 0x02 2b02a: 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) { 2b02c: f5 01 movw r30, r10 2b02e: 85 89 ldd r24, Z+21 ; 0x15 2b030: 96 89 ldd r25, Z+22 ; 0x16 2b032: a7 89 ldd r26, Z+23 ; 0x17 2b034: b0 8d ldd r27, Z+24 ; 0x18 2b036: 89 2b or r24, r25 2b038: 8a 2b or r24, r26 2b03a: 8b 2b or r24, r27 2b03c: 09 f0 breq .+2 ; 0x2b040 2b03e: b9 cf rjmp .-142 ; 0x2afb2 firstCluster_ = curCluster_; 2b040: c5 8a std Z+21, r12 ; 0x15 2b042: d6 8a std Z+22, r13 ; 0x16 2b044: e7 8a std Z+23, r14 ; 0x17 2b046: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 2b048: 81 81 ldd r24, Z+1 ; 0x01 2b04a: 80 68 ori r24, 0x80 ; 128 2b04c: 81 83 std Z+1, r24 ; 0x01 2b04e: b1 cf rjmp .-158 ; 0x2afb2 0002b050 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2b050: cf 93 push r28 2b052: df 93 push r29 2b054: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 2b056: 46 2f mov r20, r22 2b058: 41 70 andi r20, 0x01 ; 1 2b05a: 6c 85 ldd r22, Y+12 ; 0x0c 2b05c: 7d 85 ldd r23, Y+13 ; 0x0d 2b05e: 8e 85 ldd r24, Y+14 ; 0x0e 2b060: 9f 85 ldd r25, Y+15 ; 0x0f 2b062: 0f 94 14 54 call 0x2a828 ; 0x2a828 2b066: 88 23 and r24, r24 2b068: 51 f0 breq .+20 ; 0x2b07e return vol_->cache()->dir + dirIndex_; 2b06a: 88 89 ldd r24, Y+16 ; 0x10 2b06c: 20 e2 ldi r18, 0x20 ; 32 2b06e: 82 9f mul r24, r18 2b070: c0 01 movw r24, r0 2b072: 11 24 eor r1, r1 2b074: 83 56 subi r24, 0x63 ; 99 2b076: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 2b078: df 91 pop r29 2b07a: cf 91 pop r28 2b07c: 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; 2b07e: 90 e0 ldi r25, 0x00 ; 0 2b080: 80 e0 ldi r24, 0x00 ; 0 2b082: fa cf rjmp .-12 ; 0x2b078 0002b084 : * \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() { 2b084: cf 93 push r28 2b086: df 93 push r29 2b088: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2b08a: 8b 81 ldd r24, Y+3 ; 0x03 2b08c: 88 23 and r24, r24 2b08e: 49 f1 breq .+82 ; 0x2b0e2 if (flags_ & F_FILE_DIR_DIRTY) { 2b090: 89 81 ldd r24, Y+1 ; 0x01 2b092: 87 ff sbrs r24, 7 2b094: 22 c0 rjmp .+68 ; 0x2b0da dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b096: 61 e0 ldi r22, 0x01 ; 1 2b098: ce 01 movw r24, r28 2b09a: 0f 94 28 58 call 0x2b050 ; 0x2b050 2b09e: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2b0a0: 89 2b or r24, r25 2b0a2: f9 f0 breq .+62 ; 0x2b0e2 2b0a4: 80 81 ld r24, Z 2b0a6: 85 3e cpi r24, 0xE5 ; 229 2b0a8: e1 f0 breq .+56 ; 0x2b0e2 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2b0aa: 8b 81 ldd r24, Y+3 ; 0x03 2b0ac: 82 30 cpi r24, 0x02 ; 2 2b0ae: 40 f4 brcc .+16 ; 0x2b0c0 2b0b0: 89 89 ldd r24, Y+17 ; 0x11 2b0b2: 9a 89 ldd r25, Y+18 ; 0x12 2b0b4: ab 89 ldd r26, Y+19 ; 0x13 2b0b6: bc 89 ldd r27, Y+20 ; 0x14 2b0b8: 84 8f std Z+28, r24 ; 0x1c 2b0ba: 95 8f std Z+29, r25 ; 0x1d 2b0bc: a6 8f std Z+30, r26 ; 0x1e 2b0be: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2b0c0: 8d 89 ldd r24, Y+21 ; 0x15 2b0c2: 9e 89 ldd r25, Y+22 ; 0x16 2b0c4: 93 8f std Z+27, r25 ; 0x1b 2b0c6: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2b0c8: 8d 89 ldd r24, Y+21 ; 0x15 2b0ca: 9e 89 ldd r25, Y+22 ; 0x16 2b0cc: af 89 ldd r26, Y+23 ; 0x17 2b0ce: b8 8d ldd r27, Y+24 ; 0x18 2b0d0: b5 8b std Z+21, r27 ; 0x15 2b0d2: 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; 2b0d4: 89 81 ldd r24, Y+1 ; 0x01 2b0d6: 8f 77 andi r24, 0x7F ; 127 2b0d8: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2b0da: df 91 pop r29 2b0dc: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2b0de: 0d 94 1c 53 jmp 0x2a638 ; 0x2a638 fail: writeError = true; 2b0e2: 81 e0 ldi r24, 0x01 ; 1 2b0e4: 88 83 st Y, r24 return false; } 2b0e6: 80 e0 ldi r24, 0x00 ; 0 2b0e8: df 91 pop r29 2b0ea: cf 91 pop r28 2b0ec: 08 95 ret 0002b0ee : * * \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() { 2b0ee: cf 93 push r28 2b0f0: df 93 push r29 2b0f2: ec 01 movw r28, r24 bool rtn = sync(); 2b0f4: 0f 94 42 58 call 0x2b084 ; 0x2b084 type_ = FAT_FILE_TYPE_CLOSED; 2b0f8: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 2b0fa: df 91 pop r29 2b0fc: cf 91 pop r28 2b0fe: 08 95 ret 0002b100 : * \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) { 2b100: cf 93 push r28 2b102: df 93 push r29 2b104: eb 01 movw r28, r22 2b106: fc 01 movw r30, r24 2b108: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 2b10a: 21 11 cpse r18, r1 2b10c: 04 c0 rjmp .+8 ; 0x2b116 2b10e: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2b110: df 91 pop r29 2b112: cf 91 pop r28 2b114: 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; 2b116: 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()) { 2b118: 22 30 cpi r18, 0x02 ; 2 2b11a: 28 f4 brcc .+10 ; 0x2b126 name[0] = '/'; 2b11c: 8f e2 ldi r24, 0x2F ; 47 2b11e: 88 83 st Y, r24 name[1] = '\0'; 2b120: 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; 2b122: 81 e0 ldi r24, 0x01 ; 1 2b124: f5 cf rjmp .-22 ; 0x2b110 name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 2b126: 60 e0 ldi r22, 0x00 ; 0 2b128: 0f 94 28 58 call 0x2b050 ; 0x2b050 if (!p) return false; 2b12c: 00 97 sbiw r24, 0x00 ; 0 2b12e: 79 f3 breq .-34 ; 0x2b10e 2b130: 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; 2b132: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 2b134: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 2b136: 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; 2b138: 2d 91 ld r18, X+ 2b13a: 20 32 cpi r18, 0x20 ; 32 2b13c: 99 f0 breq .+38 ; 0x2b164 if (i == 8) name[j++] = '.'; 2b13e: 88 30 cpi r24, 0x08 ; 8 2b140: 31 f4 brne .+12 ; 0x2b14e 2b142: 9e 01 movw r18, r28 2b144: 26 0f add r18, r22 2b146: 31 1d adc r19, r1 2b148: f9 01 movw r30, r18 2b14a: 90 83 st Z, r25 2b14c: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2b14e: 9e 01 movw r18, r28 2b150: 26 0f add r18, r22 2b152: 31 1d adc r19, r1 2b154: ad 01 movw r20, r26 2b156: 41 50 subi r20, 0x01 ; 1 2b158: 51 09 sbc r21, r1 2b15a: fa 01 movw r30, r20 2b15c: 40 81 ld r20, Z 2b15e: f9 01 movw r30, r18 2b160: 40 83 st Z, r20 2b162: 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++) { 2b164: 8f 5f subi r24, 0xFF ; 255 2b166: 8b 30 cpi r24, 0x0B ; 11 2b168: 39 f7 brne .-50 ; 0x2b138 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 2b16a: fe 01 movw r30, r28 2b16c: e6 0f add r30, r22 2b16e: f1 1d adc r31, r1 2b170: 10 82 st Z, r1 2b172: d7 cf rjmp .-82 ; 0x2b122 0002b174 : * 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) { 2b174: 2f 92 push r2 2b176: 3f 92 push r3 2b178: 4f 92 push r4 2b17a: 5f 92 push r5 2b17c: 6f 92 push r6 2b17e: 7f 92 push r7 2b180: 8f 92 push r8 2b182: 9f 92 push r9 2b184: af 92 push r10 2b186: bf 92 push r11 2b188: cf 92 push r12 2b18a: df 92 push r13 2b18c: ef 92 push r14 2b18e: ff 92 push r15 2b190: 0f 93 push r16 2b192: 1f 93 push r17 2b194: cf 93 push r28 2b196: df 93 push r29 2b198: 00 d0 rcall .+0 ; 0x2b19a 2b19a: 1f 92 push r1 2b19c: cd b7 in r28, 0x3d ; 61 2b19e: de b7 in r29, 0x3e ; 62 2b1a0: 9c 83 std Y+4, r25 ; 0x04 2b1a2: 8b 83 std Y+3, r24 ; 0x03 2b1a4: 4b 01 movw r8, r22 2b1a6: 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; 2b1a8: dc 01 movw r26, r24 2b1aa: 13 96 adiw r26, 0x03 ; 3 2b1ac: 8c 91 ld r24, X 2b1ae: 81 11 cpse r24, r1 2b1b0: 19 c0 rjmp .+50 ; 0x2b1e4 toRead -= n; } return nbyte; fail: return -1; 2b1b2: 8f ef ldi r24, 0xFF ; 255 2b1b4: 9f ef ldi r25, 0xFF ; 255 } 2b1b6: 0f 90 pop r0 2b1b8: 0f 90 pop r0 2b1ba: 0f 90 pop r0 2b1bc: 0f 90 pop r0 2b1be: df 91 pop r29 2b1c0: cf 91 pop r28 2b1c2: 1f 91 pop r17 2b1c4: 0f 91 pop r16 2b1c6: ff 90 pop r15 2b1c8: ef 90 pop r14 2b1ca: df 90 pop r13 2b1cc: cf 90 pop r12 2b1ce: bf 90 pop r11 2b1d0: af 90 pop r10 2b1d2: 9f 90 pop r9 2b1d4: 8f 90 pop r8 2b1d6: 7f 90 pop r7 2b1d8: 6f 90 pop r6 2b1da: 5f 90 pop r5 2b1dc: 4f 90 pop r4 2b1de: 3f 90 pop r3 2b1e0: 2f 90 pop r2 2b1e2: 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; 2b1e4: eb 81 ldd r30, Y+3 ; 0x03 2b1e6: fc 81 ldd r31, Y+4 ; 0x04 2b1e8: 81 81 ldd r24, Z+1 ; 0x01 2b1ea: 80 ff sbrs r24, 0 2b1ec: e2 cf rjmp .-60 ; 0x2b1b2 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 2b1ee: 01 89 ldd r16, Z+17 ; 0x11 2b1f0: 12 89 ldd r17, Z+18 ; 0x12 2b1f2: 23 89 ldd r18, Z+19 ; 0x13 2b1f4: 34 89 ldd r19, Z+20 ; 0x14 2b1f6: 40 85 ldd r20, Z+8 ; 0x08 2b1f8: 51 85 ldd r21, Z+9 ; 0x09 2b1fa: 62 85 ldd r22, Z+10 ; 0x0a 2b1fc: 73 85 ldd r23, Z+11 ; 0x0b 2b1fe: c7 01 movw r24, r14 2b200: b0 e0 ldi r27, 0x00 ; 0 2b202: a0 e0 ldi r26, 0x00 ; 0 2b204: 28 01 movw r4, r16 2b206: 39 01 movw r6, r18 2b208: 44 1a sub r4, r20 2b20a: 55 0a sbc r5, r21 2b20c: 66 0a sbc r6, r22 2b20e: 77 0a sbc r7, r23 2b210: 84 15 cp r24, r4 2b212: 95 05 cpc r25, r5 2b214: a6 05 cpc r26, r6 2b216: b7 05 cpc r27, r7 2b218: 18 f0 brcs .+6 ; 0x2b220 nbyte = fileSize_ - curPosition_; 2b21a: 78 01 movw r14, r16 2b21c: e4 1a sub r14, r20 2b21e: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 2b220: 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; 2b222: 8b 81 ldd r24, Y+3 ; 0x03 2b224: 9c 81 ldd r25, Y+4 ; 0x04 2b226: 04 96 adiw r24, 0x04 ; 4 2b228: 9a 83 std Y+2, r25 ; 0x02 2b22a: 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; 2b22c: 61 2c mov r6, r1 2b22e: 32 e0 ldi r19, 0x02 ; 2 2b230: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 2b232: c1 14 cp r12, r1 2b234: d1 04 cpc r13, r1 2b236: 09 f4 brne .+2 ; 0x2b23a 2b238: b7 c0 rjmp .+366 ; 0x2b3a8 offset = curPosition_ & 0X1FF; // offset in block 2b23a: ab 81 ldd r26, Y+3 ; 0x03 2b23c: bc 81 ldd r27, Y+4 ; 0x04 2b23e: 18 96 adiw r26, 0x08 ; 8 2b240: 4d 91 ld r20, X+ 2b242: 5d 91 ld r21, X+ 2b244: 6d 91 ld r22, X+ 2b246: 7c 91 ld r23, X 2b248: 1b 97 sbiw r26, 0x0b ; 11 2b24a: 5a 01 movw r10, r20 2b24c: b1 e0 ldi r27, 0x01 ; 1 2b24e: bb 22 and r11, r27 2b250: eb 81 ldd r30, Y+3 ; 0x03 2b252: fc 81 ldd r31, Y+4 ; 0x04 2b254: 81 8d ldd r24, Z+25 ; 0x19 2b256: 92 8d ldd r25, Z+26 ; 0x1a 2b258: 1a 01 movw r2, r20 2b25a: 2b 01 movw r4, r22 2b25c: 29 e0 ldi r18, 0x09 ; 9 2b25e: 56 94 lsr r5 2b260: 47 94 ror r4 2b262: 37 94 ror r3 2b264: 27 94 ror r2 2b266: 2a 95 dec r18 2b268: d1 f7 brne .-12 ; 0x2b25e if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2b26a: 23 81 ldd r18, Z+3 ; 0x03 2b26c: 22 30 cpi r18, 0x02 ; 2 2b26e: 91 f5 brne .+100 ; 0x2b2d4 block = vol_->rootDirStart() + (curPosition_ >> 9); 2b270: dc 01 movw r26, r24 2b272: 5a 96 adiw r26, 0x1a ; 26 2b274: 6d 91 ld r22, X+ 2b276: 7d 91 ld r23, X+ 2b278: 8d 91 ld r24, X+ 2b27a: 9c 91 ld r25, X 2b27c: 5d 97 sbiw r26, 0x1d ; 29 2b27e: 62 0d add r22, r2 2b280: 73 1d adc r23, r3 2b282: 84 1d adc r24, r4 2b284: 95 1d adc r25, r5 2b286: 83 01 movw r16, r6 2b288: 0a 19 sub r16, r10 2b28a: 1b 09 sbc r17, r11 2b28c: c0 16 cp r12, r16 2b28e: d1 06 cpc r13, r17 2b290: 08 f4 brcc .+2 ; 0x2b294 2b292: 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()) { 2b294: 01 15 cp r16, r1 2b296: b2 e0 ldi r27, 0x02 ; 2 2b298: 1b 07 cpc r17, r27 2b29a: 71 f4 brne .+28 ; 0x2b2b8 2b29c: 20 91 91 0e lds r18, 0x0E91 ; 0x800e91 2b2a0: 30 91 92 0e lds r19, 0x0E92 ; 0x800e92 2b2a4: 40 91 93 0e lds r20, 0x0E93 ; 0x800e93 2b2a8: 50 91 94 0e lds r21, 0x0E94 ; 0x800e94 2b2ac: 62 17 cp r22, r18 2b2ae: 73 07 cpc r23, r19 2b2b0: 84 07 cpc r24, r20 2b2b2: 95 07 cpc r25, r21 2b2b4: 09 f0 breq .+2 ; 0x2b2b8 2b2b6: 59 c0 rjmp .+178 ; 0x2b36a 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; 2b2b8: 40 e0 ldi r20, 0x00 ; 0 2b2ba: 0f 94 14 54 call 0x2a828 ; 0x2a828 2b2be: 88 23 and r24, r24 2b2c0: 09 f4 brne .+2 ; 0x2b2c4 2b2c2: 77 cf rjmp .-274 ; 0x2b1b2 uint8_t* src = vol_->cache()->data + offset; 2b2c4: b5 01 movw r22, r10 2b2c6: 63 56 subi r22, 0x63 ; 99 2b2c8: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 2b2ca: a8 01 movw r20, r16 2b2cc: c4 01 movw r24, r8 2b2ce: 0f 94 4c e2 call 0x3c498 ; 0x3c498 2b2d2: 57 c0 rjmp .+174 ; 0x2b382 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);} 2b2d4: fc 01 movw r30, r24 2b2d6: 14 81 ldd r17, Z+4 ; 0x04 2b2d8: 11 50 subi r17, 0x01 ; 1 2b2da: 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) { 2b2dc: a1 14 cp r10, r1 2b2de: b1 04 cpc r11, r1 2b2e0: 81 f4 brne .+32 ; 0x2b302 2b2e2: 11 11 cpse r17, r1 2b2e4: 0e c0 rjmp .+28 ; 0x2b302 // start of new cluster if (curPosition_ == 0) { 2b2e6: 45 2b or r20, r21 2b2e8: 46 2b or r20, r22 2b2ea: 47 2b or r20, r23 2b2ec: 79 f5 brne .+94 ; 0x2b34c // use first cluster in file curCluster_ = firstCluster_; 2b2ee: eb 81 ldd r30, Y+3 ; 0x03 2b2f0: fc 81 ldd r31, Y+4 ; 0x04 2b2f2: 85 89 ldd r24, Z+21 ; 0x15 2b2f4: 96 89 ldd r25, Z+22 ; 0x16 2b2f6: a7 89 ldd r26, Z+23 ; 0x17 2b2f8: b0 8d ldd r27, Z+24 ; 0x18 2b2fa: 84 83 std Z+4, r24 ; 0x04 2b2fc: 95 83 std Z+5, r25 ; 0x05 2b2fe: a6 83 std Z+6, r26 ; 0x06 2b300: 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; 2b302: ab 81 ldd r26, Y+3 ; 0x03 2b304: bc 81 ldd r27, Y+4 ; 0x04 2b306: 59 96 adiw r26, 0x19 ; 25 2b308: ed 91 ld r30, X+ 2b30a: fc 91 ld r31, X 2b30c: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2b30e: 14 96 adiw r26, 0x04 ; 4 2b310: 6d 91 ld r22, X+ 2b312: 7d 91 ld r23, X+ 2b314: 8d 91 ld r24, X+ 2b316: 9c 91 ld r25, X 2b318: 17 97 sbiw r26, 0x07 ; 7 2b31a: 62 50 subi r22, 0x02 ; 2 2b31c: 71 09 sbc r23, r1 2b31e: 81 09 sbc r24, r1 2b320: 91 09 sbc r25, r1 2b322: 25 85 ldd r18, Z+13 ; 0x0d 2b324: 04 c0 rjmp .+8 ; 0x2b32e 2b326: 66 0f add r22, r22 2b328: 77 1f adc r23, r23 2b32a: 88 1f adc r24, r24 2b32c: 99 1f adc r25, r25 2b32e: 2a 95 dec r18 2b330: d2 f7 brpl .-12 ; 0x2b326 2b332: 26 85 ldd r18, Z+14 ; 0x0e 2b334: 37 85 ldd r19, Z+15 ; 0x0f 2b336: 40 89 ldd r20, Z+16 ; 0x10 2b338: 51 89 ldd r21, Z+17 ; 0x11 2b33a: 62 0f add r22, r18 2b33c: 73 1f adc r23, r19 2b33e: 84 1f adc r24, r20 2b340: 95 1f adc r25, r21 2b342: 61 0f add r22, r17 2b344: 71 1d adc r23, r1 2b346: 81 1d adc r24, r1 2b348: 91 1d adc r25, r1 2b34a: 9d cf rjmp .-198 ; 0x2b286 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2b34c: ab 81 ldd r26, Y+3 ; 0x03 2b34e: bc 81 ldd r27, Y+4 ; 0x04 2b350: 14 96 adiw r26, 0x04 ; 4 2b352: 4d 91 ld r20, X+ 2b354: 5d 91 ld r21, X+ 2b356: 6d 91 ld r22, X+ 2b358: 7c 91 ld r23, X 2b35a: 17 97 sbiw r26, 0x07 ; 7 2b35c: 29 81 ldd r18, Y+1 ; 0x01 2b35e: 3a 81 ldd r19, Y+2 ; 0x02 2b360: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 2b364: 81 11 cpse r24, r1 2b366: cd cf rjmp .-102 ; 0x2b302 2b368: 24 cf rjmp .-440 ; 0x2b1b2 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);} 2b36a: 94 01 movw r18, r8 2b36c: ab 01 movw r20, r22 2b36e: bc 01 movw r22, r24 2b370: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2b374: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2b378: 0f 94 5b 53 call 0x2a6b6 ; 0x2a6b6 // 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; 2b37c: 88 23 and r24, r24 2b37e: 09 f4 brne .+2 ; 0x2b382 2b380: 18 cf rjmp .-464 ; 0x2b1b2 // 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; 2b382: 80 0e add r8, r16 2b384: 91 1e adc r9, r17 curPosition_ += n; 2b386: eb 81 ldd r30, Y+3 ; 0x03 2b388: fc 81 ldd r31, Y+4 ; 0x04 2b38a: 80 85 ldd r24, Z+8 ; 0x08 2b38c: 91 85 ldd r25, Z+9 ; 0x09 2b38e: a2 85 ldd r26, Z+10 ; 0x0a 2b390: b3 85 ldd r27, Z+11 ; 0x0b 2b392: 80 0f add r24, r16 2b394: 91 1f adc r25, r17 2b396: a1 1d adc r26, r1 2b398: b1 1d adc r27, r1 2b39a: 80 87 std Z+8, r24 ; 0x08 2b39c: 91 87 std Z+9, r25 ; 0x09 2b39e: a2 87 std Z+10, r26 ; 0x0a 2b3a0: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 2b3a2: c0 1a sub r12, r16 2b3a4: d1 0a sbc r13, r17 2b3a6: 45 cf rjmp .-374 ; 0x2b232 } return nbyte; 2b3a8: c7 01 movw r24, r14 2b3aa: 05 cf rjmp .-502 ; 0x2b1b6 0002b3ac : * 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) { 2b3ac: df 92 push r13 2b3ae: ef 92 push r14 2b3b0: ff 92 push r15 2b3b2: 0f 93 push r16 2b3b4: 1f 93 push r17 2b3b6: cf 93 push r28 2b3b8: df 93 push r29 2b3ba: 8c 01 movw r16, r24 2b3bc: eb 01 movw r28, r22 2b3be: 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; 2b3c0: 8d e0 ldi r24, 0x0D ; 13 2b3c2: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2b3c4: 40 e2 ldi r20, 0x20 ; 32 2b3c6: 50 e0 ldi r21, 0x00 ; 0 2b3c8: be 01 movw r22, r28 2b3ca: c8 01 movw r24, r16 2b3cc: 0f 94 ba 58 call 0x2b174 ; 0x2b174 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2b3d0: 80 32 cpi r24, 0x20 ; 32 2b3d2: 91 05 cpc r25, r1 2b3d4: 71 f0 breq .+28 ; 0x2b3f2 2b3d6: 21 e0 ldi r18, 0x01 ; 1 2b3d8: 89 2b or r24, r25 2b3da: 09 f4 brne .+2 ; 0x2b3de 2b3dc: 20 e0 ldi r18, 0x00 ; 0 2b3de: 82 2f mov r24, r18 2b3e0: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2b3e2: df 91 pop r29 2b3e4: cf 91 pop r28 2b3e6: 1f 91 pop r17 2b3e8: 0f 91 pop r16 2b3ea: ff 90 pop r15 2b3ec: ef 90 pop r14 2b3ee: df 90 pop r13 2b3f0: 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; 2b3f2: 28 81 ld r18, Y 2b3f4: 22 23 and r18, r18 2b3f6: 09 f4 brne .+2 ; 0x2b3fa 2b3f8: 3f c0 rjmp .+126 ; 0x2b478 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2b3fa: 25 3e cpi r18, 0xE5 ; 229 2b3fc: 19 f3 breq .-58 ; 0x2b3c4 2b3fe: 2e 32 cpi r18, 0x2E ; 46 2b400: 09 f3 breq .-62 ; 0x2b3c4 //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) 2b402: 3b 85 ldd r19, Y+11 ; 0x0b 2b404: 3f 73 andi r19, 0x3F ; 63 2b406: 3f 30 cpi r19, 0x0F ; 15 2b408: 99 f5 brne .+102 ; 0x2b470 2b40a: e1 14 cp r14, r1 2b40c: f1 04 cpc r15, r1 2b40e: 81 f1 breq .+96 ; 0x2b470 { 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) 2b410: 4a 8d ldd r20, Y+26 ; 0x1a 2b412: 5b 8d ldd r21, Y+27 ; 0x1b 2b414: 45 2b or r20, r21 2b416: 61 f5 brne .+88 ; 0x2b470 2b418: 2f 71 andi r18, 0x1F ; 31 2b41a: 3f ef ldi r19, 0xFF ; 255 2b41c: 32 0f add r19, r18 2b41e: 34 30 cpi r19, 0x04 ; 4 2b420: 38 f5 brcc .+78 ; 0x2b470 { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2b422: 21 50 subi r18, 0x01 ; 1 2b424: 33 0b sbc r19, r19 2b426: d2 9e mul r13, r18 2b428: c0 01 movw r24, r0 2b42a: d3 9e mul r13, r19 2b42c: 90 0d add r25, r0 2b42e: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2b430: f7 01 movw r30, r14 2b432: e8 0f add r30, r24 2b434: f9 1f adc r31, r25 2b436: 29 81 ldd r18, Y+1 ; 0x01 2b438: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2b43a: 2b 81 ldd r18, Y+3 ; 0x03 2b43c: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2b43e: 2d 81 ldd r18, Y+5 ; 0x05 2b440: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2b442: 2f 81 ldd r18, Y+7 ; 0x07 2b444: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2b446: 29 85 ldd r18, Y+9 ; 0x09 2b448: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2b44a: 2e 85 ldd r18, Y+14 ; 0x0e 2b44c: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2b44e: 28 89 ldd r18, Y+16 ; 0x10 2b450: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2b452: 2a 89 ldd r18, Y+18 ; 0x12 2b454: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2b456: 2c 89 ldd r18, Y+20 ; 0x14 2b458: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2b45a: 2e 89 ldd r18, Y+22 ; 0x16 2b45c: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2b45e: 28 8d ldd r18, Y+24 ; 0x18 2b460: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2b462: 2c 8d ldd r18, Y+28 ; 0x1c 2b464: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2b466: 2e 8d ldd r18, Y+30 ; 0x1e 2b468: 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) 2b46a: 28 81 ld r18, Y 2b46c: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2b46e: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2b470: 2b 85 ldd r18, Y+11 ; 0x0b 2b472: 23 fd sbrc r18, 3 2b474: a7 cf rjmp .-178 ; 0x2b3c4 2b476: b5 cf rjmp .-150 ; 0x2b3e2 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; 2b478: 80 e0 ldi r24, 0x00 ; 0 2b47a: b3 cf rjmp .-154 ; 0x2b3e2 0002b47c : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b47c: 4f 92 push r4 2b47e: 5f 92 push r5 2b480: 6f 92 push r6 2b482: 7f 92 push r7 2b484: af 92 push r10 2b486: bf 92 push r11 2b488: cf 92 push r12 2b48a: df 92 push r13 2b48c: ef 92 push r14 2b48e: ff 92 push r15 2b490: 0f 93 push r16 2b492: 1f 93 push r17 2b494: cf 93 push r28 2b496: df 93 push r29 2b498: 1f 92 push r1 2b49a: cd b7 in r28, 0x3d ; 61 2b49c: de b7 in r29, 0x3e ; 62 2b49e: 8c 01 movw r16, r24 2b4a0: 7b 01 movw r14, r22 2b4a2: 5a 01 movw r10, r20 2b4a4: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 2b4a6: db 01 movw r26, r22 2b4a8: 59 96 adiw r26, 0x19 ; 25 2b4aa: 8d 91 ld r24, X+ 2b4ac: 9c 91 ld r25, X 2b4ae: f8 01 movw r30, r16 2b4b0: 92 8f std Z+26, r25 ; 0x1a 2b4b2: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 2b4b4: cb 01 movw r24, r22 2b4b6: 0e 94 33 77 call 0xee66 ; 0xee66 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 2b4ba: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 2b4bc: f7 01 movw r30, r14 2b4be: 80 85 ldd r24, Z+8 ; 0x08 2b4c0: 91 85 ldd r25, Z+9 ; 0x09 2b4c2: a2 85 ldd r26, Z+10 ; 0x0a 2b4c4: b3 85 ldd r27, Z+11 ; 0x0b 2b4c6: 41 89 ldd r20, Z+17 ; 0x11 2b4c8: 52 89 ldd r21, Z+18 ; 0x12 2b4ca: 63 89 ldd r22, Z+19 ; 0x13 2b4cc: 74 89 ldd r23, Z+20 ; 0x14 2b4ce: 84 17 cp r24, r20 2b4d0: 95 07 cpc r25, r21 2b4d2: a6 07 cpc r26, r22 2b4d4: b7 07 cpc r27, r23 2b4d6: 08 f0 brcs .+2 ; 0x2b4da 2b4d8: 52 c0 rjmp .+164 ; 0x2b57e index = 0XF & (dirFile->curPosition_ >> 5); 2b4da: 55 e0 ldi r21, 0x05 ; 5 2b4dc: b6 95 lsr r27 2b4de: a7 95 ror r26 2b4e0: 97 95 ror r25 2b4e2: 87 95 ror r24 2b4e4: 5a 95 dec r21 2b4e6: d1 f7 brne .-12 ; 0x2b4dc 2b4e8: f8 2f mov r31, r24 2b4ea: ff 70 andi r31, 0x0F ; 15 2b4ec: 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; 2b4ee: d7 01 movw r26, r14 2b4f0: 13 96 adiw r26, 0x03 ; 3 2b4f2: 8c 91 ld r24, X 2b4f4: 82 30 cpi r24, 0x02 ; 2 2b4f6: 10 f4 brcc .+4 ; 0x2b4fc if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 2b4f8: 80 e0 ldi r24, 0x00 ; 0 2b4fa: db c0 rjmp .+438 ; 0x2b6b2 * \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; 2b4fc: 41 e0 ldi r20, 0x01 ; 1 2b4fe: 50 e0 ldi r21, 0x00 ; 0 2b500: be 01 movw r22, r28 2b502: 6f 5f subi r22, 0xFF ; 255 2b504: 7f 4f sbci r23, 0xFF ; 255 2b506: c7 01 movw r24, r14 2b508: 0f 94 ba 58 call 0x2b174 ; 0x2b174 2b50c: 01 97 sbiw r24, 0x01 ; 1 2b50e: a1 f7 brne .-24 ; 0x2b4f8 // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 2b510: f7 01 movw r30, r14 2b512: 80 85 ldd r24, Z+8 ; 0x08 2b514: 91 85 ldd r25, Z+9 ; 0x09 2b516: a2 85 ldd r26, Z+10 ; 0x0a 2b518: b3 85 ldd r27, Z+11 ; 0x0b 2b51a: 4f 96 adiw r24, 0x1f ; 31 2b51c: a1 1d adc r26, r1 2b51e: b1 1d adc r27, r1 2b520: 80 87 std Z+8, r24 ; 0x08 2b522: 91 87 std Z+9, r25 ; 0x09 2b524: a2 87 std Z+10, r26 ; 0x0a 2b526: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 2b528: f0 e2 ldi r31, 0x20 ; 32 2b52a: df 9e mul r13, r31 2b52c: b0 01 movw r22, r0 2b52e: 11 24 eor r1, r1 2b530: 63 56 subi r22, 0x63 ; 99 2b532: 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; 2b534: 61 15 cp r22, r1 2b536: 71 05 cpc r23, r1 2b538: f9 f2 breq .-66 ; 0x2b4f8 if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 2b53a: db 01 movw r26, r22 2b53c: 8c 91 ld r24, X 2b53e: 88 23 and r24, r24 2b540: 41 f0 breq .+16 ; 0x2b552 2b542: 85 3e cpi r24, 0xE5 ; 229 2b544: 09 f0 breq .+2 ; 0x2b548 2b546: 4c c0 rjmp .+152 ; 0x2b5e0 // remember first empty slot if (!emptyFound) { 2b548: 77 20 and r7, r7 2b54a: 29 f0 breq .+10 ; 0x2b556 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 2b54c: 77 24 eor r7, r7 2b54e: 73 94 inc r7 2b550: b5 cf rjmp .-150 ; 0x2b4bc 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) { 2b552: 71 10 cpse r7, r1 2b554: 0e c0 rjmp .+28 ; 0x2b572 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 2b556: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 2b55a: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 2b55e: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 2b562: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 2b566: f8 01 movw r30, r16 2b568: 84 87 std Z+12, r24 ; 0x0c 2b56a: 95 87 std Z+13, r25 ; 0x0d 2b56c: a6 87 std Z+14, r26 ; 0x0e 2b56e: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 2b570: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 2b572: db 01 movw r26, r22 2b574: 8c 91 ld r24, X 2b576: 81 11 cpse r24, r1 2b578: e9 cf rjmp .-46 ; 0x2b54c 2b57a: 77 24 eor r7, r7 2b57c: 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; 2b57e: 8c 2d mov r24, r12 2b580: 82 74 andi r24, 0x42 ; 66 2b582: 82 34 cpi r24, 0x42 ; 66 2b584: 09 f0 breq .+2 ; 0x2b588 2b586: b8 cf rjmp .-144 ; 0x2b4f8 if (emptyFound) { 2b588: 77 20 and r7, r7 2b58a: 09 f4 brne .+2 ; 0x2b58e 2b58c: a2 c0 rjmp .+324 ; 0x2b6d2 index = dirIndex_; 2b58e: f8 01 movw r30, r16 2b590: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2b592: 61 e0 ldi r22, 0x01 ; 1 2b594: c8 01 movw r24, r16 2b596: 0f 94 28 58 call 0x2b050 ; 0x2b050 if (!p) goto fail; 2b59a: 00 97 sbiw r24, 0x00 ; 0 2b59c: 09 f4 brne .+2 ; 0x2b5a0 2b59e: ac cf rjmp .-168 ; 0x2b4f8 // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 2b5a0: 20 e2 ldi r18, 0x20 ; 32 2b5a2: dc 01 movw r26, r24 2b5a4: 1d 92 st X+, r1 2b5a6: 2a 95 dec r18 2b5a8: e9 f7 brne .-6 ; 0x2b5a4 memcpy(p->name, dname, 11); 2b5aa: 2b e0 ldi r18, 0x0B ; 11 2b5ac: f5 01 movw r30, r10 2b5ae: dc 01 movw r26, r24 2b5b0: 01 90 ld r0, Z+ 2b5b2: 0d 92 st X+, r0 2b5b4: 2a 95 dec r18 2b5b6: e1 f7 brne .-8 ; 0x2b5b0 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 2b5b8: 21 e2 ldi r18, 0x21 ; 33 2b5ba: 38 e2 ldi r19, 0x28 ; 40 2b5bc: fc 01 movw r30, r24 2b5be: 31 8b std Z+17, r19 ; 0x11 2b5c0: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 2b5c2: 40 e0 ldi r20, 0x00 ; 0 2b5c4: 58 e0 ldi r21, 0x08 ; 8 2b5c6: 57 87 std Z+15, r21 ; 0x0f 2b5c8: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 2b5ca: 33 8b std Z+19, r19 ; 0x13 2b5cc: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 2b5ce: 31 8f std Z+25, r19 ; 0x19 2b5d0: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 2b5d2: 57 8b std Z+23, r21 ; 0x17 2b5d4: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 2b5d6: 0f 94 1c 53 call 0x2a638 ; 0x2a638 2b5da: 81 11 cpse r24, r1 2b5dc: 09 c0 rjmp .+18 ; 0x2b5f0 2b5de: 8c cf rjmp .-232 ; 0x2b4f8 dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 2b5e0: 4b e0 ldi r20, 0x0B ; 11 2b5e2: 50 e0 ldi r21, 0x00 ; 0 2b5e4: c5 01 movw r24, r10 2b5e6: 0f 94 3f e2 call 0x3c47e ; 0x3c47e 2b5ea: 89 2b or r24, r25 2b5ec: 09 f0 breq .+2 ; 0x2b5f0 2b5ee: 66 cf rjmp .-308 ; 0x2b4bc } //------------------------------------------------------------------------------ // 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]; 2b5f0: f0 e2 ldi r31, 0x20 ; 32 2b5f2: df 9e mul r13, r31 2b5f4: d0 01 movw r26, r0 2b5f6: 11 24 eor r1, r1 2b5f8: 9d 01 movw r18, r26 2b5fa: 23 56 subi r18, 0x63 ; 99 2b5fc: 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)) { 2b5fe: f9 01 movw r30, r18 2b600: 83 85 ldd r24, Z+11 ; 0x0b 2b602: 81 71 andi r24, 0x11 ; 17 2b604: 21 f0 breq .+8 ; 0x2b60e if (oflag & (O_WRITE | O_TRUNC)) goto fail; 2b606: 8c 2d mov r24, r12 2b608: 82 71 andi r24, 0x12 ; 18 2b60a: 09 f0 breq .+2 ; 0x2b60e 2b60c: fc c0 rjmp .+504 ; 0x2b806 } //------------------------------------------------------------------------------ // 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]; 2b60e: f8 01 movw r30, r16 2b610: 81 8d ldd r24, Z+25 ; 0x19 2b612: 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(); 2b614: 40 91 91 0e lds r20, 0x0E91 ; 0x800e91 2b618: 50 91 92 0e lds r21, 0x0E92 ; 0x800e92 2b61c: 60 91 93 0e lds r22, 0x0E93 ; 0x800e93 2b620: 70 91 94 0e lds r23, 0x0E94 ; 0x800e94 2b624: 44 87 std Z+12, r20 ; 0x0c 2b626: 55 87 std Z+13, r21 ; 0x0d 2b628: 66 87 std Z+14, r22 ; 0x0e 2b62a: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 2b62c: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 2b62e: fd 01 movw r30, r26 2b630: e3 56 subi r30, 0x63 ; 99 2b632: f1 4f sbci r31, 0xF1 ; 241 2b634: 44 88 ldd r4, Z+20 ; 0x14 2b636: 55 88 ldd r5, Z+21 ; 0x15 2b638: 71 2c mov r7, r1 2b63a: 61 2c mov r6, r1 2b63c: 32 01 movw r6, r4 2b63e: 55 24 eor r5, r5 2b640: 44 24 eor r4, r4 2b642: d8 01 movw r26, r16 2b644: 55 96 adiw r26, 0x15 ; 21 2b646: 4d 92 st X+, r4 2b648: 5d 92 st X+, r5 2b64a: 6d 92 st X+, r6 2b64c: 7c 92 st X, r7 2b64e: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 2b650: 42 8d ldd r20, Z+26 ; 0x1a 2b652: 53 8d ldd r21, Z+27 ; 0x1b 2b654: 70 e0 ldi r23, 0x00 ; 0 2b656: 60 e0 ldi r22, 0x00 ; 0 2b658: 44 29 or r20, r4 2b65a: 55 29 or r21, r5 2b65c: 66 29 or r22, r6 2b65e: 77 29 or r23, r7 2b660: 55 96 adiw r26, 0x15 ; 21 2b662: 4d 93 st X+, r20 2b664: 5d 93 st X+, r21 2b666: 6d 93 st X+, r22 2b668: 7c 93 st X, r23 2b66a: 58 97 sbiw r26, 0x18 ; 24 2b66c: d9 01 movw r26, r18 2b66e: 1b 96 adiw r26, 0x0b ; 11 2b670: 2c 91 ld r18, X 2b672: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 2b674: 09 f0 breq .+2 ; 0x2b678 2b676: b9 c0 rjmp .+370 ; 0x2b7ea fileSize_ = p->fileSize; 2b678: 84 8d ldd r24, Z+28 ; 0x1c 2b67a: 95 8d ldd r25, Z+29 ; 0x1d 2b67c: a6 8d ldd r26, Z+30 ; 0x1e 2b67e: b7 8d ldd r27, Z+31 ; 0x1f 2b680: f8 01 movw r30, r16 2b682: 81 8b std Z+17, r24 ; 0x11 2b684: 92 8b std Z+18, r25 ; 0x12 2b686: a3 8b std Z+19, r26 ; 0x13 2b688: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 2b68a: 81 e0 ldi r24, 0x01 ; 1 2b68c: 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; 2b68e: 8c 2d mov r24, r12 2b690: 8f 70 andi r24, 0x0F ; 15 2b692: f8 01 movw r30, r16 2b694: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 2b696: 14 82 std Z+4, r1 ; 0x04 2b698: 15 82 std Z+5, r1 ; 0x05 2b69a: 16 82 std Z+6, r1 ; 0x06 2b69c: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 2b69e: 10 86 std Z+8, r1 ; 0x08 2b6a0: 11 86 std Z+9, r1 ; 0x09 2b6a2: 12 86 std Z+10, r1 ; 0x0a 2b6a4: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 2b6a6: 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; 2b6a8: c4 fe sbrs r12, 4 2b6aa: 03 c0 rjmp .+6 ; 0x2b6b2 2b6ac: c8 01 movw r24, r16 2b6ae: 0f 94 84 76 call 0x2ed08 ; 0x2ed08 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 2b6b2: 0f 90 pop r0 2b6b4: df 91 pop r29 2b6b6: cf 91 pop r28 2b6b8: 1f 91 pop r17 2b6ba: 0f 91 pop r16 2b6bc: ff 90 pop r15 2b6be: ef 90 pop r14 2b6c0: df 90 pop r13 2b6c2: cf 90 pop r12 2b6c4: bf 90 pop r11 2b6c6: af 90 pop r10 2b6c8: 7f 90 pop r7 2b6ca: 6f 90 pop r6 2b6cc: 5f 90 pop r5 2b6ce: 4f 90 pop r4 2b6d0: 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; 2b6d2: d7 01 movw r26, r14 2b6d4: 13 96 adiw r26, 0x03 ; 3 2b6d6: 8c 91 ld r24, X 2b6d8: 13 97 sbiw r26, 0x03 ; 3 2b6da: 82 30 cpi r24, 0x02 ; 2 2b6dc: 09 f4 brne .+2 ; 0x2b6e0 2b6de: 0c cf rjmp .-488 ; 0x2b4f8 // 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; 2b6e0: 51 96 adiw r26, 0x11 ; 17 2b6e2: 8d 91 ld r24, X+ 2b6e4: 9d 91 ld r25, X+ 2b6e6: 0d 90 ld r0, X+ 2b6e8: bc 91 ld r27, X 2b6ea: a0 2d mov r26, r0 2b6ec: 80 3e cpi r24, 0xE0 ; 224 2b6ee: 9f 4f sbci r25, 0xFF ; 255 2b6f0: af 41 sbci r26, 0x1F ; 31 2b6f2: b1 05 cpc r27, r1 2b6f4: 08 f0 brcs .+2 ; 0x2b6f8 2b6f6: 00 cf rjmp .-512 ; 0x2b4f8 if (!addCluster()) goto fail; 2b6f8: c7 01 movw r24, r14 2b6fa: 0f 94 2d 57 call 0x2ae5a ; 0x2ae5a 2b6fe: 88 23 and r24, r24 2b700: 09 f4 brne .+2 ; 0x2b704 2b702: fa ce rjmp .-524 ; 0x2b4f8 if (!vol_->cacheFlush()) goto fail; 2b704: 0f 94 1c 53 call 0x2a638 ; 0x2a638 2b708: 88 23 and r24, r24 2b70a: 09 f4 brne .+2 ; 0x2b70e 2b70c: f5 ce rjmp .-534 ; 0x2b4f8 block = vol_->clusterStartBlock(curCluster_); 2b70e: d7 01 movw r26, r14 2b710: 59 96 adiw r26, 0x19 ; 25 2b712: ed 91 ld r30, X+ 2b714: fc 91 ld r31, X 2b716: 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_);} 2b718: 14 96 adiw r26, 0x04 ; 4 2b71a: 4d 90 ld r4, X+ 2b71c: 5d 90 ld r5, X+ 2b71e: 6d 90 ld r6, X+ 2b720: 7c 90 ld r7, X 2b722: 17 97 sbiw r26, 0x07 ; 7 2b724: b2 e0 ldi r27, 0x02 ; 2 2b726: 4b 1a sub r4, r27 2b728: 51 08 sbc r5, r1 2b72a: 61 08 sbc r6, r1 2b72c: 71 08 sbc r7, r1 2b72e: 85 85 ldd r24, Z+13 ; 0x0d 2b730: 04 c0 rjmp .+8 ; 0x2b73a 2b732: 44 0c add r4, r4 2b734: 55 1c adc r5, r5 2b736: 66 1c adc r6, r6 2b738: 77 1c adc r7, r7 2b73a: 8a 95 dec r24 2b73c: d2 f7 brpl .-12 ; 0x2b732 2b73e: 86 85 ldd r24, Z+14 ; 0x0e 2b740: 97 85 ldd r25, Z+15 ; 0x0f 2b742: a0 89 ldd r26, Z+16 ; 0x10 2b744: b1 89 ldd r27, Z+17 ; 0x11 2b746: 48 0e add r4, r24 2b748: 59 1e adc r5, r25 2b74a: 6a 1e adc r6, r26 2b74c: 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; 2b74e: 81 e0 ldi r24, 0x01 ; 1 2b750: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 cacheBlockNumber_ = blockNumber; 2b754: 40 92 91 0e sts 0x0E91, r4 ; 0x800e91 2b758: 50 92 92 0e sts 0x0E92, r5 ; 0x800e92 2b75c: 60 92 93 0e sts 0x0E93, r6 ; 0x800e93 2b760: 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); 2b764: ed e9 ldi r30, 0x9D ; 157 2b766: fe e0 ldi r31, 0x0E ; 14 2b768: 80 e0 ldi r24, 0x00 ; 0 2b76a: 92 e0 ldi r25, 0x02 ; 2 2b76c: df 01 movw r26, r30 2b76e: 9c 01 movw r18, r24 2b770: 1d 92 st X+, r1 2b772: 21 50 subi r18, 0x01 ; 1 2b774: 30 40 sbci r19, 0x00 ; 0 2b776: e1 f7 brne .-8 ; 0x2b770 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b778: dd 24 eor r13, r13 2b77a: d3 94 inc r13 2b77c: d7 01 movw r26, r14 2b77e: 59 96 adiw r26, 0x19 ; 25 2b780: ed 91 ld r30, X+ 2b782: fc 91 ld r31, X 2b784: 84 81 ldd r24, Z+4 ; 0x04 2b786: d8 16 cp r13, r24 2b788: 98 f4 brcc .+38 ; 0x2b7b0 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); 2b78a: 2d e9 ldi r18, 0x9D ; 157 2b78c: 3e e0 ldi r19, 0x0E ; 14 2b78e: b3 01 movw r22, r6 2b790: a2 01 movw r20, r4 2b792: 4d 0d add r20, r13 2b794: 51 1d adc r21, r1 2b796: 61 1d adc r22, r1 2b798: 71 1d adc r23, r1 2b79a: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 2b79e: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 2b7a2: 0f 94 b8 52 call 0x2a570 ; 0x2a570 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 2b7a6: 88 23 and r24, r24 2b7a8: 09 f4 brne .+2 ; 0x2b7ac 2b7aa: a6 ce rjmp .-692 ; 0x2b4f8 // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 2b7ac: d3 94 inc r13 2b7ae: e6 cf rjmp .-52 ; 0x2b77c if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 2b7b0: 25 85 ldd r18, Z+13 ; 0x0d 2b7b2: 80 e0 ldi r24, 0x00 ; 0 2b7b4: 92 e0 ldi r25, 0x02 ; 2 2b7b6: a0 e0 ldi r26, 0x00 ; 0 2b7b8: b0 e0 ldi r27, 0x00 ; 0 2b7ba: 04 c0 rjmp .+8 ; 0x2b7c4 2b7bc: 88 0f add r24, r24 2b7be: 99 1f adc r25, r25 2b7c0: aa 1f adc r26, r26 2b7c2: bb 1f adc r27, r27 2b7c4: 2a 95 dec r18 2b7c6: d2 f7 brpl .-12 ; 0x2b7bc 2b7c8: f7 01 movw r30, r14 2b7ca: 41 89 ldd r20, Z+17 ; 0x11 2b7cc: 52 89 ldd r21, Z+18 ; 0x12 2b7ce: 63 89 ldd r22, Z+19 ; 0x13 2b7d0: 74 89 ldd r23, Z+20 ; 0x14 2b7d2: 84 0f add r24, r20 2b7d4: 95 1f adc r25, r21 2b7d6: a6 1f adc r26, r22 2b7d8: b7 1f adc r27, r23 2b7da: 81 8b std Z+17, r24 ; 0x11 2b7dc: 92 8b std Z+18, r25 ; 0x12 2b7de: a3 8b std Z+19, r26 ; 0x13 2b7e0: 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; 2b7e2: 8d e9 ldi r24, 0x9D ; 157 2b7e4: 9e e0 ldi r25, 0x0E ; 14 index = 0; 2b7e6: d1 2c mov r13, r1 2b7e8: db ce rjmp .-586 ; 0x2b5a0 // 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)) { 2b7ea: 20 31 cpi r18, 0x10 ; 16 2b7ec: 61 f4 brne .+24 ; 0x2b806 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 2b7ee: 98 01 movw r18, r16 2b7f0: 2f 5e subi r18, 0xEF ; 239 2b7f2: 3f 4f sbci r19, 0xFF ; 255 2b7f4: 0f 94 66 55 call 0x2aacc ; 0x2aacc 2b7f8: 88 23 and r24, r24 2b7fa: 29 f0 breq .+10 ; 0x2b806 type_ = FAT_FILE_TYPE_SUBDIR; 2b7fc: 84 e0 ldi r24, 0x04 ; 4 2b7fe: d8 01 movw r26, r16 2b800: 13 96 adiw r26, 0x03 ; 3 2b802: 8c 93 st X, r24 2b804: 44 cf rjmp .-376 ; 0x2b68e curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 2b806: d8 01 movw r26, r16 2b808: 13 96 adiw r26, 0x03 ; 3 2b80a: 1c 92 st X, r1 2b80c: 75 ce rjmp .-790 ; 0x2b4f8 0002b80e : // version of uvlo_() which doesn't overwrite the print state already waiting in EEPROM uvlo_tiny(); } } void recover_print(uint8_t automatic) { 2b80e: 4f 92 push r4 2b810: 5f 92 push r5 2b812: 6f 92 push r6 2b814: 7f 92 push r7 2b816: 8f 92 push r8 2b818: 9f 92 push r9 2b81a: af 92 push r10 2b81c: bf 92 push r11 2b81e: cf 92 push r12 2b820: df 92 push r13 2b822: ef 92 push r14 2b824: ff 92 push r15 2b826: 0f 93 push r16 2b828: 1f 93 push r17 2b82a: cf 93 push r28 2b82c: df 93 push r29 2b82e: 1f 92 push r1 2b830: 1f 92 push r1 2b832: cd b7 in r28, 0x3d ; 61 2b834: de b7 in r29, 0x3e ; 62 2b836: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 2b838: 8b e9 ldi r24, 0x9B ; 155 2b83a: 9d e4 ldi r25, 0x4D ; 77 2b83c: 0e 94 b3 72 call 0xe566 ; 0xe566 2b840: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 2b844: 10 92 92 06 sts 0x0692, r1 ; 0x800692 2b848: 10 92 93 06 sts 0x0693, r1 ; 0x800693 2b84c: 10 92 94 06 sts 0x0694, r1 ; 0x800694 2b850: 10 92 95 06 sts 0x0695, r1 ; 0x800695 current_position[Y_AXIS] = 0; 2b854: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2b858: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2b85c: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2b860: 10 92 99 06 sts 0x0699, r1 ; 0x800699 2b864: 9e ea ldi r25, 0xAE ; 174 2b866: e9 2e mov r14, r25 2b868: 9d e0 ldi r25, 0x0D ; 13 2b86a: 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; 2b86c: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 2b86e: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 2b870: 27 e0 ldi r18, 0x07 ; 7 2b872: b2 2e mov r11, r18 2b874: 8c 2d mov r24, r12 2b876: 6b 2d mov r22, r11 2b878: 0f 94 de dc call 0x3b9bc ; 0x3b9bc <__divmodqi4> 2b87c: 08 2f mov r16, r24 2b87e: 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); 2b880: 42 e0 ldi r20, 0x02 ; 2 2b882: 50 e0 ldi r21, 0x00 ; 0 2b884: b7 01 movw r22, r14 2b886: ce 01 movw r24, r28 2b888: 01 96 adiw r24, 0x01 ; 1 2b88a: 0f 94 13 dc call 0x3b826 ; 0x3b826 if (v != 0) 2b88e: 69 81 ldd r22, Y+1 ; 0x01 2b890: 7a 81 ldd r23, Y+2 ; 0x02 2b892: 61 15 cp r22, r1 2b894: 71 05 cpc r23, r1 2b896: 11 f0 breq .+4 ; 0x2b89c mbl_was_active = true; 2b898: dd 24 eor r13, r13 2b89a: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 2b89c: 2b 2d mov r18, r11 2b89e: 02 03 mulsu r16, r18 2b8a0: 80 01 movw r16, r0 2b8a2: 11 24 eor r1, r1 2b8a4: 09 0d add r16, r9 2b8a6: 11 1d adc r17, r1 2b8a8: 97 fc sbrc r9, 7 2b8aa: 1a 95 dec r17 2b8ac: 00 0f add r16, r16 2b8ae: 11 1f adc r17, r17 2b8b0: 00 0f add r16, r16 2b8b2: 11 1f adc r17, r17 2b8b4: 0e 53 subi r16, 0x3E ; 62 2b8b6: 1c 4e sbci r17, 0xEC ; 236 2b8b8: 07 2e mov r0, r23 2b8ba: 00 0c add r0, r0 2b8bc: 88 0b sbc r24, r24 2b8be: 99 0b sbc r25, r25 2b8c0: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2b8c4: 2f e6 ldi r18, 0x6F ; 111 2b8c6: 32 e1 ldi r19, 0x12 ; 18 2b8c8: 43 e8 ldi r20, 0x83 ; 131 2b8ca: 5a e3 ldi r21, 0x3A ; 58 2b8cc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2b8d0: f8 01 movw r30, r16 2b8d2: 61 83 std Z+1, r22 ; 0x01 2b8d4: 72 83 std Z+2, r23 ; 0x02 2b8d6: 83 83 std Z+3, r24 ; 0x03 2b8d8: 94 83 std Z+4, r25 ; 0x04 2b8da: f2 e0 ldi r31, 0x02 ; 2 2b8dc: ef 0e add r14, r31 2b8de: f1 1c adc r15, r1 2b8e0: 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) { 2b8e2: 21 e3 ldi r18, 0x31 ; 49 2b8e4: c2 12 cpse r12, r18 2b8e6: c6 cf rjmp .-116 ; 0x2b874 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)); 2b8e8: 8a ed ldi r24, 0xDA ; 218 2b8ea: 9e e0 ldi r25, 0x0E ; 14 2b8ec: 0f 94 2b dc call 0x3b856 ; 0x3b856 2b8f0: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2b8f4: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2b8f8: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2b8fc: 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)); 2b900: 8e e6 ldi r24, 0x6E ; 110 2b902: 9f e0 ldi r25, 0x0F ; 15 2b904: 0f 94 2b dc call 0x3b856 ; 0x3b856 2b908: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 2b90c: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 2b910: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 2b914: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 2b918: 0f 94 a2 ce call 0x39d44 ; 0x39d44 // 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(); 2b91c: 0f 94 8c c9 call 0x39318 ; 0x39318 // 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); 2b920: 82 e9 ldi r24, 0x92 ; 146 2b922: 96 e0 ldi r25, 0x06 ; 6 2b924: 0e 94 d0 6b call 0xd7a0 ; 0xd7a0 set_destination_to_current(); 2b928: 0e 94 41 68 call 0xd082 ; 0xd082 plan_set_position_curposXYZE(); 2b92c: 0f 94 10 bf call 0x37e20 ; 0x37e20 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 2b930: 81 e4 ldi r24, 0x41 ; 65 2b932: 9f e8 ldi r25, 0x8F ; 143 2b934: 0e 94 57 77 call 0xeeae ; 0xeeae 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]); 2b938: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 2b93c: 8f 93 push r24 2b93e: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2b942: 8f 93 push r24 2b944: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 2b948: 8f 93 push r24 2b94a: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2b94e: 8f 93 push r24 2b950: 80 91 99 06 lds r24, 0x0699 ; 0x800699 2b954: 8f 93 push r24 2b956: 80 91 98 06 lds r24, 0x0698 ; 0x800698 2b95a: 8f 93 push r24 2b95c: 80 91 97 06 lds r24, 0x0697 ; 0x800697 2b960: 8f 93 push r24 2b962: 80 91 96 06 lds r24, 0x0696 ; 0x800696 2b966: 8f 93 push r24 2b968: 80 91 95 06 lds r24, 0x0695 ; 0x800695 2b96c: 8f 93 push r24 2b96e: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2b972: 8f 93 push r24 2b974: 80 91 93 06 lds r24, 0x0693 ; 0x800693 2b978: 8f 93 push r24 2b97a: 80 91 92 06 lds r24, 0x0692 ; 0x800692 2b97e: 8f 93 push r24 2b980: 8f ef ldi r24, 0xFF ; 255 2b982: 9d e6 ldi r25, 0x6D ; 109 2b984: 9f 93 push r25 2b986: 8f 93 push r24 2b988: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 2b98c: 81 e0 ldi r24, 0x01 ; 1 2b98e: 80 93 91 06 sts 0x0691, r24 ; 0x800691 enable_z(); 2b992: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 2b994: 88 ed ldi r24, 0xD8 ; 216 2b996: 9e e0 ldi r25, 0x0E ; 14 2b998: 0f 94 31 dc call 0x3b862 ; 0x3b862 2b99c: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 2b9a0: 80 93 b6 0d sts 0x0DB6, r24 ; 0x800db6 target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 2b9a4: 8b e8 ldi r24, 0x8B ; 139 2b9a6: 9f e0 ldi r25, 0x0F ; 15 2b9a8: 0f 94 23 dc call 0x3b846 ; 0x3b846 2b9ac: 90 e0 ldi r25, 0x00 ; 0 2b9ae: 90 93 73 06 sts 0x0673, r25 ; 0x800673 2b9b2: 80 93 72 06 sts 0x0672, r24 ; 0x800672 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 2b9b6: 88 ee ldi r24, 0xE8 ; 232 2b9b8: 9e e0 ldi r25, 0x0E ; 14 2b9ba: 0f 94 2b dc call 0x3b856 ; 0x3b856 2b9be: 60 93 93 02 sts 0x0293, r22 ; 0x800293 2b9c2: 70 93 94 02 sts 0x0294, r23 ; 0x800294 2b9c6: 80 93 95 02 sts 0x0295, r24 ; 0x800295 2b9ca: 90 93 96 02 sts 0x0296, r25 ; 0x800296 extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 2b9ce: 8e ed ldi r24, 0xDE ; 222 2b9d0: 9e e0 ldi r25, 0x0E ; 14 2b9d2: 0f 94 31 dc call 0x3b862 ; 0x3b862 2b9d6: 90 93 bd 02 sts 0x02BD, r25 ; 0x8002bd 2b9da: 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)); 2b9de: 40 e1 ldi r20, 0x10 ; 16 2b9e0: 50 e0 ldi r21, 0x00 ; 0 2b9e2: 67 e3 ldi r22, 0x37 ; 55 2b9e4: 7d e0 ldi r23, 0x0D ; 13 2b9e6: 83 e8 ldi r24, 0x83 ; 131 2b9e8: 92 e0 ldi r25, 0x02 ; 2 2b9ea: 0f 94 13 dc call 0x3b826 ; 0x3b826 saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 2b9ee: 8c e6 ldi r24, 0x6C ; 108 2b9f0: 9f e0 ldi r25, 0x0F ; 15 2b9f2: 0f 94 31 dc call 0x3b862 ; 0x3b862 2b9f6: 90 93 6a 05 sts 0x056A, r25 ; 0x80056a 2b9fa: 80 93 69 05 sts 0x0569, r24 ; 0x800569 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 2b9fe: 8c e2 ldi r24, 0x2C ; 44 2ba00: 9d e0 ldi r25, 0x0D ; 13 2ba02: 0f 94 2b dc call 0x3b856 ; 0x3b856 2ba06: 60 93 65 05 sts 0x0565, r22 ; 0x800565 2ba0a: 70 93 66 05 sts 0x0566, r23 ; 0x800566 2ba0e: 80 93 67 05 sts 0x0567, r24 ; 0x800567 2ba12: 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); 2ba16: 8d e7 ldi r24, 0x7D ; 125 2ba18: 9c e0 ldi r25, 0x0C ; 12 2ba1a: 0f 94 31 dc call 0x3b862 ; 0x3b862 2ba1e: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2ba22: 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)); 2ba26: 40 e1 ldi r20, 0x10 ; 16 2ba28: 50 e0 ldi r21, 0x00 ; 0 2ba2a: 6d e6 ldi r22, 0x6D ; 109 2ba2c: 7c e0 ldi r23, 0x0C ; 12 2ba2e: 82 ee ldi r24, 0xE2 ; 226 2ba30: 9d e0 ldi r25, 0x0D ; 13 2ba32: 0f 94 13 dc call 0x3b826 ; 0x3b826 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)); 2ba36: 40 e1 ldi r20, 0x10 ; 16 2ba38: 50 e0 ldi r21, 0x00 ; 0 2ba3a: 6d e5 ldi r22, 0x5D ; 93 2ba3c: 7c e0 ldi r23, 0x0C ; 12 2ba3e: 8a e6 ldi r24, 0x6A ; 106 2ba40: 9e e0 ldi r25, 0x0E ; 14 2ba42: 0f 94 13 dc call 0x3b826 ; 0x3b826 eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 2ba46: 40 e1 ldi r20, 0x10 ; 16 2ba48: 50 e0 ldi r21, 0x00 ; 0 2ba4a: 6d e4 ldi r22, 0x4D ; 77 2ba4c: 7c e0 ldi r23, 0x0C ; 12 2ba4e: 82 ed ldi r24, 0xD2 ; 210 2ba50: 9d e0 ldi r25, 0x0D ; 13 2ba52: 0f 94 13 dc call 0x3b826 ; 0x3b826 eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 2ba56: 40 e1 ldi r20, 0x10 ; 16 2ba58: 50 e0 ldi r21, 0x00 ; 0 2ba5a: 6d e3 ldi r22, 0x3D ; 61 2ba5c: 7c e0 ldi r23, 0x0C ; 12 2ba5e: 8a e5 ldi r24, 0x5A ; 90 2ba60: 9e e0 ldi r25, 0x0E ; 14 2ba62: 0f 94 13 dc call 0x3b826 ; 0x3b826 cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 2ba66: 89 e3 ldi r24, 0x39 ; 57 2ba68: 9c e0 ldi r25, 0x0C ; 12 2ba6a: 0f 94 2b dc call 0x3b856 ; 0x3b856 2ba6e: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 2ba72: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 2ba76: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 2ba7a: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 2ba7e: 85 e3 ldi r24, 0x35 ; 53 2ba80: 9c e0 ldi r25, 0x0C ; 12 2ba82: 0f 94 2b dc call 0x3b856 ; 0x3b856 2ba86: 60 93 fe 0d sts 0x0DFE, r22 ; 0x800dfe 2ba8a: 70 93 ff 0d sts 0x0DFF, r23 ; 0x800dff 2ba8e: 80 93 00 0e sts 0x0E00, r24 ; 0x800e00 2ba92: 90 93 01 0e sts 0x0E01, r25 ; 0x800e01 cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 2ba96: 81 e3 ldi r24, 0x31 ; 49 2ba98: 9c e0 ldi r25, 0x0C ; 12 2ba9a: 0f 94 2b dc call 0x3b856 ; 0x3b856 2ba9e: 60 93 02 0e sts 0x0E02, r22 ; 0x800e02 2baa2: 70 93 03 0e sts 0x0E03, r23 ; 0x800e03 2baa6: 80 93 04 0e sts 0x0E04, r24 ; 0x800e04 2baaa: 90 93 05 0e sts 0x0E05, r25 ; 0x800e05 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 2baae: 40 e1 ldi r20, 0x10 ; 16 2bab0: 50 e0 ldi r21, 0x00 ; 0 2bab2: 61 e2 ldi r22, 0x21 ; 33 2bab4: 7c e0 ldi r23, 0x0C ; 12 2bab6: 86 e0 ldi r24, 0x06 ; 6 2bab8: 9e e0 ldi r25, 0x0E ; 14 2baba: 0f 94 13 dc call 0x3b826 ; 0x3b826 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 ) { 2babe: 8f e7 ldi r24, 0x7F ; 127 2bac0: 9c e0 ldi r25, 0x0C ; 12 2bac2: 0f 94 23 dc call 0x3b846 ; 0x3b846 2bac6: 0f b6 in r0, 0x3f ; 63 2bac8: f8 94 cli 2baca: de bf out 0x3e, r29 ; 62 2bacc: 0f be out 0x3f, r0 ; 63 2bace: cd bf out 0x3d, r28 ; 61 2bad0: 81 30 cpi r24, 0x01 ; 1 2bad2: b1 f4 brne .+44 ; 0x2bb00 current_position[Z_AXIS] += Z_PAUSE_LIFT; 2bad4: 20 e0 ldi r18, 0x00 ; 0 2bad6: 30 e0 ldi r19, 0x00 ; 0 2bad8: 40 ea ldi r20, 0xA0 ; 160 2bada: 51 e4 ldi r21, 0x41 ; 65 2badc: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 2bae0: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 2bae4: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bae8: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 2baec: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2baf0: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2baf4: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2baf8: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2bafc: 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) { 2bb00: 8f e7 ldi r24, 0x7F ; 127 2bb02: 9c e0 ldi r25, 0x0C ; 12 2bb04: 0f 94 23 dc call 0x3b846 ; 0x3b846 2bb08: 81 11 cpse r24, r1 2bb0a: 23 c0 rjmp .+70 ; 0x2bb52 enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 2bb0c: 20 e0 ldi r18, 0x00 ; 0 2bb0e: 30 e0 ldi r19, 0x00 ; 0 2bb10: 40 ea ldi r20, 0xA0 ; 160 2bb12: 51 e4 ldi r21, 0x41 ; 65 2bb14: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 2bb18: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 2bb1c: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 2bb20: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 2bb24: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2bb28: 9f 93 push r25 2bb2a: 8f 93 push r24 2bb2c: 7f 93 push r23 2bb2e: 6f 93 push r22 2bb30: 86 e4 ldi r24, 0x46 ; 70 2bb32: 90 e9 ldi r25, 0x90 ; 144 2bb34: 9f 93 push r25 2bb36: 8f 93 push r24 2bb38: 0e 94 bd 88 call 0x1117a ; 0x1117a 2bb3c: 61 e0 ldi r22, 0x01 ; 1 2bb3e: 8f e7 ldi r24, 0x7F ; 127 2bb40: 9c e0 ldi r25, 0x0C ; 12 2bb42: 0f 94 47 dc call 0x3b88e ; 0x3b88e 2bb46: 0f 90 pop r0 2bb48: 0f 90 pop r0 2bb4a: 0f 90 pop r0 2bb4c: 0f 90 pop r0 2bb4e: 0f 90 pop r0 2bb50: 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")); 2bb52: 61 e0 ldi r22, 0x01 ; 1 2bb54: 8e e3 ldi r24, 0x3E ; 62 2bb56: 90 e9 ldi r25, 0x90 ; 144 2bb58: 0e 94 27 88 call 0x1104e ; 0x1104e // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 2bb5c: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 2bb60: 8f 93 push r24 2bb62: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bb66: 8f 93 push r24 2bb68: 85 e3 ldi r24, 0x35 ; 53 2bb6a: 90 e9 ldi r25, 0x90 ; 144 2bb6c: 9f 93 push r25 2bb6e: 8f 93 push r24 2bb70: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 2bb74: 80 91 73 06 lds r24, 0x0673 ; 0x800673 2bb78: 8f 93 push r24 2bb7a: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2bb7e: 8f 93 push r24 2bb80: 8c e2 ldi r24, 0x2C ; 44 2bb82: 90 e9 ldi r25, 0x90 ; 144 2bb84: 9f 93 push r25 2bb86: 8f 93 push r24 2bb88: 0e 94 bd 88 call 0x1117a ; 0x1117a //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) { 2bb8c: 8c e8 ldi r24, 0x8C ; 140 2bb8e: 9f e0 ldi r25, 0x0F ; 15 2bb90: 0f 94 23 dc call 0x3b846 ; 0x3b846 2bb94: 0f b6 in r0, 0x3f ; 63 2bb96: f8 94 cli 2bb98: de bf out 0x3e, r29 ; 62 2bb9a: 0f be out 0x3f, r0 ; 63 2bb9c: cd bf out 0x3d, r28 ; 61 2bb9e: 81 11 cpse r24, r1 2bba0: 10 c0 rjmp .+32 ; 0x2bbc2 enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 2bba2: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 2bba6: 8f 93 push r24 2bba8: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bbac: 8f 93 push r24 2bbae: 83 e2 ldi r24, 0x23 ; 35 2bbb0: 90 e9 ldi r25, 0x90 ; 144 2bbb2: 9f 93 push r25 2bbb4: 8f 93 push r24 2bbb6: 0e 94 bd 88 call 0x1117a ; 0x1117a 2bbba: 0f 90 pop r0 2bbbc: 0f 90 pop r0 2bbbe: 0f 90 pop r0 2bbc0: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 2bbc2: 61 e0 ldi r22, 0x01 ; 1 2bbc4: 80 ee ldi r24, 0xE0 ; 224 2bbc6: 9b e6 ldi r25, 0x6B ; 107 2bbc8: 0e 94 27 88 call 0x1104e ; 0x1104e // If not automatically recoreverd (long power loss) if(automatic == 0){ 2bbcc: a1 10 cpse r10, r1 2bbce: 17 c0 rjmp .+46 ; 0x2bbfe //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 2bbd0: 61 e0 ldi r22, 0x01 ; 1 2bbd2: 88 e1 ldi r24, 0x18 ; 24 2bbd4: 90 e9 ldi r25, 0x90 ; 144 2bbd6: 0e 94 27 88 call 0x1104e ; 0x1104e // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 2bbda: 8f e3 ldi r24, 0x3F ; 63 2bbdc: 8f 93 push r24 2bbde: 80 e8 ldi r24, 0x80 ; 128 2bbe0: 8f 93 push r24 2bbe2: 1f 92 push r1 2bbe4: 1f 92 push r1 2bbe6: 8a e5 ldi r24, 0x5A ; 90 2bbe8: 9e e6 ldi r25, 0x6E ; 110 2bbea: 9f 93 push r25 2bbec: 8f 93 push r24 2bbee: 0e 94 bd 88 call 0x1117a ; 0x1117a 2bbf2: 0f 90 pop r0 2bbf4: 0f 90 pop r0 2bbf6: 0f 90 pop r0 2bbf8: 0f 90 pop r0 2bbfa: 0f 90 pop r0 2bbfc: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 2bbfe: 84 e4 ldi r24, 0x44 ; 68 2bc00: 9e e6 ldi r25, 0x6E ; 110 2bc02: 0f 94 0c db call 0x3b618 ; 0x3b618 gcode_M114(); 2bc06: 0e 94 4e 78 call 0xf09c ; 0xf09c 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); 2bc0a: 88 e8 ldi r24, 0x88 ; 136 2bc0c: 9f e0 ldi r25, 0x0F ; 15 2bc0e: 0f 94 23 dc call 0x3b846 ; 0x3b846 2bc12: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 2bc14: 89 e8 ldi r24, 0x89 ; 137 2bc16: 9f e0 ldi r25, 0x0F ; 15 2bc18: 0f 94 31 dc call 0x3b862 ; 0x3b862 2bc1c: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 2bc1e: 85 e3 ldi r24, 0x35 ; 53 2bc20: 9d e0 ldi r25, 0x0D ; 13 2bc22: 0f 94 31 dc call 0x3b862 ; 0x3b862 2bc26: f8 2e mov r15, r24 2bc28: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 2bc2a: 8e e0 ldi r24, 0x0E ; 14 2bc2c: 90 e9 ldi r25, 0x90 ; 144 2bc2e: 0e 94 57 77 call 0xeeae ; 0xeeae print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2bc32: b8 01 movw r22, r16 2bc34: 01 2e mov r0, r17 2bc36: 00 0c add r0, r0 2bc38: 88 0b sbc r24, r24 2bc3a: 99 0b sbc r25, r25 2bc3c: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 2bc40: 8e ef ldi r24, 0xFE ; 254 2bc42: 9f e8 ldi r25, 0x8F ; 143 2bc44: 0e 94 57 77 call 0xeeae ; 0xeeae MYSERIAL.println(feedmultiply_rec); 2bc48: 8f 2d mov r24, r15 2bc4a: 9e 2d mov r25, r14 2bc4c: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2bc50: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2bc54: 81 11 cpse r24, r1 2bc56: 02 c0 rjmp .+4 ; 0x2bc5c { // M23 restore_file_from_sd(); 2bc58: 0e 94 e2 88 call 0x111c4 ; 0x111c4 } // 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)); 2bc5c: 8d e9 ldi r24, 0x9D ; 157 2bc5e: 9f e0 ldi r25, 0x0F ; 15 2bc60: 0f 94 2b dc call 0x3b856 ; 0x3b856 2bc64: c6 2e mov r12, r22 2bc66: b7 2e mov r11, r23 2bc68: a8 2e mov r10, r24 2bc6a: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 2bc6c: 81 ea ldi r24, 0xA1 ; 161 2bc6e: 9f e0 ldi r25, 0x0F ; 15 2bc70: 0f 94 2b dc call 0x3b856 ; 0x3b856 2bc74: 76 2e mov r7, r22 2bc76: 67 2e mov r6, r23 2bc78: 58 2e mov r5, r24 2bc7a: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 2bc7c: 20 e0 ldi r18, 0x00 ; 0 2bc7e: 30 e0 ldi r19, 0x00 ; 0 2bc80: 40 e8 ldi r20, 0x80 ; 128 2bc82: 5f eb ldi r21, 0xBF ; 191 2bc84: 6c 2d mov r22, r12 2bc86: 7b 2d mov r23, r11 2bc88: 8a 2d mov r24, r10 2bc8a: 99 2d mov r25, r9 2bc8c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2bc90: 88 23 and r24, r24 2bc92: 99 f0 breq .+38 ; 0x2bcba enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 2bc94: 4f 92 push r4 2bc96: 5f 92 push r5 2bc98: 6f 92 push r6 2bc9a: 7f 92 push r7 2bc9c: 9f 92 push r9 2bc9e: af 92 push r10 2bca0: bf 92 push r11 2bca2: cf 92 push r12 2bca4: 87 ee ldi r24, 0xE7 ; 231 2bca6: 9f e8 ldi r25, 0x8F ; 143 2bca8: 9f 93 push r25 2bcaa: 8f 93 push r24 2bcac: 0e 94 bd 88 call 0x1117a ; 0x1117a 2bcb0: 0f b6 in r0, 0x3f ; 63 2bcb2: f8 94 cli 2bcb4: de bf out 0x3e, r29 ; 62 2bcb6: 0f be out 0x3f, r0 ; 63 2bcb8: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 2bcba: dd 20 and r13, r13 2bcbc: 29 f0 breq .+10 ; 0x2bcc8 enquecommand_P(PSTR("PRUSA MBL V1")); 2bcbe: 61 e0 ldi r22, 0x01 ; 1 2bcc0: 8a ed ldi r24, 0xDA ; 218 2bcc2: 9f e8 ldi r25, 0x8F ; 143 2bcc4: 0e 94 27 88 call 0x1104e ; 0x1104e // 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))); 2bcc8: 8d e8 ldi r24, 0x8D ; 141 2bcca: 9f e0 ldi r25, 0x0F ; 15 2bccc: 0f 94 2b dc call 0x3b856 ; 0x3b856 2bcd0: 9f 93 push r25 2bcd2: 8f 93 push r24 2bcd4: 7f 93 push r23 2bcd6: 6f 93 push r22 2bcd8: 80 ed ldi r24, 0xD0 ; 208 2bcda: 9f e8 ldi r25, 0x8F ; 143 2bcdc: 9f 93 push r25 2bcde: 8f 93 push r24 2bce0: 0e 94 bd 88 call 0x1117a ; 0x1117a // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 2bce4: 81 e1 ldi r24, 0x11 ; 17 2bce6: 9d e0 ldi r25, 0x0D ; 13 2bce8: 0f 94 2b dc call 0x3b856 ; 0x3b856 2bcec: d6 2e mov r13, r22 2bcee: c7 2e mov r12, r23 2bcf0: b8 2e mov r11, r24 2bcf2: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 2bcf4: 8d e0 ldi r24, 0x0D ; 13 2bcf6: 9d e0 ldi r25, 0x0D ; 13 2bcf8: 0f 94 2b dc call 0x3b856 ; 0x3b856 2bcfc: 96 2e mov r9, r22 2bcfe: 77 2e mov r7, r23 2bd00: 68 2e mov r6, r24 2bd02: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 2bd04: 89 e0 ldi r24, 0x09 ; 9 2bd06: 9d e0 ldi r25, 0x0D ; 13 2bd08: 0f 94 2b dc call 0x3b856 ; 0x3b856 // 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); 2bd0c: 9f 93 push r25 2bd0e: 8f 93 push r24 2bd10: 7f 93 push r23 2bd12: 6f 93 push r22 2bd14: 5f 92 push r5 2bd16: 6f 92 push r6 2bd18: 7f 92 push r7 2bd1a: 9f 92 push r9 2bd1c: af 92 push r10 2bd1e: bf 92 push r11 2bd20: cf 92 push r12 2bd22: df 92 push r13 2bd24: 86 eb ldi r24, 0xB6 ; 182 2bd26: 9f e8 ldi r25, 0x8F ; 143 2bd28: 9f 93 push r25 2bd2a: 8f 93 push r24 2bd2c: 0e 94 bd 88 call 0x1117a ; 0x1117a // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 2bd30: 8f e3 ldi r24, 0x3F ; 63 2bd32: 8f 93 push r24 2bd34: 80 e8 ldi r24, 0x80 ; 128 2bd36: 8f 93 push r24 2bd38: 1f 92 push r1 2bd3a: 1f 92 push r1 2bd3c: 8a e5 ldi r24, 0x5A ; 90 2bd3e: 9e e6 ldi r25, 0x6E ; 110 2bd40: 9f 93 push r25 2bd42: 8f 93 push r24 2bd44: 0e 94 bd 88 call 0x1117a ; 0x1117a // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 2bd48: 8e e6 ldi r24, 0x6E ; 110 2bd4a: 9f e0 ldi r25, 0x0F ; 15 2bd4c: 0f 94 2b dc call 0x3b856 ; 0x3b856 enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 2bd50: 9f 93 push r25 2bd52: 8f 93 push r24 2bd54: 7f 93 push r23 2bd56: 6f 93 push r22 2bd58: 8b ea ldi r24, 0xAB ; 171 2bd5a: 9f e8 ldi r25, 0x8F ; 143 2bd5c: 9f 93 push r25 2bd5e: 8f 93 push r24 2bd60: 0e 94 bd 88 call 0x1117a ; 0x1117a if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 2bd64: 0f b6 in r0, 0x3f ; 63 2bd66: f8 94 cli 2bd68: de bf out 0x3e, r29 ; 62 2bd6a: 0f be out 0x3f, r0 ; 63 2bd6c: cd bf out 0x3d, r28 ; 61 2bd6e: 82 e7 ldi r24, 0x72 ; 114 2bd70: 9f e0 ldi r25, 0x0F ; 15 2bd72: 0f 94 23 dc call 0x3b846 ; 0x3b846 2bd76: 88 23 and r24, r24 2bd78: 29 f0 breq .+10 ; 0x2bd84 enquecommand_P(PSTR("M82")); //E axis abslute mode 2bd7a: 61 e0 ldi r22, 0x01 ; 1 2bd7c: 87 ea ldi r24, 0xA7 ; 167 2bd7e: 9f e8 ldi r25, 0x8F ; 143 2bd80: 0e 94 27 88 call 0x1104e ; 0x1104e // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 2bd84: 1f 93 push r17 2bd86: 0f 93 push r16 2bd88: 80 ea ldi r24, 0xA0 ; 160 2bd8a: 9f e8 ldi r25, 0x8F ; 143 2bd8c: 9f 93 push r25 2bd8e: 8f 93 push r24 2bd90: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(MSG_M220, feedmultiply_rec); 2bd94: ef 92 push r14 2bd96: ff 92 push r15 2bd98: 86 e2 ldi r24, 0x26 ; 38 2bd9a: 9e e6 ldi r25, 0x6E ; 110 2bd9c: 9f 93 push r25 2bd9e: 8f 93 push r24 2bda0: 0e 94 bd 88 call 0x1117a ; 0x1117a // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 2bda4: 1f 92 push r1 2bda6: 8f 92 push r8 2bda8: 87 e9 ldi r24, 0x97 ; 151 2bdaa: 9f e8 ldi r25, 0x8F ; 143 2bdac: 9f 93 push r25 2bdae: 8f 93 push r24 2bdb0: 0e 94 bd 88 call 0x1117a ; 0x1117a // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 2bdb4: 81 e9 ldi r24, 0x91 ; 145 2bdb6: 9f e0 ldi r25, 0x0F ; 15 2bdb8: 0f 94 2b dc call 0x3b856 ; 0x3b856 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 2bdbc: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 2bdc0: 0f b6 in r0, 0x3f ; 63 2bdc2: f8 94 cli 2bdc4: de bf out 0x3e, r29 ; 62 2bdc6: 0f be out 0x3f, r0 ; 63 2bdc8: cd bf out 0x3d, r28 ; 61 2bdca: 21 11 cpse r18, r1 2bdcc: 33 c0 rjmp .+102 ; 0x2be34 { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 2bdce: 9f 93 push r25 2bdd0: 8f 93 push r24 2bdd2: 7f 93 push r23 2bdd4: 6f 93 push r22 2bdd6: 8e e8 ldi r24, 0x8E ; 142 2bdd8: 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); 2bdda: 9f 93 push r25 2bddc: 8f 93 push r24 2bdde: 0e 94 bd 88 call 0x1117a ; 0x1117a 2bde2: 0f 90 pop r0 2bde4: 0f 90 pop r0 2bde6: 0f 90 pop r0 2bde8: 0f 90 pop r0 2bdea: 0f 90 pop r0 2bdec: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 2bdee: 61 e0 ldi r22, 0x01 ; 1 2bdf0: 8e e7 ldi r24, 0x7E ; 126 2bdf2: 9f e8 ldi r25, 0x8F ; 143 2bdf4: 0e 94 27 88 call 0x1104e ; 0x1104e enquecommand_P(PSTR("PRUSA uvlo")); 2bdf8: 61 e0 ldi r22, 0x01 ; 1 2bdfa: 83 e7 ldi r24, 0x73 ; 115 2bdfc: 9f e8 ldi r25, 0x8F ; 143 2bdfe: 0e 94 27 88 call 0x1104e ; 0x1104e 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")); 2be02: 8f e2 ldi r24, 0x2F ; 47 2be04: 9e e6 ldi r25, 0x6E ; 110 2be06: 0f 94 0c db call 0x3b618 ; 0x3b618 gcode_M114(); 2be0a: 0e 94 4e 78 call 0xf09c ; 0xf09c } 2be0e: 0f 90 pop r0 2be10: 0f 90 pop r0 2be12: df 91 pop r29 2be14: cf 91 pop r28 2be16: 1f 91 pop r17 2be18: 0f 91 pop r16 2be1a: ff 90 pop r15 2be1c: ef 90 pop r14 2be1e: df 90 pop r13 2be20: cf 90 pop r12 2be22: bf 90 pop r11 2be24: af 90 pop r10 2be26: 9f 90 pop r9 2be28: 8f 90 pop r8 2be2a: 7f 90 pop r7 2be2c: 6f 90 pop r6 2be2e: 5f 90 pop r5 2be30: 4f 90 pop r4 2be32: 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) 2be34: 21 30 cpi r18, 0x01 ; 1 2be36: d9 f6 brne .-74 ; 0x2bdee { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 2be38: 9f 93 push r25 2be3a: 8f 93 push r24 2be3c: 7f 93 push r23 2be3e: 6f 93 push r22 2be40: 84 e8 ldi r24, 0x84 ; 132 2be42: 9f e8 ldi r25, 0x8F ; 143 2be44: ca cf rjmp .-108 ; 0x2bdda 0002be46 : 2be46: 88 e1 ldi r24, 0x18 ; 24 2be48: 9e e0 ldi r25, 0x0E ; 14 2be4a: 0f b6 in r0, 0x3f ; 63 2be4c: f8 94 cli 2be4e: a8 95 wdr 2be50: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2be54: 0f be out 0x3f, r0 ; 63 2be56: 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); 2be5a: 9f b7 in r25, 0x3f ; 63 2be5c: f8 94 cli 2be5e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2be62: 84 60 ori r24, 0x04 ; 4 2be64: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2be68: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 2be6a: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 2be6e: 47 ec ldi r20, 0xC7 ; 199 2be70: 5d e6 ldi r21, 0x6D ; 109 2be72: 61 e0 ldi r22, 0x01 ; 1 2be74: 80 e0 ldi r24, 0x00 ; 0 2be76: 0e 94 fb 6e call 0xddf6 ; 0xddf6 2be7a: ff cf rjmp .-2 ; 0x2be7a 0002be7c <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 2be7c: 1f 92 push r1 2be7e: 0f 92 push r0 2be80: 0f b6 in r0, 0x3f ; 63 2be82: 0f 92 push r0 2be84: 11 24 eor r1, r1 2be86: 0b b6 in r0, 0x3b ; 59 2be88: 0f 92 push r0 2be8a: 8f 92 push r8 2be8c: 9f 92 push r9 2be8e: af 92 push r10 2be90: bf 92 push r11 2be92: cf 92 push r12 2be94: df 92 push r13 2be96: ef 92 push r14 2be98: ff 92 push r15 2be9a: 0f 93 push r16 2be9c: 1f 93 push r17 2be9e: 2f 93 push r18 2bea0: 3f 93 push r19 2bea2: 4f 93 push r20 2bea4: 5f 93 push r21 2bea6: 6f 93 push r22 2bea8: 7f 93 push r23 2beaa: 8f 93 push r24 2beac: 9f 93 push r25 2beae: af 93 push r26 2beb0: bf 93 push r27 2beb2: cf 93 push r28 2beb4: df 93 push r29 2beb6: ef 93 push r30 2beb8: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 2beba: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 2bebc: 89 e1 ldi r24, 0x19 ; 25 2bebe: 9e e8 ldi r25, 0x8E ; 142 2bec0: 0e 94 82 79 call 0xf304 ; 0xf304 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 2bec4: 85 ea ldi r24, 0xA5 ; 165 2bec6: 9f e0 ldi r25, 0x0F ; 15 2bec8: 0f 94 23 dc call 0x3b846 ; 0x3b846 2becc: 18 2f mov r17, r24 2bece: 81 11 cpse r24, r1 2bed0: de c2 rjmp .+1468 ; 0x2c48e <__vector_5+0x612> { if(printer_active()) { 2bed2: 0e 94 e8 67 call 0xcfd0 ; 0xcfd0 2bed6: 88 23 and r24, r24 2bed8: 09 f4 brne .+2 ; 0x2bedc <__vector_5+0x60> 2beda: a9 c3 rjmp .+1874 ; 0x2c62e <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 2bedc: 0f 94 53 29 call 0x252a6 ; 0x252a6 2bee0: 6b 01 movw r12, r22 2bee2: 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); 2bee4: c0 91 a9 0d lds r28, 0x0DA9 ; 0x800da9 2bee8: cc 23 and r28, r28 2beea: 31 f0 breq .+12 ; 0x2bef8 <__vector_5+0x7c> 2beec: c1 e0 ldi r28, 0x01 ; 1 2beee: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2bef2: 82 30 cpi r24, 0x02 ; 2 2bef4: 09 f4 brne .+2 ; 0x2bef8 <__vector_5+0x7c> 2bef6: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 2bef8: d0 91 a8 0d lds r29, 0x0DA8 ; 0x800da8 2befc: d1 11 cpse r29, r1 2befe: 02 c0 rjmp .+4 ; 0x2bf04 <__vector_5+0x88> 2bf00: 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; 2bf04: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 2bf08: 10 92 00 04 sts 0x0400, r1 ; 0x800400 backlight_update(); 2bf0c: 0e 94 0d 8a call 0x1141a ; 0x1141a #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 2bf10: 17 9a sbi 0x02, 7 ; 2 2bf12: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 2bf16: 16 9a sbi 0x02, 6 ; 2 2bf18: 10 92 90 06 sts 0x0690, r1 ; 0x800690 // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2bf1c: 64 e1 ldi r22, 0x14 ; 20 2bf1e: 83 e6 ldi r24, 0x63 ; 99 2bf20: 92 e0 ldi r25, 0x02 ; 2 2bf22: 0e 94 05 68 call 0xd00a ; 0xd00a currents[Z_AXIS].setiRun(20); 2bf26: 64 e1 ldi r22, 0x14 ; 20 2bf28: 83 e6 ldi r24, 0x63 ; 99 2bf2a: 92 e0 ldi r25, 0x02 ; 2 2bf2c: 0e 94 0d 68 call 0xd01a ; 0xd01a tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2bf30: 50 e0 ldi r21, 0x00 ; 0 2bf32: 40 e0 ldi r20, 0x00 ; 0 2bf34: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2bf38: 82 e0 ldi r24, 0x02 ; 2 2bf3a: 0f 94 96 24 call 0x2492c ; 0x2492c currents[E_AXIS].setiHold(20); 2bf3e: 64 e1 ldi r22, 0x14 ; 20 2bf40: 86 e6 ldi r24, 0x66 ; 102 2bf42: 92 e0 ldi r25, 0x02 ; 2 2bf44: 0e 94 05 68 call 0xd00a ; 0xd00a currents[E_AXIS].setiRun(20); 2bf48: 64 e1 ldi r22, 0x14 ; 20 2bf4a: 86 e6 ldi r24, 0x66 ; 102 2bf4c: 92 e0 ldi r25, 0x02 ; 2 2bf4e: 0e 94 0d 68 call 0xd01a ; 0xd01a tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 2bf52: 50 e0 ldi r21, 0x00 ; 0 2bf54: 40 e0 ldi r20, 0x00 ; 0 2bf56: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 2bf5a: 83 e0 ldi r24, 0x03 ; 3 2bf5c: 0f 94 96 24 call 0x2492c ; 0x2492c #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 2bf60: c1 11 cpse r28, r1 2bf62: 1b c0 rjmp .+54 ; 0x2bf9a <__vector_5+0x11e> 2bf64: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 2bf68: 81 11 cpse r24, r1 2bf6a: 17 c0 rjmp .+46 ; 0x2bf9a <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 2bf6c: 80 91 72 06 lds r24, 0x0672 ; 0x800672 2bf70: 80 93 ae 05 sts 0x05AE, r24 ; 0x8005ae saved_extruder_temperature = target_temperature[active_extruder]; 2bf74: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2bf78: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2bf7c: 90 93 ad 05 sts 0x05AD, r25 ; 0x8005ad 2bf80: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2bf84: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 2bf88: 83 fb bst r24, 3 2bf8a: 88 27 eor r24, r24 2bf8c: 80 f9 bld r24, 0 2bf8e: 80 93 64 05 sts 0x0564, r24 ; 0x800564 saved_fan_speed = fanSpeed; 2bf92: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 2bf96: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab } // Stop all heaters before continuing disable_heater(); 2bf9a: 0f 94 1f 2f call 0x25e3e ; 0x25e3e // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 2bf9e: c1 11 cpse r28, r1 2bfa0: 04 c0 rjmp .+8 ; 0x2bfaa <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 2bfa2: 0e 94 41 65 call 0xca82 ; 0xca82 // save the global state at planning time save_planner_global_state(); 2bfa6: 0e 94 f7 64 call 0xc9ee ; 0xc9ee } // 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; 2bfaa: 00 91 c2 13 lds r16, 0x13C2 ; 0x8013c2 mbl.active = false; 2bfae: 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(); 2bfb2: 0f 94 ca c1 call 0x38394 ; 0x38394 // 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) 2bfb6: c1 11 cpse r28, r1 2bfb8: 1b c0 rjmp .+54 ; 0x2bff0 <__vector_5+0x174> 2bfba: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 2bfbe: 81 11 cpse r24, r1 2bfc0: 17 c0 rjmp .+46 ; 0x2bff0 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 2bfc2: 80 e1 ldi r24, 0x10 ; 16 2bfc4: e2 e9 ldi r30, 0x92 ; 146 2bfc6: f6 e0 ldi r31, 0x06 ; 6 2bfc8: a3 e7 ldi r26, 0x73 ; 115 2bfca: b2 e0 ldi r27, 0x02 ; 2 2bfcc: 01 90 ld r0, Z+ 2bfce: 0d 92 st X+, r0 2bfd0: 8a 95 dec r24 2bfd2: e1 f7 brne .-8 ; 0x2bfcc <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2bfd4: dd 23 and r29, r29 2bfd6: 61 f0 breq .+24 ; 0x2bff0 <__vector_5+0x174> 2bfd8: 80 e0 ldi r24, 0x00 ; 0 2bfda: 90 e0 ldi r25, 0x00 ; 0 2bfdc: a0 e8 ldi r26, 0x80 ; 128 2bfde: bf eb ldi r27, 0xBF ; 191 2bfe0: 80 93 73 02 sts 0x0273, r24 ; 0x800273 2bfe4: 90 93 74 02 sts 0x0274, r25 ; 0x800274 2bfe8: a0 93 75 02 sts 0x0275, r26 ; 0x800275 2bfec: 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]; 2bff0: 80 90 7b 02 lds r8, 0x027B ; 0x80027b 2bff4: 90 90 7c 02 lds r9, 0x027C ; 0x80027c 2bff8: a0 90 7d 02 lds r10, 0x027D ; 0x80027d 2bffc: b0 90 7e 02 lds r11, 0x027E ; 0x80027e if(mbl_was_active) { 2c000: 00 23 and r16, r16 2c002: d1 f0 breq .+52 ; 0x2c038 <__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]); 2c004: 20 91 77 02 lds r18, 0x0277 ; 0x800277 2c008: 30 91 78 02 lds r19, 0x0278 ; 0x800278 2c00c: 40 91 79 02 lds r20, 0x0279 ; 0x800279 2c010: 50 91 7a 02 lds r21, 0x027A ; 0x80027a 2c014: 60 91 73 02 lds r22, 0x0273 ; 0x800273 2c018: 70 91 74 02 lds r23, 0x0274 ; 0x800274 2c01c: 80 91 75 02 lds r24, 0x0275 ; 0x800275 2c020: 90 91 76 02 lds r25, 0x0276 ; 0x800276 2c024: 0f 94 b8 a1 call 0x34370 ; 0x34370 2c028: 9b 01 movw r18, r22 2c02a: ac 01 movw r20, r24 2c02c: c5 01 movw r24, r10 2c02e: b4 01 movw r22, r8 2c030: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2c034: 4b 01 movw r8, r22 2c036: 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); 2c038: b5 01 movw r22, r10 2c03a: a4 01 movw r20, r8 2c03c: 8d e8 ldi r24, 0x8D ; 141 2c03e: 9f e0 ldi r25, 0x0F ; 15 2c040: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c044: 40 91 7f 02 lds r20, 0x027F ; 0x80027f 2c048: 50 91 80 02 lds r21, 0x0280 ; 0x800280 2c04c: 60 91 81 02 lds r22, 0x0281 ; 0x800281 2c050: 70 91 82 02 lds r23, 0x0282 ; 0x800282 2c054: 8e e6 ldi r24, 0x6E ; 110 2c056: 9f e0 ldi r25, 0x0F ; 15 2c058: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 } 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); 2c05c: 60 91 64 05 lds r22, 0x0564 ; 0x800564 2c060: c1 e0 ldi r28, 0x01 ; 1 2c062: 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); 2c064: 82 e7 ldi r24, 0x72 ; 114 2c066: 9f e0 ldi r25, 0x0F ; 15 2c068: 0f 94 47 dc call 0x3b88e ; 0x3b88e // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c06c: 0e 94 4b 7f call 0xfe96 ; 0xfe96 card.sdprinting = false; 2c070: 10 92 90 14 sts 0x1490, r1 ; 0x801490 saved_printing = true; 2c074: 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; 2c078: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac sei(); 2c07c: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 2c07e: 20 e0 ldi r18, 0x00 ; 0 2c080: 30 e0 ldi r19, 0x00 ; 0 2c082: 40 e8 ldi r20, 0x80 ; 128 2c084: 5f e3 ldi r21, 0x3F ; 63 2c086: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 2c08a: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 2c08e: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 2c092: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 2c096: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2c09a: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 2c09e: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 2c0a2: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 2c0a6: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_buffer_line_curposXYZE(95); 2c0aa: 60 e0 ldi r22, 0x00 ; 0 2c0ac: 70 e0 ldi r23, 0x00 ; 0 2c0ae: 8e eb ldi r24, 0xBE ; 190 2c0b0: 92 e4 ldi r25, 0x42 ; 66 2c0b2: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 2c0b6: 0f 94 ef 42 call 0x285de ; 0x285de disable_e0(); 2c0ba: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 2c0bc: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 2c0c0: c0 e0 ldi r28, 0x00 ; 0 2c0c2: d1 e0 ldi r29, 0x01 ; 1 2c0c4: 02 c0 rjmp .+4 ; 0x2c0ca <__vector_5+0x24e> 2c0c6: d6 95 lsr r29 2c0c8: c7 95 ror r28 2c0ca: 8a 95 dec r24 2c0cc: e2 f7 brpl .-8 ; 0x2c0c6 <__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); 2c0ce: 82 e0 ldi r24, 0x02 ; 2 2c0d0: 0f 94 7c 24 call 0x248f8 ; 0x248f8 current_position[Z_AXIS] += float(1024 - z_microsteps) 2c0d4: 60 e0 ldi r22, 0x00 ; 0 2c0d6: 74 e0 ldi r23, 0x04 ; 4 2c0d8: 68 1b sub r22, r24 2c0da: 79 0b sbc r23, r25 2c0dc: 90 e0 ldi r25, 0x00 ; 0 2c0de: 80 e0 ldi r24, 0x00 ; 0 2c0e0: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2c0e4: 4b 01 movw r8, r22 2c0e6: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c0e8: be 01 movw r22, r28 2c0ea: 90 e0 ldi r25, 0x00 ; 0 2c0ec: 80 e0 ldi r24, 0x00 ; 0 2c0ee: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2c0f2: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c0f6: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c0fa: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c0fe: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c102: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2c106: 9b 01 movw r18, r22 2c108: ac 01 movw r20, r24 2c10a: c5 01 movw r24, r10 2c10c: b4 01 movw r22, r8 2c10e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> + UVLO_Z_AXIS_SHIFT; 2c112: 2a e0 ldi r18, 0x0A ; 10 2c114: 37 ed ldi r19, 0xD7 ; 215 2c116: 43 e2 ldi r20, 0x23 ; 35 2c118: 5f e3 ldi r21, 0x3F ; 63 2c11a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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) 2c11e: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 2c122: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 2c126: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 2c12a: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 2c12e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2c132: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2c136: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2c13a: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2c13e: 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); 2c142: 65 e5 ldi r22, 0x55 ; 85 2c144: 75 e5 ldi r23, 0x55 ; 85 2c146: 85 e5 ldi r24, 0x55 ; 85 2c148: 91 e4 ldi r25, 0x41 ; 65 2c14a: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 2c14e: 0f 94 ef 42 call 0x285de ; 0x285de if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c152: 40 91 60 05 lds r20, 0x0560 ; 0x800560 2c156: 50 91 61 05 lds r21, 0x0561 ; 0x800561 2c15a: 60 91 62 05 lds r22, 0x0562 ; 0x800562 2c15e: 70 91 63 05 lds r23, 0x0563 ; 0x800563 2c162: 81 e9 ldi r24, 0x91 ; 145 2c164: 9f e0 ldi r25, 0x0F ; 15 2c166: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c16a: ce ea ldi r28, 0xAE ; 174 2c16c: 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; 2c16e: 97 e0 ldi r25, 0x07 ; 7 2c170: 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; 2c172: 70 e0 ldi r23, 0x00 ; 0 2c174: 60 e0 ldi r22, 0x00 ; 0 2c176: 00 23 and r16, r16 2c178: 19 f1 breq .+70 ; 0x2c1c0 <__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; 2c17a: 81 2f mov r24, r17 2c17c: 6b 2d mov r22, r11 2c17e: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__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; 2c182: b8 9e mul r11, r24 2c184: f0 01 movw r30, r0 2c186: 11 24 eor r1, r1 2c188: e9 0f add r30, r25 2c18a: f1 1d adc r31, r1 2c18c: ee 0f add r30, r30 2c18e: ff 1f adc r31, r31 2c190: ee 0f add r30, r30 2c192: ff 1f adc r31, r31 2c194: ee 53 subi r30, 0x3E ; 62 2c196: fc 4e sbci r31, 0xEC ; 236 2c198: 20 e0 ldi r18, 0x00 ; 0 2c19a: 30 e0 ldi r19, 0x00 ; 0 2c19c: 4a e7 ldi r20, 0x7A ; 122 2c19e: 54 e4 ldi r21, 0x44 ; 68 2c1a0: 61 81 ldd r22, Z+1 ; 0x01 2c1a2: 72 81 ldd r23, Z+2 ; 0x02 2c1a4: 83 81 ldd r24, Z+3 ; 0x03 2c1a6: 94 81 ldd r25, Z+4 ; 0x04 2c1a8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2c1ac: 20 e0 ldi r18, 0x00 ; 0 2c1ae: 30 e0 ldi r19, 0x00 ; 0 2c1b0: 40 e0 ldi r20, 0x00 ; 0 2c1b2: 5f e3 ldi r21, 0x3F ; 63 2c1b4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2c1b8: 0f 94 f2 de call 0x3bde4 ; 0x3bde4 2c1bc: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c1c0: ce 01 movw r24, r28 2c1c2: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca // 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) 2c1c6: 1f 5f subi r17, 0xFF ; 255 2c1c8: 22 96 adiw r28, 0x02 ; 2 2c1ca: 11 33 cpi r17, 0x31 ; 49 2c1cc: 91 f6 brne .-92 ; 0x2c172 <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c1ce: 40 91 9a 06 lds r20, 0x069A ; 0x80069a 2c1d2: 50 91 9b 06 lds r21, 0x069B ; 0x80069b 2c1d6: 60 91 9c 06 lds r22, 0x069C ; 0x80069c 2c1da: 70 91 9d 06 lds r23, 0x069D ; 0x80069d 2c1de: 8a ed ldi r24, 0xDA ; 218 2c1e0: 9e e0 ldi r25, 0x0E ; 14 2c1e2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c1e6: 40 91 73 02 lds r20, 0x0273 ; 0x800273 2c1ea: 50 91 74 02 lds r21, 0x0274 ; 0x800274 2c1ee: 60 91 75 02 lds r22, 0x0275 ; 0x800275 2c1f2: 70 91 76 02 lds r23, 0x0276 ; 0x800276 2c1f6: 8d e9 ldi r24, 0x9D ; 157 2c1f8: 9f e0 ldi r25, 0x0F ; 15 2c1fa: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c1fe: 40 91 77 02 lds r20, 0x0277 ; 0x800277 2c202: 50 91 78 02 lds r21, 0x0278 ; 0x800278 2c206: 60 91 79 02 lds r22, 0x0279 ; 0x800279 2c20a: 70 91 7a 02 lds r23, 0x027A ; 0x80027a 2c20e: 81 ea ldi r24, 0xA1 ; 161 2c210: 9f e0 ldi r25, 0x0F ; 15 2c212: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c216: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 2c21a: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 2c21e: 89 e8 ldi r24, 0x89 ; 137 2c220: 9f e0 ldi r25, 0x0F ; 15 2c222: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 2c226: 60 91 39 02 lds r22, 0x0239 ; 0x800239 2c22a: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 2c22e: 85 e3 ldi r24, 0x35 ; 53 2c230: 9d e0 ldi r25, 0x0D ; 13 2c232: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca 2c236: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 2c23a: 70 91 ad 05 lds r23, 0x05AD ; 0x8005ad 2c23e: 88 ed ldi r24, 0xD8 ; 216 2c240: 9e e0 ldi r25, 0x0E ; 14 2c242: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c246: 60 91 ae 05 lds r22, 0x05AE ; 0x8005ae 2c24a: 8b e8 ldi r24, 0x8B ; 139 2c24c: 9f e0 ldi r25, 0x0F ; 15 2c24e: 0f 94 47 dc call 0x3b88e ; 0x3b88e 2c252: 60 91 ab 05 lds r22, 0x05AB ; 0x8005ab 2c256: 88 e8 ldi r24, 0x88 ; 136 2c258: 9f e0 ldi r25, 0x0F ; 15 2c25a: 0f 94 47 dc call 0x3b88e ; 0x3b88e if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c25e: 40 91 93 02 lds r20, 0x0293 ; 0x800293 2c262: 50 91 94 02 lds r21, 0x0294 ; 0x800294 2c266: 60 91 95 02 lds r22, 0x0295 ; 0x800295 2c26a: 70 91 96 02 lds r23, 0x0296 ; 0x800296 2c26e: 88 ee ldi r24, 0xE8 ; 232 2c270: 9e e0 ldi r25, 0x0E ; 14 2c272: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c276: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 2c27a: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 2c27e: 8e ed ldi r24, 0xDE ; 222 2c280: 9e e0 ldi r25, 0x0E ; 14 2c282: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c286: 40 91 f2 0d lds r20, 0x0DF2 ; 0x800df2 2c28a: 50 91 f3 0d lds r21, 0x0DF3 ; 0x800df3 2c28e: 60 91 f4 0d lds r22, 0x0DF4 ; 0x800df4 2c292: 70 91 f5 0d lds r23, 0x0DF5 ; 0x800df5 2c296: 81 e1 ldi r24, 0x11 ; 17 2c298: 9d e0 ldi r25, 0x0D ; 13 2c29a: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c29e: 40 91 f6 0d lds r20, 0x0DF6 ; 0x800df6 2c2a2: 50 91 f7 0d lds r21, 0x0DF7 ; 0x800df7 2c2a6: 60 91 f8 0d lds r22, 0x0DF8 ; 0x800df8 2c2aa: 70 91 f9 0d lds r23, 0x0DF9 ; 0x800df9 2c2ae: 8d e0 ldi r24, 0x0D ; 13 2c2b0: 9d e0 ldi r25, 0x0D ; 13 2c2b2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c2b6: 40 91 7e 0e lds r20, 0x0E7E ; 0x800e7e 2c2ba: 50 91 7f 0e lds r21, 0x0E7F ; 0x800e7f 2c2be: 60 91 80 0e lds r22, 0x0E80 ; 0x800e80 2c2c2: 70 91 81 0e lds r23, 0x0E81 ; 0x800e81 2c2c6: 89 e0 ldi r24, 0x09 ; 9 2c2c8: 9d e0 ldi r25, 0x0D ; 13 2c2ca: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 #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); 2c2ce: 40 e1 ldi r20, 0x10 ; 16 2c2d0: 50 e0 ldi r21, 0x00 ; 0 2c2d2: 67 e3 ldi r22, 0x37 ; 55 2c2d4: 7d e0 ldi r23, 0x0D ; 13 2c2d6: 83 e8 ldi r24, 0x83 ; 131 2c2d8: 92 e0 ldi r25, 0x02 ; 2 2c2da: 0f 94 37 dc call 0x3b86e ; 0x3b86e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c2de: 60 91 69 05 lds r22, 0x0569 ; 0x800569 2c2e2: 70 91 6a 05 lds r23, 0x056A ; 0x80056a 2c2e6: 8c e6 ldi r24, 0x6C ; 108 2c2e8: 9f e0 ldi r25, 0x0F ; 15 2c2ea: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c2ee: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 2c2f2: 8c e8 ldi r24, 0x8C ; 140 2c2f4: 9f e0 ldi r25, 0x0F ; 15 2c2f6: 0f 94 47 dc call 0x3b88e ; 0x3b88e if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c2fa: 40 91 65 05 lds r20, 0x0565 ; 0x800565 2c2fe: 50 91 66 05 lds r21, 0x0566 ; 0x800566 2c302: 60 91 67 05 lds r22, 0x0567 ; 0x800567 2c306: 70 91 68 05 lds r23, 0x0568 ; 0x800568 2c30a: 8c e2 ldi r24, 0x2C ; 44 2c30c: 9d e0 ldi r25, 0x0D ; 13 2c30e: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2c312: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 2c316: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 2c31a: 8d e7 ldi r24, 0x7D ; 125 2c31c: 9c e0 ldi r25, 0x0C ; 12 2c31e: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca #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); 2c322: 40 e1 ldi r20, 0x10 ; 16 2c324: 50 e0 ldi r21, 0x00 ; 0 2c326: 6d e6 ldi r22, 0x6D ; 109 2c328: 7c e0 ldi r23, 0x0C ; 12 2c32a: 82 ee ldi r24, 0xE2 ; 226 2c32c: 9d e0 ldi r25, 0x0D ; 13 2c32e: 0f 94 37 dc call 0x3b86e ; 0x3b86e 2c332: 40 e1 ldi r20, 0x10 ; 16 2c334: 50 e0 ldi r21, 0x00 ; 0 2c336: 6d e5 ldi r22, 0x5D ; 93 2c338: 7c e0 ldi r23, 0x0C ; 12 2c33a: 8a e6 ldi r24, 0x6A ; 106 2c33c: 9e e0 ldi r25, 0x0E ; 14 2c33e: 0f 94 37 dc call 0x3b86e ; 0x3b86e 2c342: 40 e1 ldi r20, 0x10 ; 16 2c344: 50 e0 ldi r21, 0x00 ; 0 2c346: 6d e4 ldi r22, 0x4D ; 77 2c348: 7c e0 ldi r23, 0x0C ; 12 2c34a: 82 ed ldi r24, 0xD2 ; 210 2c34c: 9d e0 ldi r25, 0x0D ; 13 2c34e: 0f 94 37 dc call 0x3b86e ; 0x3b86e 2c352: 40 e1 ldi r20, 0x10 ; 16 2c354: 50 e0 ldi r21, 0x00 ; 0 2c356: 6d e3 ldi r22, 0x3D ; 61 2c358: 7c e0 ldi r23, 0x0C ; 12 2c35a: 8a e5 ldi r24, 0x5A ; 90 2c35c: 9e e0 ldi r25, 0x0E ; 14 2c35e: 0f 94 37 dc call 0x3b86e ; 0x3b86e if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c362: 40 91 fa 0d lds r20, 0x0DFA ; 0x800dfa 2c366: 50 91 fb 0d lds r21, 0x0DFB ; 0x800dfb 2c36a: 60 91 fc 0d lds r22, 0x0DFC ; 0x800dfc 2c36e: 70 91 fd 0d lds r23, 0x0DFD ; 0x800dfd 2c372: 89 e3 ldi r24, 0x39 ; 57 2c374: 9c e0 ldi r25, 0x0C ; 12 2c376: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 2c37a: 40 91 fe 0d lds r20, 0x0DFE ; 0x800dfe 2c37e: 50 91 ff 0d lds r21, 0x0DFF ; 0x800dff 2c382: 60 91 00 0e lds r22, 0x0E00 ; 0x800e00 2c386: 70 91 01 0e lds r23, 0x0E01 ; 0x800e01 2c38a: 85 e3 ldi r24, 0x35 ; 53 2c38c: 9c e0 ldi r25, 0x0C ; 12 2c38e: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 2c392: 40 91 02 0e lds r20, 0x0E02 ; 0x800e02 2c396: 50 91 03 0e lds r21, 0x0E03 ; 0x800e03 2c39a: 60 91 04 0e lds r22, 0x0E04 ; 0x800e04 2c39e: 70 91 05 0e lds r23, 0x0E05 ; 0x800e05 2c3a2: 81 e3 ldi r24, 0x31 ; 49 2c3a4: 9c e0 ldi r25, 0x0C ; 12 2c3a6: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 #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); 2c3aa: 40 e1 ldi r20, 0x10 ; 16 2c3ac: 50 e0 ldi r21, 0x00 ; 0 2c3ae: 61 e2 ldi r22, 0x21 ; 33 2c3b0: 7c e0 ldi r23, 0x0C ; 12 2c3b2: 86 e0 ldi r24, 0x06 ; 6 2c3b4: 9e e0 ldi r25, 0x0E ; 14 2c3b6: 0f 94 37 dc call 0x3b86e ; 0x3b86e 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) { 2c3ba: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 2c3be: 88 23 and r24, r24 2c3c0: 29 f0 breq .+10 ; 0x2c3cc <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c3c2: 61 e0 ldi r22, 0x01 ; 1 2c3c4: 8f e7 ldi r24, 0x7F ; 127 2c3c6: 9c e0 ldi r25, 0x0C ; 12 2c3c8: 0f 94 47 dc call 0x3b88e ; 0x3b88e 2c3cc: 61 e0 ldi r22, 0x01 ; 1 2c3ce: 85 ea ldi r24, 0xA5 ; 165 2c3d0: 9f e0 ldi r25, 0x0F ; 15 2c3d2: 0f 94 47 dc call 0x3b88e ; 0x3b88e } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 2c3d6: 84 e6 ldi r24, 0x64 ; 100 2c3d8: 9f e0 ldi r25, 0x0F ; 15 2c3da: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c3de: 8f ef ldi r24, 0xFF ; 255 2c3e0: 9e e0 ldi r25, 0x0E ; 14 2c3e2: 0e 94 22 76 call 0xec44 ; 0xec44 printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 2c3e6: 0f 94 53 29 call 0x252a6 ; 0x252a6 2c3ea: dc 01 movw r26, r24 2c3ec: cb 01 movw r24, r22 2c3ee: 8c 19 sub r24, r12 2c3f0: 9d 09 sbc r25, r13 2c3f2: ae 09 sbc r26, r14 2c3f4: bf 09 sbc r27, r15 2c3f6: bf 93 push r27 2c3f8: af 93 push r26 2c3fa: 9f 93 push r25 2c3fc: 8f 93 push r24 2c3fe: 8c ed ldi r24, 0xDC ; 220 2c400: 9d e6 ldi r25, 0x6D ; 109 2c402: 9f 93 push r25 2c404: 8f 93 push r24 2c406: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca WRITE(BEEPER,HIGH); 2c40a: 9f b7 in r25, 0x3f ; 63 2c40c: f8 94 cli 2c40e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c412: 84 60 ori r24, 0x04 ; 4 2c414: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c418: 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(); 2c41a: 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; 2c41c: 0f 90 pop r0 2c41e: 0f 90 pop r0 2c420: 0f 90 pop r0 2c422: 0f 90 pop r0 2c424: 0f 90 pop r0 2c426: 0f 90 pop r0 2c428: 20 e0 ldi r18, 0x00 ; 0 2c42a: 30 e0 ldi r19, 0x00 ; 0 2c42c: 4f ef ldi r20, 0xFF ; 255 2c42e: 52 e4 ldi r21, 0x42 ; 66 2c430: 60 91 92 06 lds r22, 0x0692 ; 0x800692 2c434: 70 91 93 06 lds r23, 0x0693 ; 0x800693 2c438: 80 91 94 06 lds r24, 0x0694 ; 0x800694 2c43c: 90 91 95 06 lds r25, 0x0695 ; 0x800695 2c440: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2c444: 87 fd sbrc r24, 7 2c446: 1f c0 rjmp .+62 ; 0x2c486 <__vector_5+0x60a> 2c448: 80 e0 ldi r24, 0x00 ; 0 2c44a: 90 e0 ldi r25, 0x00 ; 0 2c44c: af e7 ldi r26, 0x7F ; 127 2c44e: b3 e4 ldi r27, 0x43 ; 67 2c450: 80 93 92 06 sts 0x0692, r24 ; 0x800692 2c454: 90 93 93 06 sts 0x0693, r25 ; 0x800693 2c458: a0 93 94 06 sts 0x0694, r26 ; 0x800694 2c45c: b0 93 95 06 sts 0x0695, r27 ; 0x800695 plan_buffer_line_curposXYZE(500); 2c460: 60 e0 ldi r22, 0x00 ; 0 2c462: 70 e0 ldi r23, 0x00 ; 0 2c464: 8a ef ldi r24, 0xFA ; 250 2c466: 93 e4 ldi r25, 0x43 ; 67 2c468: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 2c46c: 0f 94 ef 42 call 0x285de ; 0x285de 2c470: 88 e1 ldi r24, 0x18 ; 24 2c472: 9e e0 ldi r25, 0x0E ; 14 2c474: 0f b6 in r0, 0x3f ; 63 2c476: f8 94 cli 2c478: a8 95 wdr 2c47a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c47e: 0f be out 0x3f, r0 ; 63 2c480: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2c484: ff cf rjmp .-2 ; 0x2c484 <__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; 2c486: 80 e0 ldi r24, 0x00 ; 0 2c488: 90 e0 ldi r25, 0x00 ; 0 2c48a: dc 01 movw r26, r24 2c48c: e1 cf rjmp .-62 ; 0x2c450 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 2c48e: 0f 94 53 29 call 0x252a6 ; 0x252a6 2c492: 6b 01 movw r12, r22 2c494: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 2c496: 17 9a sbi 0x02, 7 ; 2 2c498: 10 92 8f 06 sts 0x068F, r1 ; 0x80068f disable_y(); 2c49c: 16 9a sbi 0x02, 6 ; 2 2c49e: 10 92 90 06 sts 0x0690, r1 ; 0x800690 disable_e0(); 2c4a2: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 2c4a4: 64 e1 ldi r22, 0x14 ; 20 2c4a6: 83 e6 ldi r24, 0x63 ; 99 2c4a8: 92 e0 ldi r25, 0x02 ; 2 2c4aa: 0e 94 05 68 call 0xd00a ; 0xd00a currents[Z_AXIS].setiRun(20); 2c4ae: 64 e1 ldi r22, 0x14 ; 20 2c4b0: 83 e6 ldi r24, 0x63 ; 99 2c4b2: 92 e0 ldi r25, 0x02 ; 2 2c4b4: 0e 94 0d 68 call 0xd01a ; 0xd01a tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 2c4b8: 50 e0 ldi r21, 0x00 ; 0 2c4ba: 40 e0 ldi r20, 0x00 ; 0 2c4bc: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2c4c0: 82 e0 ldi r24, 0x02 ; 2 2c4c2: 0f 94 96 24 call 0x2492c ; 0x2492c #endif //TMC2130 // Stop all heaters disable_heater(); 2c4c6: 0f 94 1f 2f call 0x25e3e ; 0x25e3e // 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; 2c4ca: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 planner_abort_hard(); 2c4ce: 0f 94 ca c1 call 0x38394 ; 0x38394 // 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]) 2c4d2: 80 90 9a 06 lds r8, 0x069A ; 0x80069a 2c4d6: 90 90 9b 06 lds r9, 0x069B ; 0x80069b 2c4da: a0 90 9c 06 lds r10, 0x069C ; 0x80069c 2c4de: b0 90 9d 06 lds r11, 0x069D ; 0x80069d 2c4e2: 8a ed ldi r24, 0xDA ; 218 2c4e4: 9e e0 ldi r25, 0x0E ; 14 2c4e6: 0f 94 2b dc call 0x3b856 ; 0x3b856 2c4ea: 9b 01 movw r18, r22 2c4ec: ac 01 movw r20, r24 2c4ee: c5 01 movw r24, r10 2c4f0: b4 01 movw r22, r8 2c4f2: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2c4f6: 4b 01 movw r8, r22 2c4f8: 5c 01 movw r10, r24 2c4fa: e8 94 clt 2c4fc: b7 f8 bld r11, 7 2c4fe: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c502: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c506: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c50a: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c50e: 60 e0 ldi r22, 0x00 ; 0 2c510: 70 e0 ldi r23, 0x00 ; 0 2c512: 80 e8 ldi r24, 0x80 ; 128 2c514: 9f e3 ldi r25, 0x3F ; 63 2c516: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 2c51a: 9b 01 movw r18, r22 2c51c: ac 01 movw r20, r24 2c51e: c5 01 movw r24, r10 2c520: b4 01 movw r22, r8 2c522: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2c526: 87 fd sbrc r24, 7 2c528: 61 c0 rjmp .+194 ; 0x2c5ec <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 2c52a: 0e 94 4b 7f call 0xfe96 ; 0xfe96 card.sdprinting = false; 2c52e: 10 92 90 14 sts 0x1490, r1 ; 0x801490 saved_printing = true; 2c532: 81 e0 ldi r24, 0x01 ; 1 2c534: 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; 2c538: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac sei(); 2c53c: 78 94 sei 2c53e: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 2c542: c0 e0 ldi r28, 0x00 ; 0 2c544: d1 e0 ldi r29, 0x01 ; 1 2c546: 02 c0 rjmp .+4 ; 0x2c54c <__vector_5+0x6d0> 2c548: d6 95 lsr r29 2c54a: c7 95 ror r28 2c54c: 8a 95 dec r24 2c54e: e2 f7 brpl .-8 ; 0x2c548 <__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); 2c550: 82 e0 ldi r24, 0x02 ; 2 2c552: 0f 94 7c 24 call 0x248f8 ; 0x248f8 current_position[Z_AXIS] += float(1024 - z_microsteps) 2c556: 60 e0 ldi r22, 0x00 ; 0 2c558: 74 e0 ldi r23, 0x04 ; 4 2c55a: 68 1b sub r22, r24 2c55c: 79 0b sbc r23, r25 2c55e: 90 e0 ldi r25, 0x00 ; 0 2c560: 80 e0 ldi r24, 0x00 ; 0 2c562: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2c566: 4b 01 movw r8, r22 2c568: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 2c56a: be 01 movw r22, r28 2c56c: 90 e0 ldi r25, 0x00 ; 0 2c56e: 80 e0 ldi r24, 0x00 ; 0 2c570: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2c574: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c578: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c57c: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c580: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c584: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2c588: 9b 01 movw r18, r22 2c58a: ac 01 movw r20, r24 2c58c: c5 01 movw r24, r10 2c58e: b4 01 movw r22, r8 2c590: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 2c594: 2a e0 ldi r18, 0x0A ; 10 2c596: 37 ed ldi r19, 0xD7 ; 215 2c598: 43 e2 ldi r20, 0x23 ; 35 2c59a: 5e e3 ldi r21, 0x3E ; 62 2c59c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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) 2c5a0: 20 91 9a 06 lds r18, 0x069A ; 0x80069a 2c5a4: 30 91 9b 06 lds r19, 0x069B ; 0x80069b 2c5a8: 40 91 9c 06 lds r20, 0x069C ; 0x80069c 2c5ac: 50 91 9d 06 lds r21, 0x069D ; 0x80069d 2c5b0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2c5b4: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 2c5b8: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 2c5bc: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 2c5c0: 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); 2c5c4: 65 e5 ldi r22, 0x55 ; 85 2c5c6: 75 e5 ldi r23, 0x55 ; 85 2c5c8: 85 e5 ldi r24, 0x55 ; 85 2c5ca: 91 e4 ldi r25, 0x41 ; 65 2c5cc: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 2c5d0: 0f 94 ef 42 call 0x285de ; 0x285de if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 2c5d4: 40 91 9a 06 lds r20, 0x069A ; 0x80069a 2c5d8: 50 91 9b 06 lds r21, 0x069B ; 0x80069b 2c5dc: 60 91 9c 06 lds r22, 0x069C ; 0x80069c 2c5e0: 70 91 9d 06 lds r23, 0x069D ; 0x80069d 2c5e4: 8a ed ldi r24, 0xDA ; 218 2c5e6: 9e e0 ldi r25, 0x0E ; 14 2c5e8: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2c5ec: 62 e0 ldi r22, 0x02 ; 2 2c5ee: 85 ea ldi r24, 0xA5 ; 165 2c5f0: 9f e0 ldi r25, 0x0F ; 15 2c5f2: 0f 94 47 dc call 0x3b88e ; 0x3b88e // 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); 2c5f6: 84 e6 ldi r24, 0x64 ; 100 2c5f8: 9f e0 ldi r25, 0x0F ; 15 2c5fa: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 2c5fe: 8f ef ldi r24, 0xFF ; 255 2c600: 9e e0 ldi r25, 0x0E ; 14 2c602: 0e 94 22 76 call 0xec44 ; 0xec44 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 2c606: 0f 94 53 29 call 0x252a6 ; 0x252a6 2c60a: dc 01 movw r26, r24 2c60c: cb 01 movw r24, r22 2c60e: 8c 19 sub r24, r12 2c610: 9d 09 sbc r25, r13 2c612: ae 09 sbc r26, r14 2c614: bf 09 sbc r27, r15 2c616: bf 93 push r27 2c618: af 93 push r26 2c61a: 9f 93 push r25 2c61c: 8f 93 push r24 2c61e: 8b ee ldi r24, 0xEB ; 235 2c620: 9d e6 ldi r25, 0x6D ; 109 2c622: 9f 93 push r25 2c624: 8f 93 push r24 2c626: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca uvlo_drain_reset(); 2c62a: 0f 94 23 5f call 0x2be46 ; 0x2be46 // 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(); } } 2c62e: ff 91 pop r31 2c630: ef 91 pop r30 2c632: df 91 pop r29 2c634: cf 91 pop r28 2c636: bf 91 pop r27 2c638: af 91 pop r26 2c63a: 9f 91 pop r25 2c63c: 8f 91 pop r24 2c63e: 7f 91 pop r23 2c640: 6f 91 pop r22 2c642: 5f 91 pop r21 2c644: 4f 91 pop r20 2c646: 3f 91 pop r19 2c648: 2f 91 pop r18 2c64a: 1f 91 pop r17 2c64c: 0f 91 pop r16 2c64e: ff 90 pop r15 2c650: ef 90 pop r14 2c652: df 90 pop r13 2c654: cf 90 pop r12 2c656: bf 90 pop r11 2c658: af 90 pop r10 2c65a: 9f 90 pop r9 2c65c: 8f 90 pop r8 2c65e: 0f 90 pop r0 2c660: 0b be out 0x3b, r0 ; 59 2c662: 0f 90 pop r0 2c664: 0f be out 0x3f, r0 ; 63 2c666: 0f 90 pop r0 2c668: 1f 90 pop r1 2c66a: 18 95 reti 0002c66c : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 2c66c: 60 91 a5 0d lds r22, 0x0DA5 ; 0x800da5 uint8_t _block_buffer_tail = block_buffer_tail; 2c670: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 uint16_t sdlen = 0; 2c674: 30 e0 ldi r19, 0x00 ; 0 2c676: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c678: 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) 2c67a: 96 17 cp r25, r22 2c67c: 61 f0 breq .+24 ; 0x2c696 { sdlen += block_buffer[_block_buffer_tail].sdlen; 2c67e: 89 9f mul r24, r25 2c680: f0 01 movw r30, r0 2c682: 11 24 eor r1, r1 2c684: ef 5c subi r30, 0xCF ; 207 2c686: f8 4f sbci r31, 0xF8 ; 248 2c688: 40 81 ld r20, Z 2c68a: 51 81 ldd r21, Z+1 ; 0x01 2c68c: 24 0f add r18, r20 2c68e: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c690: 9f 5f subi r25, 0xFF ; 255 2c692: 9f 70 andi r25, 0x0F ; 15 2c694: f2 cf rjmp .-28 ; 0x2c67a } return sdlen; } 2c696: c9 01 movw r24, r18 2c698: 08 95 ret 0002c69a : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 2c69a: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 2c69e: 20 91 a6 0d lds r18, 0x0DA6 ; 0x800da6 2c6a2: 32 17 cp r19, r18 2c6a4: 91 f0 breq .+36 ; 0x2c6ca // 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; 2c6a6: 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) 2c6aa: e1 11 cpse r30, r1 2c6ac: 01 c0 rjmp .+2 ; 0x2c6b0 block_index = BLOCK_BUFFER_SIZE; 2c6ae: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 2c6b0: 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; 2c6b2: 2e e6 ldi r18, 0x6E ; 110 2c6b4: e2 9f mul r30, r18 2c6b6: f0 01 movw r30, r0 2c6b8: 11 24 eor r1, r1 2c6ba: ef 5c subi r30, 0xCF ; 207 2c6bc: f8 4f sbci r31, 0xF8 ; 248 2c6be: 20 81 ld r18, Z 2c6c0: 31 81 ldd r19, Z+1 ; 0x01 2c6c2: 82 0f add r24, r18 2c6c4: 93 1f adc r25, r19 2c6c6: 91 83 std Z+1, r25 ; 0x01 2c6c8: 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. } } 2c6ca: 08 95 ret 0002c6cc : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 2c6cc: 8f 92 push r8 2c6ce: 9f 92 push r9 2c6d0: af 92 push r10 2c6d2: bf 92 push r11 2c6d4: cf 92 push r12 2c6d6: df 92 push r13 2c6d8: ef 92 push r14 2c6da: ff 92 push r15 2c6dc: 0f 93 push r16 2c6de: 1f 93 push r17 2c6e0: cf 93 push r28 2c6e2: df 93 push r29 2c6e4: c0 91 6f 02 lds r28, 0x026F ; 0x80026f 2c6e8: d0 91 70 02 lds r29, 0x0270 ; 0x800270 2c6ec: 82 ec ldi r24, 0xC2 ; 194 2c6ee: e8 2e mov r14, r24 2c6f0: 8d e0 ldi r24, 0x0D ; 13 2c6f2: f8 2e mov r15, r24 2c6f4: 0e e4 ldi r16, 0x4E ; 78 2c6f6: 15 e0 ldi r17, 0x05 ; 5 2c6f8: 6e 01 movw r12, r28 2c6fa: 80 e1 ldi r24, 0x10 ; 16 2c6fc: c8 0e add r12, r24 2c6fe: 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]; 2c700: 69 91 ld r22, Y+ 2c702: 79 91 ld r23, Y+ 2c704: 89 91 ld r24, Y+ 2c706: 99 91 ld r25, Y+ 2c708: f7 01 movw r30, r14 2c70a: 81 90 ld r8, Z+ 2c70c: 91 90 ld r9, Z+ 2c70e: a1 90 ld r10, Z+ 2c710: b1 90 ld r11, Z+ 2c712: 7f 01 movw r14, r30 2c714: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2c718: a5 01 movw r20, r10 2c71a: 94 01 movw r18, r8 2c71c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2c720: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 2c724: f8 01 movw r30, r16 2c726: 61 93 st Z+, r22 2c728: 71 93 st Z+, r23 2c72a: 81 93 st Z+, r24 2c72c: 91 93 st Z+, r25 2c72e: 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++) 2c730: cc 15 cp r28, r12 2c732: dd 05 cpc r29, r13 2c734: 29 f7 brne .-54 ; 0x2c700 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 2c736: df 91 pop r29 2c738: cf 91 pop r28 2c73a: 1f 91 pop r17 2c73c: 0f 91 pop r16 2c73e: ff 90 pop r15 2c740: ef 90 pop r14 2c742: df 90 pop r13 2c744: cf 90 pop r12 2c746: bf 90 pop r11 2c748: af 90 pop r10 2c74a: 9f 90 pop r9 2c74c: 8f 90 pop r8 2c74e: 08 95 ret 0002c750 : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 2c750: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 2c754: 81 11 cpse r24, r1 2c756: 0e c0 rjmp .+28 ; 0x2c774 { max_feedrate = cs.max_feedrate_normal; 2c758: 82 ed ldi r24, 0xD2 ; 210 2c75a: 9d e0 ldi r25, 0x0D ; 13 2c75c: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c760: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 2c764: 82 ee ldi r24, 0xE2 ; 226 2c766: 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; 2c768: 90 93 70 02 sts 0x0270, r25 ; 0x800270 2c76c: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } reset_acceleration_rates(); 2c770: 0d 94 66 63 jmp 0x2c6cc ; 0x2c6cc 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) 2c774: 81 30 cpi r24, 0x01 ; 1 2c776: e1 f7 brne .-8 ; 0x2c770 { max_feedrate = cs.max_feedrate_silent; 2c778: 8a e5 ldi r24, 0x5A ; 90 2c77a: 9e e0 ldi r25, 0x0E ; 14 2c77c: 90 93 72 02 sts 0x0272, r25 ; 0x800272 2c780: 80 93 71 02 sts 0x0271, r24 ; 0x800271 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 2c784: 8a e6 ldi r24, 0x6A ; 106 2c786: 9e e0 ldi r25, 0x0E ; 14 2c788: ef cf rjmp .-34 ; 0x2c768 0002c78a : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2c78a: fc 01 movw r30, r24 2c78c: 40 81 ld r20, Z 2c78e: 51 81 ldd r21, Z+1 ; 0x01 2c790: 62 81 ldd r22, Z+2 ; 0x02 2c792: 73 81 ldd r23, Z+3 ; 0x03 2c794: 40 93 d9 04 sts 0x04D9, r20 ; 0x8004d9 2c798: 50 93 da 04 sts 0x04DA, r21 ; 0x8004da 2c79c: 60 93 db 04 sts 0x04DB, r22 ; 0x8004db 2c7a0: 70 93 dc 04 sts 0x04DC, r23 ; 0x8004dc #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 2c7a4: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 2c7a8: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 2c7ac: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 2c7b0: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 2c7b4: 60 81 ld r22, Z 2c7b6: 71 81 ldd r23, Z+1 ; 0x01 2c7b8: 82 81 ldd r24, Z+2 ; 0x02 2c7ba: 93 81 ldd r25, Z+3 ; 0x03 2c7bc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2c7c0: 0f 94 88 e0 call 0x3c110 ; 0x3c110 2c7c4: e3 ea ldi r30, 0xA3 ; 163 2c7c6: f6 e0 ldi r31, 0x06 ; 6 2c7c8: 64 87 std Z+12, r22 ; 0x0c 2c7ca: 75 87 std Z+13, r23 ; 0x0d 2c7cc: 86 87 std Z+14, r24 ; 0x0e 2c7ce: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 2c7d0: 8f b7 in r24, 0x3f ; 63 2c7d2: f8 94 cli count_position[E_AXIS] = e; 2c7d4: 44 85 ldd r20, Z+12 ; 0x0c 2c7d6: 55 85 ldd r21, Z+13 ; 0x0d 2c7d8: 66 85 ldd r22, Z+14 ; 0x0e 2c7da: 77 85 ldd r23, Z+15 ; 0x0f 2c7dc: 40 93 bf 06 sts 0x06BF, r20 ; 0x8006bf 2c7e0: 50 93 c0 06 sts 0x06C0, r21 ; 0x8006c0 2c7e4: 60 93 c1 06 sts 0x06C1, r22 ; 0x8006c1 2c7e8: 70 93 c2 06 sts 0x06C2, r23 ; 0x8006c2 CRITICAL_SECTION_END; 2c7ec: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2c7ee: 08 95 ret 0002c7f0 : // 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; 2c7f0: fc 01 movw r30, r24 2c7f2: 40 81 ld r20, Z 2c7f4: 51 81 ldd r21, Z+1 ; 0x01 2c7f6: 62 81 ldd r22, Z+2 ; 0x02 2c7f8: 73 81 ldd r23, Z+3 ; 0x03 2c7fa: 40 93 d5 04 sts 0x04D5, r20 ; 0x8004d5 2c7fe: 50 93 d6 04 sts 0x04D6, r21 ; 0x8004d6 2c802: 60 93 d7 04 sts 0x04D7, r22 ; 0x8004d7 2c806: 70 93 d8 04 sts 0x04D8, r23 ; 0x8004d8 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2c80a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 2c80e: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 2c812: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 2c816: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 2c81a: 60 81 ld r22, Z 2c81c: 71 81 ldd r23, Z+1 ; 0x01 2c81e: 82 81 ldd r24, Z+2 ; 0x02 2c820: 93 81 ldd r25, Z+3 ; 0x03 2c822: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2c826: 0f 94 88 e0 call 0x3c110 ; 0x3c110 2c82a: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 2c82e: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 2c832: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 2c836: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae st_set_position(position); 2c83a: 0d 94 f2 87 jmp 0x30fe4 ; 0x30fe4 0002c83e : * 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) { 2c83e: 2f 92 push r2 2c840: 3f 92 push r3 2c842: 4f 92 push r4 2c844: 5f 92 push r5 2c846: 6f 92 push r6 2c848: 7f 92 push r7 2c84a: 8f 92 push r8 2c84c: 9f 92 push r9 2c84e: af 92 push r10 2c850: bf 92 push r11 2c852: cf 92 push r12 2c854: df 92 push r13 2c856: ef 92 push r14 2c858: ff 92 push r15 2c85a: 0f 93 push r16 2c85c: 1f 93 push r17 2c85e: cf 93 push r28 2c860: df 93 push r29 2c862: cd b7 in r28, 0x3d ; 61 2c864: de b7 in r29, 0x3e ; 62 2c866: c2 54 subi r28, 0x42 ; 66 2c868: d1 09 sbc r29, r1 2c86a: 0f b6 in r0, 0x3f ; 63 2c86c: f8 94 cli 2c86e: de bf out 0x3e, r29 ; 62 2c870: 0f be out 0x3f, r0 ; 63 2c872: cd bf out 0x3d, r28 ; 61 2c874: 4c 01 movw r8, r24 2c876: 5b 01 movw r10, r22 2c878: 6a 01 movw r12, r20 2c87a: 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) {} 2c87c: 19 82 std Y+1, r1 ; 0x01 2c87e: 1c 82 std Y+4, r1 ; 0x04 2c880: 1c 8e std Y+28, r1 ; 0x1c 2c882: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2c884: 67 2b or r22, r23 2c886: 21 f5 brne .+72 ; 0x2c8d0 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2c888: 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; 2c88a: ce 01 movw r24, r28 2c88c: 4c 96 adiw r24, 0x1c ; 28 2c88e: 0e 94 38 77 call 0xee70 ; 0xee70 2c892: ce 01 movw r24, r28 2c894: 01 96 adiw r24, 0x01 ; 1 2c896: 0e 94 38 77 call 0xee70 ; 0xee70 } return open(parent, dname, oflag); fail: return false; } 2c89a: 81 2f mov r24, r17 2c89c: ce 5b subi r28, 0xBE ; 190 2c89e: df 4f sbci r29, 0xFF ; 255 2c8a0: 0f b6 in r0, 0x3f ; 63 2c8a2: f8 94 cli 2c8a4: de bf out 0x3e, r29 ; 62 2c8a6: 0f be out 0x3f, r0 ; 63 2c8a8: cd bf out 0x3d, r28 ; 61 2c8aa: df 91 pop r29 2c8ac: cf 91 pop r28 2c8ae: 1f 91 pop r17 2c8b0: 0f 91 pop r16 2c8b2: ff 90 pop r15 2c8b4: ef 90 pop r14 2c8b6: df 90 pop r13 2c8b8: cf 90 pop r12 2c8ba: bf 90 pop r11 2c8bc: af 90 pop r10 2c8be: 9f 90 pop r9 2c8c0: 8f 90 pop r8 2c8c2: 7f 90 pop r7 2c8c4: 6f 90 pop r6 2c8c6: 5f 90 pop r5 2c8c8: 4f 90 pop r4 2c8ca: 3f 90 pop r3 2c8cc: 2f 90 pop r2 2c8ce: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2c8d0: fc 01 movw r30, r24 2c8d2: 83 81 ldd r24, Z+3 ; 0x03 2c8d4: 81 11 cpse r24, r1 2c8d6: d8 cf rjmp .-80 ; 0x2c888 if (*path == '/') { 2c8d8: fa 01 movw r30, r20 2c8da: 80 81 ld r24, Z 2c8dc: 8f 32 cpi r24, 0x2F ; 47 2c8de: c1 f4 brne .+48 ; 0x2c910 2c8e0: ca 01 movw r24, r20 2c8e2: 6c 01 movw r12, r24 2c8e4: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2c8e6: f6 01 movw r30, r12 2c8e8: 20 81 ld r18, Z 2c8ea: 2f 32 cpi r18, 0x2F ; 47 2c8ec: d1 f3 breq .-12 ; 0x2c8e2 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; 2c8ee: f5 01 movw r30, r10 2c8f0: 83 81 ldd r24, Z+3 ; 0x03 2c8f2: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2c8f4: 82 30 cpi r24, 0x02 ; 2 2c8f6: 60 f0 brcs .+24 ; 0x2c910 if (!dir2.openRoot(dirFile->vol_)) goto fail; 2c8f8: 61 8d ldd r22, Z+25 ; 0x19 2c8fa: 72 8d ldd r23, Z+26 ; 0x1a 2c8fc: ce 01 movw r24, r28 2c8fe: 4c 96 adiw r24, 0x1c ; 28 2c900: 0f 94 d0 55 call 0x2aba0 ; 0x2aba0 parent = &dir2; 2c904: 8e 01 movw r16, r28 2c906: 04 5e subi r16, 0xE4 ; 228 2c908: 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; 2c90a: 81 11 cpse r24, r1 2c90c: 02 c0 rjmp .+4 ; 0x2c912 2c90e: bc cf rjmp .-136 ; 0x2c888 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2c910: 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; 2c912: ce 01 movw r24, r28 2c914: 01 96 adiw r24, 0x01 ; 1 2c916: 7c 01 movw r14, r24 2c918: 3c 01 movw r6, r24 2c91a: 2e 01 movw r4, r28 2c91c: 9c e1 ldi r25, 0x1C ; 28 2c91e: 49 0e add r4, r25 2c920: 51 1c adc r5, r1 2c922: 23 96 adiw r28, 0x03 ; 3 2c924: ef ae std Y+63, r14 ; 0x3f 2c926: 23 97 sbiw r28, 0x03 ; 3 2c928: 2f 2c mov r2, r15 2c92a: fe 01 movw r30, r28 2c92c: f7 96 adiw r30, 0x37 ; 55 2c92e: cf 01 movw r24, r30 2c930: 0b 96 adiw r24, 0x0b ; 11 2c932: 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++] = ' '; 2c934: 20 e2 ldi r18, 0x20 ; 32 2c936: 21 93 st Z+, r18 2c938: e8 17 cp r30, r24 2c93a: f9 07 cpc r31, r25 2c93c: d9 f7 brne .-10 ; 0x2c934 2c93e: 96 01 movw r18, r12 i = 0; 2c940: 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 2c942: 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 != '/') { 2c944: d9 01 movw r26, r18 2c946: 8d 91 ld r24, X+ 2c948: 88 23 and r24, r24 2c94a: 49 f1 breq .+82 ; 0x2c99e 2c94c: 8f 32 cpi r24, 0x2F ; 47 2c94e: 39 f1 breq .+78 ; 0x2c99e c = *str++; 2c950: 28 2f mov r18, r24 if (c == '.') { 2c952: 8e 32 cpi r24, 0x2E ; 46 2c954: 39 f4 brne .+14 ; 0x2c964 if (n == 10) goto fail; // only one dot allowed 2c956: 6a 30 cpi r22, 0x0A ; 10 2c958: 09 f4 brne .+2 ; 0x2c95c 2c95a: 96 cf rjmp .-212 ; 0x2c888 n = 10; // max index for full 8.3 name i = 8; // place for extension 2c95c: 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 2c95e: 6a e0 ldi r22, 0x0A ; 10 2c960: 9d 01 movw r18, r26 2c962: f0 cf rjmp .-32 ; 0x2c944 2c964: e4 e5 ldi r30, 0x54 ; 84 2c966: 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; 2c968: 34 91 lpm r19, Z 2c96a: 33 23 and r19, r19 2c96c: 21 f0 breq .+8 ; 0x2c976 2c96e: 31 96 adiw r30, 0x01 ; 1 2c970: 83 13 cpse r24, r19 2c972: fa cf rjmp .-12 ; 0x2c968 2c974: 89 cf rjmp .-238 ; 0x2c888 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2c976: 69 17 cp r22, r25 2c978: 08 f4 brcc .+2 ; 0x2c97c 2c97a: 86 cf rjmp .-244 ; 0x2c888 2c97c: 3f ed ldi r19, 0xDF ; 223 2c97e: 38 0f add r19, r24 2c980: 3e 35 cpi r19, 0x5E ; 94 2c982: 08 f0 brcs .+2 ; 0x2c986 2c984: 81 cf rjmp .-254 ; 0x2c888 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2c986: 3f e9 ldi r19, 0x9F ; 159 2c988: 38 0f add r19, r24 2c98a: 3a 31 cpi r19, 0x1A ; 26 2c98c: 10 f4 brcc .+4 ; 0x2c992 2c98e: 20 ee ldi r18, 0xE0 ; 224 2c990: 28 0f add r18, r24 2c992: fa 01 movw r30, r20 2c994: e9 0f add r30, r25 2c996: f1 1d adc r31, r1 2c998: 20 83 st Z, r18 2c99a: 9f 5f subi r25, 0xFF ; 255 2c99c: e1 cf rjmp .-62 ; 0x2c960 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2c99e: 8f a9 ldd r24, Y+55 ; 0x37 2c9a0: 80 32 cpi r24, 0x20 ; 32 2c9a2: 09 f4 brne .+2 ; 0x2c9a6 2c9a4: 71 cf rjmp .-286 ; 0x2c888 2c9a6: 69 01 movw r12, r18 while (*path == '/') path++; 2c9a8: f9 01 movw r30, r18 2c9aa: 80 81 ld r24, Z 2c9ac: 2f 5f subi r18, 0xFF ; 255 2c9ae: 3f 4f sbci r19, 0xFF ; 255 2c9b0: 8f 32 cpi r24, 0x2F ; 47 2c9b2: c9 f3 breq .-14 ; 0x2c9a6 if (!*path) break; 2c9b4: 88 23 and r24, r24 2c9b6: d9 f0 breq .+54 ; 0x2c9ee if (!sub->open(parent, dname, O_READ)) goto fail; 2c9b8: 21 e0 ldi r18, 0x01 ; 1 2c9ba: b8 01 movw r22, r16 2c9bc: c7 01 movw r24, r14 2c9be: 0f 94 3e 5a call 0x2b47c ; 0x2b47c 2c9c2: 88 23 and r24, r24 2c9c4: 09 f4 brne .+2 ; 0x2c9c8 2c9c6: 60 cf rjmp .-320 ; 0x2c888 if (parent != dirFile) parent->close(); 2c9c8: 0a 15 cp r16, r10 2c9ca: 1b 05 cpc r17, r11 2c9cc: 19 f0 breq .+6 ; 0x2c9d4 2c9ce: c8 01 movw r24, r16 2c9d0: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2c9d4: 94 2d mov r25, r4 2c9d6: 85 2d mov r24, r5 2c9d8: 6e 14 cp r6, r14 2c9da: 7f 04 cpc r7, r15 2c9dc: 21 f0 breq .+8 ; 0x2c9e6 2c9de: 23 96 adiw r28, 0x03 ; 3 2c9e0: 9f ad ldd r25, Y+63 ; 0x3f 2c9e2: 23 97 sbiw r28, 0x03 ; 3 2c9e4: 82 2d mov r24, r2 2c9e6: 87 01 movw r16, r14 2c9e8: e9 2e mov r14, r25 2c9ea: f8 2e mov r15, r24 2c9ec: 9e cf rjmp .-196 ; 0x2c92a } return open(parent, dname, oflag); 2c9ee: 23 2d mov r18, r3 2c9f0: b8 01 movw r22, r16 2c9f2: c4 01 movw r24, r8 2c9f4: 0f 94 3e 5a call 0x2b47c ; 0x2b47c 2c9f8: 18 2f mov r17, r24 2c9fa: 47 cf rjmp .-370 ; 0x2c88a 0002c9fc : 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){ 2c9fc: 2f 92 push r2 2c9fe: 3f 92 push r3 2ca00: 4f 92 push r4 2ca02: 5f 92 push r5 2ca04: 6f 92 push r6 2ca06: 7f 92 push r7 2ca08: 8f 92 push r8 2ca0a: 9f 92 push r9 2ca0c: af 92 push r10 2ca0e: bf 92 push r11 2ca10: cf 92 push r12 2ca12: df 92 push r13 2ca14: ef 92 push r14 2ca16: ff 92 push r15 2ca18: 0f 93 push r16 2ca1a: 1f 93 push r17 2ca1c: cf 93 push r28 2ca1e: df 93 push r29 2ca20: 00 d0 rcall .+0 ; 0x2ca22 2ca22: 1f 92 push r1 2ca24: 1f 92 push r1 2ca26: cd b7 in r28, 0x3d ; 61 2ca28: de b7 in r29, 0x3e ; 62 2ca2a: 1c 01 movw r2, r24 2ca2c: 2a 01 movw r4, r20 2ca2e: 3b 01 movw r6, r22 2ca30: 00 e2 ldi r16, 0x20 ; 32 2ca32: 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){ 2ca34: 19 82 std Y+1, r1 ; 0x01 2ca36: 99 81 ldd r25, Y+1 ; 0x01 2ca38: 89 2f mov r24, r25 2ca3a: 90 e0 ldi r25, 0x00 ; 0 2ca3c: 9b 83 std Y+3, r25 ; 0x03 2ca3e: 8a 83 std Y+2, r24 ; 0x02 2ca40: 80 17 cp r24, r16 2ca42: 91 07 cpc r25, r17 2ca44: 9c f5 brge .+102 ; 0x2caac if (points[j] > points[j + 1]) 2ca46: 88 0f add r24, r24 2ca48: 99 1f adc r25, r25 2ca4a: 88 0f add r24, r24 2ca4c: 99 1f adc r25, r25 2ca4e: 9d 83 std Y+5, r25 ; 0x05 2ca50: 8c 83 std Y+4, r24 ; 0x04 2ca52: 82 0d add r24, r2 2ca54: 93 1d adc r25, r3 2ca56: 9b 83 std Y+3, r25 ; 0x03 2ca58: 8a 83 std Y+2, r24 ; 0x02 2ca5a: fc 01 movw r30, r24 2ca5c: c0 80 ld r12, Z 2ca5e: d1 80 ldd r13, Z+1 ; 0x01 2ca60: e2 80 ldd r14, Z+2 ; 0x02 2ca62: f3 80 ldd r15, Z+3 ; 0x03 2ca64: 8c 81 ldd r24, Y+4 ; 0x04 2ca66: 9d 81 ldd r25, Y+5 ; 0x05 2ca68: 04 96 adiw r24, 0x04 ; 4 2ca6a: 82 0d add r24, r2 2ca6c: 93 1d adc r25, r3 2ca6e: 9d 83 std Y+5, r25 ; 0x05 2ca70: 8c 83 std Y+4, r24 ; 0x04 2ca72: fc 01 movw r30, r24 2ca74: 80 80 ld r8, Z 2ca76: 91 80 ldd r9, Z+1 ; 0x01 2ca78: a2 80 ldd r10, Z+2 ; 0x02 2ca7a: b3 80 ldd r11, Z+3 ; 0x03 2ca7c: a5 01 movw r20, r10 2ca7e: 94 01 movw r18, r8 2ca80: c7 01 movw r24, r14 2ca82: b6 01 movw r22, r12 2ca84: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2ca88: 18 16 cp r1, r24 2ca8a: 64 f4 brge .+24 ; 0x2caa4 SWAP(points[j], points[j + 1]); 2ca8c: ea 81 ldd r30, Y+2 ; 0x02 2ca8e: fb 81 ldd r31, Y+3 ; 0x03 2ca90: 80 82 st Z, r8 2ca92: 91 82 std Z+1, r9 ; 0x01 2ca94: a2 82 std Z+2, r10 ; 0x02 2ca96: b3 82 std Z+3, r11 ; 0x03 2ca98: ec 81 ldd r30, Y+4 ; 0x04 2ca9a: fd 81 ldd r31, Y+5 ; 0x05 2ca9c: c0 82 st Z, r12 2ca9e: d1 82 std Z+1, r13 ; 0x01 2caa0: e2 82 std Z+2, r14 ; 0x02 2caa2: 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){ 2caa4: f9 81 ldd r31, Y+1 ; 0x01 2caa6: ff 5f subi r31, 0xFF ; 255 2caa8: f9 83 std Y+1, r31 ; 0x01 2caaa: c5 cf rjmp .-118 ; 0x2ca36 2caac: 01 50 subi r16, 0x01 ; 1 2caae: 11 09 sbc r17, r1 2cab0: 08 f6 brcc .-126 ; 0x2ca34 /// 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]; 2cab2: f1 01 movw r30, r2 2cab4: e0 5c subi r30, 0xC0 ; 192 2cab6: 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); 2cab8: 20 81 ld r18, Z 2caba: 31 81 ldd r19, Z+1 ; 0x01 2cabc: 42 81 ldd r20, Z+2 ; 0x02 2cabe: 53 81 ldd r21, Z+3 ; 0x03 2cac0: c3 01 movw r24, r6 2cac2: b2 01 movw r22, r4 2cac4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2cac8: 6b 01 movw r12, r22 2caca: 7c 01 movw r14, r24 2cacc: 20 e0 ldi r18, 0x00 ; 0 2cace: 30 e0 ldi r19, 0x00 ; 0 2cad0: 40 e0 ldi r20, 0x00 ; 0 2cad2: 5f eb ldi r21, 0xBF ; 191 2cad4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2cad8: 87 fd sbrc r24, 7 2cada: 10 c0 rjmp .+32 ; 0x2cafc 2cadc: 20 e0 ldi r18, 0x00 ; 0 2cade: 30 e0 ldi r19, 0x00 ; 0 2cae0: 40 e0 ldi r20, 0x00 ; 0 2cae2: 5f e3 ldi r21, 0x3F ; 63 2cae4: c7 01 movw r24, r14 2cae6: b6 01 movw r22, r12 2cae8: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2caec: 18 16 cp r1, r24 2caee: 5c f4 brge .+22 ; 0x2cb06 2caf0: c1 2c mov r12, r1 2caf2: d1 2c mov r13, r1 2caf4: e1 2c mov r14, r1 2caf6: 8f e3 ldi r24, 0x3F ; 63 2caf8: f8 2e mov r15, r24 2cafa: 05 c0 rjmp .+10 ; 0x2cb06 2cafc: c1 2c mov r12, r1 2cafe: d1 2c mov r13, r1 2cb00: e1 2c mov r14, r1 2cb02: 9f eb ldi r25, 0xBF ; 191 2cb04: f9 2e mov r15, r25 } 2cb06: c7 01 movw r24, r14 2cb08: b6 01 movw r22, r12 2cb0a: 0f 90 pop r0 2cb0c: 0f 90 pop r0 2cb0e: 0f 90 pop r0 2cb10: 0f 90 pop r0 2cb12: 0f 90 pop r0 2cb14: df 91 pop r29 2cb16: cf 91 pop r28 2cb18: 1f 91 pop r17 2cb1a: 0f 91 pop r16 2cb1c: ff 90 pop r15 2cb1e: ef 90 pop r14 2cb20: df 90 pop r13 2cb22: cf 90 pop r12 2cb24: bf 90 pop r11 2cb26: af 90 pop r10 2cb28: 9f 90 pop r9 2cb2a: 8f 90 pop r8 2cb2c: 7f 90 pop r7 2cb2e: 6f 90 pop r6 2cb30: 5f 90 pop r5 2cb32: 4f 90 pop r4 2cb34: 3f 90 pop r3 2cb36: 2f 90 pop r2 2cb38: 08 95 ret 0002cb3a : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2cb3a: 0f 94 53 29 call 0x252a6 ; 0x252a6 2cb3e: 60 93 5a 13 sts 0x135A, r22 ; 0x80135a 2cb42: 70 93 5b 13 sts 0x135B, r23 ; 0x80135b 2cb46: 80 93 5c 13 sts 0x135C, r24 ; 0x80135c 2cb4a: 90 93 5d 13 sts 0x135D, r25 ; 0x80135d } 2cb4e: 08 95 ret 0002cb50 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2cb50: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 2cb54: 88 23 and r24, r24 2cb56: 69 f0 breq .+26 ; 0x2cb72 2cb58: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cb5c: 88 23 and r24, r24 2cb5e: 49 f0 breq .+18 ; 0x2cb72 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2cb60: 87 e5 ldi r24, 0x57 ; 87 2cb62: 9b ea ldi r25, 0xAB ; 171 2cb64: 0e 94 82 79 call 0xf304 ; 0xf304 retryAttempts--; 2cb68: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 2cb6c: 81 50 subi r24, 0x01 ; 1 2cb6e: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f } } 2cb72: 08 95 ret 0002cb74 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2cb74: 9f 92 push r9 2cb76: af 92 push r10 2cb78: bf 92 push r11 2cb7a: cf 92 push r12 2cb7c: df 92 push r13 2cb7e: ef 92 push r14 2cb80: ff 92 push r15 2cb82: 0f 93 push r16 2cb84: 1f 93 push r17 2cb86: cf 93 push r28 2cb88: df 93 push r29 2cb8a: cd b7 in r28, 0x3d ; 61 2cb8c: de b7 in r29, 0x3e ; 62 2cb8e: e0 97 sbiw r28, 0x30 ; 48 2cb90: 0f b6 in r0, 0x3f ; 63 2cb92: f8 94 cli 2cb94: de bf out 0x3e, r29 ; 62 2cb96: 0f be out 0x3f, r0 ; 63 2cb98: cd bf out 0x3d, r28 ; 61 2cb9a: 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()]; 2cb9c: e0 90 88 13 lds r14, 0x1388 ; 0x801388 2cba0: fe 01 movw r30, r28 2cba2: 31 96 adiw r30, 0x01 ; 1 2cba4: 21 e0 ldi r18, 0x01 ; 1 2cba6: 30 e0 ldi r19, 0x00 ; 0 2cba8: 5f 01 movw r10, r30 2cbaa: f1 2c mov r15, r1 2cbac: 40 e1 ldi r20, 0x10 ; 16 2cbae: c4 2e mov r12, r20 2cbb0: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2cbb2: 50 e2 ldi r21, 0x20 ; 32 2cbb4: 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()]; 2cbb6: c7 01 movw r24, r14 2cbb8: 82 1b sub r24, r18 2cbba: 93 0b sbc r25, r19 2cbbc: b6 01 movw r22, r12 2cbbe: 0f 94 00 dd call 0x3ba00 ; 0x3ba00 <__divmodhi4> 2cbc2: dc 01 movw r26, r24 2cbc4: bb 27 eor r27, r27 2cbc6: a5 5b subi r26, 0xB5 ; 181 2cbc8: bc 4e sbci r27, 0xEC ; 236 2cbca: 9d 96 adiw r26, 0x2d ; 45 2cbcc: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2cbce: 48 2f mov r20, r24 2cbd0: 50 e0 ldi r21, 0x00 ; 0 2cbd2: 94 e0 ldi r25, 0x04 ; 4 2cbd4: 55 95 asr r21 2cbd6: 47 95 ror r20 2cbd8: 9a 95 dec r25 2cbda: e1 f7 brne .-8 ; 0x2cbd4 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2cbdc: 96 ef ldi r25, 0xF6 ; 246 2cbde: 94 0f add r25, r20 2cbe0: 96 30 cpi r25, 0x06 ; 6 2cbe2: a8 f1 brcs .+106 ; 0x2cc4e case 5: case 6: case 7: case 8: case 9: return c + '0'; 2cbe4: 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); 2cbe6: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2cbe8: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2cbea: 96 ef ldi r25, 0xF6 ; 246 2cbec: 98 0f add r25, r24 2cbee: 96 30 cpi r25, 0x06 ; 6 2cbf0: 80 f1 brcs .+96 ; 0x2cc52 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2cbf2: 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); 2cbf4: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2cbf6: 92 82 std Z+2, r9 ; 0x02 2cbf8: 2f 5f subi r18, 0xFF ; 255 2cbfa: 3f 4f sbci r19, 0xFF ; 255 2cbfc: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2cbfe: 21 31 cpi r18, 0x11 ; 17 2cc00: 31 05 cpc r19, r1 2cc02: c9 f6 brne .-78 ; 0x2cbb6 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 2cc04: 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); 2cc06: 80 ed ldi r24, 0xD0 ; 208 2cc08: 9b ea ldi r25, 0xAB ; 171 2cc0a: 0e 94 57 77 call 0xeeae ; 0xeeae 2cc0e: 8a ec ldi r24, 0xCA ; 202 2cc10: 9b ea ldi r25, 0xAB ; 171 2cc12: 0e 94 57 77 call 0xeeae ; 0xeeae 2cc16: c8 01 movw r24, r16 2cc18: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOPGM(", last bytes: "); 2cc1c: 82 e8 ldi r24, 0x82 ; 130 2cc1e: 9b ea ldi r25, 0xAB ; 171 2cc20: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(lrb); 2cc24: c5 01 movw r24, r10 2cc26: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e } 2cc2a: e0 96 adiw r28, 0x30 ; 48 2cc2c: 0f b6 in r0, 0x3f ; 63 2cc2e: f8 94 cli 2cc30: de bf out 0x3e, r29 ; 62 2cc32: 0f be out 0x3f, r0 ; 63 2cc34: cd bf out 0x3d, r28 ; 61 2cc36: df 91 pop r29 2cc38: cf 91 pop r28 2cc3a: 1f 91 pop r17 2cc3c: 0f 91 pop r16 2cc3e: ff 90 pop r15 2cc40: ef 90 pop r14 2cc42: df 90 pop r13 2cc44: cf 90 pop r12 2cc46: bf 90 pop r11 2cc48: af 90 pop r10 2cc4a: 9f 90 pop r9 2cc4c: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2cc4e: 49 5a subi r20, 0xA9 ; 169 2cc50: ca cf rjmp .-108 ; 0x2cbe6 2cc52: 89 5a subi r24, 0xA9 ; 169 2cc54: cf cf rjmp .-98 ; 0x2cbf4 0002cc56 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2cc56: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2cc58: 90 91 5f 13 lds r25, 0x135F ; 0x80135f 2cc5c: 9a 30 cpi r25, 0x0A ; 10 2cc5e: 11 f4 brne .+4 ; 0x2cc64 cause = ss; 2cc60: 60 93 5e 13 sts 0x135E, r22 ; 0x80135e } --occurrences; 2cc64: 91 50 subi r25, 0x01 ; 1 2cc66: 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)) { 2cc6a: 91 11 cpse r25, r1 2cc6c: 0d c0 rjmp .+26 ; 0x2cc88 2cc6e: c9 01 movw r24, r18 LogError(msg_P); 2cc70: 0f 94 ba 65 call 0x2cb74 ; 0x2cb74 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2cc74: 83 e7 ldi r24, 0x73 ; 115 2cc76: 9b ea ldi r25, 0xAB ; 171 2cc78: 0e 94 82 79 call 0xf304 ; 0xf304 /// @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; } 2cc7c: 8a e0 ldi r24, 0x0A ; 10 2cc7e: 80 93 5f 13 sts 0x135F, r24 ; 0x80135f 2cc82: 80 91 5e 13 lds r24, 0x135E ; 0x80135e 2cc86: 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 2cc88: 80 e0 ldi r24, 0x00 ; 0 } } 2cc8a: 08 95 ret 0002cc8c : } *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) { 2cc8c: cf 93 push r28 2cc8e: df 93 push r29 2cc90: cd b7 in r28, 0x3d ; 61 2cc92: de b7 in r29, 0x3e ; 62 2cc94: 2e 97 sbiw r28, 0x0e ; 14 2cc96: 0f b6 in r0, 0x3f ; 63 2cc98: f8 94 cli 2cc9a: de bf out 0x3e, r29 ; 62 2cc9c: 0f be out 0x3f, r0 ; 63 2cc9e: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2cca0: 2e e3 ldi r18, 0x3E ; 62 2cca2: 30 e0 ldi r19, 0x00 ; 0 2cca4: 3a 83 std Y+2, r19 ; 0x02 2cca6: 29 83 std Y+1, r18 ; 0x01 2cca8: fe 01 movw r30, r28 2ccaa: 33 96 adiw r30, 0x03 ; 3 2ccac: 2c e0 ldi r18, 0x0C ; 12 2ccae: df 01 movw r26, r30 2ccb0: 1d 92 st X+, r1 2ccb2: 2a 95 dec r18 2ccb4: e9 f7 brne .-6 ; 0x2ccb0 2ccb6: de 01 movw r26, r28 2ccb8: 12 96 adiw r26, 0x02 ; 2 2ccba: 48 2f mov r20, r24 2ccbc: fc 01 movw r30, r24 2ccbe: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2ccc0: 8e 2f mov r24, r30 2ccc2: 84 1b sub r24, r20 2ccc4: 86 17 cp r24, r22 2ccc6: 40 f4 brcc .+16 ; 0x2ccd8 uint8_t b = txbuff[i]; 2ccc8: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2ccca: 90 ee ldi r25, 0xE0 ; 224 2cccc: 98 0f add r25, r24 2ccce: 90 36 cpi r25, 0x60 ; 96 2ccd0: 08 f0 brcs .+2 ; 0x2ccd4 b = '.'; 2ccd2: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2ccd4: 8d 93 st X+, r24 2ccd6: f4 cf rjmp .-24 ; 0x2ccc0 } tmp[size + 1] = 0; 2ccd8: f9 01 movw r30, r18 2ccda: e6 0f add r30, r22 2ccdc: f1 1d adc r31, r1 2ccde: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2cce0: 4e e0 ldi r20, 0x0E ; 14 2cce2: 50 e0 ldi r21, 0x00 ; 0 2cce4: 66 ed ldi r22, 0xD6 ; 214 2cce6: 7b ea ldi r23, 0xAB ; 171 2cce8: ce 01 movw r24, r28 2ccea: 01 96 adiw r24, 0x01 ; 1 2ccec: 0f 94 02 da call 0x3b404 ; 0x3b404 2ccf0: 89 2b or r24, r25 2ccf2: 59 f4 brne .+22 ; 0x2cd0a 2ccf4: 4e e0 ldi r20, 0x0E ; 14 2ccf6: 50 e0 ldi r21, 0x00 ; 0 2ccf8: be 01 movw r22, r28 2ccfa: 6f 5f subi r22, 0xFF ; 255 2ccfc: 7f 4f sbci r23, 0xFF ; 255 2ccfe: 82 ea ldi r24, 0xA2 ; 162 2cd00: 92 e1 ldi r25, 0x12 ; 18 2cd02: 0f 94 95 e2 call 0x3c52a ; 0x3c52a 2cd06: 89 2b or r24, r25 2cd08: 61 f0 breq .+24 ; 0x2cd22 // 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); 2cd0a: 80 ed ldi r24, 0xD0 ; 208 2cd0c: 9b ea ldi r25, 0xAB ; 171 2cd0e: 0e 94 57 77 call 0xeeae ; 0xeeae 2cd12: 8a ec ldi r24, 0xCA ; 202 2cd14: 9b ea ldi r25, 0xAB ; 171 2cd16: 0e 94 57 77 call 0xeeae ; 0xeeae 2cd1a: ce 01 movw r24, r28 2cd1c: 01 96 adiw r24, 0x01 ; 1 2cd1e: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e } strncpy(lastMsg, tmp, rqs); 2cd22: 4e e0 ldi r20, 0x0E ; 14 2cd24: 50 e0 ldi r21, 0x00 ; 0 2cd26: be 01 movw r22, r28 2cd28: 6f 5f subi r22, 0xFF ; 255 2cd2a: 7f 4f sbci r23, 0xFF ; 255 2cd2c: 82 ea ldi r24, 0xA2 ; 162 2cd2e: 92 e1 ldi r25, 0x12 ; 18 2cd30: 0f 94 a3 e2 call 0x3c546 ; 0x3c546 } 2cd34: 2e 96 adiw r28, 0x0e ; 14 2cd36: 0f b6 in r0, 0x3f ; 63 2cd38: f8 94 cli 2cd3a: de bf out 0x3e, r29 ; 62 2cd3c: 0f be out 0x3f, r0 ; 63 2cd3e: cd bf out 0x3d, r28 ; 61 2cd40: df 91 pop r29 2cd42: cf 91 pop r28 2cd44: 08 95 ret 0002cd46 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2cd46: cf 92 push r12 2cd48: df 92 push r13 2cd4a: ef 92 push r14 2cd4c: ff 92 push r15 2cd4e: 1f 93 push r17 2cd50: cf 93 push r28 2cd52: df 93 push r29 2cd54: cd b7 in r28, 0x3d ; 61 2cd56: de b7 in r29, 0x3e ; 62 2cd58: 62 97 sbiw r28, 0x12 ; 18 2cd5a: 0f b6 in r0, 0x3f ; 63 2cd5c: f8 94 cli 2cd5e: de bf out 0x3e, r29 ; 62 2cd60: 0f be out 0x3f, r0 ; 63 2cd62: cd bf out 0x3d, r28 ; 61 2cd64: 4e 87 std Y+14, r20 ; 0x0e 2cd66: 5f 87 std Y+15, r21 ; 0x0f 2cd68: 68 8b std Y+16, r22 ; 0x10 2cd6a: 79 8b std Y+17, r23 ; 0x11 2cd6c: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2cd6e: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2cd70: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cd72: 51 11 cpse r21, r1 2cd74: 31 c0 rjmp .+98 ; 0x2cdd8 *dst = '0'; 2cd76: 80 e3 ldi r24, 0x30 ; 48 2cd78: 8a 83 std Y+2, r24 ; 0x02 return 1; 2cd7a: 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); 2cd7c: e1 e0 ldi r30, 0x01 ; 1 2cd7e: e1 0f add r30, r17 2cd80: 81 e0 ldi r24, 0x01 ; 1 2cd82: 90 e0 ldi r25, 0x00 ; 0 2cd84: 8c 0f add r24, r28 2cd86: 9d 1f adc r25, r29 2cd88: 8e 0f add r24, r30 2cd8a: 91 1d adc r25, r1 2cd8c: fc 01 movw r30, r24 2cd8e: 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 2cd90: 9a e2 ldi r25, 0x2A ; 42 2cd92: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cd94: 81 11 cpse r24, r1 2cd96: 27 c0 rjmp .+78 ; 0x2cde6 *dst = '0'; 2cd98: 80 e3 ldi r24, 0x30 ; 48 2cd9a: 81 83 std Z+1, r24 ; 0x01 return 1; 2cd9c: 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); 2cd9e: 1e 5f subi r17, 0xFE ; 254 2cda0: 18 0f add r17, r24 txbuff[i] = '\n'; 2cda2: e1 e0 ldi r30, 0x01 ; 1 2cda4: f0 e0 ldi r31, 0x00 ; 0 2cda6: ec 0f add r30, r28 2cda8: fd 1f adc r31, r29 2cdaa: e1 0f add r30, r17 2cdac: f1 1d adc r31, r1 2cdae: 8a e0 ldi r24, 0x0A ; 10 2cdb0: 80 83 st Z, r24 ++i; 2cdb2: 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); 2cdb4: fe 01 movw r30, r28 2cdb6: 31 96 adiw r30, 0x01 ; 1 2cdb8: 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--){ 2cdba: 6f 01 movw r12, r30 2cdbc: c1 0e add r12, r17 2cdbe: d1 1c adc r13, r1 2cdc0: ec 14 cp r14, r12 2cdc2: fd 04 cpc r15, r13 2cdc4: b1 f0 breq .+44 ; 0x2cdf2 fputc(*buffer, uart2io); 2cdc6: f7 01 movw r30, r14 2cdc8: 81 91 ld r24, Z+ 2cdca: 7f 01 movw r14, r30 2cdcc: 64 e9 ldi r22, 0x94 ; 148 2cdce: 72 e1 ldi r23, 0x12 ; 18 2cdd0: 90 e0 ldi r25, 0x00 ; 0 2cdd2: 0f 94 8b da call 0x3b516 ; 0x3b516 2cdd6: f4 cf rjmp .-24 ; 0x2cdc0 2cdd8: be 01 movw r22, r28 2cdda: 6e 5f subi r22, 0xFE ; 254 2cddc: 7f 4f sbci r23, 0xFF ; 255 2cdde: 0f 94 44 c5 call 0x38a88 ; 0x38a88 2cde2: 18 2f mov r17, r24 2cde4: cb cf rjmp .-106 ; 0x2cd7c 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); 2cde6: bf 01 movw r22, r30 2cde8: 6f 5f subi r22, 0xFF ; 255 2cdea: 7f 4f sbci r23, 0xFF ; 255 2cdec: 0f 94 44 c5 call 0x38a88 ; 0x38a88 2cdf0: d6 cf rjmp .-84 ; 0x2cd9e LogRequestMsg(txbuff, len); 2cdf2: 61 2f mov r22, r17 2cdf4: ce 01 movw r24, r28 2cdf6: 01 96 adiw r24, 0x01 ; 1 2cdf8: 0f 94 46 66 call 0x2cc8c ; 0x2cc8c RecordUARTActivity(); 2cdfc: 0f 94 9d 65 call 0x2cb3a ; 0x2cb3a } 2ce00: 62 96 adiw r28, 0x12 ; 18 2ce02: 0f b6 in r0, 0x3f ; 63 2ce04: f8 94 cli 2ce06: de bf out 0x3e, r29 ; 62 2ce08: 0f be out 0x3f, r0 ; 63 2ce0a: cd bf out 0x3d, r28 ; 61 2ce0c: df 91 pop r29 2ce0e: cf 91 pop r28 2ce10: 1f 91 pop r17 2ce12: ff 90 pop r15 2ce14: ef 90 pop r14 2ce16: df 90 pop r13 2ce18: cf 90 pop r12 2ce1a: 08 95 ret 0002ce1c : 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) { 2ce1c: 8f 92 push r8 2ce1e: 9f 92 push r9 2ce20: af 92 push r10 2ce22: bf 92 push r11 2ce24: df 92 push r13 2ce26: ef 92 push r14 2ce28: ff 92 push r15 2ce2a: 0f 93 push r16 2ce2c: 1f 93 push r17 2ce2e: cf 93 push r28 2ce30: df 93 push r29 2ce32: cd b7 in r28, 0x3d ; 61 2ce34: de b7 in r29, 0x3e ; 62 2ce36: 67 97 sbiw r28, 0x17 ; 23 2ce38: 0f b6 in r0, 0x3f ; 63 2ce3a: f8 94 cli 2ce3c: de bf out 0x3e, r29 ; 62 2ce3e: 0f be out 0x3f, r0 ; 63 2ce40: cd bf out 0x3d, r28 ; 61 2ce42: 18 2f mov r17, r24 2ce44: 7b 01 movw r14, r22 2ce46: d4 2e mov r13, r20 2ce48: 07 e5 ldi r16, 0x57 ; 87 2ce4a: 0b 8b std Y+19, r16 ; 0x13 2ce4c: 8c 8b std Y+20, r24 ; 0x14 2ce4e: 7e 8b std Y+22, r23 ; 0x16 2ce50: 6d 8b std Y+21, r22 ; 0x15 2ce52: ce 01 movw r24, r28 2ce54: 43 96 adiw r24, 0x13 ; 19 2ce56: 0f 94 70 c5 call 0x38ae0 ; 0x38ae0 2ce5a: 8f 8b std Y+23, r24 ; 0x17 2ce5c: 0e 87 std Y+14, r16 ; 0x0e 2ce5e: 1f 87 std Y+15, r17 ; 0x0f 2ce60: f9 8a std Y+17, r15 ; 0x11 2ce62: e8 8a std Y+16, r14 ; 0x10 2ce64: ce 01 movw r24, r28 2ce66: 0e 96 adiw r24, 0x0e ; 14 2ce68: 0f 94 70 c5 call 0x38ae0 ; 0x38ae0 2ce6c: 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; 2ce6e: 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) { 2ce70: 11 11 cpse r17, r1 2ce72: 27 c0 rjmp .+78 ; 0x2cec2 *dst = '0'; 2ce74: 80 e3 ldi r24, 0x30 ; 48 2ce76: 8a 83 std Y+2, r24 ; 0x02 return 1; 2ce78: 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); 2ce7a: e1 e0 ldi r30, 0x01 ; 1 2ce7c: e8 0f add r30, r24 dst[i] = ' '; 2ce7e: 21 e0 ldi r18, 0x01 ; 1 2ce80: 30 e0 ldi r19, 0x00 ; 0 2ce82: 2c 0f add r18, r28 2ce84: 3d 1f adc r19, r29 2ce86: 2e 0f add r18, r30 2ce88: 31 1d adc r19, r1 2ce8a: f9 01 movw r30, r18 2ce8c: 90 e2 ldi r25, 0x20 ; 32 2ce8e: 90 83 st Z, r25 return i + 1; 2ce90: 02 e0 ldi r16, 0x02 ; 2 2ce92: 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); 2ce94: aa 24 eor r10, r10 2ce96: a3 94 inc r10 2ce98: b1 2c mov r11, r1 2ce9a: ac 0e add r10, r28 2ce9c: bd 1e adc r11, r29 2ce9e: a0 0e add r10, r16 2cea0: 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) { 2cea2: e1 14 cp r14, r1 2cea4: f1 04 cpc r15, r1 2cea6: 39 f1 breq .+78 ; 0x2cef6 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2cea8: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2ceaa: c7 01 movw r24, r14 2ceac: 88 27 eor r24, r24 2ceae: 90 7f andi r25, 0xF0 ; 240 2ceb0: 89 2b or r24, r25 2ceb2: 71 f4 brne .+28 ; 0x2ced0 value <<= 4U; 2ceb4: 24 e0 ldi r18, 0x04 ; 4 2ceb6: ee 0c add r14, r14 2ceb8: ff 1c adc r15, r15 2ceba: 2a 95 dec r18 2cebc: e1 f7 brne .-8 ; 0x2ceb6 --charsOut; 2cebe: 11 50 subi r17, 0x01 ; 1 2cec0: f4 cf rjmp .-24 ; 0x2ceaa 2cec2: be 01 movw r22, r28 2cec4: 6e 5f subi r22, 0xFE ; 254 2cec6: 7f 4f sbci r23, 0xFF ; 255 2cec8: 81 2f mov r24, r17 2ceca: 0f 94 44 c5 call 0x38a88 ; 0x38a88 2cece: d5 cf rjmp .-86 ; 0x2ce7a *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2ced0: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2ced2: 88 2d mov r24, r8 2ced4: 8a 19 sub r24, r10 2ced6: 81 17 cp r24, r17 2ced8: 90 f4 brcc .+36 ; 0x2cefe uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2ceda: 8f 2d mov r24, r15 2cedc: 82 95 swap r24 2cede: 8f 70 andi r24, 0x0F ; 15 2cee0: 94 e0 ldi r25, 0x04 ; 4 2cee2: ee 0c add r14, r14 2cee4: ff 1c adc r15, r15 2cee6: 9a 95 dec r25 2cee8: e1 f7 brne .-8 ; 0x2cee2 2ceea: 0f 94 3a c5 call 0x38a74 ; 0x38a74 2ceee: f4 01 movw r30, r8 2cef0: 81 93 st Z+, r24 2cef2: 4f 01 movw r8, r30 2cef4: ee cf rjmp .-36 ; 0x2ced2 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2cef6: 80 e3 ldi r24, 0x30 ; 48 2cef8: f5 01 movw r30, r10 2cefa: 80 83 st Z, r24 return 1; 2cefc: 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); 2cefe: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2cf00: e1 e0 ldi r30, 0x01 ; 1 2cf02: f0 e0 ldi r31, 0x00 ; 0 2cf04: ec 0f add r30, r28 2cf06: fd 1f adc r31, r29 2cf08: e1 0f add r30, r17 2cf0a: f1 1d adc r31, r1 2cf0c: 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 2cf0e: 9a e2 ldi r25, 0x2A ; 42 2cf10: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2cf12: 81 11 cpse r24, r1 2cf14: 21 c0 rjmp .+66 ; 0x2cf58 *dst = '0'; 2cf16: 80 e3 ldi r24, 0x30 ; 48 2cf18: 81 83 std Z+1, r24 ; 0x01 return 1; 2cf1a: 81 e0 ldi r24, 0x01 ; 1 2cf1c: 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); 2cf1e: 18 0f add r17, r24 txbuff[i] = '\n'; 2cf20: e1 e0 ldi r30, 0x01 ; 1 2cf22: f0 e0 ldi r31, 0x00 ; 0 2cf24: ec 0f add r30, r28 2cf26: fd 1f adc r31, r29 2cf28: e1 0f add r30, r17 2cf2a: f1 1d adc r31, r1 2cf2c: 8a e0 ldi r24, 0x0A ; 10 2cf2e: 80 83 st Z, r24 ++i; 2cf30: 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); 2cf32: 9e 01 movw r18, r28 2cf34: 2f 5f subi r18, 0xFF ; 255 2cf36: 3f 4f sbci r19, 0xFF ; 255 2cf38: 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--){ 2cf3a: 59 01 movw r10, r18 2cf3c: a1 0e add r10, r17 2cf3e: b1 1c adc r11, r1 2cf40: ea 14 cp r14, r10 2cf42: fb 04 cpc r15, r11 2cf44: 79 f0 breq .+30 ; 0x2cf64 fputc(*buffer, uart2io); 2cf46: f7 01 movw r30, r14 2cf48: 81 91 ld r24, Z+ 2cf4a: 7f 01 movw r14, r30 2cf4c: 64 e9 ldi r22, 0x94 ; 148 2cf4e: 72 e1 ldi r23, 0x12 ; 18 2cf50: 90 e0 ldi r25, 0x00 ; 0 2cf52: 0f 94 8b da call 0x3b516 ; 0x3b516 2cf56: f4 cf rjmp .-24 ; 0x2cf40 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); 2cf58: bf 01 movw r22, r30 2cf5a: 6f 5f subi r22, 0xFF ; 255 2cf5c: 7f 4f sbci r23, 0xFF ; 255 2cf5e: 0f 94 44 c5 call 0x38a88 ; 0x38a88 2cf62: dc cf rjmp .-72 ; 0x2cf1c LogRequestMsg(txbuff, len); 2cf64: 61 2f mov r22, r17 2cf66: ce 01 movw r24, r28 2cf68: 01 96 adiw r24, 0x01 ; 1 2cf6a: 0f 94 46 66 call 0x2cc8c ; 0x2cc8c RecordUARTActivity(); 2cf6e: 0f 94 9d 65 call 0x2cb3a ; 0x2cb3a scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2cf72: d0 92 4e 13 sts 0x134E, r13 ; 0x80134e } 2cf76: 67 96 adiw r28, 0x17 ; 23 2cf78: 0f b6 in r0, 0x3f ; 63 2cf7a: f8 94 cli 2cf7c: de bf out 0x3e, r29 ; 62 2cf7e: 0f be out 0x3f, r0 ; 63 2cf80: cd bf out 0x3d, r28 ; 61 2cf82: df 91 pop r29 2cf84: cf 91 pop r28 2cf86: 1f 91 pop r17 2cf88: 0f 91 pop r16 2cf8a: ff 90 pop r15 2cf8c: ef 90 pop r14 2cf8e: df 90 pop r13 2cf90: bf 90 pop r11 2cf92: af 90 pop r10 2cf94: 9f 90 pop r9 2cf96: 8f 90 pop r8 2cf98: 08 95 ret 0002cf9a : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2cf9a: 20 91 99 13 lds r18, 0x1399 ; 0x801399 2cf9e: 2f 5f subi r18, 0xFF ; 255 2cfa0: 20 93 99 13 sts 0x1399, r18 ; 0x801399 if (regIndex >= initRegs8Count) { 2cfa4: 22 30 cpi r18, 0x02 ; 2 2cfa6: 78 f4 brcc .+30 ; 0x2cfc6 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2cfa8: 30 e0 ldi r19, 0x00 ; 0 2cfaa: f9 01 movw r30, r18 2cfac: ef 58 subi r30, 0x8F ; 143 2cfae: f4 45 sbci r31, 0x54 ; 84 2cfb0: 84 91 lpm r24, Z 2cfb2: 29 56 subi r18, 0x69 ; 105 2cfb4: 3c 4e sbci r19, 0xEC ; 236 2cfb6: f9 01 movw r30, r18 2cfb8: 60 81 ld r22, Z 2cfba: 70 e0 ldi r23, 0x00 ; 0 2cfbc: 49 e0 ldi r20, 0x09 ; 9 2cfbe: 0f 94 0e 67 call 0x2ce1c ; 0x2ce1c } return false; 2cfc2: 80 e0 ldi r24, 0x00 ; 0 2cfc4: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2cfc6: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2cfc8: 08 95 ret 0002cfca : } /// 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){ 2cfca: 2f 92 push r2 2cfcc: 3f 92 push r3 2cfce: 4f 92 push r4 2cfd0: 5f 92 push r5 2cfd2: 6f 92 push r6 2cfd4: 7f 92 push r7 2cfd6: 8f 92 push r8 2cfd8: 9f 92 push r9 2cfda: af 92 push r10 2cfdc: bf 92 push r11 2cfde: cf 92 push r12 2cfe0: df 92 push r13 2cfe2: ef 92 push r14 2cfe4: ff 92 push r15 2cfe6: 0f 93 push r16 2cfe8: 1f 93 push r17 2cfea: cf 93 push r28 2cfec: df 93 push r29 2cfee: 00 d0 rcall .+0 ; 0x2cff0 2cff0: 1f 92 push r1 2cff2: 1f 92 push r1 2cff4: cd b7 in r28, 0x3d ; 61 2cff6: de b7 in r29, 0x3e ; 62 2cff8: 2b 01 movw r4, r22 2cffa: 1a 01 movw r2, r20 2cffc: f1 2c mov r15, r1 2cffe: 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; 2d000: 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; 2d002: 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; 2d004: 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){ 2d006: 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); 2d008: 66 24 eor r6, r6 2d00a: 63 94 inc r6 2d00c: 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){ 2d00e: 70 e0 ldi r23, 0x00 ; 0 2d010: 60 e0 ldi r22, 0x00 ; 0 2d012: 97 01 movw r18, r14 2d014: 2b 53 subi r18, 0x3B ; 59 2d016: 39 4f sbci r19, 0xF9 ; 249 2d018: 3a 83 std Y+2, r19 ; 0x02 2d01a: 29 83 std Y+1, r18 ; 0x01 2d01c: 86 2e mov r8, r22 2d01e: c9 80 ldd r12, Y+1 ; 0x01 2d020: da 80 ldd r13, Y+2 ; 0x02 2d022: c6 0e add r12, r22 2d024: d7 1e adc r13, r23 2d026: 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; 2d028: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2d02a: 40 e0 ldi r20, 0x00 ; 0 2d02c: 30 e0 ldi r19, 0x00 ; 0 2d02e: 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; 2d030: ae ef ldi r26, 0xFE ; 254 2d032: a4 0f add r26, r20 2d034: 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; 2d036: 44 23 and r20, r20 2d038: 19 f0 breq .+6 ; 0x2d040 2d03a: 4b 30 cpi r20, 0x0B ; 11 2d03c: 09 f0 breq .+2 ; 0x2d040 2d03e: 7d c0 rjmp .+250 ; 0x2d13a 2d040: ae ef ldi r26, 0xFE ; 254 2d042: a2 0f add r26, r18 2d044: a8 30 cpi r26, 0x08 ; 8 2d046: 08 f4 brcc .+2 ; 0x2d04a 2d048: 7a c0 rjmp .+244 ; 0x2d13e 2d04a: 2f 5f subi r18, 0xFF ; 255 2d04c: 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){ 2d04e: 2c 30 cpi r18, 0x0C ; 12 2d050: 31 05 cpc r19, r1 2d052: 89 f7 brne .-30 ; 0x2d036 /// 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){ 2d054: 4f 5f subi r20, 0xFF ; 255 2d056: 20 e2 ldi r18, 0x20 ; 32 2d058: c2 0e add r12, r18 2d05a: d1 1c adc r13, r1 2d05c: 32 96 adiw r30, 0x02 ; 2 2d05e: 4c 30 cpi r20, 0x0C ; 12 2d060: 29 f7 brne .-54 ; 0x2d02c // 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){ 2d062: 3c 81 ldd r19, Y+4 ; 0x04 2d064: 30 17 cp r19, r16 2d066: 18 f4 brcc .+6 ; 0x2d06e 2d068: 0c 83 std Y+4, r16 ; 0x04 2d06a: 5d 83 std Y+5, r21 ; 0x05 2d06c: 18 2d mov r17, r8 2d06e: 6f 5f subi r22, 0xFF ; 255 2d070: 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){ 2d072: 64 31 cpi r22, 0x14 ; 20 2d074: 71 05 cpc r23, r1 2d076: 91 f6 brne .-92 ; 0x2d01c 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){ 2d078: 5f 5f subi r21, 0xFF ; 255 2d07a: a0 e2 ldi r26, 0x20 ; 32 2d07c: ea 0e add r14, r26 2d07e: f1 1c adc r15, r1 2d080: 54 31 cpi r21, 0x14 ; 20 2d082: 29 f6 brne .-118 ; 0x2d00e // 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); 2d084: ec 81 ldd r30, Y+4 ; 0x04 2d086: 6e 2f mov r22, r30 2d088: 70 e0 ldi r23, 0x00 ; 0 2d08a: 90 e0 ldi r25, 0x00 ; 0 2d08c: 80 e0 ldi r24, 0x00 ; 0 2d08e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d092: 23 ec ldi r18, 0xC3 ; 195 2d094: 35 ef ldi r19, 0xF5 ; 245 2d096: 48 ea ldi r20, 0xA8 ; 168 2d098: 5f e3 ldi r21, 0x3F ; 63 2d09a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 2d09e: 9f 93 push r25 2d0a0: 8f 93 push r24 2d0a2: 7f 93 push r23 2d0a4: 6f 93 push r22 2d0a6: fd 81 ldd r31, Y+5 ; 0x05 2d0a8: 6f 2f mov r22, r31 2d0aa: 70 e0 ldi r23, 0x00 ; 0 2d0ac: 90 e0 ldi r25, 0x00 ; 0 2d0ae: 80 e0 ldi r24, 0x00 ; 0 2d0b0: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d0b4: 20 e0 ldi r18, 0x00 ; 0 2d0b6: 30 e0 ldi r19, 0x00 ; 0 2d0b8: 40 eb ldi r20, 0xB0 ; 176 2d0ba: 50 e4 ldi r21, 0x40 ; 64 2d0bc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2d0c0: 9f 93 push r25 2d0c2: 8f 93 push r24 2d0c4: 7f 93 push r23 2d0c6: 6f 93 push r22 2d0c8: 61 2f mov r22, r17 2d0ca: 70 e0 ldi r23, 0x00 ; 0 2d0cc: 90 e0 ldi r25, 0x00 ; 0 2d0ce: 80 e0 ldi r24, 0x00 ; 0 2d0d0: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d0d4: 20 e0 ldi r18, 0x00 ; 0 2d0d6: 30 e0 ldi r19, 0x00 ; 0 2d0d8: 40 eb ldi r20, 0xB0 ; 176 2d0da: 50 e4 ldi r21, 0x40 ; 64 2d0dc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2d0e0: 9f 93 push r25 2d0e2: 8f 93 push r24 2d0e4: 7f 93 push r23 2d0e6: 6f 93 push r22 2d0e8: 89 ea ldi r24, 0xA9 ; 169 2d0ea: 96 ea ldi r25, 0xA6 ; 166 2d0ec: 9f 93 push r25 2d0ee: 8f 93 push r24 2d0f0: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca *pc = max_c; 2d0f4: f2 01 movw r30, r4 2d0f6: 10 83 st Z, r17 *pr = max_r; 2d0f8: 2d 81 ldd r18, Y+5 ; 0x05 2d0fa: f1 01 movw r30, r2 2d0fc: 20 83 st Z, r18 2d0fe: 0f b6 in r0, 0x3f ; 63 2d100: f8 94 cli 2d102: de bf out 0x3e, r29 ; 62 2d104: 0f be out 0x3f, r0 ; 63 2d106: cd bf out 0x3d, r28 ; 61 return max_match; } 2d108: 8c 81 ldd r24, Y+4 ; 0x04 2d10a: 0f 90 pop r0 2d10c: 0f 90 pop r0 2d10e: 0f 90 pop r0 2d110: 0f 90 pop r0 2d112: 0f 90 pop r0 2d114: df 91 pop r29 2d116: cf 91 pop r28 2d118: 1f 91 pop r17 2d11a: 0f 91 pop r16 2d11c: ff 90 pop r15 2d11e: ef 90 pop r14 2d120: df 90 pop r13 2d122: cf 90 pop r12 2d124: bf 90 pop r11 2d126: af 90 pop r10 2d128: 9f 90 pop r9 2d12a: 8f 90 pop r8 2d12c: 7f 90 pop r7 2d12e: 6f 90 pop r6 2d130: 5f 90 pop r5 2d132: 4f 90 pop r4 2d134: 3f 90 pop r3 2d136: 2f 90 pop r2 2d138: 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; 2d13a: 22 23 and r18, r18 2d13c: 11 f0 breq .+4 ; 0x2d142 2d13e: 2b 30 cpi r18, 0x0B ; 11 2d140: 21 f4 brne .+8 ; 0x2d14a 2d142: ab 81 ldd r26, Y+3 ; 0x03 2d144: a8 30 cpi r26, 0x08 ; 8 2d146: 08 f0 brcs .+2 ; 0x2d14a 2d148: 80 cf rjmp .-256 ; 0x2d04a const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2d14a: 99 24 eor r9, r9 2d14c: 93 94 inc r9 2d14e: d6 01 movw r26, r12 2d150: a2 0f add r26, r18 2d152: b3 1f adc r27, r19 2d154: ac 91 ld r26, X 2d156: a1 31 cpi r26, 0x11 ; 17 2d158: 08 f4 brcc .+2 ; 0x2d15c 2d15a: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2d15c: a0 80 ld r10, Z 2d15e: b1 80 ldd r11, Z+1 ; 0x01 2d160: d3 01 movw r26, r6 2d162: 02 2e mov r0, r18 2d164: 02 c0 rjmp .+4 ; 0x2d16a 2d166: aa 0f add r26, r26 2d168: bb 1f adc r27, r27 2d16a: 0a 94 dec r0 2d16c: e2 f7 brpl .-8 ; 0x2d166 2d16e: aa 21 and r26, r10 2d170: bb 21 and r27, r11 2d172: bb 24 eor r11, r11 2d174: b3 94 inc r11 2d176: ab 2b or r26, r27 2d178: 09 f4 brne .+2 ; 0x2d17c 2d17a: b1 2c mov r11, r1 if (high_pix == high_pat) 2d17c: 9b 10 cpse r9, r11 2d17e: 65 cf rjmp .-310 ; 0x2d04a match++; 2d180: 0f 5f subi r16, 0xFF ; 255 2d182: 63 cf rjmp .-314 ; 0x2d04a 0002d184 : * \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) { 2d184: 8f 92 push r8 2d186: 9f 92 push r9 2d188: af 92 push r10 2d18a: bf 92 push r11 2d18c: cf 92 push r12 2d18e: df 92 push r13 2d190: ef 92 push r14 2d192: ff 92 push r15 2d194: cf 93 push r28 2d196: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2d198: 2d ef ldi r18, 0xFD ; 253 2d19a: 36 e1 ldi r19, 0x16 ; 22 2d19c: 30 93 9b 0e sts 0x0E9B, r19 ; 0x800e9b 2d1a0: 20 93 9a 0e sts 0x0E9A, r18 ; 0x800e9a fatType_ = 0; 2d1a4: 10 92 19 17 sts 0x1719, r1 ; 0x801719 allocSearchStart_ = 2; 2d1a8: 42 e0 ldi r20, 0x02 ; 2 2d1aa: 50 e0 ldi r21, 0x00 ; 0 2d1ac: 60 e0 ldi r22, 0x00 ; 0 2d1ae: 70 e0 ldi r23, 0x00 ; 0 2d1b0: 40 93 02 17 sts 0x1702, r20 ; 0x801702 2d1b4: 50 93 03 17 sts 0x1703, r21 ; 0x801703 2d1b8: 60 93 04 17 sts 0x1704, r22 ; 0x801704 2d1bc: 70 93 05 17 sts 0x1705, r23 ; 0x801705 cacheDirty_ = 0; // cacheFlush() will write block if true 2d1c0: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 cacheMirrorBlock_ = 0; 2d1c4: 10 92 95 0e sts 0x0E95, r1 ; 0x800e95 2d1c8: 10 92 96 0e sts 0x0E96, r1 ; 0x800e96 2d1cc: 10 92 97 0e sts 0x0E97, r1 ; 0x800e97 2d1d0: 10 92 98 0e sts 0x0E98, r1 ; 0x800e98 cacheBlockNumber_ = 0XFFFFFFFF; 2d1d4: 4f ef ldi r20, 0xFF ; 255 2d1d6: 5f ef ldi r21, 0xFF ; 255 2d1d8: ba 01 movw r22, r20 2d1da: 40 93 91 0e sts 0x0E91, r20 ; 0x800e91 2d1de: 50 93 92 0e sts 0x0E92, r21 ; 0x800e92 2d1e2: 60 93 93 0e sts 0x0E93, r22 ; 0x800e93 2d1e6: 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) { 2d1ea: 88 23 and r24, r24 2d1ec: 09 f4 brne .+2 ; 0x2d1f0 2d1ee: 70 c0 rjmp .+224 ; 0x2d2d0 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d1f0: 40 e0 ldi r20, 0x00 ; 0 2d1f2: 60 e0 ldi r22, 0x00 ; 0 2d1f4: 70 e0 ldi r23, 0x00 ; 0 2d1f6: cb 01 movw r24, r22 2d1f8: 0f 94 14 54 call 0x2a828 ; 0x2a828 2d1fc: 81 11 cpse r24, r1 2d1fe: 0d c0 rjmp .+26 ; 0x2d21a fatType_ = 32; } return true; fail: return false; 2d200: c0 e0 ldi r28, 0x00 ; 0 } 2d202: 8c 2f mov r24, r28 2d204: df 91 pop r29 2d206: cf 91 pop r28 2d208: ff 90 pop r15 2d20a: ef 90 pop r14 2d20c: df 90 pop r13 2d20e: cf 90 pop r12 2d210: bf 90 pop r11 2d212: af 90 pop r10 2d214: 9f 90 pop r9 2d216: 8f 90 pop r8 2d218: 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 || 2d21a: 80 91 5b 10 lds r24, 0x105B ; 0x80105b 2d21e: 8f 77 andi r24, 0x7F ; 127 2d220: 79 f7 brne .-34 ; 0x2d200 2d222: 80 91 67 10 lds r24, 0x1067 ; 0x801067 2d226: 90 91 68 10 lds r25, 0x1068 ; 0x801068 2d22a: a0 91 69 10 lds r26, 0x1069 ; 0x801069 2d22e: b0 91 6a 10 lds r27, 0x106A ; 0x80106a 2d232: 84 36 cpi r24, 0x64 ; 100 2d234: 91 05 cpc r25, r1 2d236: a1 05 cpc r26, r1 2d238: b1 05 cpc r27, r1 2d23a: 10 f3 brcs .-60 ; 0x2d200 p->totalSectors < 100 || p->firstSector == 0) { 2d23c: c0 90 63 10 lds r12, 0x1063 ; 0x801063 2d240: d0 90 64 10 lds r13, 0x1064 ; 0x801064 2d244: e0 90 65 10 lds r14, 0x1065 ; 0x801065 2d248: 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 || 2d24c: c1 14 cp r12, r1 2d24e: d1 04 cpc r13, r1 2d250: e1 04 cpc r14, r1 2d252: f1 04 cpc r15, r1 2d254: a9 f2 breq .-86 ; 0x2d200 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2d256: 40 e0 ldi r20, 0x00 ; 0 2d258: c7 01 movw r24, r14 2d25a: b6 01 movw r22, r12 2d25c: 0f 94 14 54 call 0x2a828 ; 0x2a828 2d260: c8 2f mov r28, r24 2d262: 88 23 and r24, r24 2d264: 69 f2 breq .-102 ; 0x2d200 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2d266: 80 91 a8 0e lds r24, 0x0EA8 ; 0x800ea8 2d26a: 90 91 a9 0e lds r25, 0x0EA9 ; 0x800ea9 2d26e: 81 15 cp r24, r1 2d270: 92 40 sbci r25, 0x02 ; 2 2d272: 31 f6 brne .-116 ; 0x2d200 fbs->fatCount == 0 || 2d274: 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 || 2d278: aa 23 and r26, r26 2d27a: 11 f2 breq .-124 ; 0x2d200 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2d27c: 60 91 ab 0e lds r22, 0x0EAB ; 0x800eab 2d280: 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 || 2d284: 61 15 cp r22, r1 2d286: 71 05 cpc r23, r1 2d288: 09 f4 brne .+2 ; 0x2d28c 2d28a: ba cf rjmp .-140 ; 0x2d200 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2d28c: 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 || 2d290: 22 23 and r18, r18 2d292: 09 f4 brne .+2 ; 0x2d296 2d294: b5 cf rjmp .-150 ; 0x2d200 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2d296: a0 93 14 17 sts 0x1714, r26 ; 0x801714 blocksPerCluster_ = fbs->sectorsPerCluster; 2d29a: 20 93 06 17 sts 0x1706, r18 ; 0x801706 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2d29e: 90 e0 ldi r25, 0x00 ; 0 2d2a0: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2d2a2: 30 e0 ldi r19, 0x00 ; 0 2d2a4: e1 e0 ldi r30, 0x01 ; 1 2d2a6: f0 e0 ldi r31, 0x00 ; 0 2d2a8: d8 2f mov r29, r24 2d2aa: af 01 movw r20, r30 2d2ac: 08 2e mov r0, r24 2d2ae: 02 c0 rjmp .+4 ; 0x2d2b4 2d2b0: 44 0f add r20, r20 2d2b2: 55 1f adc r21, r21 2d2b4: 0a 94 dec r0 2d2b6: e2 f7 brpl .-8 ; 0x2d2b0 2d2b8: 24 17 cp r18, r20 2d2ba: 35 07 cpc r19, r21 2d2bc: 69 f0 breq .+26 ; 0x2d2d8 2d2be: 41 e0 ldi r20, 0x01 ; 1 2d2c0: 48 0f add r20, r24 2d2c2: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2d2c4: 89 30 cpi r24, 0x09 ; 9 2d2c6: 91 05 cpc r25, r1 2d2c8: 79 f7 brne .-34 ; 0x2d2a8 2d2ca: 40 93 0f 17 sts 0x170F, r20 ; 0x80170f 2d2ce: 98 cf rjmp .-208 ; 0x2d200 * 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; 2d2d0: c1 2c mov r12, r1 2d2d2: d1 2c mov r13, r1 2d2d4: 76 01 movw r14, r12 2d2d6: bf cf rjmp .-130 ; 0x2d256 2d2d8: 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 ? 2d2dc: 20 91 b3 0e lds r18, 0x0EB3 ; 0x800eb3 2d2e0: 30 91 b4 0e lds r19, 0x0EB4 ; 0x800eb4 2d2e4: 50 e0 ldi r21, 0x00 ; 0 2d2e6: 40 e0 ldi r20, 0x00 ; 0 2d2e8: 21 15 cp r18, r1 2d2ea: 31 05 cpc r19, r1 2d2ec: 41 f4 brne .+16 ; 0x2d2fe 2d2ee: 20 91 c1 0e lds r18, 0x0EC1 ; 0x800ec1 2d2f2: 30 91 c2 0e lds r19, 0x0EC2 ; 0x800ec2 2d2f6: 40 91 c3 0e lds r20, 0x0EC3 ; 0x800ec3 2d2fa: 50 91 c4 0e lds r21, 0x0EC4 ; 0x800ec4 2d2fe: 20 93 07 17 sts 0x1707, r18 ; 0x801707 2d302: 30 93 08 17 sts 0x1708, r19 ; 0x801708 2d306: 40 93 09 17 sts 0x1709, r20 ; 0x801709 2d30a: 50 93 0a 17 sts 0x170A, r21 ; 0x80170a fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2d30e: 46 01 movw r8, r12 2d310: 57 01 movw r10, r14 2d312: 86 0e add r8, r22 2d314: 97 1e adc r9, r23 2d316: a1 1c adc r10, r1 2d318: b1 1c adc r11, r1 2d31a: 80 92 15 17 sts 0x1715, r8 ; 0x801715 2d31e: 90 92 16 17 sts 0x1716, r9 ; 0x801716 2d322: a0 92 17 17 sts 0x1717, r10 ; 0x801717 2d326: b0 92 18 17 sts 0x1718, r11 ; 0x801718 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2d32a: e0 91 ae 0e lds r30, 0x0EAE ; 0x800eae 2d32e: f0 91 af 0e lds r31, 0x0EAF ; 0x800eaf 2d332: f0 93 1b 17 sts 0x171B, r31 ; 0x80171b 2d336: e0 93 1a 17 sts 0x171A, r30 ; 0x80171a // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2d33a: b0 e0 ldi r27, 0x00 ; 0 2d33c: 0f 94 b8 dc call 0x3b970 ; 0x3b970 <__muluhisi3> 2d340: dc 01 movw r26, r24 2d342: cb 01 movw r24, r22 2d344: 88 0d add r24, r8 2d346: 99 1d adc r25, r9 2d348: aa 1d adc r26, r10 2d34a: bb 1d adc r27, r11 2d34c: 80 93 1c 17 sts 0x171C, r24 ; 0x80171c 2d350: 90 93 1d 17 sts 0x171D, r25 ; 0x80171d 2d354: a0 93 1e 17 sts 0x171E, r26 ; 0x80171e 2d358: b0 93 1f 17 sts 0x171F, r27 ; 0x80171f // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2d35c: 25 e0 ldi r18, 0x05 ; 5 2d35e: ee 0f add r30, r30 2d360: ff 1f adc r31, r31 2d362: 2a 95 dec r18 2d364: e1 f7 brne .-8 ; 0x2d35e 2d366: e1 50 subi r30, 0x01 ; 1 2d368: fe 4f sbci r31, 0xFE ; 254 2d36a: ef 2f mov r30, r31 2d36c: ff 27 eor r31, r31 2d36e: e6 95 lsr r30 2d370: 8e 0f add r24, r30 2d372: 9f 1f adc r25, r31 2d374: a1 1d adc r26, r1 2d376: b1 1d adc r27, r1 2d378: 80 93 10 17 sts 0x1710, r24 ; 0x801710 2d37c: 90 93 11 17 sts 0x1711, r25 ; 0x801711 2d380: a0 93 12 17 sts 0x1712, r26 ; 0x801712 2d384: b0 93 13 17 sts 0x1713, r27 ; 0x801713 // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2d388: 80 90 b0 0e lds r8, 0x0EB0 ; 0x800eb0 2d38c: 90 90 b1 0e lds r9, 0x0EB1 ; 0x800eb1 2d390: b1 2c mov r11, r1 2d392: a1 2c mov r10, r1 2d394: 81 14 cp r8, r1 2d396: 91 04 cpc r9, r1 2d398: 41 f4 brne .+16 ; 0x2d3aa 2d39a: 80 90 bd 0e lds r8, 0x0EBD ; 0x800ebd 2d39e: 90 90 be 0e lds r9, 0x0EBE ; 0x800ebe 2d3a2: a0 90 bf 0e lds r10, 0x0EBF ; 0x800ebf 2d3a6: b0 90 c0 0e lds r11, 0x0EC0 ; 0x800ec0 fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2d3aa: c8 1a sub r12, r24 2d3ac: d9 0a sbc r13, r25 2d3ae: ea 0a sbc r14, r26 2d3b0: fb 0a sbc r15, r27 2d3b2: c8 0c add r12, r8 2d3b4: d9 1c adc r13, r9 2d3b6: ea 1c adc r14, r10 2d3b8: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2d3ba: 04 c0 rjmp .+8 ; 0x2d3c4 2d3bc: f6 94 lsr r15 2d3be: e7 94 ror r14 2d3c0: d7 94 ror r13 2d3c2: c7 94 ror r12 2d3c4: da 95 dec r29 2d3c6: d2 f7 brpl .-12 ; 0x2d3bc 2d3c8: c0 92 0b 17 sts 0x170B, r12 ; 0x80170b 2d3cc: d0 92 0c 17 sts 0x170C, r13 ; 0x80170c 2d3d0: e0 92 0d 17 sts 0x170D, r14 ; 0x80170d 2d3d4: f0 92 0e 17 sts 0x170E, r15 ; 0x80170e // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2d3d8: 85 ef ldi r24, 0xF5 ; 245 2d3da: c8 16 cp r12, r24 2d3dc: 8f e0 ldi r24, 0x0F ; 15 2d3de: d8 06 cpc r13, r24 2d3e0: e1 04 cpc r14, r1 2d3e2: f1 04 cpc r15, r1 2d3e4: 20 f4 brcc .+8 ; 0x2d3ee fatType_ = 12; 2d3e6: 8c e0 ldi r24, 0x0C ; 12 2d3e8: 80 93 19 17 sts 0x1719, r24 ; 0x801719 2d3ec: 09 cf rjmp .-494 ; 0x2d200 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2d3ee: 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) { 2d3f0: 25 ef ldi r18, 0xF5 ; 245 2d3f2: c2 16 cp r12, r18 2d3f4: 2f ef ldi r18, 0xFF ; 255 2d3f6: d2 06 cpc r13, r18 2d3f8: e1 04 cpc r14, r1 2d3fa: f1 04 cpc r15, r1 2d3fc: 88 f0 brcs .+34 ; 0x2d420 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2d3fe: 80 91 c9 0e lds r24, 0x0EC9 ; 0x800ec9 2d402: 90 91 ca 0e lds r25, 0x0ECA ; 0x800eca 2d406: a0 91 cb 0e lds r26, 0x0ECB ; 0x800ecb 2d40a: b0 91 cc 0e lds r27, 0x0ECC ; 0x800ecc 2d40e: 80 93 1c 17 sts 0x171C, r24 ; 0x80171c 2d412: 90 93 1d 17 sts 0x171D, r25 ; 0x80171d 2d416: a0 93 1e 17 sts 0x171E, r26 ; 0x80171e 2d41a: b0 93 1f 17 sts 0x171F, r27 ; 0x80171f fatType_ = 32; 2d41e: 80 e2 ldi r24, 0x20 ; 32 2d420: 80 93 19 17 sts 0x1719, r24 ; 0x801719 2d424: ee ce rjmp .-548 ; 0x2d202 0002d426 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2d426: 20 e0 ldi r18, 0x00 ; 0 2d428: 30 e0 ldi r19, 0x00 ; 0 2d42a: 40 ea ldi r20, 0xA0 ; 160 2d42c: 52 e4 ldi r21, 0x42 ; 66 2d42e: 60 e0 ldi r22, 0x00 ; 0 2d430: 70 e0 ldi r23, 0x00 ; 0 2d432: 80 ea ldi r24, 0xA0 ; 160 2d434: 92 ec ldi r25, 0xC2 ; 194 2d436: 0d 94 b8 c5 jmp 0x38b70 ; 0x38b70 0002d43a : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2d43a: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 2d43e: 91 fd sbrc r25, 1 2d440: 17 c0 rjmp .+46 ; 0x2d470 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2d442: 88 23 and r24, r24 2d444: a9 f0 breq .+42 ; 0x2d470 2d446: 92 fd sbrc r25, 2 2d448: 13 c0 rjmp .+38 ; 0x2d470 Disable_E0(); 2d44a: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c resume_hotend_temp = thermal_degTargetHotend(); 2d44e: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 2d452: 90 91 b7 0d lds r25, 0x0DB7 ; 0x800db7 2d456: 90 93 b0 13 sts 0x13B0, r25 ; 0x8013b0 2d45a: 80 93 af 13 sts 0x13AF, r24 ; 0x8013af mmu_print_saved |= SavedState::CooldownPending; 2d45e: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d462: 84 60 ori r24, 0x04 ; 4 2d464: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb LogEchoEvent_P(PSTR("Heater cooldown pending")); 2d468: 8d ef ldi r24, 0xFD ; 253 2d46a: 97 ea ldi r25, 0xA7 ; 167 2d46c: 0d 94 dc c5 jmp 0x38bb8 ; 0x38bb8 } } 2d470: 08 95 ret 0002d472 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2d472: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d476: 80 ff sbrs r24, 0 2d478: 47 c0 rjmp .+142 ; 0x2d508 LogEchoEvent_P(PSTR("Resuming XYZ")); 2d47a: 85 e1 ldi r24, 0x15 ; 21 2d47c: 98 ea ldi r25, 0xA8 ; 168 2d47e: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 // 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)); 2d482: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 2d486: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 2d48a: a0 91 a9 13 lds r26, 0x13A9 ; 0x8013a9 2d48e: 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; 2d492: 40 91 a3 13 lds r20, 0x13A3 ; 0x8013a3 2d496: 50 91 a4 13 lds r21, 0x13A4 ; 0x8013a4 2d49a: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 2d49e: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 2d4a2: 40 93 92 06 sts 0x0692, r20 ; 0x800692 2d4a6: 50 93 93 06 sts 0x0693, r21 ; 0x800693 2d4aa: 60 93 94 06 sts 0x0694, r22 ; 0x800694 2d4ae: 70 93 95 06 sts 0x0695, r23 ; 0x800695 current_position[Y_AXIS] = ry; 2d4b2: 80 93 96 06 sts 0x0696, r24 ; 0x800696 2d4b6: 90 93 97 06 sts 0x0697, r25 ; 0x800697 2d4ba: a0 93 98 06 sts 0x0698, r26 ; 0x800698 2d4be: b0 93 99 06 sts 0x0699, r27 ; 0x800699 planner_line_to_current_position_sync(feedRate_mm_s); 2d4c2: 60 e0 ldi r22, 0x00 ; 0 2d4c4: 70 e0 ldi r23, 0x00 ; 0 2d4c6: 88 e4 ldi r24, 0x48 ; 72 2d4c8: 92 e4 ldi r25, 0x42 ; 66 2d4ca: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2d4ce: 80 91 ab 13 lds r24, 0x13AB ; 0x8013ab 2d4d2: 90 91 ac 13 lds r25, 0x13AC ; 0x8013ac 2d4d6: a0 91 ad 13 lds r26, 0x13AD ; 0x8013ad 2d4da: b0 91 ae 13 lds r27, 0x13AE ; 0x8013ae 2d4de: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 2d4e2: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 2d4e6: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 2d4ea: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d planner_line_to_current_position_sync(feedRate_mm_s); 2d4ee: 60 e0 ldi r22, 0x00 ; 0 2d4f0: 70 e0 ldi r23, 0x00 ; 0 2d4f2: 80 e7 ldi r24, 0x70 ; 112 2d4f4: 91 e4 ldi r25, 0x41 ; 65 2d4f6: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2d4fa: 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); 2d4fe: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d502: 8e 7f andi r24, 0xFE ; 254 2d504: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb } } 2d508: 08 95 ret 0002d50a : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2d50a: 0f 93 push r16 2d50c: 1f 93 push r17 2d50e: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2d510: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 2d514: 91 11 cpse r25, r1 2d516: 72 c0 rjmp .+228 ; 0x2d5fc 2d518: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2d51a: 8a ee ldi r24, 0xEA ; 234 2d51c: 97 ea ldi r25, 0xA7 ; 167 2d51e: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 Disable_E0(); 2d522: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2d526: 0f 94 ef 42 call 0x285de ; 0x285de /// 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; 2d52a: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 2d52e: 81 11 cpse r24, r1 2d530: 02 c0 rjmp .+4 ; 0x2d536 2d532: 0e 94 50 64 call 0xc8a0 ; 0xc8a0 // 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) { 2d536: cc 23 and r28, r28 2d538: 09 f4 brne .+2 ; 0x2d53c 2d53a: 60 c0 rjmp .+192 ; 0x2d5fc mmu_print_saved |= SavedState::ParkExtruder; 2d53c: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 2d540: 81 60 ori r24, 0x01 ; 1 2d542: 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]); 2d546: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 2d54a: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 2d54e: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 2d552: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 2d556: 40 91 96 06 lds r20, 0x0696 ; 0x800696 2d55a: 50 91 97 06 lds r21, 0x0697 ; 0x800697 2d55e: 60 91 98 06 lds r22, 0x0698 ; 0x800698 2d562: 70 91 99 06 lds r23, 0x0699 ; 0x800699 resume_position = planner_current_position(); // save current pos 2d566: 00 91 92 06 lds r16, 0x0692 ; 0x800692 2d56a: 10 91 93 06 lds r17, 0x0693 ; 0x800693 2d56e: 20 91 94 06 lds r18, 0x0694 ; 0x800694 2d572: 30 91 95 06 lds r19, 0x0695 ; 0x800695 2d576: 00 93 a3 13 sts 0x13A3, r16 ; 0x8013a3 2d57a: 10 93 a4 13 sts 0x13A4, r17 ; 0x8013a4 2d57e: 20 93 a5 13 sts 0x13A5, r18 ; 0x8013a5 2d582: 30 93 a6 13 sts 0x13A6, r19 ; 0x8013a6 2d586: 40 93 a7 13 sts 0x13A7, r20 ; 0x8013a7 2d58a: 50 93 a8 13 sts 0x13A8, r21 ; 0x8013a8 2d58e: 60 93 a9 13 sts 0x13A9, r22 ; 0x8013a9 2d592: 70 93 aa 13 sts 0x13AA, r23 ; 0x8013aa 2d596: 80 93 ab 13 sts 0x13AB, r24 ; 0x8013ab 2d59a: 90 93 ac 13 sts 0x13AC, r25 ; 0x8013ac 2d59e: a0 93 ad 13 sts 0x13AD, r26 ; 0x8013ad 2d5a2: 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); 2d5a6: 60 e0 ldi r22, 0x00 ; 0 2d5a8: 70 e0 ldi r23, 0x00 ; 0 2d5aa: 80 ea ldi r24, 0xA0 ; 160 2d5ac: 91 e4 ldi r25, 0x41 ; 65 2d5ae: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2d5b2: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 2d5b6: 88 23 and r24, r24 2d5b8: 09 f1 breq .+66 ; 0x2d5fc 2d5ba: 80 91 90 06 lds r24, 0x0690 ; 0x800690 2d5be: 88 23 and r24, r24 2d5c0: e9 f0 breq .+58 ; 0x2d5fc 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; 2d5c2: 80 e0 ldi r24, 0x00 ; 0 2d5c4: 90 e0 ldi r25, 0x00 ; 0 2d5c6: aa ef ldi r26, 0xFA ; 250 2d5c8: b2 e4 ldi r27, 0x42 ; 66 2d5ca: 80 93 92 06 sts 0x0692, r24 ; 0x800692 2d5ce: 90 93 93 06 sts 0x0693, r25 ; 0x800693 2d5d2: a0 93 94 06 sts 0x0694, r26 ; 0x800694 2d5d6: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2d5da: 10 92 96 06 sts 0x0696, r1 ; 0x800696 2d5de: 10 92 97 06 sts 0x0697, r1 ; 0x800697 2d5e2: 10 92 98 06 sts 0x0698, r1 ; 0x800698 2d5e6: 10 92 99 06 sts 0x0699, r1 ; 0x800699 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2d5ea: 60 e0 ldi r22, 0x00 ; 0 2d5ec: 70 e0 ldi r23, 0x00 ; 0 2d5ee: 88 e4 ldi r24, 0x48 ; 72 2d5f0: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2d5f2: cf 91 pop r28 2d5f4: 1f 91 pop r17 2d5f6: 0f 91 pop r16 2d5f8: 0d 94 d8 c5 jmp 0x38bb0 ; 0x38bb0 2d5fc: cf 91 pop r28 2d5fe: 1f 91 pop r17 2d600: 0f 91 pop r16 2d602: 08 95 ret 0002d604 : /// 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){ 2d604: 2f 92 push r2 2d606: 3f 92 push r3 2d608: 4f 92 push r4 2d60a: 5f 92 push r5 2d60c: 6f 92 push r6 2d60e: 7f 92 push r7 2d610: 8f 92 push r8 2d612: 9f 92 push r9 2d614: af 92 push r10 2d616: bf 92 push r11 2d618: cf 92 push r12 2d61a: df 92 push r13 2d61c: ef 92 push r14 2d61e: ff 92 push r15 2d620: 0f 93 push r16 2d622: 1f 93 push r17 2d624: cf 93 push r28 2d626: df 93 push r29 2d628: cd b7 in r28, 0x3d ; 61 2d62a: de b7 in r29, 0x3e ; 62 2d62c: cd 5b subi r28, 0xBD ; 189 2d62e: d1 40 sbci r29, 0x01 ; 1 2d630: 0f b6 in r0, 0x3f ; 63 2d632: f8 94 cli 2d634: de bf out 0x3e, r29 ; 62 2d636: 0f be out 0x3f, r0 ; 63 2d638: cd bf out 0x3d, r28 ; 61 2d63a: c3 57 subi r28, 0x73 ; 115 2d63c: de 4f sbci r29, 0xFE ; 254 2d63e: 99 83 std Y+1, r25 ; 0x01 2d640: 88 83 st Y, r24 2d642: cd 58 subi r28, 0x8D ; 141 2d644: d1 40 sbci r29, 0x01 ; 1 2d646: c1 57 subi r28, 0x71 ; 113 2d648: de 4f sbci r29, 0xFE ; 254 2d64a: 79 83 std Y+1, r23 ; 0x01 2d64c: 68 83 st Y, r22 2d64e: cf 58 subi r28, 0x8F ; 143 2d650: d1 40 sbci r29, 0x01 ; 1 2d652: ce 56 subi r28, 0x6E ; 110 2d654: de 4f sbci r29, 0xFE ; 254 2d656: 59 83 std Y+1, r21 ; 0x01 2d658: 48 83 st Y, r20 2d65a: c2 59 subi r28, 0x92 ; 146 2d65c: d1 40 sbci r29, 0x01 ; 1 2d65e: 84 e1 ldi r24, 0x14 ; 20 2d660: cf 56 subi r28, 0x6F ; 111 2d662: de 4f sbci r29, 0xFE ; 254 2d664: 88 83 st Y, r24 2d666: c1 59 subi r28, 0x91 ; 145 2d668: 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; 2d66a: ce 56 subi r28, 0x6E ; 110 2d66c: de 4f sbci r29, 0xFE ; 254 2d66e: a8 81 ld r26, Y 2d670: b9 81 ldd r27, Y+1 ; 0x01 2d672: c2 59 subi r28, 0x92 ; 146 2d674: d1 40 sbci r29, 0x01 ; 1 2d676: 8d 91 ld r24, X+ 2d678: 9d 91 ld r25, X+ 2d67a: 0d 90 ld r0, X+ 2d67c: bc 91 ld r27, X 2d67e: a0 2d mov r26, r0 2d680: c6 56 subi r28, 0x66 ; 102 2d682: de 4f sbci r29, 0xFE ; 254 2d684: 88 83 st Y, r24 2d686: 99 83 std Y+1, r25 ; 0x01 2d688: aa 83 std Y+2, r26 ; 0x02 2d68a: bb 83 std Y+3, r27 ; 0x03 2d68c: ca 59 subi r28, 0x9A ; 154 2d68e: d1 40 sbci r29, 0x01 ; 1 2d690: c1 57 subi r28, 0x71 ; 113 2d692: de 4f sbci r29, 0xFE ; 254 2d694: a8 81 ld r26, Y 2d696: b9 81 ldd r27, Y+1 ; 0x01 2d698: cf 58 subi r28, 0x8F ; 143 2d69a: d1 40 sbci r29, 0x01 ; 1 2d69c: 8d 91 ld r24, X+ 2d69e: 9d 91 ld r25, X+ 2d6a0: 0d 90 ld r0, X+ 2d6a2: bc 91 ld r27, X 2d6a4: a0 2d mov r26, r0 2d6a6: ca 54 subi r28, 0x4A ; 74 2d6a8: de 4f sbci r29, 0xFE ; 254 2d6aa: 88 83 st Y, r24 2d6ac: 99 83 std Y+1, r25 ; 0x01 2d6ae: aa 83 std Y+2, r26 ; 0x02 2d6b0: bb 83 std Y+3, r27 ; 0x03 2d6b2: c6 5b subi r28, 0xB6 ; 182 2d6b4: d1 40 sbci r29, 0x01 ; 1 2d6b6: c3 57 subi r28, 0x73 ; 115 2d6b8: de 4f sbci r29, 0xFE ; 254 2d6ba: a8 81 ld r26, Y 2d6bc: b9 81 ldd r27, Y+1 ; 0x01 2d6be: cd 58 subi r28, 0x8D ; 141 2d6c0: d1 40 sbci r29, 0x01 ; 1 2d6c2: 8d 91 ld r24, X+ 2d6c4: 9d 91 ld r25, X+ 2d6c6: 0d 90 ld r0, X+ 2d6c8: bc 91 ld r27, X 2d6ca: a0 2d mov r26, r0 2d6cc: c6 54 subi r28, 0x46 ; 70 2d6ce: de 4f sbci r29, 0xFE ; 254 2d6d0: 88 83 st Y, r24 2d6d2: 99 83 std Y+1, r25 ; 0x01 2d6d4: aa 83 std Y+2, r26 ; 0x02 2d6d6: bb 83 std Y+3, r27 ; 0x03 2d6d8: ca 5b subi r28, 0xBA ; 186 2d6da: d1 40 sbci r29, 0x01 ; 1 2d6dc: fe 01 movw r30, r28 2d6de: e7 5f subi r30, 0xF7 ; 247 2d6e0: fe 4f sbci r31, 0xFE ; 254 2d6e2: c8 55 subi r28, 0x58 ; 88 2d6e4: de 4f sbci r29, 0xFE ; 254 2d6e6: f9 83 std Y+1, r31 ; 0x01 2d6e8: e8 83 st Y, r30 2d6ea: c8 5a subi r28, 0xA8 ; 168 2d6ec: d1 40 sbci r29, 0x01 ; 1 2d6ee: ce 01 movw r24, r28 2d6f0: 8b 57 subi r24, 0x7B ; 123 2d6f2: 9f 4f sbci r25, 0xFF ; 255 2d6f4: ca 55 subi r28, 0x5A ; 90 2d6f6: de 4f sbci r29, 0xFE ; 254 2d6f8: 99 83 std Y+1, r25 ; 0x01 2d6fa: 88 83 st Y, r24 2d6fc: c6 5a subi r28, 0xA6 ; 166 2d6fe: d1 40 sbci r29, 0x01 ; 1 2d700: de 01 movw r26, r28 2d702: 11 96 adiw r26, 0x01 ; 1 2d704: c8 56 subi r28, 0x68 ; 104 2d706: de 4f sbci r29, 0xFE ; 254 2d708: b9 83 std Y+1, r27 ; 0x01 2d70a: a8 83 st Y, r26 2d70c: c8 59 subi r28, 0x98 ; 152 2d70e: d1 40 sbci r29, 0x01 ; 1 2d710: 31 2c mov r3, r1 2d712: 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; 2d714: b1 01 movw r22, r2 2d716: 03 2c mov r0, r3 2d718: 00 0c add r0, r0 2d71a: 88 0b sbc r24, r24 2d71c: 99 0b sbc r25, r25 2d71e: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d722: 2a e1 ldi r18, 0x1A ; 26 2d724: 38 ef ldi r19, 0xF8 ; 248 2d726: 42 e4 ldi r20, 0x42 ; 66 2d728: 5e e3 ldi r21, 0x3E ; 62 2d72a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d72e: 6b 01 movw r12, r22 2d730: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2d732: 0f 94 0b e1 call 0x3c216 ; 0x3c216 2d736: c2 56 subi r28, 0x62 ; 98 2d738: de 4f sbci r29, 0xFE ; 254 2d73a: 68 83 st Y, r22 2d73c: 79 83 std Y+1, r23 ; 0x01 2d73e: 8a 83 std Y+2, r24 ; 0x02 2d740: 9b 83 std Y+3, r25 ; 0x03 2d742: ce 59 subi r28, 0x9E ; 158 2d744: d1 40 sbci r29, 0x01 ; 1 2d746: c7 01 movw r24, r14 2d748: b6 01 movw r22, r12 2d74a: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 2d74e: ce 55 subi r28, 0x5E ; 94 2d750: de 4f sbci r29, 0xFE ; 254 2d752: 68 83 st Y, r22 2d754: 79 83 std Y+1, r23 ; 0x01 2d756: 8a 83 std Y+2, r24 ; 0x02 2d758: 9b 83 std Y+3, r25 ; 0x03 2d75a: c2 5a subi r28, 0xA2 ; 162 2d75c: d1 40 sbci r29, 0x01 ; 1 2d75e: 9b 01 movw r18, r22 2d760: ac 01 movw r20, r24 2d762: c6 56 subi r28, 0x66 ; 102 2d764: de 4f sbci r29, 0xFE ; 254 2d766: 68 81 ld r22, Y 2d768: 79 81 ldd r23, Y+1 ; 0x01 2d76a: 8a 81 ldd r24, Y+2 ; 0x02 2d76c: 9b 81 ldd r25, Y+3 ; 0x03 2d76e: ca 59 subi r28, 0x9A ; 154 2d770: d1 40 sbci r29, 0x01 ; 1 2d772: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d776: c6 54 subi r28, 0x46 ; 70 2d778: de 4f sbci r29, 0xFE ; 254 2d77a: 28 81 ld r18, Y 2d77c: 39 81 ldd r19, Y+1 ; 0x01 2d77e: 4a 81 ldd r20, Y+2 ; 0x02 2d780: 5b 81 ldd r21, Y+3 ; 0x03 2d782: ca 5b subi r28, 0xBA ; 186 2d784: d1 40 sbci r29, 0x01 ; 1 2d786: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2d78a: 6b 01 movw r12, r22 2d78c: 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) 2d78e: 20 e0 ldi r18, 0x00 ; 0 2d790: 30 e0 ldi r19, 0x00 ; 0 2d792: a9 01 movw r20, r18 2d794: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2d798: 18 16 cp r1, r24 2d79a: 0c f0 brlt .+2 ; 0x2d79e 2d79c: 7a c2 rjmp .+1268 ; 0x2dc92 // 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; 2d79e: c2 56 subi r28, 0x62 ; 98 2d7a0: de 4f sbci r29, 0xFE ; 254 2d7a2: 28 81 ld r18, Y 2d7a4: 39 81 ldd r19, Y+1 ; 0x01 2d7a6: 4a 81 ldd r20, Y+2 ; 0x02 2d7a8: 5b 81 ldd r21, Y+3 ; 0x03 2d7aa: ce 59 subi r28, 0x9E ; 158 2d7ac: d1 40 sbci r29, 0x01 ; 1 2d7ae: c6 56 subi r28, 0x66 ; 102 2d7b0: de 4f sbci r29, 0xFE ; 254 2d7b2: 68 81 ld r22, Y 2d7b4: 79 81 ldd r23, Y+1 ; 0x01 2d7b6: 8a 81 ldd r24, Y+2 ; 0x02 2d7b8: 9b 81 ldd r25, Y+3 ; 0x03 2d7ba: ca 59 subi r28, 0x9A ; 154 2d7bc: d1 40 sbci r29, 0x01 ; 1 2d7be: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d7c2: ca 54 subi r28, 0x4A ; 74 2d7c4: de 4f sbci r29, 0xFE ; 254 2d7c6: 28 81 ld r18, Y 2d7c8: 39 81 ldd r19, Y+1 ; 0x01 2d7ca: 4a 81 ldd r20, Y+2 ; 0x02 2d7cc: 5b 81 ldd r21, Y+3 ; 0x03 2d7ce: c6 5b subi r28, 0xB6 ; 182 2d7d0: d1 40 sbci r29, 0x01 ; 1 2d7d2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2d7d6: 4b 01 movw r8, r22 2d7d8: 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) 2d7da: 20 e0 ldi r18, 0x00 ; 0 2d7dc: 30 e0 ldi r19, 0x00 ; 0 2d7de: a9 01 movw r20, r18 2d7e0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2d7e4: 18 16 cp r1, r24 2d7e6: 0c f0 brlt .+2 ; 0x2d7ea 2d7e8: 54 c2 rjmp .+1192 ; 0x2dc92 2d7ea: 20 e0 ldi r18, 0x00 ; 0 2d7ec: 30 e0 ldi r19, 0x00 ; 0 2d7ee: 48 ef ldi r20, 0xF8 ; 248 2d7f0: 51 e4 ldi r21, 0x41 ; 65 2d7f2: c7 01 movw r24, r14 2d7f4: b6 01 movw r22, r12 2d7f6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2d7fa: 87 ff sbrs r24, 7 2d7fc: 4a c2 rjmp .+1172 ; 0x2dc92 2d7fe: 20 e0 ldi r18, 0x00 ; 0 2d800: 30 e0 ldi r19, 0x00 ; 0 2d802: 48 ef ldi r20, 0xF8 ; 248 2d804: 51 e4 ldi r21, 0x41 ; 65 2d806: c5 01 movw r24, r10 2d808: b4 01 movw r22, r8 2d80a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 2d80e: 87 ff sbrs r24, 7 2d810: 40 c2 rjmp .+1152 ; 0x2dc92 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2d812: c7 01 movw r24, r14 2d814: b6 01 movw r22, r12 2d816: 0f 94 f2 de call 0x3bde4 ; 0x3bde4 2d81a: 9b 01 movw r18, r22 2d81c: ac 01 movw r20, r24 2d81e: c7 01 movw r24, r14 2d820: b6 01 movw r22, r12 2d822: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2d826: 2b 01 movw r4, r22 2d828: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2d82a: c5 01 movw r24, r10 2d82c: b4 01 movw r22, r8 2d82e: 0f 94 f2 de call 0x3bde4 ; 0x3bde4 2d832: 9b 01 movw r18, r22 2d834: ac 01 movw r20, r24 2d836: c5 01 movw r24, r10 2d838: b4 01 movw r22, r8 2d83a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2d83e: cc 56 subi r28, 0x6C ; 108 2d840: de 4f sbci r29, 0xFE ; 254 2d842: 68 83 st Y, r22 2d844: 79 83 std Y+1, r23 ; 0x01 2d846: 8a 83 std Y+2, r24 ; 0x02 2d848: 9b 83 std Y+3, r25 ; 0x03 2d84a: c4 59 subi r28, 0x94 ; 148 2d84c: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2d84e: a3 01 movw r20, r6 2d850: 92 01 movw r18, r4 2d852: 60 e0 ldi r22, 0x00 ; 0 2d854: 70 e0 ldi r23, 0x00 ; 0 2d856: 80 e8 ldi r24, 0x80 ; 128 2d858: 9f e3 ldi r25, 0x3F ; 63 2d85a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2d85e: c2 55 subi r28, 0x52 ; 82 2d860: de 4f sbci r29, 0xFE ; 254 2d862: 68 83 st Y, r22 2d864: 79 83 std Y+1, r23 ; 0x01 2d866: 8a 83 std Y+2, r24 ; 0x02 2d868: 9b 83 std Y+3, r25 ; 0x03 2d86a: ce 5a subi r28, 0xAE ; 174 2d86c: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2d86e: cc 56 subi r28, 0x6C ; 108 2d870: de 4f sbci r29, 0xFE ; 254 2d872: 28 81 ld r18, Y 2d874: 39 81 ldd r19, Y+1 ; 0x01 2d876: 4a 81 ldd r20, Y+2 ; 0x02 2d878: 5b 81 ldd r21, Y+3 ; 0x03 2d87a: c4 59 subi r28, 0x94 ; 148 2d87c: d1 40 sbci r29, 0x01 ; 1 2d87e: 60 e0 ldi r22, 0x00 ; 0 2d880: 70 e0 ldi r23, 0x00 ; 0 2d882: 80 e8 ldi r24, 0x80 ; 128 2d884: 9f e3 ldi r25, 0x3F ; 63 2d886: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2d88a: ce 54 subi r28, 0x4E ; 78 2d88c: de 4f sbci r29, 0xFE ; 254 2d88e: 68 83 st Y, r22 2d890: 79 83 std Y+1, r23 ; 0x01 2d892: 8a 83 std Y+2, r24 ; 0x02 2d894: 9b 83 std Y+3, r25 ; 0x03 2d896: c2 5b subi r28, 0xB2 ; 178 2d898: 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; 2d89a: c7 01 movw r24, r14 2d89c: b6 01 movw r22, r12 2d89e: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 2d8a2: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2d8a4: fb 01 movw r30, r22 2d8a6: 31 96 adiw r30, 0x01 ; 1 2d8a8: c6 55 subi r28, 0x56 ; 86 2d8aa: de 4f sbci r29, 0xFE ; 254 2d8ac: f9 83 std Y+1, r31 ; 0x01 2d8ae: e8 83 st Y, r30 2d8b0: ca 5a subi r28, 0xAA ; 170 2d8b2: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2d8b4: c5 01 movw r24, r10 2d8b6: b4 01 movw r22, r8 2d8b8: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2d8bc: 8b 01 movw r16, r22 2d8be: 95 e0 ldi r25, 0x05 ; 5 2d8c0: 00 0f add r16, r16 2d8c2: 11 1f adc r17, r17 2d8c4: 9a 95 dec r25 2d8c6: e1 f7 brne .-8 ; 0x2d8c0 const uint16_t idx01 = c0 + 32 * r1; 2d8c8: c8 01 movw r24, r16 2d8ca: 80 96 adiw r24, 0x20 ; 32 2d8cc: c4 55 subi r28, 0x54 ; 84 2d8ce: de 4f sbci r29, 0xFE ; 254 2d8d0: 99 83 std Y+1, r25 ; 0x01 2d8d2: 88 83 st Y, r24 2d8d4: cc 5a subi r28, 0xAC ; 172 2d8d6: 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]; 2d8d8: f8 01 movw r30, r16 2d8da: ec 0d add r30, r12 2d8dc: fd 1d adc r31, r13 2d8de: eb 53 subi r30, 0x3B ; 59 2d8e0: f9 4f sbci r31, 0xF9 ; 249 2d8e2: 60 81 ld r22, Z 2d8e4: 70 e0 ldi r23, 0x00 ; 0 2d8e6: 90 e0 ldi r25, 0x00 ; 0 2d8e8: 80 e0 ldi r24, 0x00 ; 0 2d8ea: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d8ee: 4b 01 movw r8, r22 2d8f0: 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; 2d8f2: ce 54 subi r28, 0x4E ; 78 2d8f4: de 4f sbci r29, 0xFE ; 254 2d8f6: 28 81 ld r18, Y 2d8f8: 39 81 ldd r19, Y+1 ; 0x01 2d8fa: 4a 81 ldd r20, Y+2 ; 0x02 2d8fc: 5b 81 ldd r21, Y+3 ; 0x03 2d8fe: c2 5b subi r28, 0xB2 ; 178 2d900: d1 40 sbci r29, 0x01 ; 1 2d902: c2 55 subi r28, 0x52 ; 82 2d904: de 4f sbci r29, 0xFE ; 254 2d906: 68 81 ld r22, Y 2d908: 79 81 ldd r23, Y+1 ; 0x01 2d90a: 8a 81 ldd r24, Y+2 ; 0x02 2d90c: 9b 81 ldd r25, Y+3 ; 0x03 2d90e: ce 5a subi r28, 0xAE ; 174 2d910: d1 40 sbci r29, 0x01 ; 1 2d912: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d916: 9b 01 movw r18, r22 2d918: 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]; 2d91a: c5 01 movw r24, r10 2d91c: b4 01 movw r22, r8 2d91e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d922: 4b 01 movw r8, r22 2d924: 5c 01 movw r10, r24 2d926: c4 55 subi r28, 0x54 ; 84 2d928: de 4f sbci r29, 0xFE ; 254 2d92a: e8 81 ld r30, Y 2d92c: f9 81 ldd r31, Y+1 ; 0x01 2d92e: cc 5a subi r28, 0xAC ; 172 2d930: d1 40 sbci r29, 0x01 ; 1 2d932: ec 0d add r30, r12 2d934: fd 1d adc r31, r13 2d936: eb 53 subi r30, 0x3B ; 59 2d938: f9 4f sbci r31, 0xF9 ; 249 2d93a: 60 81 ld r22, Z 2d93c: 70 e0 ldi r23, 0x00 ; 0 2d93e: 90 e0 ldi r25, 0x00 ; 0 2d940: 80 e0 ldi r24, 0x00 ; 0 2d942: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d946: 6b 01 movw r12, r22 2d948: 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; 2d94a: c2 55 subi r28, 0x52 ; 82 2d94c: de 4f sbci r29, 0xFE ; 254 2d94e: 28 81 ld r18, Y 2d950: 39 81 ldd r19, Y+1 ; 0x01 2d952: 4a 81 ldd r20, Y+2 ; 0x02 2d954: 5b 81 ldd r21, Y+3 ; 0x03 2d956: ce 5a subi r28, 0xAE ; 174 2d958: d1 40 sbci r29, 0x01 ; 1 2d95a: cc 56 subi r28, 0x6C ; 108 2d95c: de 4f sbci r29, 0xFE ; 254 2d95e: 68 81 ld r22, Y 2d960: 79 81 ldd r23, Y+1 ; 0x01 2d962: 8a 81 ldd r24, Y+2 ; 0x02 2d964: 9b 81 ldd r25, Y+3 ; 0x03 2d966: c4 59 subi r28, 0x94 ; 148 2d968: d1 40 sbci r29, 0x01 ; 1 2d96a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d96e: 9b 01 movw r18, r22 2d970: 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]; 2d972: c7 01 movw r24, r14 2d974: b6 01 movw r22, r12 2d976: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d97a: 9b 01 movw r18, r22 2d97c: ac 01 movw r20, r24 2d97e: c5 01 movw r24, r10 2d980: b4 01 movw r22, r8 2d982: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2d986: 6b 01 movw r12, r22 2d988: 7c 01 movw r14, r24 2d98a: c6 55 subi r28, 0x56 ; 86 2d98c: de 4f sbci r29, 0xFE ; 254 2d98e: a8 81 ld r26, Y 2d990: b9 81 ldd r27, Y+1 ; 0x01 2d992: ca 5a subi r28, 0xAA ; 170 2d994: d1 40 sbci r29, 0x01 ; 1 2d996: 0a 0f add r16, r26 2d998: 1b 1f adc r17, r27 2d99a: f8 01 movw r30, r16 2d99c: eb 53 subi r30, 0x3B ; 59 2d99e: f9 4f sbci r31, 0xF9 ; 249 2d9a0: 60 81 ld r22, Z 2d9a2: 70 e0 ldi r23, 0x00 ; 0 2d9a4: 90 e0 ldi r25, 0x00 ; 0 2d9a6: 80 e0 ldi r24, 0x00 ; 0 2d9a8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2d9ac: 4b 01 movw r8, r22 2d9ae: 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; 2d9b0: ce 54 subi r28, 0x4E ; 78 2d9b2: de 4f sbci r29, 0xFE ; 254 2d9b4: 28 81 ld r18, Y 2d9b6: 39 81 ldd r19, Y+1 ; 0x01 2d9b8: 4a 81 ldd r20, Y+2 ; 0x02 2d9ba: 5b 81 ldd r21, Y+3 ; 0x03 2d9bc: c2 5b subi r28, 0xB2 ; 178 2d9be: d1 40 sbci r29, 0x01 ; 1 2d9c0: c3 01 movw r24, r6 2d9c2: b2 01 movw r22, r4 2d9c4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d9c8: 9b 01 movw r18, r22 2d9ca: 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]; 2d9cc: c5 01 movw r24, r10 2d9ce: b4 01 movw r22, r8 2d9d0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2d9d4: 9b 01 movw r18, r22 2d9d6: ac 01 movw r20, r24 2d9d8: c7 01 movw r24, r14 2d9da: b6 01 movw r22, r12 2d9dc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2d9e0: 6b 01 movw r12, r22 2d9e2: 7c 01 movw r14, r24 2d9e4: c6 55 subi r28, 0x56 ; 86 2d9e6: de 4f sbci r29, 0xFE ; 254 2d9e8: e8 81 ld r30, Y 2d9ea: f9 81 ldd r31, Y+1 ; 0x01 2d9ec: ca 5a subi r28, 0xAA ; 170 2d9ee: d1 40 sbci r29, 0x01 ; 1 2d9f0: c4 55 subi r28, 0x54 ; 84 2d9f2: de 4f sbci r29, 0xFE ; 254 2d9f4: 88 81 ld r24, Y 2d9f6: 99 81 ldd r25, Y+1 ; 0x01 2d9f8: cc 5a subi r28, 0xAC ; 172 2d9fa: d1 40 sbci r29, 0x01 ; 1 2d9fc: e8 0f add r30, r24 2d9fe: f9 1f adc r31, r25 2da00: eb 53 subi r30, 0x3B ; 59 2da02: f9 4f sbci r31, 0xF9 ; 249 2da04: 60 81 ld r22, Z 2da06: 70 e0 ldi r23, 0x00 ; 0 2da08: 90 e0 ldi r25, 0x00 ; 0 2da0a: 80 e0 ldi r24, 0x00 ; 0 2da0c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2da10: 4b 01 movw r8, r22 2da12: 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; 2da14: cc 56 subi r28, 0x6C ; 108 2da16: de 4f sbci r29, 0xFE ; 254 2da18: 28 81 ld r18, Y 2da1a: 39 81 ldd r19, Y+1 ; 0x01 2da1c: 4a 81 ldd r20, Y+2 ; 0x02 2da1e: 5b 81 ldd r21, Y+3 ; 0x03 2da20: c4 59 subi r28, 0x94 ; 148 2da22: d1 40 sbci r29, 0x01 ; 1 2da24: c3 01 movw r24, r6 2da26: b2 01 movw r22, r4 2da28: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2da2c: 9b 01 movw r18, r22 2da2e: 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]; 2da30: c5 01 movw r24, r10 2da32: b4 01 movw r22, r8 2da34: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2da38: 9b 01 movw r18, r22 2da3a: ac 01 movw r20, r24 2da3c: c7 01 movw r24, r14 2da3e: b6 01 movw r22, r12 2da40: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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; 2da44: 20 e0 ldi r18, 0x00 ; 0 2da46: 30 e0 ldi r19, 0x00 ; 0 2da48: 40 e0 ldi r20, 0x00 ; 0 2da4a: 52 e4 ldi r21, 0x42 ; 66 2da4c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2da50: 6b 01 movw r12, r22 2da52: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2da54: ac 01 movw r20, r24 2da56: 9b 01 movw r18, r22 2da58: ce 55 subi r28, 0x5E ; 94 2da5a: de 4f sbci r29, 0xFE ; 254 2da5c: 68 81 ld r22, Y 2da5e: 79 81 ldd r23, Y+1 ; 0x01 2da60: 8a 81 ldd r24, Y+2 ; 0x02 2da62: 9b 81 ldd r25, Y+3 ; 0x03 2da64: c2 5a subi r28, 0xA2 ; 162 2da66: d1 40 sbci r29, 0x01 ; 1 2da68: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2da6c: c8 55 subi r28, 0x58 ; 88 2da6e: de 4f sbci r29, 0xFE ; 254 2da70: a8 81 ld r26, Y 2da72: b9 81 ldd r27, Y+1 ; 0x01 2da74: c8 5a subi r28, 0xA8 ; 168 2da76: d1 40 sbci r29, 0x01 ; 1 2da78: 6d 93 st X+, r22 2da7a: 7d 93 st X+, r23 2da7c: 8d 93 st X+, r24 2da7e: 9d 93 st X+, r25 2da80: c8 55 subi r28, 0x58 ; 88 2da82: de 4f sbci r29, 0xFE ; 254 2da84: b9 83 std Y+1, r27 ; 0x01 2da86: a8 83 st Y, r26 2da88: c8 5a subi r28, 0xA8 ; 168 2da8a: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2da8c: a7 01 movw r20, r14 2da8e: 96 01 movw r18, r12 2da90: c2 56 subi r28, 0x62 ; 98 2da92: de 4f sbci r29, 0xFE ; 254 2da94: 68 81 ld r22, Y 2da96: 79 81 ldd r23, Y+1 ; 0x01 2da98: 8a 81 ldd r24, Y+2 ; 0x02 2da9a: 9b 81 ldd r25, Y+3 ; 0x03 2da9c: ce 59 subi r28, 0x9E ; 158 2da9e: d1 40 sbci r29, 0x01 ; 1 2daa0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2daa4: ca 55 subi r28, 0x5A ; 90 2daa6: de 4f sbci r29, 0xFE ; 254 2daa8: e8 81 ld r30, Y 2daaa: f9 81 ldd r31, Y+1 ; 0x01 2daac: c6 5a subi r28, 0xA6 ; 166 2daae: d1 40 sbci r29, 0x01 ; 1 2dab0: 61 93 st Z+, r22 2dab2: 71 93 st Z+, r23 2dab4: 81 93 st Z+, r24 2dab6: 91 93 st Z+, r25 2dab8: ca 55 subi r28, 0x5A ; 90 2daba: de 4f sbci r29, 0xFE ; 254 2dabc: f9 83 std Y+1, r31 ; 0x01 2dabe: e8 83 st Y, r30 2dac0: c6 5a subi r28, 0xA6 ; 166 2dac2: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2dac4: c8 56 subi r28, 0x68 ; 104 2dac6: de 4f sbci r29, 0xFE ; 254 2dac8: a8 81 ld r26, Y 2daca: b9 81 ldd r27, Y+1 ; 0x01 2dacc: c8 59 subi r28, 0x98 ; 152 2dace: d1 40 sbci r29, 0x01 ; 1 2dad0: cd 92 st X+, r12 2dad2: dd 92 st X+, r13 2dad4: ed 92 st X+, r14 2dad6: fd 92 st X+, r15 2dad8: c8 56 subi r28, 0x68 ; 104 2dada: de 4f sbci r29, 0xFE ; 254 2dadc: b9 83 std Y+1, r27 ; 0x01 2dade: a8 83 st Y, r26 2dae0: c8 59 subi r28, 0x98 ; 152 2dae2: d1 40 sbci r29, 0x01 ; 1 2dae4: bf ef ldi r27, 0xFF ; 255 2dae6: 2b 1a sub r2, r27 2dae8: 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){ 2daea: e1 e2 ldi r30, 0x21 ; 33 2daec: 2e 16 cp r2, r30 2daee: 31 04 cpc r3, r1 2daf0: 09 f0 breq .+2 ; 0x2daf4 2daf2: 10 ce rjmp .-992 ; 0x2d714 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); 2daf4: 40 e0 ldi r20, 0x00 ; 0 2daf6: 50 e0 ldi r21, 0x00 ; 0 2daf8: 60 e0 ldi r22, 0x00 ; 0 2dafa: 7d e3 ldi r23, 0x3D ; 61 2dafc: ce 01 movw r24, r28 2dafe: 87 5f subi r24, 0xF7 ; 247 2db00: 9e 4f sbci r25, 0xFE ; 254 2db02: 0f 94 fe 64 call 0x2c9fc ; 0x2c9fc 2db06: 9b 01 movw r18, r22 2db08: ac 01 movw r20, r24 2db0a: c3 57 subi r28, 0x73 ; 115 2db0c: de 4f sbci r29, 0xFE ; 254 2db0e: a8 81 ld r26, Y 2db10: b9 81 ldd r27, Y+1 ; 0x01 2db12: cd 58 subi r28, 0x8D ; 141 2db14: d1 40 sbci r29, 0x01 ; 1 2db16: 6d 91 ld r22, X+ 2db18: 7d 91 ld r23, X+ 2db1a: 8d 91 ld r24, X+ 2db1c: 9c 91 ld r25, X 2db1e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2db22: c3 57 subi r28, 0x73 ; 115 2db24: de 4f sbci r29, 0xFE ; 254 2db26: e8 81 ld r30, Y 2db28: f9 81 ldd r31, Y+1 ; 0x01 2db2a: cd 58 subi r28, 0x8D ; 141 2db2c: d1 40 sbci r29, 0x01 ; 1 2db2e: 60 83 st Z, r22 2db30: 71 83 std Z+1, r23 ; 0x01 2db32: 82 83 std Z+2, r24 ; 0x02 2db34: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2db36: 40 e0 ldi r20, 0x00 ; 0 2db38: 50 e0 ldi r21, 0x00 ; 0 2db3a: 60 e0 ldi r22, 0x00 ; 0 2db3c: 7d e3 ldi r23, 0x3D ; 61 2db3e: ce 01 movw r24, r28 2db40: 8b 57 subi r24, 0x7B ; 123 2db42: 9f 4f sbci r25, 0xFF ; 255 2db44: 0f 94 fe 64 call 0x2c9fc ; 0x2c9fc 2db48: 9b 01 movw r18, r22 2db4a: ac 01 movw r20, r24 2db4c: c1 57 subi r28, 0x71 ; 113 2db4e: de 4f sbci r29, 0xFE ; 254 2db50: a8 81 ld r26, Y 2db52: b9 81 ldd r27, Y+1 ; 0x01 2db54: cf 58 subi r28, 0x8F ; 143 2db56: d1 40 sbci r29, 0x01 ; 1 2db58: 6d 91 ld r22, X+ 2db5a: 7d 91 ld r23, X+ 2db5c: 8d 91 ld r24, X+ 2db5e: 9c 91 ld r25, X 2db60: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2db64: c1 57 subi r28, 0x71 ; 113 2db66: de 4f sbci r29, 0xFE ; 254 2db68: e8 81 ld r30, Y 2db6a: f9 81 ldd r31, Y+1 ; 0x01 2db6c: cf 58 subi r28, 0x8F ; 143 2db6e: d1 40 sbci r29, 0x01 ; 1 2db70: 60 83 st Z, r22 2db72: 71 83 std Z+1, r23 ; 0x01 2db74: 82 83 std Z+2, r24 ; 0x02 2db76: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2db78: 40 e0 ldi r20, 0x00 ; 0 2db7a: 50 e0 ldi r21, 0x00 ; 0 2db7c: 60 e8 ldi r22, 0x80 ; 128 2db7e: 7c e3 ldi r23, 0x3C ; 60 2db80: ce 01 movw r24, r28 2db82: 01 96 adiw r24, 0x01 ; 1 2db84: 0f 94 fe 64 call 0x2c9fc ; 0x2c9fc 2db88: ce 56 subi r28, 0x6E ; 110 2db8a: de 4f sbci r29, 0xFE ; 254 2db8c: a8 81 ld r26, Y 2db8e: b9 81 ldd r27, Y+1 ; 0x01 2db90: c2 59 subi r28, 0x92 ; 146 2db92: d1 40 sbci r29, 0x01 ; 1 2db94: 2d 91 ld r18, X+ 2db96: 3d 91 ld r19, X+ 2db98: 4d 91 ld r20, X+ 2db9a: 5c 91 ld r21, X 2db9c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2dba0: 16 2f mov r17, r22 2dba2: 07 2f mov r16, r23 2dba4: f8 2e mov r15, r24 2dba6: e9 2e mov r14, r25 r = MAX(2, r); 2dba8: 20 e0 ldi r18, 0x00 ; 0 2dbaa: 30 e0 ldi r19, 0x00 ; 0 2dbac: 40 e0 ldi r20, 0x00 ; 0 2dbae: 50 e4 ldi r21, 0x40 ; 64 2dbb0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 2dbb4: 18 16 cp r1, r24 2dbb6: 2c f0 brlt .+10 ; 0x2dbc2 2dbb8: 10 e0 ldi r17, 0x00 ; 0 2dbba: 00 e0 ldi r16, 0x00 ; 0 2dbbc: f1 2c mov r15, r1 2dbbe: 80 e4 ldi r24, 0x40 ; 64 2dbc0: e8 2e mov r14, r24 2dbc2: a8 01 movw r20, r16 2dbc4: 97 01 movw r18, r14 2dbc6: 85 2f mov r24, r21 2dbc8: 90 2f mov r25, r16 2dbca: a3 2f mov r26, r19 2dbcc: be 2d mov r27, r14 2dbce: ce 56 subi r28, 0x6E ; 110 2dbd0: de 4f sbci r29, 0xFE ; 254 2dbd2: e8 81 ld r30, Y 2dbd4: f9 81 ldd r31, Y+1 ; 0x01 2dbd6: c2 59 subi r28, 0x92 ; 146 2dbd8: d1 40 sbci r29, 0x01 ; 1 2dbda: 80 83 st Z, r24 2dbdc: 91 83 std Z+1, r25 ; 0x01 2dbde: a2 83 std Z+2, r26 ; 0x02 2dbe0: b3 83 std Z+3, r27 ; 0x03 2dbe2: cf 56 subi r28, 0x6F ; 111 2dbe4: de 4f sbci r29, 0xFE ; 254 2dbe6: f8 81 ld r31, Y 2dbe8: c1 59 subi r28, 0x91 ; 145 2dbea: d1 40 sbci r29, 0x01 ; 1 2dbec: f1 50 subi r31, 0x01 ; 1 2dbee: cf 56 subi r28, 0x6F ; 111 2dbf0: de 4f sbci r29, 0xFE ; 254 2dbf2: f8 83 st Y, r31 2dbf4: c1 59 subi r28, 0x91 ; 145 2dbf6: 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){ 2dbf8: f1 11 cpse r31, r1 2dbfa: 37 cd rjmp .-1426 ; 0x2d66a r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2dbfc: ef 92 push r14 2dbfe: ff 92 push r15 2dc00: 0f 93 push r16 2dc02: 1f 93 push r17 2dc04: c1 57 subi r28, 0x71 ; 113 2dc06: de 4f sbci r29, 0xFE ; 254 2dc08: a8 81 ld r26, Y 2dc0a: b9 81 ldd r27, Y+1 ; 0x01 2dc0c: cf 58 subi r28, 0x8F ; 143 2dc0e: d1 40 sbci r29, 0x01 ; 1 2dc10: 13 96 adiw r26, 0x03 ; 3 2dc12: 8c 91 ld r24, X 2dc14: 13 97 sbiw r26, 0x03 ; 3 2dc16: 8f 93 push r24 2dc18: 12 96 adiw r26, 0x02 ; 2 2dc1a: 8c 91 ld r24, X 2dc1c: 12 97 sbiw r26, 0x02 ; 2 2dc1e: 8f 93 push r24 2dc20: 11 96 adiw r26, 0x01 ; 1 2dc22: 8c 91 ld r24, X 2dc24: 11 97 sbiw r26, 0x01 ; 1 2dc26: 8f 93 push r24 2dc28: 8c 91 ld r24, X 2dc2a: 8f 93 push r24 2dc2c: c3 57 subi r28, 0x73 ; 115 2dc2e: de 4f sbci r29, 0xFE ; 254 2dc30: e8 81 ld r30, Y 2dc32: f9 81 ldd r31, Y+1 ; 0x01 2dc34: cd 58 subi r28, 0x8D ; 141 2dc36: d1 40 sbci r29, 0x01 ; 1 2dc38: 83 81 ldd r24, Z+3 ; 0x03 2dc3a: 8f 93 push r24 2dc3c: 82 81 ldd r24, Z+2 ; 0x02 2dc3e: 8f 93 push r24 2dc40: 81 81 ldd r24, Z+1 ; 0x01 2dc42: 8f 93 push r24 2dc44: 80 81 ld r24, Z 2dc46: 8f 93 push r24 2dc48: 8d ec ldi r24, 0xCD ; 205 2dc4a: 96 ea ldi r25, 0xA6 ; 166 2dc4c: 9f 93 push r25 2dc4e: 8f 93 push r24 2dc50: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 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: c3 54 subi r28, 0x43 ; 67 2dc60: de 4f sbci r29, 0xFE ; 254 2dc62: 0f b6 in r0, 0x3f ; 63 2dc64: f8 94 cli 2dc66: de bf out 0x3e, r29 ; 62 2dc68: 0f be out 0x3f, r0 ; 63 2dc6a: cd bf out 0x3d, r28 ; 61 2dc6c: df 91 pop r29 2dc6e: cf 91 pop r28 2dc70: 1f 91 pop r17 2dc72: 0f 91 pop r16 2dc74: ff 90 pop r15 2dc76: ef 90 pop r14 2dc78: df 90 pop r13 2dc7a: cf 90 pop r12 2dc7c: bf 90 pop r11 2dc7e: af 90 pop r10 2dc80: 9f 90 pop r9 2dc82: 8f 90 pop r8 2dc84: 7f 90 pop r7 2dc86: 6f 90 pop r6 2dc88: 5f 90 pop r5 2dc8a: 4f 90 pop r4 2dc8c: 3f 90 pop r3 2dc8e: 2f 90 pop r2 2dc90: 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; 2dc92: 60 e0 ldi r22, 0x00 ; 0 2dc94: 70 e0 ldi r23, 0x00 ; 0 2dc96: cb 01 movw r24, r22 2dc98: d5 ce rjmp .-598 ; 0x2da44 0002dc9a : 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){ 2dc9a: ef 92 push r14 2dc9c: ff 92 push r15 2dc9e: 0f 93 push r16 2dca0: 1f 93 push r17 2dca2: cf 93 push r28 2dca4: df 93 push r29 2dca6: 1f 92 push r1 2dca8: 1f 92 push r1 2dcaa: cd b7 in r28, 0x3d ; 61 2dcac: de b7 in r29, 0x3e ; 62 2dcae: f8 2e mov r15, r24 2dcb0: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2dcb2: 80 e1 ldi r24, 0x10 ; 16 2dcb4: 97 e2 ldi r25, 0x27 ; 39 2dcb6: 9a 83 std Y+2, r25 ; 0x02 2dcb8: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2dcba: 8a 01 movw r16, r20 2dcbc: 16 95 lsr r17 2dcbe: 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); 2dcc0: 8f 2d mov r24, r15 2dcc2: 0e 94 23 eb call 0x1d646 ; 0x1d646 while (steps--){ 2dcc6: 01 50 subi r16, 0x01 ; 1 2dcc8: 11 09 sbc r17, r1 2dcca: 78 f0 brcs .+30 ; 0x2dcea accelerate_1_step(axes, acc, delay_us, min_delay_us); 2dccc: 28 ec ldi r18, 0xC8 ; 200 2dcce: 30 e0 ldi r19, 0x00 ; 0 2dcd0: ae 01 movw r20, r28 2dcd2: 4f 5f subi r20, 0xFF ; 255 2dcd4: 5f 4f sbci r21, 0xFF ; 255 2dcd6: 68 ee ldi r22, 0xE8 ; 232 2dcd8: 73 e0 ldi r23, 0x03 ; 3 2dcda: 8f 2d mov r24, r15 2dcdc: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 update_position_1_step(axes, dir); 2dce0: 6e 2d mov r22, r14 2dce2: 8f 2d mov r24, r15 2dce4: 0e 94 3c eb call 0x1d678 ; 0x1d678 2dce8: ee cf rjmp .-36 ; 0x2dcc6 } /// \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); 2dcea: 6e 2d mov r22, r14 2dcec: 8f 2d mov r24, r15 2dcee: 0e 94 23 eb call 0x1d646 ; 0x1d646 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); } 2dcf2: 0f 90 pop r0 2dcf4: 0f 90 pop r0 2dcf6: df 91 pop r29 2dcf8: cf 91 pop r28 2dcfa: 1f 91 pop r17 2dcfc: 0f 91 pop r16 2dcfe: ff 90 pop r15 2dd00: ef 90 pop r14 2dd02: 08 95 ret 0002dd04 : /// 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) 2dd04: 2f 92 push r2 2dd06: 3f 92 push r3 2dd08: 4f 92 push r4 2dd0a: 5f 92 push r5 2dd0c: 6f 92 push r6 2dd0e: 7f 92 push r7 2dd10: 8f 92 push r8 2dd12: 9f 92 push r9 2dd14: af 92 push r10 2dd16: bf 92 push r11 2dd18: cf 92 push r12 2dd1a: df 92 push r13 2dd1c: ef 92 push r14 2dd1e: ff 92 push r15 2dd20: 0f 93 push r16 2dd22: 1f 93 push r17 2dd24: cf 93 push r28 2dd26: df 93 push r29 2dd28: cd b7 in r28, 0x3d ; 61 2dd2a: de b7 in r29, 0x3e ; 62 2dd2c: 6c 97 sbiw r28, 0x1c ; 28 2dd2e: 0f b6 in r0, 0x3f ; 63 2dd30: f8 94 cli 2dd32: de bf out 0x3e, r29 ; 62 2dd34: 0f be out 0x3f, r0 ; 63 2dd36: cd bf out 0x3d, r28 ; 61 2dd38: 6c 01 movw r12, r24 2dd3a: 5b 01 movw r10, r22 2dd3c: 4a 01 movw r8, r20 2dd3e: 19 01 movw r2, r18 2dd40: 18 87 std Y+8, r17 ; 0x08 2dd42: 0f 83 std Y+7, r16 ; 0x07 2dd44: fa 82 std Y+2, r15 ; 0x02 2dd46: 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; 2dd48: d7 01 movw r26, r14 2dd4a: 8d 91 ld r24, X+ 2dd4c: 9c 91 ld r25, X 2dd4e: 60 ed ldi r22, 0xD0 ; 208 2dd50: 72 e0 ldi r23, 0x02 ; 2 2dd52: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2dd56: 9c 8f std Y+28, r25 ; 0x1c 2dd58: 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); 2dd5a: 9f 93 push r25 2dd5c: 8f 93 push r24 2dd5e: 3f 92 push r3 2dd60: 2f 93 push r18 2dd62: 1f 92 push r1 2dd64: 84 e6 ldi r24, 0x64 ; 100 2dd66: 8f 93 push r24 2dd68: 9f 92 push r9 2dd6a: 8f 92 push r8 2dd6c: bf 92 push r11 2dd6e: af 92 push r10 2dd70: df 92 push r13 2dd72: cf 92 push r12 2dd74: 8b e4 ldi r24, 0x4B ; 75 2dd76: 96 ea ldi r25, 0xA6 ; 166 2dd78: 9f 93 push r25 2dd7a: 8f 93 push r24 2dd7c: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2dd80: 0f b6 in r0, 0x3f ; 63 2dd82: f8 94 cli 2dd84: de bf out 0x3e, r29 ; 62 2dd86: 0f be out 0x3f, r0 ; 63 2dd88: 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; 2dd8a: 22 27 eor r18, r18 2dd8c: 33 27 eor r19, r19 2dd8e: 22 19 sub r18, r2 2dd90: 33 09 sbc r19, r3 2dd92: 3a 8f std Y+26, r19 ; 0x1a 2dd94: 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)); 2dd96: c4 01 movw r24, r8 2dd98: 99 0c add r9, r9 2dd9a: aa 0b sbc r26, r26 2dd9c: bb 0b sbc r27, r27 2dd9e: 89 87 std Y+9, r24 ; 0x09 2dda0: 9a 87 std Y+10, r25 ; 0x0a 2dda2: ab 87 std Y+11, r26 ; 0x0b 2dda4: 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)); 2dda6: 95 01 movw r18, r10 2dda8: bb 0c add r11, r11 2ddaa: 44 0b sbc r20, r20 2ddac: 55 0b sbc r21, r21 2ddae: 29 8b std Y+17, r18 ; 0x11 2ddb0: 3a 8b std Y+18, r19 ; 0x12 2ddb2: 4b 8b std Y+19, r20 ; 0x13 2ddb4: 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)); 2ddb6: c6 01 movw r24, r12 2ddb8: dd 0c add r13, r13 2ddba: aa 0b sbc r26, r26 2ddbc: bb 0b sbc r27, r27 2ddbe: 8d 8b std Y+21, r24 ; 0x15 2ddc0: 9e 8b std Y+22, r25 ; 0x16 2ddc2: af 8b std Y+23, r26 ; 0x17 2ddc4: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2ddc6: 12 14 cp r1, r2 2ddc8: 13 04 cpc r1, r3 2ddca: 0c f0 brlt .+2 ; 0x2ddce 2ddcc: ba c0 rjmp .+372 ; 0x2df42 { dad = dad_max - (ad / k); 2ddce: 8b 8d ldd r24, Y+27 ; 0x1b 2ddd0: 9c 8d ldd r25, Y+28 ; 0x1c 2ddd2: 6c e3 ldi r22, 0x3C ; 60 2ddd4: 70 e0 ldi r23, 0x00 ; 0 2ddd6: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2ddda: 10 e1 ldi r17, 0x10 ; 16 2dddc: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2ddde: 2b 8d ldd r18, Y+27 ; 0x1b 2dde0: 3c 8d ldd r19, Y+28 ; 0x1c 2dde2: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2dde4: 0f 94 43 dd call 0x3ba86 ; 0x3ba86 <__usmulhisi3> 2dde8: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2ddec: 20 e0 ldi r18, 0x00 ; 0 2ddee: 30 e0 ldi r19, 0x00 ; 0 2ddf0: 44 e3 ldi r20, 0x34 ; 52 2ddf2: 54 e4 ldi r21, 0x44 ; 68 2ddf4: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 2ddf8: 6b 01 movw r12, r22 2ddfa: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2ddfc: 6f 81 ldd r22, Y+7 ; 0x07 2ddfe: 78 85 ldd r23, Y+8 ; 0x08 2de00: eb 8d ldd r30, Y+27 ; 0x1b 2de02: fc 8d ldd r31, Y+28 ; 0x1c 2de04: 6e 0f add r22, r30 2de06: 7f 1f adc r23, r31 2de08: 90 e0 ldi r25, 0x00 ; 0 2de0a: 80 e0 ldi r24, 0x00 ; 0 2de0c: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 2de10: 25 e3 ldi r18, 0x35 ; 53 2de12: 3a ef ldi r19, 0xFA ; 250 2de14: 4e e8 ldi r20, 0x8E ; 142 2de16: 5c e3 ldi r21, 0x3C ; 60 2de18: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2de1c: 4b 01 movw r8, r22 2de1e: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2de20: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 2de24: 6b 83 std Y+3, r22 ; 0x03 2de26: 7c 83 std Y+4, r23 ; 0x04 2de28: 8d 83 std Y+5, r24 ; 0x05 2de2a: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2de2c: c5 01 movw r24, r10 2de2e: b4 01 movw r22, r8 2de30: 0f 94 0b e1 call 0x3c216 ; 0x3c216 2de34: 2b 01 movw r4, r22 2de36: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2de38: 69 85 ldd r22, Y+9 ; 0x09 2de3a: 7a 85 ldd r23, Y+10 ; 0x0a 2de3c: 8b 85 ldd r24, Y+11 ; 0x0b 2de3e: 9c 85 ldd r25, Y+12 ; 0x0c 2de40: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2de44: 4b 01 movw r8, r22 2de46: 5c 01 movw r10, r24 2de48: 2b 8d ldd r18, Y+27 ; 0x1b 2de4a: 3c 8d ldd r19, Y+28 ; 0x1c 2de4c: a4 e6 ldi r26, 0x64 ; 100 2de4e: b0 e0 ldi r27, 0x00 ; 0 2de50: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 2de54: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2de58: 20 e0 ldi r18, 0x00 ; 0 2de5a: 30 e0 ldi r19, 0x00 ; 0 2de5c: 44 e3 ldi r20, 0x34 ; 52 2de5e: 54 e4 ldi r21, 0x44 ; 68 2de60: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 2de64: 9b 01 movw r18, r22 2de66: ac 01 movw r20, r24 2de68: c5 01 movw r24, r10 2de6a: b4 01 movw r22, r8 2de6c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 2de70: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2de74: 6d 87 std Y+13, r22 ; 0x0d 2de76: 7e 87 std Y+14, r23 ; 0x0e 2de78: 8f 87 std Y+15, r24 ; 0x0f 2de7a: 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)); 2de7c: 69 89 ldd r22, Y+17 ; 0x11 2de7e: 7a 89 ldd r23, Y+18 ; 0x12 2de80: 8b 89 ldd r24, Y+19 ; 0x13 2de82: 9c 89 ldd r25, Y+20 ; 0x14 2de84: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2de88: 4b 01 movw r8, r22 2de8a: 5c 01 movw r10, r24 2de8c: a3 01 movw r20, r6 2de8e: 92 01 movw r18, r4 2de90: c7 01 movw r24, r14 2de92: b6 01 movw r22, r12 2de94: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2de98: 9b 01 movw r18, r22 2de9a: ac 01 movw r20, r24 2de9c: c5 01 movw r24, r10 2de9e: b4 01 movw r22, r8 2dea0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2dea4: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2dea8: 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)); 2deaa: 6d 89 ldd r22, Y+21 ; 0x15 2deac: 7e 89 ldd r23, Y+22 ; 0x16 2deae: 8f 89 ldd r24, Y+23 ; 0x17 2deb0: 98 8d ldd r25, Y+24 ; 0x18 2deb2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 2deb6: 2b 01 movw r4, r22 2deb8: 3c 01 movw r6, r24 2deba: a7 01 movw r20, r14 2debc: 96 01 movw r18, r12 2debe: 6b 81 ldd r22, Y+3 ; 0x03 2dec0: 7c 81 ldd r23, Y+4 ; 0x04 2dec2: 8d 81 ldd r24, Y+5 ; 0x05 2dec4: 9e 81 ldd r25, Y+6 ; 0x06 2dec6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2deca: 9b 01 movw r18, r22 2decc: ac 01 movw r20, r24 2dece: c3 01 movw r24, r6 2ded0: b2 01 movw r22, r4 2ded2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 2ded6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2deda: 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)) 2dedc: 01 e0 ldi r16, 0x01 ; 1 2dede: 20 e4 ldi r18, 0x40 ; 64 2dee0: 31 e0 ldi r19, 0x01 ; 1 2dee2: 4d 85 ldd r20, Y+13 ; 0x0d 2dee4: 5e 85 ldd r21, Y+14 ; 0x0e 2dee6: b4 01 movw r22, r8 2dee8: 0e 94 7c eb call 0x1d6f8 ; 0x1d6f8 2deec: 21 2f mov r18, r17 2deee: 30 e0 ldi r19, 0x00 ; 0 2def0: 88 23 and r24, r24 2def2: b9 f1 breq .+110 ; 0x2df62 2def4: 4b 8d ldd r20, Y+27 ; 0x1b 2def6: 5c 8d ldd r21, Y+28 ; 0x1c 2def8: 42 0f add r20, r18 2defa: 53 1f adc r21, r19 { ad += dad + 1; 2defc: 4f 5f subi r20, 0xFF ; 255 2defe: 5f 4f sbci r21, 0xFF ; 255 2df00: 5c 8f std Y+28, r21 ; 0x1c 2df02: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2df04: eb 8d ldd r30, Y+27 ; 0x1b 2df06: fc 8d ldd r31, Y+28 ; 0x1c 2df08: a9 81 ldd r26, Y+1 ; 0x01 2df0a: ba 81 ldd r27, Y+2 ; 0x02 2df0c: ed 93 st X+, r30 2df0e: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2df10: 6c 96 adiw r28, 0x1c ; 28 2df12: 0f b6 in r0, 0x3f ; 63 2df14: f8 94 cli 2df16: de bf out 0x3e, r29 ; 62 2df18: 0f be out 0x3f, r0 ; 63 2df1a: cd bf out 0x3d, r28 ; 61 2df1c: df 91 pop r29 2df1e: cf 91 pop r28 2df20: 1f 91 pop r17 2df22: 0f 91 pop r16 2df24: ff 90 pop r15 2df26: ef 90 pop r14 2df28: df 90 pop r13 2df2a: cf 90 pop r12 2df2c: bf 90 pop r11 2df2e: af 90 pop r10 2df30: 9f 90 pop r9 2df32: 8f 90 pop r8 2df34: 7f 90 pop r7 2df36: 6f 90 pop r6 2df38: 5f 90 pop r5 2df3a: 4f 90 pop r4 2df3c: 3f 90 pop r3 2df3e: 2f 90 pop r2 2df40: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2df42: 2f ec ldi r18, 0xCF ; 207 2df44: 32 e0 ldi r19, 0x02 ; 2 2df46: ab 8d ldd r26, Y+27 ; 0x1b 2df48: bc 8d ldd r27, Y+28 ; 0x1c 2df4a: 2a 1b sub r18, r26 2df4c: 3b 0b sbc r19, r27 2df4e: c9 01 movw r24, r18 2df50: 6c e3 ldi r22, 0x3C ; 60 2df52: 70 e0 ldi r23, 0x00 ; 0 2df54: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 2df58: 10 e1 ldi r17, 0x10 ; 16 2df5a: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2df5c: a9 8d ldd r26, Y+25 ; 0x19 2df5e: ba 8d ldd r27, Y+26 ; 0x1a 2df60: 41 cf rjmp .-382 ; 0x2dde4 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2df62: 2f 5f subi r18, 0xFF ; 255 2df64: 3f 4f sbci r19, 0xFF ; 255 2df66: ab 8d ldd r26, Y+27 ; 0x1b 2df68: bc 8d ldd r27, Y+28 ; 0x1c 2df6a: a2 0f add r26, r18 2df6c: b3 1f adc r27, r19 2df6e: bc 8f std Y+28, r27 ; 0x1c 2df70: ab 8f std Y+27, r26 ; 0x1b 2df72: a0 3d cpi r26, 0xD0 ; 208 2df74: b2 40 sbci r27, 0x02 ; 2 2df76: 08 f4 brcc .+2 ; 0x2df7a 2df78: 26 cf rjmp .-436 ; 0x2ddc6 2df7a: c4 cf rjmp .-120 ; 0x2df04 0002df7c : 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){ 2df7c: 2f 92 push r2 2df7e: 3f 92 push r3 2df80: 4f 92 push r4 2df82: 5f 92 push r5 2df84: 6f 92 push r6 2df86: 7f 92 push r7 2df88: 8f 92 push r8 2df8a: 9f 92 push r9 2df8c: af 92 push r10 2df8e: bf 92 push r11 2df90: cf 92 push r12 2df92: df 92 push r13 2df94: ef 92 push r14 2df96: ff 92 push r15 2df98: 0f 93 push r16 2df9a: 1f 93 push r17 2df9c: cf 93 push r28 2df9e: df 93 push r29 2dfa0: cd b7 in r28, 0x3d ; 61 2dfa2: de b7 in r29, 0x3e ; 62 2dfa4: ca 55 subi r28, 0x5A ; 90 2dfa6: d1 09 sbc r29, r1 2dfa8: 0f b6 in r0, 0x3f ; 63 2dfaa: f8 94 cli 2dfac: de bf out 0x3e, r29 ; 62 2dfae: 0f be out 0x3f, r0 ; 63 2dfb0: cd bf out 0x3d, r28 ; 61 2dfb2: 63 96 adiw r28, 0x13 ; 19 2dfb4: 9f af std Y+63, r25 ; 0x3f 2dfb6: 8e af std Y+62, r24 ; 0x3e 2dfb8: 63 97 sbiw r28, 0x13 ; 19 2dfba: 8b 01 movw r16, r22 2dfbc: 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 2dfbe: 7e 01 movw r14, r28 2dfc0: 25 e4 ldi r18, 0x45 ; 69 2dfc2: e2 0e add r14, r18 2dfc4: f1 1c adc r15, r1 2dfc6: 80 e1 ldi r24, 0x10 ; 16 2dfc8: 97 e2 ldi r25, 0x27 ; 39 2dfca: f7 01 movw r30, r14 2dfcc: 91 83 std Z+1, r25 ; 0x01 2dfce: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2dfd0: 88 e9 ldi r24, 0x98 ; 152 2dfd2: 96 ea ldi r25, 0xA6 ; 166 2dfd4: 9f 93 push r25 2dfd6: 8f 93 push r24 2dfd8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2dfdc: 25 ec ldi r18, 0xC5 ; 197 2dfde: 36 e0 ldi r19, 0x06 ; 6 2dfe0: 61 96 adiw r28, 0x11 ; 17 2dfe2: 3f af std Y+63, r19 ; 0x3f 2dfe4: 2e af std Y+62, r18 ; 0x3e 2dfe6: 61 97 sbiw r28, 0x11 ; 17 2dfe8: c8 01 movw r24, r16 2dfea: 80 5e subi r24, 0xE0 ; 224 2dfec: 93 40 sbci r25, 0x03 ; 3 2dfee: 2b 96 adiw r28, 0x0b ; 11 2dff0: 9f af std Y+63, r25 ; 0x3f 2dff2: 8e af std Y+62, r24 ; 0x3e 2dff4: 2b 97 sbiw r28, 0x0b ; 11 2dff6: 0f 90 pop r0 2dff8: 0f 90 pop r0 2dffa: e0 e4 ldi r30, 0x40 ; 64 2dffc: f0 e0 ldi r31, 0x00 ; 0 2dffe: 29 96 adiw r28, 0x09 ; 9 2e000: ff af std Y+63, r31 ; 0x3f 2e002: ee af std Y+62, r30 ; 0x3e 2e004: 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); 2e006: 63 96 adiw r28, 0x13 ; 19 2e008: 2e ad ldd r18, Y+62 ; 0x3e 2e00a: 3f ad ldd r19, Y+63 ; 0x3f 2e00c: 63 97 sbiw r28, 0x13 ; 19 2e00e: 20 5e subi r18, 0xE0 ; 224 2e010: 33 40 sbci r19, 0x03 ; 3 2e012: 69 96 adiw r28, 0x19 ; 25 2e014: 3f af std Y+63, r19 ; 0x3f 2e016: 2e af std Y+62, r18 ; 0x3e 2e018: 69 97 sbiw r28, 0x19 ; 25 2e01a: 29 96 adiw r28, 0x09 ; 9 2e01c: 4e ac ldd r4, Y+62 ; 0x3e 2e01e: 5f ac ldd r5, Y+63 ; 0x3f 2e020: 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){ 2e022: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2e024: 63 96 adiw r28, 0x13 ; 19 2e026: 8e ad ldd r24, Y+62 ; 0x3e 2e028: 9f ad ldd r25, Y+63 ; 0x3f 2e02a: 63 97 sbiw r28, 0x13 ; 19 2e02c: 80 52 subi r24, 0x20 ; 32 2e02e: 9c 4f sbci r25, 0xFC ; 252 2e030: 6b 96 adiw r28, 0x1b ; 27 2e032: 9f af std Y+63, r25 ; 0x3f 2e034: 8e af std Y+62, r24 ; 0x3e 2e036: 6b 97 sbiw r28, 0x1b ; 27 2e038: 60 90 bb 06 lds r6, 0x06BB ; 0x8006bb 2e03c: 70 90 bc 06 lds r7, 0x06BC ; 0x8006bc 2e040: 80 90 bd 06 lds r8, 0x06BD ; 0x8006bd 2e044: 90 90 be 06 lds r9, 0x06BE ; 0x8006be 2e048: 6b 96 adiw r28, 0x1b ; 27 2e04a: ae ac ldd r10, Y+62 ; 0x3e 2e04c: bf ac ldd r11, Y+63 ; 0x3f 2e04e: 6b 97 sbiw r28, 0x1b ; 27 2e050: 31 10 cpse r3, r1 2e052: 04 c0 rjmp .+8 ; 0x2e05c 2e054: 69 96 adiw r28, 0x19 ; 25 2e056: ae ac ldd r10, Y+62 ; 0x3e 2e058: bf ac ldd r11, Y+63 ; 0x3f 2e05a: 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; 2e05c: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 2e060: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 2e064: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 2e068: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 2e06c: f5 01 movw r30, r10 2e06e: e8 1b sub r30, r24 2e070: f9 0b sbc r31, r25 2e072: 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) 2e074: 71 f0 breq .+28 ; 0x2e092 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)); 2e076: af 01 movw r20, r30 2e078: f7 ff sbrs r31, 7 2e07a: 04 c0 rjmp .+8 ; 0x2e084 2e07c: 44 27 eor r20, r20 2e07e: 55 27 eor r21, r21 2e080: 4e 1b sub r20, r30 2e082: 5f 0b sbc r21, r31 2e084: 69 2f mov r22, r25 2e086: 66 1f adc r22, r22 2e088: 66 27 eor r22, r22 2e08a: 66 1f adc r22, r22 2e08c: 81 e0 ldi r24, 0x01 ; 1 2e08e: 0f 94 4d 6e call 0x2dc9a ; 0x2dc9a // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2e092: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 2e096: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 2e09a: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 2e09e: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 2e0a2: 2b 96 adiw r28, 0x0b ; 11 2e0a4: 4e ad ldd r20, Y+62 ; 0x3e 2e0a6: 5f ad ldd r21, Y+63 ; 0x3f 2e0a8: 2b 97 sbiw r28, 0x0b ; 11 2e0aa: 48 1b sub r20, r24 2e0ac: 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)); 2e0ae: 57 fd sbrc r21, 7 2e0b0: b2 c0 rjmp .+356 ; 0x2e216 2e0b2: 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) 2e0b4: 41 15 cp r20, r1 2e0b6: 51 05 cpc r21, r1 2e0b8: 09 f0 breq .+2 ; 0x2e0bc 2e0ba: ae c0 rjmp .+348 ; 0x2e218 // 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; 2e0bc: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e0c0: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e0c4: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e0c8: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e0cc: 68 1a sub r6, r24 2e0ce: 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)); 2e0d0: 77 fc sbrc r7, 7 2e0d2: ab c0 rjmp .+342 ; 0x2e22a 2e0d4: 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) 2e0d6: 61 14 cp r6, r1 2e0d8: 71 04 cpc r7, r1 2e0da: 09 f0 breq .+2 ; 0x2e0de 2e0dc: a7 c0 rjmp .+334 ; 0x2e22c 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); 2e0de: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 2e0e2: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 2e0e6: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 2e0ea: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 2e0ee: 00 e0 ldi r16, 0x00 ; 0 2e0f0: 28 ec ldi r18, 0xC8 ; 200 2e0f2: 30 e0 ldi r19, 0x00 ; 0 2e0f4: 2b 96 adiw r28, 0x0b ; 11 2e0f6: 6e ad ldd r22, Y+62 ; 0x3e 2e0f8: 7f ad ldd r23, Y+63 ; 0x3f 2e0fa: 2b 97 sbiw r28, 0x0b ; 11 2e0fc: c5 01 movw r24, r10 2e0fe: 0e 94 7c eb call 0x1d6f8 ; 0x1d6f8 sm4_set_dir(X_AXIS, d); 2e102: 63 2d mov r22, r3 2e104: 80 e0 ldi r24, 0x00 ; 0 2e106: 0f 94 23 52 call 0x2a446 ; 0x2a446 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2e10a: 5f 92 push r5 2e10c: 4f 92 push r4 2e10e: 84 e9 ldi r24, 0x94 ; 148 2e110: 96 ea ldi r25, 0xA6 ; 166 2e112: 9f 93 push r25 2e114: 8f 93 push r24 2e116: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca lcd_set_cursor(4,3); 2e11a: 63 e0 ldi r22, 0x03 ; 3 2e11c: 84 e0 ldi r24, 0x04 ; 4 2e11e: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2e122: 5f 92 push r5 2e124: 4f 92 push r4 2e126: 85 e8 ldi r24, 0x85 ; 133 2e128: 96 ea ldi r25, 0xA6 ; 166 2e12a: 9f 93 push r25 2e12c: 8f 93 push r24 2e12e: 0e 94 c0 6e call 0xdd80 ; 0xdd80 2e132: 0f b6 in r0, 0x3f ; 63 2e134: f8 94 cli 2e136: de bf out 0x3e, r29 ; 62 2e138: 0f be out 0x3f, r0 ; 63 2e13a: cd bf out 0x3d, r28 ; 61 2e13c: 21 e0 ldi r18, 0x01 ; 1 2e13e: 30 e0 ldi r19, 0x00 ; 0 2e140: 31 10 cpse r3, r1 2e142: 02 c0 rjmp .+4 ; 0x2e148 2e144: 2f ef ldi r18, 0xFF ; 255 2e146: 3f ef ldi r19, 0xFF ; 255 2e148: 40 ec ldi r20, 0xC0 ; 192 2e14a: 42 03 mulsu r20, r18 2e14c: c0 01 movw r24, r0 2e14e: 43 9f mul r20, r19 2e150: 90 0d add r25, r0 2e152: 11 24 eor r1, r1 2e154: 67 96 adiw r28, 0x17 ; 23 2e156: 9f af std Y+63, r25 ; 0x3f 2e158: 8e af std Y+62, r24 ; 0x3e 2e15a: 67 97 sbiw r28, 0x17 ; 23 2e15c: 40 ee ldi r20, 0xE0 ; 224 2e15e: 53 e0 ldi r21, 0x03 ; 3 2e160: 24 9f mul r18, r20 2e162: 40 01 movw r8, r0 2e164: 25 9f mul r18, r21 2e166: 90 0c add r9, r0 2e168: 34 9f mul r19, r20 2e16a: 90 0c add r9, r0 2e16c: 11 24 eor r1, r1 2e16e: 63 96 adiw r28, 0x13 ; 19 2e170: ee ad ldd r30, Y+62 ; 0x3e 2e172: ff ad ldd r31, Y+63 ; 0x3f 2e174: 63 97 sbiw r28, 0x13 ; 19 2e176: 8e 0e add r8, r30 2e178: 9f 1e adc r9, r31 2e17a: 9e 01 movw r18, r28 2e17c: 2f 5f subi r18, 0xFF ; 255 2e17e: 3f 4f sbci r19, 0xFF ; 255 2e180: 2d 96 adiw r28, 0x0d ; 13 2e182: 3f af std Y+63, r19 ; 0x3f 2e184: 2e af std Y+62, r18 ; 0x3e 2e186: 2d 97 sbiw r28, 0x0d ; 13 2e188: 61 96 adiw r28, 0x11 ; 17 2e18a: 8e ad ldd r24, Y+62 ; 0x3e 2e18c: 9f ad ldd r25, Y+63 ; 0x3f 2e18e: 61 97 sbiw r28, 0x11 ; 17 2e190: 2f 96 adiw r28, 0x0f ; 15 2e192: 9f af std Y+63, r25 ; 0x3f 2e194: 8e af std Y+62, r24 ; 0x3e 2e196: 2f 97 sbiw r28, 0x0f ; 15 2e198: 71 2c mov r7, r1 2e19a: 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; 2e19c: e0 e1 ldi r30, 0x10 ; 16 2e19e: f7 e2 ldi r31, 0x27 ; 39 2e1a0: 27 96 adiw r28, 0x07 ; 7 2e1a2: ff af std Y+63, r31 ; 0x3f 2e1a4: ee af std Y+62, r30 ; 0x3e 2e1a6: 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); 2e1a8: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 2e1ac: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 2e1b0: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 2e1b4: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 2e1b8: 84 01 movw r16, r8 2e1ba: 08 1b sub r16, r24 2e1bc: 19 0b sbc r17, r25 2e1be: 17 ff sbrs r17, 7 2e1c0: 03 c0 rjmp .+6 ; 0x2e1c8 2e1c2: 11 95 neg r17 2e1c4: 01 95 neg r16 2e1c6: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2e1c8: 98 01 movw r18, r16 2e1ca: 35 95 asr r19 2e1cc: 27 95 ror r18 2e1ce: 65 96 adiw r28, 0x15 ; 21 2e1d0: 3f af std Y+63, r19 ; 0x3f 2e1d2: 2e af std Y+62, r18 ; 0x3e 2e1d4: 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; 2e1d6: 1c 9b sbis 0x03, 4 ; 3 2e1d8: 33 c0 rjmp .+102 ; 0x2e240 2e1da: 45 e0 ldi r20, 0x05 ; 5 2e1dc: 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); 2e1de: 65 96 adiw r28, 0x15 ; 21 2e1e0: ae ac ldd r10, Y+62 ; 0x3e 2e1e2: bf ac ldd r11, Y+63 ; 0x3f 2e1e4: 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); 2e1e6: 63 2d mov r22, r3 2e1e8: 82 2d mov r24, r2 2e1ea: 0e 94 23 eb call 0x1d646 ; 0x1d646 while (steps--){ 2e1ee: 31 e0 ldi r19, 0x01 ; 1 2e1f0: a3 1a sub r10, r19 2e1f2: b1 08 sbc r11, r1 2e1f4: 40 f1 brcs .+80 ; 0x2e246 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e1f6: 28 ec ldi r18, 0xC8 ; 200 2e1f8: 30 e0 ldi r19, 0x00 ; 0 2e1fa: a7 01 movw r20, r14 2e1fc: 68 ee ldi r22, 0xE8 ; 232 2e1fe: 73 e0 ldi r23, 0x03 ; 3 2e200: 82 2d mov r24, r2 2e202: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 update_position_1_step(axes, dir); 2e206: 63 2d mov r22, r3 2e208: 82 2d mov r24, r2 2e20a: 0e 94 3c eb call 0x1d678 ; 0x1d678 2e20e: ef cf rjmp .-34 ; 0x2e1ee 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){ 2e210: 33 24 eor r3, r3 2e212: 33 94 inc r3 2e214: 11 cf rjmp .-478 ; 0x2e038 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)); 2e216: 62 e0 ldi r22, 0x02 ; 2 2e218: 57 ff sbrs r21, 7 2e21a: 03 c0 rjmp .+6 ; 0x2e222 2e21c: 51 95 neg r21 2e21e: 41 95 neg r20 2e220: 51 09 sbc r21, r1 2e222: 82 e0 ldi r24, 0x02 ; 2 2e224: 0f 94 4d 6e call 0x2dc9a ; 0x2dc9a 2e228: 49 cf rjmp .-366 ; 0x2e0bc // 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)); 2e22a: 64 e0 ldi r22, 0x04 ; 4 2e22c: a3 01 movw r20, r6 2e22e: 77 fe sbrs r7, 7 2e230: 03 c0 rjmp .+6 ; 0x2e238 2e232: 51 95 neg r21 2e234: 41 95 neg r20 2e236: 51 09 sbc r21, r1 2e238: 84 e0 ldi r24, 0x04 ; 4 2e23a: 0f 94 4d 6e call 0x2dc9a ; 0x2dc9a 2e23e: 4f cf rjmp .-354 ; 0x2e0de 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; 2e240: 22 24 eor r2, r2 2e242: 23 94 inc r2 2e244: cc cf rjmp .-104 ; 0x2e1de 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); 2e246: 65 96 adiw r28, 0x15 ; 21 2e248: ee ad ldd r30, Y+62 ; 0x3e 2e24a: ff ad ldd r31, Y+63 ; 0x3f 2e24c: 65 97 sbiw r28, 0x15 ; 21 2e24e: 0e 1b sub r16, r30 2e250: 1f 0b sbc r17, r31 2e252: 23 96 adiw r28, 0x03 ; 3 2e254: 1f af std Y+63, r17 ; 0x3f 2e256: 0e af std Y+62, r16 ; 0x3e 2e258: 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); 2e25a: 63 2d mov r22, r3 2e25c: 82 2d mov r24, r2 2e25e: 0e 94 23 eb call 0x1d646 ; 0x1d646 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2e262: 9e 01 movw r18, r28 2e264: 2f 5b subi r18, 0xBF ; 191 2e266: 3f 4f sbci r19, 0xFF ; 255 2e268: a7 01 movw r20, r14 2e26a: 68 ee ldi r22, 0xE8 ; 232 2e26c: 73 e0 ldi r23, 0x03 ; 3 2e26e: 82 2d mov r24, r2 2e270: 0e 94 9a ea call 0x1d534 ; 0x1d534 2e274: 88 23 and r24, r24 2e276: 29 f0 breq .+10 ; 0x2e282 update_position_1_step(axes, dir); 2e278: 63 2d mov r22, r3 2e27a: 82 2d mov r24, r2 2e27c: 0e 94 3c eb call 0x1d678 ; 0x1d678 2e280: f0 cf rjmp .-32 ; 0x2e262 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2e282: 60 e0 ldi r22, 0x00 ; 0 2e284: 82 e0 ldi r24, 0x02 ; 2 2e286: 0f 94 23 52 call 0x2a446 ; 0x2a446 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2e28a: 20 e1 ldi r18, 0x10 ; 16 2e28c: 37 e2 ldi r19, 0x27 ; 39 2e28e: 27 96 adiw r28, 0x07 ; 7 2e290: 3f af std Y+63, r19 ; 0x3f 2e292: 2e af std Y+62, r18 ; 0x3e 2e294: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2e296: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e29a: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e29e: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e2a2: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 2e2a6: 00 5a subi r16, 0xA0 ; 160 2e2a8: 16 4f sbci r17, 0xF6 ; 246 2e2aa: 17 ff sbrs r17, 7 2e2ac: 02 c0 rjmp .+4 ; 0x2e2b2 2e2ae: 0f 5f subi r16, 0xFF ; 255 2e2b0: 1f 4f sbci r17, 0xFF ; 255 2e2b2: 15 95 asr r17 2e2b4: 07 95 ror r16 2e2b6: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e2ba: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e2be: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e2c2: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e2c6: 80 17 cp r24, r16 2e2c8: 91 07 cpc r25, r17 2e2ca: f4 f4 brge .+60 ; 0x2e308 if (!_PINDA){ 2e2cc: 1c 9b sbis 0x03, 4 ; 3 2e2ce: 1c c0 rjmp .+56 ; 0x2e308 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2e2d0: 28 ec ldi r18, 0xC8 ; 200 2e2d2: 30 e0 ldi r19, 0x00 ; 0 2e2d4: a7 01 movw r20, r14 2e2d6: 68 ee ldi r22, 0xE8 ; 232 2e2d8: 73 e0 ldi r23, 0x03 ; 3 2e2da: 84 e0 ldi r24, 0x04 ; 4 2e2dc: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 /// 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_){ 2e2e0: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e2e4: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e2e8: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e2ec: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e2f0: 01 96 adiw r24, 0x01 ; 1 2e2f2: a1 1d adc r26, r1 2e2f4: b1 1d adc r27, r1 2e2f6: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e2fa: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e2fe: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e302: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e306: d7 cf rjmp .-82 ; 0x2e2b6 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2e308: 1c 9b sbis 0x03, 4 ; 3 2e30a: 3f c0 rjmp .+126 ; 0x2e38a steps_to_go = MAX(0, max_z - _Z); 2e30c: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e310: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e314: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e318: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e31c: e0 e6 ldi r30, 0x60 ; 96 2e31e: f9 e0 ldi r31, 0x09 ; 9 2e320: e8 1b sub r30, r24 2e322: f9 0b sbc r31, r25 2e324: cf 01 movw r24, r30 2e326: f7 ff sbrs r31, 7 2e328: 02 c0 rjmp .+4 ; 0x2e32e 2e32a: 90 e0 ldi r25, 0x00 ; 0 2e32c: 80 e0 ldi r24, 0x00 ; 0 2e32e: 25 96 adiw r28, 0x05 ; 5 2e330: 9f af std Y+63, r25 ; 0x3f 2e332: 8e af std Y+62, r24 ; 0x3e 2e334: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2e336: 1c 9b sbis 0x03, 4 ; 3 2e338: 28 c0 rjmp .+80 ; 0x2e38a 2e33a: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e33e: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e342: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e346: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e34a: 80 36 cpi r24, 0x60 ; 96 2e34c: 99 40 sbci r25, 0x09 ; 9 2e34e: ec f4 brge .+58 ; 0x2e38a go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2e350: 9e 01 movw r18, r28 2e352: 2d 5b subi r18, 0xBD ; 189 2e354: 3f 4f sbci r19, 0xFF ; 255 2e356: a7 01 movw r20, r14 2e358: 68 ee ldi r22, 0xE8 ; 232 2e35a: 73 e0 ldi r23, 0x03 ; 3 2e35c: 84 e0 ldi r24, 0x04 ; 4 2e35e: 0e 94 9a ea call 0x1d534 ; 0x1d534 ++_Z_; 2e362: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e366: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e36a: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e36e: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e372: 01 96 adiw r24, 0x01 ; 1 2e374: a1 1d adc r26, r1 2e376: b1 1d adc r27, r1 2e378: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e37c: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e380: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e384: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e388: d6 cf rjmp .-84 ; 0x2e336 /// \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); 2e38a: 60 e0 ldi r22, 0x00 ; 0 2e38c: 84 e0 ldi r24, 0x04 ; 4 2e38e: 0e 94 23 eb call 0x1d646 ; 0x1d646 while (delay_us < MAX_DELAY){ 2e392: f7 01 movw r30, r14 2e394: 20 81 ld r18, Z 2e396: 31 81 ldd r19, Z+1 ; 0x01 2e398: 20 31 cpi r18, 0x10 ; 16 2e39a: f7 e2 ldi r31, 0x27 ; 39 2e39c: 3f 07 cpc r19, r31 2e39e: 58 f4 brcc .+22 ; 0x2e3b6 accelerate_1_step(axes, -dec, delay_us, delay_us); 2e3a0: a7 01 movw r20, r14 2e3a2: 68 e1 ldi r22, 0x18 ; 24 2e3a4: 7c ef ldi r23, 0xFC ; 252 2e3a6: 84 e0 ldi r24, 0x04 ; 4 2e3a8: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 update_position_1_step(axes, dir); 2e3ac: 60 e0 ldi r22, 0x00 ; 0 2e3ae: 84 e0 ldi r24, 0x04 ; 4 2e3b0: 0e 94 3c eb call 0x1d678 ; 0x1d678 2e3b4: ee cf rjmp .-36 ; 0x2e392 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2e3b6: 61 e0 ldi r22, 0x01 ; 1 2e3b8: 82 e0 ldi r24, 0x02 ; 2 2e3ba: 0f 94 23 52 call 0x2a446 ; 0x2a446 /// speed up current_delay_us = MAX_DELAY; 2e3be: 20 e1 ldi r18, 0x10 ; 16 2e3c0: 37 e2 ldi r19, 0x27 ; 39 2e3c2: f7 01 movw r30, r14 2e3c4: 31 83 std Z+1, r19 ; 0x01 2e3c6: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2e3c8: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e3cc: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e3d0: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e3d4: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 2e3d8: 0c 0d add r16, r12 2e3da: 1d 1d adc r17, r13 2e3dc: 17 ff sbrs r17, 7 2e3de: 02 c0 rjmp .+4 ; 0x2e3e4 2e3e0: 0f 5f subi r16, 0xFF ; 255 2e3e2: 1f 4f sbci r17, 0xFF ; 255 2e3e4: 15 95 asr r17 2e3e6: 07 95 ror r16 2e3e8: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e3ec: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e3f0: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e3f4: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e3f8: 08 17 cp r16, r24 2e3fa: 19 07 cpc r17, r25 2e3fc: 0c f0 brlt .+2 ; 0x2e400 2e3fe: d9 c0 rjmp .+434 ; 0x2e5b2 if (_PINDA){ 2e400: 1c 9b sbis 0x03, 4 ; 3 2e402: bb c0 rjmp .+374 ; 0x2e57a z_trig = _Z; 2e404: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e408: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e40c: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e410: 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){ 2e414: 1c 99 sbic 0x03, 4 ; 3 2e416: 28 c0 rjmp .+80 ; 0x2e468 steps_to_go = MAX(0, _Z - min_z); 2e418: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e41c: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e420: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e424: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e428: 8c 19 sub r24, r12 2e42a: 9d 09 sbc r25, r13 2e42c: 97 ff sbrs r25, 7 2e42e: 02 c0 rjmp .+4 ; 0x2e434 2e430: 90 e0 ldi r25, 0x00 ; 0 2e432: 80 e0 ldi r24, 0x00 ; 0 2e434: 25 96 adiw r28, 0x05 ; 5 2e436: 9f af std Y+63, r25 ; 0x3f 2e438: 8e af std Y+62, r24 ; 0x3e 2e43a: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2e43c: 1c 99 sbic 0x03, 4 ; 3 2e43e: 0c c0 rjmp .+24 ; 0x2e458 2e440: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e444: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e448: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e44c: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e450: c8 16 cp r12, r24 2e452: d9 06 cpc r13, r25 2e454: 0c f4 brge .+2 ; 0x2e458 2e456: af c0 rjmp .+350 ; 0x2e5b6 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2e458: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 2e45c: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 2e460: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 2e464: 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){ 2e468: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e46c: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e470: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e474: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e478: c8 16 cp r12, r24 2e47a: d9 06 cpc r13, r25 2e47c: 3c f4 brge .+14 ; 0x2e48c 2e47e: f7 01 movw r30, r14 2e480: 80 81 ld r24, Z 2e482: 91 81 ldd r25, Z+1 ; 0x01 2e484: 80 31 cpi r24, 0x10 ; 16 2e486: 97 42 sbci r25, 0x27 ; 39 2e488: 08 f4 brcc .+2 ; 0x2e48c 2e48a: b2 c0 rjmp .+356 ; 0x2e5f0 2e48c: 0c 19 sub r16, r12 2e48e: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2e490: 31 10 cpse r3, r1 2e492: ca c0 rjmp .+404 ; 0x2e628 line_buffer[c] = (uint16_t)(z_trig - min_z); 2e494: f3 01 movw r30, r6 2e496: ee 0f add r30, r30 2e498: ff 1f adc r31, r31 2e49a: 21 e0 ldi r18, 0x01 ; 1 2e49c: 30 e0 ldi r19, 0x00 ; 0 2e49e: 2c 0f add r18, r28 2e4a0: 3d 1f adc r19, r29 2e4a2: e2 0f add r30, r18 2e4a4: f3 1f adc r31, r19 2e4a6: 11 83 std Z+1, r17 ; 0x01 2e4a8: 00 83 st Z, r16 2e4aa: ff ef ldi r31, 0xFF ; 255 2e4ac: 6f 1a sub r6, r31 2e4ae: 7f 0a sbc r7, r31 2e4b0: 67 96 adiw r28, 0x17 ; 23 2e4b2: 2e ad ldd r18, Y+62 ; 0x3e 2e4b4: 3f ad ldd r19, Y+63 ; 0x3f 2e4b6: 67 97 sbiw r28, 0x17 ; 23 2e4b8: 82 0e add r8, r18 2e4ba: 93 1e adc r9, r19 2e4bc: 2d 96 adiw r28, 0x0d ; 13 2e4be: 8e ad ldd r24, Y+62 ; 0x3e 2e4c0: 9f ad ldd r25, Y+63 ; 0x3f 2e4c2: 2d 97 sbiw r28, 0x0d ; 13 2e4c4: 02 97 sbiw r24, 0x02 ; 2 2e4c6: 2d 96 adiw r28, 0x0d ; 13 2e4c8: 9f af std Y+63, r25 ; 0x3f 2e4ca: 8e af std Y+62, r24 ; 0x3e 2e4cc: 2d 97 sbiw r28, 0x0d ; 13 2e4ce: 2f 96 adiw r28, 0x0f ; 15 2e4d0: ee ad ldd r30, Y+62 ; 0x3e 2e4d2: ff ad ldd r31, Y+63 ; 0x3f 2e4d4: 2f 97 sbiw r28, 0x0f ; 15 2e4d6: 31 97 sbiw r30, 0x01 ; 1 2e4d8: 2f 96 adiw r28, 0x0f ; 15 2e4da: ff af std Y+63, r31 ; 0x3f 2e4dc: ee af std Y+62, r30 ; 0x3e 2e4de: 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 2e4e0: f0 e2 ldi r31, 0x20 ; 32 2e4e2: 6f 16 cp r6, r31 2e4e4: 71 04 cpc r7, r1 2e4e6: 09 f0 breq .+2 ; 0x2e4ea 2e4e8: 59 ce rjmp .-846 ; 0x2e19c 2e4ea: 21 e0 ldi r18, 0x01 ; 1 2e4ec: 42 1a sub r4, r18 2e4ee: 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){ 2e4f0: 31 e0 ldi r19, 0x01 ; 1 2e4f2: 33 12 cpse r3, r19 2e4f4: 8d ce rjmp .-742 ; 0x2e210 2e4f6: 61 96 adiw r28, 0x11 ; 17 2e4f8: 8e ad ldd r24, Y+62 ; 0x3e 2e4fa: 9f ad ldd r25, Y+63 ; 0x3f 2e4fc: 61 97 sbiw r28, 0x11 ; 17 2e4fe: 80 96 adiw r24, 0x20 ; 32 2e500: 61 96 adiw r28, 0x11 ; 17 2e502: 9f af std Y+63, r25 ; 0x3f 2e504: 8e af std Y+62, r24 ; 0x3e 2e506: 61 97 sbiw r28, 0x11 ; 17 2e508: 2b 96 adiw r28, 0x0b ; 11 2e50a: ee ad ldd r30, Y+62 ; 0x3e 2e50c: ff ad ldd r31, Y+63 ; 0x3f 2e50e: 2b 97 sbiw r28, 0x0b ; 11 2e510: e0 5c subi r30, 0xC0 ; 192 2e512: ff 4f sbci r31, 0xFF ; 255 2e514: 2b 96 adiw r28, 0x0b ; 11 2e516: ff af std Y+63, r31 ; 0x3f 2e518: ee af std Y+62, r30 ; 0x3e 2e51a: 2b 97 sbiw r28, 0x0b ; 11 2e51c: 29 96 adiw r28, 0x09 ; 9 2e51e: 2e ad ldd r18, Y+62 ; 0x3e 2e520: 3f ad ldd r19, Y+63 ; 0x3f 2e522: 29 97 sbiw r28, 0x09 ; 9 2e524: 22 50 subi r18, 0x02 ; 2 2e526: 31 09 sbc r19, r1 2e528: 29 96 adiw r28, 0x09 ; 9 2e52a: 3f af std Y+63, r19 ; 0x3f 2e52c: 2e af std Y+62, r18 ; 0x3e 2e52e: 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 2e530: 23 2b or r18, r19 2e532: 09 f0 breq .+2 ; 0x2e536 2e534: 72 cd rjmp .-1308 ; 0x2e01a 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); 2e536: 83 e8 ldi r24, 0x83 ; 131 2e538: 96 ea ldi r25, 0xA6 ; 166 2e53a: 9f 93 push r25 2e53c: 8f 93 push r24 2e53e: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2e542: 0f 90 pop r0 2e544: 0f 90 pop r0 } 2e546: c6 5a subi r28, 0xA6 ; 166 2e548: df 4f sbci r29, 0xFF ; 255 2e54a: 0f b6 in r0, 0x3f ; 63 2e54c: f8 94 cli 2e54e: de bf out 0x3e, r29 ; 62 2e550: 0f be out 0x3f, r0 ; 63 2e552: cd bf out 0x3d, r28 ; 61 2e554: df 91 pop r29 2e556: cf 91 pop r28 2e558: 1f 91 pop r17 2e55a: 0f 91 pop r16 2e55c: ff 90 pop r15 2e55e: ef 90 pop r14 2e560: df 90 pop r13 2e562: cf 90 pop r12 2e564: bf 90 pop r11 2e566: af 90 pop r10 2e568: 9f 90 pop r9 2e56a: 8f 90 pop r8 2e56c: 7f 90 pop r7 2e56e: 6f 90 pop r6 2e570: 5f 90 pop r5 2e572: 4f 90 pop r4 2e574: 3f 90 pop r3 2e576: 2f 90 pop r2 2e578: 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); 2e57a: 28 ec ldi r18, 0xC8 ; 200 2e57c: 30 e0 ldi r19, 0x00 ; 0 2e57e: a7 01 movw r20, r14 2e580: 68 ee ldi r22, 0xE8 ; 232 2e582: 73 e0 ldi r23, 0x03 ; 3 2e584: 84 e0 ldi r24, 0x04 ; 4 2e586: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 /// 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_){ 2e58a: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e58e: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e592: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e596: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e59a: 01 97 sbiw r24, 0x01 ; 1 2e59c: a1 09 sbc r26, r1 2e59e: b1 09 sbc r27, r1 2e5a0: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e5a4: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e5a8: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e5ac: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e5b0: 1b cf rjmp .-458 ; 0x2e3e8 2e5b2: 86 01 movw r16, r12 2e5b4: 2f cf rjmp .-418 ; 0x2e414 } /// 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); 2e5b6: 9e 01 movw r18, r28 2e5b8: 2d 5b subi r18, 0xBD ; 189 2e5ba: 3f 4f sbci r19, 0xFF ; 255 2e5bc: a7 01 movw r20, r14 2e5be: 68 ee ldi r22, 0xE8 ; 232 2e5c0: 73 e0 ldi r23, 0x03 ; 3 2e5c2: 84 e0 ldi r24, 0x04 ; 4 2e5c4: 0e 94 9a ea call 0x1d534 ; 0x1d534 --_Z_; 2e5c8: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e5cc: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e5d0: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e5d4: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e5d8: 01 97 sbiw r24, 0x01 ; 1 2e5da: a1 09 sbc r26, r1 2e5dc: b1 09 sbc r27, r1 2e5de: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e5e2: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e5e6: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e5ea: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e5ee: 26 cf rjmp .-436 ; 0x2e43c } 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); 2e5f0: 28 ec ldi r18, 0xC8 ; 200 2e5f2: 30 e0 ldi r19, 0x00 ; 0 2e5f4: a7 01 movw r20, r14 2e5f6: 68 e1 ldi r22, 0x18 ; 24 2e5f8: 7c ef ldi r23, 0xFC ; 252 2e5fa: 84 e0 ldi r24, 0x04 ; 4 2e5fc: 0e 94 f4 e9 call 0x1d3e8 ; 0x1d3e8 --_Z_; 2e600: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 2e604: 90 91 bc 06 lds r25, 0x06BC ; 0x8006bc 2e608: a0 91 bd 06 lds r26, 0x06BD ; 0x8006bd 2e60c: b0 91 be 06 lds r27, 0x06BE ; 0x8006be 2e610: 01 97 sbiw r24, 0x01 ; 1 2e612: a1 09 sbc r26, r1 2e614: b1 09 sbc r27, r1 2e616: 80 93 bb 06 sts 0x06BB, r24 ; 0x8006bb 2e61a: 90 93 bc 06 sts 0x06BC, r25 ; 0x8006bc 2e61e: a0 93 bd 06 sts 0x06BD, r26 ; 0x8006bd 2e622: b0 93 be 06 sts 0x06BE, r27 ; 0x8006be 2e626: 20 cf rjmp .-448 ; 0x2e468 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); 2e628: 2d 96 adiw r28, 0x0d ; 13 2e62a: ee ad ldd r30, Y+62 ; 0x3e 2e62c: ff ad ldd r31, Y+63 ; 0x3f 2e62e: 2d 97 sbiw r28, 0x0d ; 13 2e630: 86 ad ldd r24, Z+62 ; 0x3e 2e632: 97 ad ldd r25, Z+63 ; 0x3f 2e634: 01 2e mov r0, r17 2e636: 00 0c add r0, r0 2e638: 22 0b sbc r18, r18 2e63a: 33 0b sbc r19, r19 2e63c: 08 0f add r16, r24 2e63e: 19 1f adc r17, r25 2e640: 21 1d adc r18, r1 2e642: 31 1d adc r19, r1 2e644: 36 95 lsr r19 2e646: 27 95 ror r18 2e648: 17 95 ror r17 2e64a: 07 95 ror r16 2e64c: 0f 3f cpi r16, 0xFF ; 255 2e64e: 11 05 cpc r17, r1 2e650: 21 05 cpc r18, r1 2e652: 31 05 cpc r19, r1 2e654: 29 f0 breq .+10 ; 0x2e660 2e656: 20 f0 brcs .+8 ; 0x2e660 2e658: 0f ef ldi r16, 0xFF ; 255 2e65a: 10 e0 ldi r17, 0x00 ; 0 2e65c: 20 e0 ldi r18, 0x00 ; 0 2e65e: 30 e0 ldi r19, 0x00 ; 0 2e660: 2f 96 adiw r28, 0x0f ; 15 2e662: ee ad ldd r30, Y+62 ; 0x3e 2e664: ff ad ldd r31, Y+63 ; 0x3f 2e666: 2f 97 sbiw r28, 0x0f ; 15 2e668: 07 8f std Z+31, r16 ; 0x1f 2e66a: 1f cf rjmp .-450 ; 0x2e4aa 0002e66c : 2e66c: ef 92 push r14 2e66e: ff 92 push r15 2e670: 0f 93 push r16 2e672: 1f 93 push r17 2e674: cf 93 push r28 2e676: df 93 push r29 2e678: cd b7 in r28, 0x3d ; 61 2e67a: de b7 in r29, 0x3e ; 62 2e67c: 2f 97 sbiw r28, 0x0f ; 15 2e67e: 0f b6 in r0, 0x3f ; 63 2e680: f8 94 cli 2e682: de bf out 0x3e, r29 ; 62 2e684: 0f be out 0x3f, r0 ; 63 2e686: cd bf out 0x3d, r28 ; 61 2e688: e0 eb ldi r30, 0xB0 ; 176 2e68a: f2 e1 ldi r31, 0x12 ; 18 2e68c: 10 a2 std Z+32, r1 ; 0x20 2e68e: 11 a2 std Z+33, r1 ; 0x21 2e690: 12 a2 std Z+34, r1 ; 0x22 2e692: 13 a2 std Z+35, r1 ; 0x23 2e694: 14 a2 std Z+36, r1 ; 0x24 2e696: 15 a2 std Z+37, r1 ; 0x25 2e698: 16 a2 std Z+38, r1 ; 0x26 2e69a: 17 a2 std Z+39, r1 ; 0x27 2e69c: 10 a6 std Z+40, r1 ; 0x28 2e69e: 11 a6 std Z+41, r1 ; 0x29 2e6a0: 10 92 49 13 sts 0x1349, r1 ; 0x801349 2e6a4: 0b e4 ldi r16, 0x4B ; 75 2e6a6: 13 e1 ldi r17, 0x13 ; 19 2e6a8: ee 24 eor r14, r14 2e6aa: e3 94 inc r14 2e6ac: f1 2c mov r15, r1 2e6ae: d8 01 movw r26, r16 2e6b0: 11 96 adiw r26, 0x01 ; 1 2e6b2: fc 92 st X, r15 2e6b4: ee 92 st -X, r14 2e6b6: 12 96 adiw r26, 0x02 ; 2 2e6b8: 1c 92 st X, r1 2e6ba: 12 97 sbiw r26, 0x02 ; 2 2e6bc: 82 e8 ldi r24, 0x82 ; 130 2e6be: 13 96 adiw r26, 0x03 ; 3 2e6c0: 8c 93 st X, r24 2e6c2: 40 e0 ldi r20, 0x00 ; 0 2e6c4: 60 e0 ldi r22, 0x00 ; 0 2e6c6: 80 e5 ldi r24, 0x50 ; 80 2e6c8: 93 e1 ldi r25, 0x13 ; 19 2e6ca: 0f 94 94 c5 call 0x38b28 ; 0x38b28 2e6ce: 40 e0 ldi r20, 0x00 ; 0 2e6d0: 60 e0 ldi r22, 0x00 ; 0 2e6d2: 85 e5 ldi r24, 0x55 ; 85 2e6d4: 93 e1 ldi r25, 0x13 ; 19 2e6d6: 0f 94 94 c5 call 0x38b28 ; 0x38b28 2e6da: f8 01 movw r30, r16 2e6dc: 17 86 std Z+15, r1 ; 0x0f 2e6de: 10 8a std Z+16, r1 ; 0x10 2e6e0: 11 8a std Z+17, r1 ; 0x11 2e6e2: 12 8a std Z+18, r1 ; 0x12 2e6e4: 13 8a std Z+19, r1 ; 0x13 2e6e6: 8a e0 ldi r24, 0x0A ; 10 2e6e8: 84 8b std Z+20, r24 ; 0x14 2e6ea: 40 e0 ldi r20, 0x00 ; 0 2e6ec: 60 e0 ldi r22, 0x00 ; 0 2e6ee: ce 01 movw r24, r28 2e6f0: 01 96 adiw r24, 0x01 ; 1 2e6f2: 0f 94 94 c5 call 0x38b28 ; 0x38b28 2e6f6: 85 e0 ldi r24, 0x05 ; 5 2e6f8: fe 01 movw r30, r28 2e6fa: 31 96 adiw r30, 0x01 ; 1 2e6fc: de 01 movw r26, r28 2e6fe: 16 96 adiw r26, 0x06 ; 6 2e700: 01 90 ld r0, Z+ 2e702: 0d 92 st X+, r0 2e704: 8a 95 dec r24 2e706: e1 f7 brne .-8 ; 0x2e700 2e708: 85 e0 ldi r24, 0x05 ; 5 2e70a: fe 01 movw r30, r28 2e70c: 36 96 adiw r30, 0x06 ; 6 2e70e: a0 e6 ldi r26, 0x60 ; 96 2e710: b3 e1 ldi r27, 0x13 ; 19 2e712: 01 90 ld r0, Z+ 2e714: 0d 92 st X+, r0 2e716: 8a 95 dec r24 2e718: e1 f7 brne .-8 ; 0x2e712 2e71a: d8 01 movw r26, r16 2e71c: 5a 96 adiw r26, 0x1a ; 26 2e71e: 1c 92 st X, r1 2e720: 5a 97 sbiw r26, 0x1a ; 26 2e722: 5c 96 adiw r26, 0x1c ; 28 2e724: 1c 92 st X, r1 2e726: 1e 92 st -X, r1 2e728: 5b 97 sbiw r26, 0x1b ; 27 2e72a: 80 e6 ldi r24, 0x60 ; 96 2e72c: 93 e1 ldi r25, 0x13 ; 19 2e72e: 0f 94 83 c5 call 0x38b06 ; 0x38b06 2e732: f8 01 movw r30, r16 2e734: 81 8f std Z+25, r24 ; 0x19 2e736: 15 8e std Z+29, r1 ; 0x1d 2e738: 16 8e std Z+30, r1 ; 0x1e 2e73a: 40 e0 ldi r20, 0x00 ; 0 2e73c: 60 e0 ldi r22, 0x00 ; 0 2e73e: 8a e6 ldi r24, 0x6A ; 106 2e740: 93 e1 ldi r25, 0x13 ; 19 2e742: 0f 94 94 c5 call 0x38b28 ; 0x38b28 2e746: d8 01 movw r26, r16 2e748: 94 96 adiw r26, 0x24 ; 36 2e74a: 1c 92 st X, r1 2e74c: 40 e0 ldi r20, 0x00 ; 0 2e74e: 60 e0 ldi r22, 0x00 ; 0 2e750: ce 01 movw r24, r28 2e752: 0b 96 adiw r24, 0x0b ; 11 2e754: 0f 94 94 c5 call 0x38b28 ; 0x38b28 2e758: 85 e0 ldi r24, 0x05 ; 5 2e75a: fe 01 movw r30, r28 2e75c: 3b 96 adiw r30, 0x0b ; 11 2e75e: de 01 movw r26, r28 2e760: 11 96 adiw r26, 0x01 ; 1 2e762: 01 90 ld r0, Z+ 2e764: 0d 92 st X+, r0 2e766: 8a 95 dec r24 2e768: e1 f7 brne .-8 ; 0x2e762 2e76a: 85 e0 ldi r24, 0x05 ; 5 2e76c: fe 01 movw r30, r28 2e76e: 31 96 adiw r30, 0x01 ; 1 2e770: a0 e7 ldi r26, 0x70 ; 112 2e772: b3 e1 ldi r27, 0x13 ; 19 2e774: 01 90 ld r0, Z+ 2e776: 0d 92 st X+, r0 2e778: 8a 95 dec r24 2e77a: e1 f7 brne .-8 ; 0x2e774 2e77c: f8 01 movw r30, r16 2e77e: 12 a6 std Z+42, r1 ; 0x2a 2e780: 14 a6 std Z+44, r1 ; 0x2c 2e782: 13 a6 std Z+43, r1 ; 0x2b 2e784: 80 e7 ldi r24, 0x70 ; 112 2e786: 93 e1 ldi r25, 0x13 ; 19 2e788: 0f 94 83 c5 call 0x38b06 ; 0x38b06 2e78c: d8 01 movw r26, r16 2e78e: 99 96 adiw r26, 0x29 ; 41 2e790: 8c 93 st X, r24 2e792: 99 97 sbiw r26, 0x29 ; 41 2e794: dd 96 adiw r26, 0x3d ; 61 2e796: 1c 92 st X, r1 2e798: dd 97 sbiw r26, 0x3d ; 61 2e79a: 8a e4 ldi r24, 0x4A ; 74 2e79c: 93 e1 ldi r25, 0x13 ; 19 2e79e: df 96 adiw r26, 0x3f ; 63 2e7a0: 9c 93 st X, r25 2e7a2: 8e 93 st -X, r24 2e7a4: de 97 sbiw r26, 0x3e ; 62 2e7a6: f0 92 8c 13 sts 0x138C, r15 ; 0x80138c 2e7aa: e0 92 8b 13 sts 0x138B, r14 ; 0x80138b 2e7ae: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d 2e7b2: 1f ef ldi r17, 0xFF ; 255 2e7b4: 10 93 8e 13 sts 0x138E, r17 ; 0x80138e 2e7b8: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 2e7bc: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f 2e7c0: 10 92 90 13 sts 0x1390, r1 ; 0x801390 2e7c4: 10 92 91 13 sts 0x1391, r1 ; 0x801391 2e7c8: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2e7cc: 10 92 94 13 sts 0x1394, r1 ; 0x801394 2e7d0: 10 92 93 13 sts 0x1393, r1 ; 0x801393 2e7d4: 10 92 96 13 sts 0x1396, r1 ; 0x801396 2e7d8: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2e7dc: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2e7e0: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2e7e4: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2e7e8: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2e7ec: 83 e0 ldi r24, 0x03 ; 3 2e7ee: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f 2e7f2: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 2e7f6: 85 e1 ldi r24, 0x15 ; 21 2e7f8: 80 93 97 13 sts 0x1397, r24 ; 0x801397 2e7fc: 84 e1 ldi r24, 0x14 ; 20 2e7fe: 80 93 98 13 sts 0x1398, r24 ; 0x801398 2e802: 83 e6 ldi r24, 0x63 ; 99 2e804: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 2e808: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 2e80c: 10 92 a3 13 sts 0x13A3, r1 ; 0x8013a3 2e810: 10 92 a4 13 sts 0x13A4, r1 ; 0x8013a4 2e814: 10 92 a5 13 sts 0x13A5, r1 ; 0x8013a5 2e818: 10 92 a6 13 sts 0x13A6, r1 ; 0x8013a6 2e81c: 10 92 a7 13 sts 0x13A7, r1 ; 0x8013a7 2e820: 10 92 a8 13 sts 0x13A8, r1 ; 0x8013a8 2e824: 10 92 a9 13 sts 0x13A9, r1 ; 0x8013a9 2e828: 10 92 aa 13 sts 0x13AA, r1 ; 0x8013aa 2e82c: 10 92 ab 13 sts 0x13AB, r1 ; 0x8013ab 2e830: 10 92 ac 13 sts 0x13AC, r1 ; 0x8013ac 2e834: 10 92 ad 13 sts 0x13AD, r1 ; 0x8013ad 2e838: 10 92 ae 13 sts 0x13AE, r1 ; 0x8013ae 2e83c: 10 92 b0 13 sts 0x13B0, r1 ; 0x8013b0 2e840: 10 92 af 13 sts 0x13AF, r1 ; 0x8013af 2e844: 10 92 b1 13 sts 0x13B1, r1 ; 0x8013b1 2e848: 8e e2 ldi r24, 0x2E ; 46 2e84a: 90 e8 ldi r25, 0x80 ; 128 2e84c: 90 93 b3 13 sts 0x13B3, r25 ; 0x8013b3 2e850: 80 93 b2 13 sts 0x13B2, r24 ; 0x8013b2 2e854: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 2e858: 10 93 b5 13 sts 0x13B5, r17 ; 0x8013b5 2e85c: 10 92 b7 13 sts 0x13B7, r1 ; 0x8013b7 2e860: 10 92 b6 13 sts 0x13B6, r1 ; 0x8013b6 2e864: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 2e868: 82 e0 ldi r24, 0x02 ; 2 2e86a: 80 93 b9 13 sts 0x13B9, r24 ; 0x8013b9 2e86e: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba 2e872: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb 2e876: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 2e87a: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 2e87e: 10 92 bf 13 sts 0x13BF, r1 ; 0x8013bf 2e882: 10 92 be 13 sts 0x13BE, r1 ; 0x8013be 2e886: 10 92 c1 13 sts 0x13C1, r1 ; 0x8013c1 2e88a: 10 92 c0 13 sts 0x13C0, r1 ; 0x8013c0 2e88e: 0f 94 54 8c call 0x318a8 ; 0x318a8 2e892: ee e8 ldi r30, 0x8E ; 142 2e894: f4 e1 ldi r31, 0x14 ; 20 2e896: 10 92 16 15 sts 0x1516, r1 ; 0x801516 2e89a: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2e89e: 10 92 3b 15 sts 0x153B, r1 ; 0x80153b 2e8a2: 10 92 3e 15 sts 0x153E, r1 ; 0x80153e 2e8a6: 89 e1 ldi r24, 0x19 ; 25 2e8a8: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd 2e8ac: 10 92 00 17 sts 0x1700, r1 ; 0x801700 2e8b0: 10 92 01 17 sts 0x1701, r1 ; 0x801701 2e8b4: 10 92 19 17 sts 0x1719, r1 ; 0x801719 2e8b8: 10 92 20 17 sts 0x1720, r1 ; 0x801720 2e8bc: 10 92 23 17 sts 0x1723, r1 ; 0x801723 2e8c0: 10 92 a1 17 sts 0x17A1, r1 ; 0x8017a1 2e8c4: 10 92 a3 17 sts 0x17A3, r1 ; 0x8017a3 2e8c8: 10 92 a2 17 sts 0x17A2, r1 ; 0x8017a2 2e8cc: 10 92 32 16 sts 0x1632, r1 ; 0x801632 2e8d0: 10 92 31 16 sts 0x1631, r1 ; 0x801631 2e8d4: 10 92 9d 17 sts 0x179D, r1 ; 0x80179d 2e8d8: 10 92 9e 17 sts 0x179E, r1 ; 0x80179e 2e8dc: 10 92 9f 17 sts 0x179F, r1 ; 0x80179f 2e8e0: 10 92 a0 17 sts 0x17A0, r1 ; 0x8017a0 2e8e4: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 2e8e8: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 2e8ec: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 2e8f0: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 2e8f4: 12 82 std Z+2, r1 ; 0x02 2e8f6: 13 82 std Z+3, r1 ; 0x03 2e8f8: 10 82 st Z, r1 2e8fa: 11 82 std Z+1, r1 ; 0x01 2e8fc: 10 92 30 16 sts 0x1630, r1 ; 0x801630 2e900: 10 92 43 17 sts 0x1743, r1 ; 0x801743 2e904: ee e5 ldi r30, 0x5E ; 94 2e906: f5 e1 ldi r31, 0x15 ; 21 2e908: 82 ed ldi r24, 0xD2 ; 210 2e90a: df 01 movw r26, r30 2e90c: 1d 92 st X+, r1 2e90e: 8a 95 dec r24 2e910: e9 f7 brne .-6 ; 0x2e90c 2e912: 10 92 df 14 sts 0x14DF, r1 ; 0x8014df 2e916: 10 92 de 14 sts 0x14DE, r1 ; 0x8014de 2e91a: 10 92 dd 14 sts 0x14DD, r1 ; 0x8014dd 2e91e: 81 ea ldi r24, 0xA1 ; 161 2e920: 97 e1 ldi r25, 0x17 ; 23 2e922: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> 2e926: e7 e8 ldi r30, 0x87 ; 135 2e928: f4 e1 ldi r31, 0x14 ; 20 2e92a: 11 82 std Z+1, r1 ; 0x01 2e92c: 12 82 std Z+2, r1 ; 0x02 2e92e: 13 82 std Z+3, r1 ; 0x03 2e930: 14 82 std Z+4, r1 ; 0x04 2e932: 15 82 std Z+5, r1 ; 0x05 2e934: 16 82 std Z+6, r1 ; 0x06 2e936: 10 83 st Z, r17 2e938: ea ea ldi r30, 0xAA ; 170 2e93a: f7 e1 ldi r31, 0x17 ; 23 2e93c: 15 82 std Z+5, r1 ; 0x05 2e93e: 17 82 std Z+7, r1 ; 0x07 2e940: 16 82 std Z+6, r1 ; 0x06 2e942: 11 86 std Z+9, r1 ; 0x09 2e944: 13 86 std Z+11, r1 ; 0x0b 2e946: 12 86 std Z+10, r1 ; 0x0a 2e948: 0f 94 53 29 call 0x252a6 ; 0x252a6 2e94c: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 2e950: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 2e954: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 2e958: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 2e95c: 2f 96 adiw r28, 0x0f ; 15 2e95e: 0f b6 in r0, 0x3f ; 63 2e960: f8 94 cli 2e962: de bf out 0x3e, r29 ; 62 2e964: 0f be out 0x3f, r0 ; 63 2e966: cd bf out 0x3d, r28 ; 61 2e968: df 91 pop r29 2e96a: cf 91 pop r28 2e96c: 1f 91 pop r17 2e96e: 0f 91 pop r16 2e970: ff 90 pop r15 2e972: ef 90 pop r14 2e974: 08 95 ret 0002e976 : else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2e976: 42 e0 ldi r20, 0x02 ; 2 2e978: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2e97c: 0d 94 04 d6 jmp 0x3ac08 ; 0x3ac08 0002e980 : 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; 2e980: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 2e984: 83 36 cpi r24, 0x63 ; 99 2e986: 09 f4 brne .+2 ; 0x2e98a 2e988: 8f ef ldi r24, 0xFF ; 255 } 2e98a: 08 95 ret 0002e98c : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2e98c: 9f b7 in r25, 0x3f ; 63 2e98e: f8 94 cli 2e990: e5 e0 ldi r30, 0x05 ; 5 2e992: f1 e0 ldi r31, 0x01 ; 1 2e994: 80 81 ld r24, Z 2e996: 80 64 ori r24, 0x40 ; 64 2e998: 80 83 st Z, r24 2e99a: 9f bf out 0x3f, r25 ; 63 } 2e99c: 08 95 ret 0002e99e : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2e99e: 0f 93 push r16 2e9a0: 1f 93 push r17 2e9a2: cf 93 push r28 2e9a4: df 93 push r29 2e9a6: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2e9a8: 0f 94 53 29 call 0x252a6 ; 0x252a6 2e9ac: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2e9ae: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 2e9b2: 8f 3f cpi r24, 0xFF ; 255 2e9b4: 69 f0 breq .+26 ; 0x2e9d0 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2e9b6: 0f 94 53 29 call 0x252a6 ; 0x252a6 2e9ba: 60 1b sub r22, r16 2e9bc: 71 0b sbc r23, r17 2e9be: 6c 17 cp r22, r28 2e9c0: 7d 07 cpc r23, r29 2e9c2: a8 f3 brcs .-22 ; 0x2e9ae } return true; fail: return false; 2e9c4: 80 e0 ldi r24, 0x00 ; 0 } 2e9c6: df 91 pop r29 2e9c8: cf 91 pop r28 2e9ca: 1f 91 pop r17 2e9cc: 0f 91 pop r16 2e9ce: 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; 2e9d0: 81 e0 ldi r24, 0x01 ; 1 2e9d2: f9 cf rjmp .-14 ; 0x2e9c6 0002e9d4 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2e9d4: 8e ed ldi r24, 0xDE ; 222 2e9d6: 9b ea ldi r25, 0xAB ; 171 2e9d8: 0e 94 57 77 call 0xeeae ; 0xeeae uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2e9dc: 60 e0 ldi r22, 0x00 ; 0 2e9de: 8c ea ldi r24, 0xAC ; 172 2e9e0: 9c e0 ldi r25, 0x0C ; 12 2e9e2: 0e 94 10 76 call 0xec20 ; 0xec20 if (status == 1) { 2e9e6: 81 30 cpi r24, 0x01 ; 1 2e9e8: 21 f4 brne .+8 ; 0x2e9f2 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2e9ea: 8b ed ldi r24, 0xDB ; 219 2e9ec: 9c e5 ldi r25, 0x5C ; 92 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2e9ee: 0c 94 82 79 jmp 0xf304 ; 0xf304 2e9f2: 85 ed ldi r24, 0xD5 ; 213 2e9f4: 9c e5 ldi r25, 0x5C ; 92 2e9f6: fb cf rjmp .-10 ; 0x2e9ee 0002e9f8 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2e9f8: bc 01 movw r22, r24 2e9fa: 99 0f add r25, r25 2e9fc: 88 0b sbc r24, r24 2e9fe: 99 0b sbc r25, r25 2ea00: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2ea04: 0d 94 04 d6 jmp 0x3ac08 ; 0x3ac08 0002ea08 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ea08: 0f 93 push r16 2ea0a: 1f 93 push r17 2ea0c: cf 93 push r28 2ea0e: df 93 push r29 2ea10: ec 01 movw r28, r24 2ea12: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> 2ea16: 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) 2ea18: 80 36 cpi r24, 0x60 ; 96 2ea1a: 91 05 cpc r25, r1 2ea1c: 08 f0 brcs .+2 ; 0x2ea20 2ea1e: 85 c0 rjmp .+266 ; 0x2eb2a return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ea20: 80 91 a2 10 lds r24, 0x10A2 ; 0x8010a2 2ea24: 81 11 cpse r24, r1 2ea26: 05 c0 rjmp .+10 ; 0x2ea32 cmdqueue_pop_front(); 2ea28: 0e 94 c3 76 call 0xed86 ; 0xed86 cmdbuffer_front_already_processed = true; 2ea2c: 81 e0 ldi r24, 0x01 ; 1 2ea2e: 80 93 a2 10 sts 0x10A2, r24 ; 0x8010a2 } if (bufindr == bufindw && buflen > 0) 2ea32: 40 91 92 12 lds r20, 0x1292 ; 0x801292 2ea36: 50 91 93 12 lds r21, 0x1293 ; 0x801293 2ea3a: 80 91 a0 10 lds r24, 0x10A0 ; 0x8010a0 <_ZL7bufindw.lto_priv.550> 2ea3e: 90 91 a1 10 lds r25, 0x10A1 ; 0x8010a1 <_ZL7bufindw.lto_priv.550+0x1> 2ea42: 48 17 cp r20, r24 2ea44: 59 07 cpc r21, r25 2ea46: 41 f4 brne .+16 ; 0x2ea58 2ea48: 20 91 a3 10 lds r18, 0x10A3 ; 0x8010a3 2ea4c: 30 91 a4 10 lds r19, 0x10A4 ; 0x8010a4 2ea50: 12 16 cp r1, r18 2ea52: 13 06 cpc r1, r19 2ea54: 0c f4 brge .+2 ; 0x2ea58 2ea56: 69 c0 rjmp .+210 ; 0x2eb2a // 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; 2ea58: 20 91 9e 10 lds r18, 0x109E ; 0x80109e 2ea5c: 30 91 9f 10 lds r19, 0x109F ; 0x80109f 2ea60: 12 16 cp r1, r18 2ea62: 13 06 cpc r1, r19 2ea64: 0c f0 brlt .+2 ; 0x2ea68 2ea66: 41 c0 rjmp .+130 ; 0x2eaea 2ea68: 9c 01 movw r18, r24 2ea6a: 2f 59 subi r18, 0x9F ; 159 2ea6c: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ea6e: 84 17 cp r24, r20 2ea70: 95 07 cpc r25, r21 2ea72: e8 f5 brcc .+122 ; 0x2eaee int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ea74: 44 50 subi r20, 0x04 ; 4 2ea76: 51 09 sbc r21, r1 2ea78: 40 1b sub r20, r16 2ea7a: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ea7c: 42 17 cp r20, r18 2ea7e: 53 07 cpc r21, r19 2ea80: 0c f4 brge .+2 ; 0x2ea84 2ea82: 53 c0 rjmp .+166 ; 0x2eb2a } } 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); 2ea84: 50 93 93 12 sts 0x1293, r21 ; 0x801293 2ea88: 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; 2ea8c: 80 91 92 12 lds r24, 0x1292 ; 0x801292 2ea90: 90 91 93 12 lds r25, 0x1293 ; 0x801293 2ea94: fc 01 movw r30, r24 2ea96: eb 55 subi r30, 0x5B ; 91 2ea98: ff 4e sbci r31, 0xEF ; 239 2ea9a: 23 e0 ldi r18, 0x03 ; 3 2ea9c: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ea9e: be 01 movw r22, r28 2eaa0: 88 55 subi r24, 0x58 ; 88 2eaa2: 9f 4e sbci r25, 0xEF ; 239 2eaa4: 0f 94 da d9 call 0x3b3b4 ; 0x3b3b4 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2eaa8: 80 91 a3 10 lds r24, 0x10A3 ; 0x8010a3 2eaac: 90 91 a4 10 lds r25, 0x10A4 ; 0x8010a4 2eab0: 01 96 adiw r24, 0x01 ; 1 2eab2: 90 93 a4 10 sts 0x10A4, r25 ; 0x8010a4 2eab6: 80 93 a3 10 sts 0x10A3, r24 ; 0x8010a3 SERIAL_ECHO_START; 2eaba: 80 ed ldi r24, 0xD0 ; 208 2eabc: 9b ea ldi r25, 0xAB ; 171 2eabe: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(enqueingFront); 2eac2: 81 eb ldi r24, 0xB1 ; 177 2eac4: 9b ea ldi r25, 0xAB ; 171 2eac6: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2eaca: 80 91 92 12 lds r24, 0x1292 ; 0x801292 2eace: 90 91 93 12 lds r25, 0x1293 ; 0x801293 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ead2: 88 55 subi r24, 0x58 ; 88 2ead4: 9f 4e sbci r25, 0xEF ; 239 2ead6: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_ECHOLNPGM("\""); 2eada: 8f ea ldi r24, 0xAF ; 175 2eadc: 9b ea ldi r25, 0xAB ; 171 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2eade: df 91 pop r29 2eae0: cf 91 pop r28 2eae2: 1f 91 pop r17 2eae4: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2eae6: 0c 94 82 79 jmp 0xf304 ; 0xf304 // 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) 2eaea: 9c 01 movw r18, r24 2eaec: c0 cf rjmp .-128 ; 0x2ea6e bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2eaee: c8 01 movw r24, r16 2eaf0: 04 96 adiw r24, 0x04 ; 4 2eaf2: 48 17 cp r20, r24 2eaf4: 59 07 cpc r21, r25 2eaf6: 28 f0 brcs .+10 ; 0x2eb02 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2eaf8: 44 50 subi r20, 0x04 ; 4 2eafa: 51 09 sbc r21, r1 2eafc: 40 1b sub r20, r16 2eafe: 51 0b sbc r21, r17 2eb00: c1 cf rjmp .-126 ; 0x2ea84 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2eb02: 89 ee ldi r24, 0xE9 ; 233 2eb04: 91 e0 ldi r25, 0x01 ; 1 2eb06: bc 01 movw r22, r24 2eb08: 60 1b sub r22, r16 2eb0a: 71 0b sbc r23, r17 2eb0c: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2eb0e: 62 17 cp r22, r18 2eb10: 73 07 cpc r23, r19 2eb12: 5c f0 brlt .+22 ; 0x2eb2a memset(cmdbuffer, 0, bufindr); 2eb14: 70 e0 ldi r23, 0x00 ; 0 2eb16: 60 e0 ldi r22, 0x00 ; 0 2eb18: 85 ea ldi r24, 0xA5 ; 165 2eb1a: 90 e1 ldi r25, 0x10 ; 16 2eb1c: 0f 94 55 e2 call 0x3c4aa ; 0x3c4aa bufindr = bufindr_new; 2eb20: 10 93 93 12 sts 0x1293, r17 ; 0x801293 2eb24: 00 93 92 12 sts 0x1292, r16 ; 0x801292 2eb28: b1 cf rjmp .-158 ; 0x2ea8c SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2eb2a: 88 ea ldi r24, 0xA8 ; 168 2eb2c: 9b ea ldi r25, 0xAB ; 171 2eb2e: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(enqueingFront); 2eb32: 81 eb ldi r24, 0xB1 ; 177 2eb34: 9b ea ldi r25, 0xAB ; 171 2eb36: 0e 94 57 77 call 0xeeae ; 0xeeae if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2eb3a: ce 01 movw r24, r28 2eb3c: 0e 94 57 77 call 0xeeae ; 0xeeae else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2eb40: 81 e9 ldi r24, 0x91 ; 145 2eb42: 9b ea ldi r25, 0xAB ; 171 2eb44: cc cf rjmp .-104 ; 0x2eade 0002eb46 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2eb46: ab 01 movw r20, r22 2eb48: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2eb4a: 80 e2 ldi r24, 0x20 ; 32 2eb4c: 97 e1 ldi r25, 0x17 ; 23 2eb4e: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 2eb52: 81 11 cpse r24, r1 2eb54: 02 c0 rjmp .+4 ; 0x2eb5a 2eb56: 80 e0 ldi r24, 0x00 ; 0 2eb58: 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() ) 2eb5a: 80 e2 ldi r24, 0x20 ; 32 2eb5c: 97 e1 ldi r25, 0x17 ; 23 2eb5e: 0f 94 20 56 call 0x2ac40 ; 0x2ac40 2eb62: 88 23 and r24, r24 2eb64: c1 f3 breq .-16 ; 0x2eb56 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; 2eb66: 20 91 41 17 lds r18, 0x1741 ; 0x801741 2eb6a: 30 91 42 17 lds r19, 0x1742 ; 0x801742 2eb6e: 23 56 subi r18, 0x63 ; 99 2eb70: 31 4f sbci r19, 0xF1 ; 241 2eb72: 30 93 3c 17 sts 0x173C, r19 ; 0x80173c 2eb76: 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; } 2eb7a: 08 95 ret 0002eb7c : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2eb7c: 8f 92 push r8 2eb7e: 9f 92 push r9 2eb80: af 92 push r10 2eb82: bf 92 push r11 2eb84: cf 92 push r12 2eb86: df 92 push r13 2eb88: ef 92 push r14 2eb8a: ff 92 push r15 2eb8c: 0f 93 push r16 2eb8e: 1f 93 push r17 2eb90: cf 93 push r28 2eb92: df 93 push r29 2eb94: cd b7 in r28, 0x3d ; 61 2eb96: de b7 in r29, 0x3e ; 62 2eb98: ee 97 sbiw r28, 0x3e ; 62 2eb9a: 0f b6 in r0, 0x3f ; 63 2eb9c: f8 94 cli 2eb9e: de bf out 0x3e, r29 ; 62 2eba0: 0f be out 0x3f, r0 ; 63 2eba2: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2eba4: 80 91 de 14 lds r24, 0x14DE ; 0x8014de 2eba8: 8f 93 push r24 2ebaa: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2ebae: 8f 93 push r24 2ebb0: 8c e4 ldi r24, 0x4C ; 76 2ebb2: 9b ea ldi r25, 0xAB ; 171 2ebb4: 9f 93 push r25 2ebb6: 8f 93 push r24 2ebb8: 8e 01 movw r16, r28 2ebba: 0f 5d subi r16, 0xDF ; 223 2ebbc: 1f 4f sbci r17, 0xFF ; 255 2ebbe: 1f 93 push r17 2ebc0: 0f 93 push r16 2ebc2: 0f 94 3a db call 0x3b674 ; 0x3b674 2ebc6: 0f 90 pop r0 2ebc8: 0f 90 pop r0 2ebca: 0f 90 pop r0 2ebcc: 0f 90 pop r0 2ebce: 0f 90 pop r0 2ebd0: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2ebd2: f1 2c mov r15, r1 2ebd4: f8 01 movw r30, r16 2ebd6: 01 90 ld r0, Z+ 2ebd8: 00 20 and r0, r0 2ebda: e9 f7 brne .-6 ; 0x2ebd6 2ebdc: 31 97 sbiw r30, 0x01 ; 1 2ebde: e0 1b sub r30, r16 2ebe0: f1 0b sbc r31, r17 2ebe2: fe 16 cp r15, r30 2ebe4: 84 f4 brge .+32 ; 0x2ec06 autoname[i]=tolower(autoname[i]); 2ebe6: 68 01 movw r12, r16 2ebe8: cf 0c add r12, r15 2ebea: d1 1c adc r13, r1 2ebec: f7 fc sbrc r15, 7 2ebee: da 94 dec r13 2ebf0: f6 01 movw r30, r12 2ebf2: 80 81 ld r24, Z 2ebf4: 08 2e mov r0, r24 2ebf6: 00 0c add r0, r0 2ebf8: 99 0b sbc r25, r25 2ebfa: 0f 94 37 e2 call 0x3c46e ; 0x3c46e 2ebfe: f6 01 movw r30, r12 2ec00: 80 83 st Z, r24 2ec02: f3 94 inc r15 2ec04: e7 cf rjmp .-50 ; 0x2ebd4 dir_t p; root.rewind(); 2ec06: 86 e1 ldi r24, 0x16 ; 22 2ec08: 95 e1 ldi r25, 0x15 ; 21 2ec0a: 0e 94 33 77 call 0xee66 ; 0xee66 bool found=false; 2ec0e: a1 2c mov r10, r1 2ec10: ce 01 movw r24, r28 2ec12: 01 96 adiw r24, 0x01 ; 1 2ec14: 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); 2ec16: 85 ef ldi r24, 0xF5 ; 245 2ec18: c8 2e mov r12, r24 2ec1a: 80 e7 ldi r24, 0x70 ; 112 2ec1c: 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; 2ec1e: 80 91 19 15 lds r24, 0x1519 ; 0x801519 2ec22: 82 30 cpi r24, 0x02 ; 2 2ec24: 08 f4 brcc .+2 ; 0x2ec28 2ec26: 50 c0 rjmp .+160 ; 0x2ecc8 2ec28: 80 91 1e 15 lds r24, 0x151E ; 0x80151e 2ec2c: 90 91 1f 15 lds r25, 0x151F ; 0x80151f 2ec30: a0 91 20 15 lds r26, 0x1520 ; 0x801520 2ec34: b0 91 21 15 lds r27, 0x1521 ; 0x801521 2ec38: 8f 71 andi r24, 0x1F ; 31 2ec3a: 99 27 eor r25, r25 2ec3c: aa 27 eor r26, r26 2ec3e: bb 27 eor r27, r27 2ec40: 89 2b or r24, r25 2ec42: 8a 2b or r24, r26 2ec44: 8b 2b or r24, r27 2ec46: 09 f0 breq .+2 ; 0x2ec4a 2ec48: 3f c0 rjmp .+126 ; 0x2ecc8 2ec4a: 50 e0 ldi r21, 0x00 ; 0 2ec4c: 40 e0 ldi r20, 0x00 ; 0 2ec4e: b7 01 movw r22, r14 2ec50: 86 e1 ldi r24, 0x16 ; 22 2ec52: 95 e1 ldi r25, 0x15 ; 21 2ec54: 0f 94 d6 59 call 0x2b3ac ; 0x2b3ac dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2ec58: 18 16 cp r1, r24 2ec5a: b4 f5 brge .+108 ; 0x2ecc8 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2ec5c: b1 2c mov r11, r1 2ec5e: f7 01 movw r30, r14 2ec60: 01 90 ld r0, Z+ 2ec62: 00 20 and r0, r0 2ec64: e9 f7 brne .-6 ; 0x2ec60 2ec66: 31 97 sbiw r30, 0x01 ; 1 2ec68: ee 19 sub r30, r14 2ec6a: ff 09 sbc r31, r15 2ec6c: be 16 cp r11, r30 2ec6e: 74 f4 brge .+28 ; 0x2ec8c p.name[i]=tolower(p.name[i]); 2ec70: 47 01 movw r8, r14 2ec72: 8b 0c add r8, r11 2ec74: 91 1c adc r9, r1 2ec76: b7 fc sbrc r11, 7 2ec78: 9a 94 dec r9 2ec7a: f4 01 movw r30, r8 2ec7c: 80 81 ld r24, Z 2ec7e: 90 e0 ldi r25, 0x00 ; 0 2ec80: 0f 94 37 e2 call 0x3c46e ; 0x3c46e 2ec84: f4 01 movw r30, r8 2ec86: 80 83 st Z, r24 2ec88: b3 94 inc r11 2ec8a: e9 cf rjmp .-46 ; 0x2ec5e //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2ec8c: 8a 85 ldd r24, Y+10 ; 0x0a 2ec8e: 8e 37 cpi r24, 0x7E ; 126 2ec90: 31 f2 breq .-116 ; 0x2ec1e if(strncmp((char*)p.name,autoname,5)==0) 2ec92: 45 e0 ldi r20, 0x05 ; 5 2ec94: 50 e0 ldi r21, 0x00 ; 0 2ec96: b8 01 movw r22, r16 2ec98: c7 01 movw r24, r14 2ec9a: 0f 94 95 e2 call 0x3c52a ; 0x3c52a 2ec9e: 89 2b or r24, r25 2eca0: 09 f0 breq .+2 ; 0x2eca4 2eca2: bd cf rjmp .-134 ; 0x2ec1e { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2eca4: 1f 93 push r17 2eca6: 0f 93 push r16 2eca8: df 92 push r13 2ecaa: cf 92 push r12 2ecac: 0e 94 bd 88 call 0x1117a ; 0x1117a // M24: Start/resume SD print enquecommand_P(MSG_M24); 2ecb0: 61 e0 ldi r22, 0x01 ; 1 2ecb2: 81 ef ldi r24, 0xF1 ; 241 2ecb4: 90 e7 ldi r25, 0x70 ; 112 2ecb6: 0e 94 27 88 call 0x1104e ; 0x1104e 2ecba: 0f 90 pop r0 2ecbc: 0f 90 pop r0 2ecbe: 0f 90 pop r0 2ecc0: 0f 90 pop r0 found=true; 2ecc2: aa 24 eor r10, r10 2ecc4: a3 94 inc r10 2ecc6: ab cf rjmp .-170 ; 0x2ec1e } } if(!found) lastnr=-1; 2ecc8: 8f ef ldi r24, 0xFF ; 255 2ecca: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2eccc: aa 20 and r10, r10 2ecce: 29 f0 breq .+10 ; 0x2ecda lastnr=-1; else lastnr++; 2ecd0: 80 91 dd 14 lds r24, 0x14DD ; 0x8014dd 2ecd4: 90 91 de 14 lds r25, 0x14DE ; 0x8014de 2ecd8: 01 96 adiw r24, 0x01 ; 1 2ecda: 90 93 de 14 sts 0x14DE, r25 ; 0x8014de 2ecde: 80 93 dd 14 sts 0x14DD, r24 ; 0x8014dd } 2ece2: ee 96 adiw r28, 0x3e ; 62 2ece4: 0f b6 in r0, 0x3f ; 63 2ece6: f8 94 cli 2ece8: de bf out 0x3e, r29 ; 62 2ecea: 0f be out 0x3f, r0 ; 63 2ecec: cd bf out 0x3d, r28 ; 61 2ecee: df 91 pop r29 2ecf0: cf 91 pop r28 2ecf2: 1f 91 pop r17 2ecf4: 0f 91 pop r16 2ecf6: ff 90 pop r15 2ecf8: ef 90 pop r14 2ecfa: df 90 pop r13 2ecfc: cf 90 pop r12 2ecfe: bf 90 pop r11 2ed00: af 90 pop r10 2ed02: 9f 90 pop r9 2ed04: 8f 90 pop r8 2ed06: 08 95 ret 0002ed08 : * \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) { 2ed08: 8f 92 push r8 2ed0a: 9f 92 push r9 2ed0c: af 92 push r10 2ed0e: bf 92 push r11 2ed10: cf 92 push r12 2ed12: df 92 push r13 2ed14: ef 92 push r14 2ed16: ff 92 push r15 2ed18: 0f 93 push r16 2ed1a: 1f 93 push r17 2ed1c: cf 93 push r28 2ed1e: df 93 push r29 2ed20: 00 d0 rcall .+0 ; 0x2ed22 2ed22: 1f 92 push r1 2ed24: cd b7 in r28, 0x3d ; 61 2ed26: de b7 in r29, 0x3e ; 62 2ed28: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2ed2a: 83 81 ldd r24, Z+3 ; 0x03 2ed2c: 81 30 cpi r24, 0x01 ; 1 2ed2e: 11 f0 breq .+4 ; 0x2ed34 // set file to correct position return seekSet(newPos); fail: return false; 2ed30: 80 e0 ldi r24, 0x00 ; 0 2ed32: 60 c0 rjmp .+192 ; 0x2edf4 * \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; 2ed34: 81 81 ldd r24, Z+1 ; 0x01 2ed36: 81 ff sbrs r24, 1 2ed38: fb cf rjmp .-10 ; 0x2ed30 // 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; 2ed3a: 81 89 ldd r24, Z+17 ; 0x11 2ed3c: 92 89 ldd r25, Z+18 ; 0x12 2ed3e: a3 89 ldd r26, Z+19 ; 0x13 2ed40: b4 89 ldd r27, Z+20 ; 0x14 2ed42: 89 2b or r24, r25 2ed44: 8a 2b or r24, r26 2ed46: 8b 2b or r24, r27 2ed48: 09 f4 brne .+2 ; 0x2ed4c 2ed4a: 6e c0 rjmp .+220 ; 0x2ee28 2ed4c: 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; 2ed4e: 40 e0 ldi r20, 0x00 ; 0 2ed50: 50 e0 ldi r21, 0x00 ; 0 2ed52: ba 01 movw r22, r20 2ed54: cf 01 movw r24, r30 2ed56: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 2ed5a: 88 23 and r24, r24 2ed5c: 49 f3 breq .-46 ; 0x2ed30 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2ed5e: f7 01 movw r30, r14 2ed60: c1 8c ldd r12, Z+25 ; 0x19 2ed62: d2 8c ldd r13, Z+26 ; 0x1a 2ed64: 85 88 ldd r8, Z+21 ; 0x15 2ed66: 96 88 ldd r9, Z+22 ; 0x16 2ed68: a7 88 ldd r10, Z+23 ; 0x17 2ed6a: 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; 2ed6c: 82 e0 ldi r24, 0x02 ; 2 2ed6e: 90 e0 ldi r25, 0x00 ; 0 2ed70: a0 e0 ldi r26, 0x00 ; 0 2ed72: b0 e0 ldi r27, 0x00 ; 0 2ed74: f6 01 movw r30, r12 2ed76: 80 83 st Z, r24 2ed78: 91 83 std Z+1, r25 ; 0x01 2ed7a: a2 83 std Z+2, r26 ; 0x02 2ed7c: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2ed7e: 9e 01 movw r18, r28 2ed80: 2f 5f subi r18, 0xFF ; 255 2ed82: 3f 4f sbci r19, 0xFF ; 255 2ed84: b5 01 movw r22, r10 2ed86: a4 01 movw r20, r8 2ed88: c6 01 movw r24, r12 2ed8a: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 2ed8e: 88 23 and r24, r24 2ed90: 79 f2 breq .-98 ; 0x2ed30 // free cluster if (!fatPut(cluster, 0)) goto fail; 2ed92: 00 e0 ldi r16, 0x00 ; 0 2ed94: 10 e0 ldi r17, 0x00 ; 0 2ed96: 98 01 movw r18, r16 2ed98: b5 01 movw r22, r10 2ed9a: a4 01 movw r20, r8 2ed9c: c6 01 movw r24, r12 2ed9e: 0f 94 51 54 call 0x2a8a2 ; 0x2a8a2 2eda2: 88 23 and r24, r24 2eda4: 29 f2 breq .-118 ; 0x2ed30 cluster = next; 2eda6: 89 80 ldd r8, Y+1 ; 0x01 2eda8: 9a 80 ldd r9, Y+2 ; 0x02 2edaa: ab 80 ldd r10, Y+3 ; 0x03 2edac: 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; 2edae: f6 01 movw r30, r12 2edb0: 87 89 ldd r24, Z+23 ; 0x17 2edb2: 80 31 cpi r24, 0x10 ; 16 2edb4: 81 f5 brne .+96 ; 0x2ee16 2edb6: f8 ef ldi r31, 0xF8 ; 248 2edb8: 8f 16 cp r8, r31 2edba: ff ef ldi r31, 0xFF ; 255 2edbc: 9f 06 cpc r9, r31 2edbe: a1 04 cpc r10, r1 2edc0: b1 04 cpc r11, r1 2edc2: e8 f2 brcs .-70 ; 0x2ed7e firstCluster_ = 0; 2edc4: f7 01 movw r30, r14 2edc6: 15 8a std Z+21, r1 ; 0x15 2edc8: 16 8a std Z+22, r1 ; 0x16 2edca: 17 8a std Z+23, r1 ; 0x17 2edcc: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2edce: 11 8a std Z+17, r1 ; 0x11 2edd0: 12 8a std Z+18, r1 ; 0x12 2edd2: 13 8a std Z+19, r1 ; 0x13 2edd4: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2edd6: 81 81 ldd r24, Z+1 ; 0x01 2edd8: 80 68 ori r24, 0x80 ; 128 2edda: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2eddc: c7 01 movw r24, r14 2edde: 0f 94 42 58 call 0x2b084 ; 0x2b084 2ede2: 88 23 and r24, r24 2ede4: 09 f4 brne .+2 ; 0x2ede8 2ede6: a4 cf rjmp .-184 ; 0x2ed30 // set file to correct position return seekSet(newPos); 2ede8: 40 e0 ldi r20, 0x00 ; 0 2edea: 50 e0 ldi r21, 0x00 ; 0 2edec: ba 01 movw r22, r20 2edee: c7 01 movw r24, r14 2edf0: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 fail: return false; } 2edf4: 0f 90 pop r0 2edf6: 0f 90 pop r0 2edf8: 0f 90 pop r0 2edfa: 0f 90 pop r0 2edfc: df 91 pop r29 2edfe: cf 91 pop r28 2ee00: 1f 91 pop r17 2ee02: 0f 91 pop r16 2ee04: ff 90 pop r15 2ee06: ef 90 pop r14 2ee08: df 90 pop r13 2ee0a: cf 90 pop r12 2ee0c: bf 90 pop r11 2ee0e: af 90 pop r10 2ee10: 9f 90 pop r9 2ee12: 8f 90 pop r8 2ee14: 08 95 ret return cluster >= FAT32EOC_MIN; 2ee16: 88 ef ldi r24, 0xF8 ; 248 2ee18: 88 16 cp r8, r24 2ee1a: 8f ef ldi r24, 0xFF ; 255 2ee1c: 98 06 cpc r9, r24 2ee1e: a8 06 cpc r10, r24 2ee20: 8f e0 ldi r24, 0x0F ; 15 2ee22: b8 06 cpc r11, r24 2ee24: 78 f6 brcc .-98 ; 0x2edc4 2ee26: ab cf rjmp .-170 ; 0x2ed7e // 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; 2ee28: 81 e0 ldi r24, 0x01 ; 1 2ee2a: e4 cf rjmp .-56 ; 0x2edf4 0002ee2c : +* 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) { 2ee2c: 2f 92 push r2 2ee2e: 3f 92 push r3 2ee30: 4f 92 push r4 2ee32: 5f 92 push r5 2ee34: 6f 92 push r6 2ee36: 7f 92 push r7 2ee38: 8f 92 push r8 2ee3a: 9f 92 push r9 2ee3c: af 92 push r10 2ee3e: bf 92 push r11 2ee40: cf 92 push r12 2ee42: df 92 push r13 2ee44: ef 92 push r14 2ee46: ff 92 push r15 2ee48: 0f 93 push r16 2ee4a: 1f 93 push r17 2ee4c: cf 93 push r28 2ee4e: df 93 push r29 2ee50: cd b7 in r28, 0x3d ; 61 2ee52: de b7 in r29, 0x3e ; 62 2ee54: c6 57 subi r28, 0x76 ; 118 2ee56: d1 09 sbc r29, r1 2ee58: 0f b6 in r0, 0x3f ; 63 2ee5a: f8 94 cli 2ee5c: de bf out 0x3e, r29 ; 62 2ee5e: 0f be out 0x3f, r0 ; 63 2ee60: cd bf out 0x3d, r28 ; 61 2ee62: 4c 01 movw r8, r24 2ee64: 6b 01 movw r12, r22 2ee66: 3a 01 movw r6, r20 2ee68: e5 96 adiw r28, 0x35 ; 53 2ee6a: 2f af std Y+63, r18 ; 0x3f 2ee6c: e5 97 sbiw r28, 0x35 ; 53 2ee6e: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2ee70: 2d b6 in r2, 0x3d ; 61 2ee72: 3e b6 in r3, 0x3e ; 62 2ee74: 10 2f mov r17, r16 2ee76: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2ee78: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2ee7c: 8f 5f subi r24, 0xFF ; 255 2ee7e: 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()) { 2ee82: fb 01 movw r30, r22 2ee84: 80 85 ldd r24, Z+8 ; 0x08 2ee86: 91 85 ldd r25, Z+9 ; 0x09 2ee88: a2 85 ldd r26, Z+10 ; 0x0a 2ee8a: b3 85 ldd r27, Z+11 ; 0x0b 2ee8c: 80 93 a3 14 sts 0x14A3, r24 ; 0x8014a3 2ee90: 90 93 a4 14 sts 0x14A4, r25 ; 0x8014a4 2ee94: a0 93 a5 14 sts 0x14A5, r26 ; 0x8014a5 2ee98: b0 93 a6 14 sts 0x14A6, r27 ; 0x8014a6 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2ee9c: 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); 2ee9e: 5e 01 movw r10, r28 2eea0: f7 e6 ldi r31, 0x67 ; 103 2eea2: af 0e add r10, r31 2eea4: 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; 2eea6: f6 01 movw r30, r12 2eea8: 83 81 ldd r24, Z+3 ; 0x03 2eeaa: 82 30 cpi r24, 0x02 ; 2 2eeac: 08 f4 brcc .+2 ; 0x2eeb0 2eeae: c0 c1 rjmp .+896 ; 0x2f230 2eeb0: 80 85 ldd r24, Z+8 ; 0x08 2eeb2: 91 85 ldd r25, Z+9 ; 0x09 2eeb4: a2 85 ldd r26, Z+10 ; 0x0a 2eeb6: b3 85 ldd r27, Z+11 ; 0x0b 2eeb8: 8f 71 andi r24, 0x1F ; 31 2eeba: 99 27 eor r25, r25 2eebc: aa 27 eor r26, r26 2eebe: bb 27 eor r27, r27 2eec0: 89 2b or r24, r25 2eec2: 8a 2b or r24, r26 2eec4: 8b 2b or r24, r27 2eec6: 09 f0 breq .+2 ; 0x2eeca 2eec8: b3 c1 rjmp .+870 ; 0x2f230 //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'; 2eeca: 10 92 a7 14 sts 0x14A7, r1 ; 0x8014a7 2eece: 47 ea ldi r20, 0xA7 ; 167 2eed0: 54 e1 ldi r21, 0x14 ; 20 2eed2: be 01 movw r22, r28 2eed4: 69 5b subi r22, 0xB9 ; 185 2eed6: 7f 4f sbci r23, 0xFF ; 255 2eed8: c6 01 movw r24, r12 2eeda: 0f 94 d6 59 call 0x2b3ac ; 0x2b3ac } 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()) { 2eede: 18 16 cp r1, r24 2eee0: 0c f0 brlt .+2 ; 0x2eee4 2eee2: a6 c1 rjmp .+844 ; 0x2f230 if (recursionCnt > MAX_DIR_DEPTH) 2eee4: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2eee8: 87 30 cpi r24, 0x07 ; 7 2eeea: 08 f0 brcs .+2 ; 0x2eeee 2eeec: a1 c1 rjmp .+834 ; 0x2f230 return; uint8_t pn0 = p.name[0]; 2eeee: 28 96 adiw r28, 0x08 ; 8 2eef0: 8f ad ldd r24, Y+63 ; 0x3f 2eef2: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2eef4: 88 23 and r24, r24 2eef6: 09 f4 brne .+2 ; 0x2eefa 2eef8: 9b c1 rjmp .+822 ; 0x2f230 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2eefa: 85 3e cpi r24, 0xE5 ; 229 2eefc: 09 f4 brne .+2 ; 0x2ef00 2eefe: 39 c1 rjmp .+626 ; 0x2f172 2ef00: 8e 32 cpi r24, 0x2E ; 46 2ef02: 09 f4 brne .+2 ; 0x2ef06 2ef04: 36 c1 rjmp .+620 ; 0x2f172 if (longFilename[0] == '.') continue; 2ef06: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2ef0a: 8e 32 cpi r24, 0x2E ; 46 2ef0c: 09 f4 brne .+2 ; 0x2ef10 2ef0e: 31 c1 rjmp .+610 ; 0x2f172 2ef10: 63 96 adiw r28, 0x13 ; 19 2ef12: 8f ad ldd r24, Y+63 ; 0x3f 2ef14: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2ef16: 98 2f mov r25, r24 2ef18: 9a 70 andi r25, 0x0A ; 10 2ef1a: 09 f0 breq .+2 ; 0x2ef1e 2ef1c: 2a c1 rjmp .+596 ; 0x2f172 2ef1e: 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; 2ef20: 91 e0 ldi r25, 0x01 ; 1 2ef22: 80 31 cpi r24, 0x10 ; 16 2ef24: 19 f0 breq .+6 ; 0x2ef2c 2ef26: 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 2ef28: 80 31 cpi r24, 0x10 ; 16 2ef2a: 31 f4 brne .+12 ; 0x2ef38 2ef2c: e5 96 adiw r28, 0x35 ; 53 2ef2e: ff ad ldd r31, Y+63 ; 0x3f 2ef30: e5 97 sbiw r28, 0x35 ; 53 2ef32: ff 23 and r31, r31 2ef34: 09 f4 brne .+2 ; 0x2ef38 2ef36: 94 c0 rjmp .+296 ; 0x2f060 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2ef38: 90 93 dc 14 sts 0x14DC, r25 ; 0x8014dc if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2ef3c: 80 31 cpi r24, 0x10 ; 16 2ef3e: 61 f0 breq .+24 ; 0x2ef58 2ef40: 60 96 adiw r28, 0x10 ; 16 2ef42: 8f ad ldd r24, Y+63 ; 0x3f 2ef44: 60 97 sbiw r28, 0x10 ; 16 2ef46: 87 34 cpi r24, 0x47 ; 71 2ef48: 09 f0 breq .+2 ; 0x2ef4c 2ef4a: 13 c1 rjmp .+550 ; 0x2f172 2ef4c: 61 96 adiw r28, 0x11 ; 17 2ef4e: 8f ad ldd r24, Y+63 ; 0x3f 2ef50: 61 97 sbiw r28, 0x11 ; 17 2ef52: 8e 37 cpi r24, 0x7E ; 126 2ef54: 09 f4 brne .+2 ; 0x2ef58 2ef56: 0d c1 rjmp .+538 ; 0x2f172 switch (lsAction) { 2ef58: e5 96 adiw r28, 0x35 ; 53 2ef5a: ff ad ldd r31, Y+63 ; 0x3f 2ef5c: e5 97 sbiw r28, 0x35 ; 53 2ef5e: f1 30 cpi r31, 0x01 ; 1 2ef60: 09 f4 brne .+2 ; 0x2ef64 2ef62: 1b c1 rjmp .+566 ; 0x2f19a 2ef64: f2 30 cpi r31, 0x02 ; 2 2ef66: 09 f4 brne .+2 ; 0x2ef6a 2ef68: 25 c1 rjmp .+586 ; 0x2f1b4 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2ef6a: be 01 movw r22, r28 2ef6c: 69 5b subi r22, 0xB9 ; 185 2ef6e: 7f 4f sbci r23, 0xFF ; 255 2ef70: 82 e9 ldi r24, 0x92 ; 146 2ef72: 94 e1 ldi r25, 0x14 ; 20 2ef74: 0e 94 1d 77 call 0xee3a ; 0xee3a 2ef78: c4 01 movw r24, r8 2ef7a: 0e 94 1b 88 call 0x11036 ; 0x11036 2ef7e: 82 e9 ldi r24, 0x92 ; 146 2ef80: 94 e1 ldi r25, 0x14 ; 20 2ef82: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2ef86: 80 e2 ldi r24, 0x20 ; 32 2ef88: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2ef8c: a7 96 adiw r28, 0x27 ; 39 2ef8e: 6c ad ldd r22, Y+60 ; 0x3c 2ef90: 7d ad ldd r23, Y+61 ; 0x3d 2ef92: 8e ad ldd r24, Y+62 ; 0x3e 2ef94: 9f ad ldd r25, Y+63 ; 0x3f 2ef96: a7 97 sbiw r28, 0x27 ; 39 2ef98: 4a e0 ldi r20, 0x0A ; 10 2ef9a: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2ef9e: 51 fe sbrs r5, 1 2efa0: 45 c0 rjmp .+138 ; 0x2f02c { crmodDate = p.lastWriteDate; 2efa2: a1 96 adiw r28, 0x21 ; 33 2efa4: 2e ad ldd r18, Y+62 ; 0x3e 2efa6: 3f ad ldd r19, Y+63 ; 0x3f 2efa8: a1 97 sbiw r28, 0x21 ; 33 2efaa: 30 93 a2 14 sts 0x14A2, r19 ; 0x8014a2 2efae: 20 93 a1 14 sts 0x14A1, r18 ; 0x8014a1 crmodTime = p.lastWriteTime; 2efb2: 6f 96 adiw r28, 0x1f ; 31 2efb4: 4e ad ldd r20, Y+62 ; 0x3e 2efb6: 5f ad ldd r21, Y+63 ; 0x3f 2efb8: 6f 97 sbiw r28, 0x1f ; 31 2efba: 50 93 a0 14 sts 0x14A0, r21 ; 0x8014a0 2efbe: 40 93 9f 14 sts 0x149F, r20 ; 0x80149f if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2efc2: 69 96 adiw r28, 0x19 ; 25 2efc4: 8e ad ldd r24, Y+62 ; 0x3e 2efc6: 9f ad ldd r25, Y+63 ; 0x3f 2efc8: 69 97 sbiw r28, 0x19 ; 25 2efca: 28 17 cp r18, r24 2efcc: 39 07 cpc r19, r25 2efce: 50 f0 brcs .+20 ; 0x2efe4 2efd0: 28 17 cp r18, r24 2efd2: 39 07 cpc r19, r25 2efd4: 99 f4 brne .+38 ; 0x2effc 2efd6: 67 96 adiw r28, 0x17 ; 23 2efd8: 2e ad ldd r18, Y+62 ; 0x3e 2efda: 3f ad ldd r19, Y+63 ; 0x3f 2efdc: 67 97 sbiw r28, 0x17 ; 23 2efde: 42 17 cp r20, r18 2efe0: 53 07 cpc r21, r19 2efe2: 60 f4 brcc .+24 ; 0x2effc crmodDate = p.creationDate; 2efe4: 90 93 a2 14 sts 0x14A2, r25 ; 0x8014a2 2efe8: 80 93 a1 14 sts 0x14A1, r24 ; 0x8014a1 crmodTime = p.creationTime; 2efec: 67 96 adiw r28, 0x17 ; 23 2efee: 8e ad ldd r24, Y+62 ; 0x3e 2eff0: 9f ad ldd r25, Y+63 ; 0x3f 2eff2: 67 97 sbiw r28, 0x17 ; 23 2eff4: 90 93 a0 14 sts 0x14A0, r25 ; 0x8014a0 2eff8: 80 93 9f 14 sts 0x149F, r24 ; 0x80149f } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2effc: 80 91 a2 14 lds r24, 0x14A2 ; 0x8014a2 2f000: 8f 93 push r24 2f002: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2f006: 8f 93 push r24 2f008: 80 91 a0 14 lds r24, 0x14A0 ; 0x8014a0 2f00c: 8f 93 push r24 2f00e: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2f012: 8f 93 push r24 2f014: 29 e2 ldi r18, 0x29 ; 41 2f016: 3b ea ldi r19, 0xAB ; 171 2f018: 3f 93 push r19 2f01a: 2f 93 push r18 2f01c: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2f020: 0f 90 pop r0 2f022: 0f 90 pop r0 2f024: 0f 90 pop r0 2f026: 0f 90 pop r0 2f028: 0f 90 pop r0 2f02a: 0f 90 pop r0 } if (lsParams.LFN) 2f02c: 11 23 and r17, r17 2f02e: 99 f0 breq .+38 ; 0x2f056 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f030: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f034: 88 23 and r24, r24 2f036: 09 f4 brne .+2 ; 0x2f03a 2f038: ba c0 rjmp .+372 ; 0x2f1ae 2f03a: 87 ea ldi r24, 0xA7 ; 167 2f03c: 94 e1 ldi r25, 0x14 ; 20 2f03e: 9f 93 push r25 2f040: 8f 93 push r24 2f042: e3 e2 ldi r30, 0x23 ; 35 2f044: fb ea ldi r31, 0xAB ; 171 2f046: ff 93 push r31 2f048: ef 93 push r30 2f04a: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2f04e: 0f 90 pop r0 2f050: 0f 90 pop r0 2f052: 0f 90 pop r0 2f054: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f056: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 manage_heater(); 2f05a: 0f 94 63 38 call 0x270c6 ; 0x270c6 2f05e: 89 c0 rjmp .+274 ; 0x2f172 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f060: 2d b7 in r18, 0x3d ; 61 2f062: 3e b7 in r19, 0x3e ; 62 2f064: e7 96 adiw r28, 0x37 ; 55 2f066: 3f af std Y+63, r19 ; 0x3f 2f068: 2e af std Y+62, r18 ; 0x3e 2f06a: 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); 2f06c: be 01 movw r22, r28 2f06e: 69 5b subi r22, 0xB9 ; 185 2f070: 7f 4f sbci r23, 0xFF ; 255 2f072: c5 01 movw r24, r10 2f074: 0e 94 1d 77 call 0xee3a ; 0xee3a // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f078: f4 01 movw r30, r8 2f07a: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f07c: 88 23 and r24, r24 2f07e: 09 f4 brne .+2 ; 0x2f082 2f080: 86 c0 rjmp .+268 ; 0x2f18e 2f082: 01 90 ld r0, Z+ 2f084: 00 20 and r0, r0 2f086: e9 f7 brne .-6 ; 0x2f082 2f088: 31 97 sbiw r30, 0x01 ; 1 2f08a: e8 19 sub r30, r8 2f08c: f9 09 sbc r31, r9 2f08e: d5 01 movw r26, r10 2f090: 0d 90 ld r0, X+ 2f092: 00 20 and r0, r0 2f094: e9 f7 brne .-6 ; 0x2f090 2f096: ea 19 sub r30, r10 2f098: fb 09 sbc r31, r11 char path[len]; 2f09a: ea 0f add r30, r26 2f09c: fb 1f adc r31, r27 2f09e: 31 96 adiw r30, 0x01 ; 1 2f0a0: 2d b7 in r18, 0x3d ; 61 2f0a2: 3e b7 in r19, 0x3e ; 62 2f0a4: 2e 1b sub r18, r30 2f0a6: 3f 0b sbc r19, r31 2f0a8: 0f b6 in r0, 0x3f ; 63 2f0aa: f8 94 cli 2f0ac: 3e bf out 0x3e, r19 ; 62 2f0ae: 0f be out 0x3f, r0 ; 63 2f0b0: 2d bf out 0x3d, r18 ; 61 2f0b2: ed b7 in r30, 0x3d ; 61 2f0b4: fe b7 in r31, 0x3e ; 62 2f0b6: 31 96 adiw r30, 0x01 ; 1 2f0b8: 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 2f0ba: 6e e1 ldi r22, 0x1E ; 30 2f0bc: 73 e0 ldi r23, 0x03 ; 3 2f0be: 81 11 cpse r24, r1 2f0c0: b4 01 movw r22, r8 2f0c2: c7 01 movw r24, r14 2f0c4: 0f 94 8e e2 call 0x3c51c ; 0x3c51c strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f0c8: b5 01 movw r22, r10 2f0ca: c7 01 movw r24, r14 2f0cc: 0f 94 6f e2 call 0x3c4de ; 0x3c4de strcat(path, "/"); // 1 character 2f0d0: 6e e1 ldi r22, 0x1E ; 30 2f0d2: 73 e0 ldi r23, 0x03 ; 3 2f0d4: c7 01 movw r24, r14 2f0d6: 0f 94 6f e2 call 0x3c4de ; 0x3c4de // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f0da: 11 23 and r17, r17 2f0dc: a9 f0 breq .+42 ; 0x2f108 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f0de: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f0e2: 81 11 cpse r24, r1 2f0e4: 57 c0 rjmp .+174 ; 0x2f194 2f0e6: c5 01 movw r24, r10 2f0e8: 9f 93 push r25 2f0ea: 8f 93 push r24 2f0ec: ff 92 push r15 2f0ee: ef 92 push r14 2f0f0: 28 e3 ldi r18, 0x38 ; 56 2f0f2: 3b ea ldi r19, 0xAB ; 171 2f0f4: 3f 93 push r19 2f0f6: 2f 93 push r18 2f0f8: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 2f0fc: 0f 90 pop r0 2f0fe: 0f 90 pop r0 2f100: 0f 90 pop r0 2f102: 0f 90 pop r0 2f104: 0f 90 pop r0 2f106: 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) {} 2f108: 1c a2 std Y+36, r1 ; 0x24 2f10a: 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); 2f10c: 21 e0 ldi r18, 0x01 ; 1 2f10e: a5 01 movw r20, r10 2f110: b6 01 movw r22, r12 2f112: ce 01 movw r24, r28 2f114: 84 96 adiw r24, 0x24 ; 36 2f116: 0f 94 1f 64 call 0x2c83e ; 0x2c83e 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); 2f11a: 83 e2 ldi r24, 0x23 ; 35 2f11c: fe 01 movw r30, r28 2f11e: b4 96 adiw r30, 0x24 ; 36 2f120: de 01 movw r26, r28 2f122: 11 96 adiw r26, 0x01 ; 1 2f124: 01 90 ld r0, Z+ 2f126: 0d 92 st X+, r0 2f128: 8a 95 dec r24 2f12a: e1 f7 brne .-8 ; 0x2f124 2f12c: 10 fb bst r17, 0 2f12e: 50 f8 bld r5, 0 2f130: 05 2d mov r16, r5 2f132: 20 e0 ldi r18, 0x00 ; 0 2f134: 50 e0 ldi r21, 0x00 ; 0 2f136: 40 e0 ldi r20, 0x00 ; 0 2f138: be 01 movw r22, r28 2f13a: 6f 5f subi r22, 0xFF ; 255 2f13c: 7f 4f sbci r23, 0xFF ; 255 2f13e: c7 01 movw r24, r14 2f140: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 2f144: ce 01 movw r24, r28 2f146: 01 96 adiw r24, 0x01 ; 1 2f148: 0e 94 38 77 call 0xee70 ; 0xee70 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f14c: 11 23 and r17, r17 2f14e: 21 f0 breq .+8 ; 0x2f158 puts_P(PSTR("DIR_EXIT")); 2f150: 8f e2 ldi r24, 0x2F ; 47 2f152: 9b ea ldi r25, 0xAB ; 171 2f154: 0f 94 0c db call 0x3b618 ; 0x3b618 2f158: ce 01 movw r24, r28 2f15a: 84 96 adiw r24, 0x24 ; 36 2f15c: 0e 94 38 77 call 0xee70 ; 0xee70 2f160: e7 96 adiw r28, 0x37 ; 55 2f162: ee ad ldd r30, Y+62 ; 0x3e 2f164: ff ad ldd r31, Y+63 ; 0x3f 2f166: e7 97 sbiw r28, 0x37 ; 55 2f168: 0f b6 in r0, 0x3f ; 63 2f16a: f8 94 cli 2f16c: fe bf out 0x3e, r31 ; 62 2f16e: 0f be out 0x3f, r0 ; 63 2f170: 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()) { 2f172: f6 01 movw r30, r12 2f174: 80 85 ldd r24, Z+8 ; 0x08 2f176: 91 85 ldd r25, Z+9 ; 0x09 2f178: a2 85 ldd r26, Z+10 ; 0x0a 2f17a: b3 85 ldd r27, Z+11 ; 0x0b 2f17c: 80 93 a3 14 sts 0x14A3, r24 ; 0x8014a3 2f180: 90 93 a4 14 sts 0x14A4, r25 ; 0x8014a4 2f184: a0 93 a5 14 sts 0x14A5, r26 ; 0x8014a5 2f188: b0 93 a6 14 sts 0x14A6, r27 ; 0x8014a6 2f18c: 8c ce rjmp .-744 ; 0x2eea6 // 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; 2f18e: e1 e0 ldi r30, 0x01 ; 1 2f190: f0 e0 ldi r31, 0x00 ; 0 2f192: 7d cf rjmp .-262 ; 0x2f08e // 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); 2f194: 87 ea ldi r24, 0xA7 ; 167 2f196: 94 e1 ldi r25, 0x14 ; 20 2f198: a7 cf rjmp .-178 ; 0x2f0e8 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f19a: 80 91 a8 17 lds r24, 0x17A8 ; 0x8017a8 2f19e: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 2f1a2: 01 96 adiw r24, 0x01 ; 1 2f1a4: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 2f1a8: 80 93 a8 17 sts 0x17A8, r24 ; 0x8017a8 2f1ac: e2 cf rjmp .-60 ; 0x2f172 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f1ae: 82 e9 ldi r24, 0x92 ; 146 2f1b0: 94 e1 ldi r25, 0x14 ; 20 2f1b2: 45 cf rjmp .-374 ; 0x2f03e manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f1b4: be 01 movw r22, r28 2f1b6: 69 5b subi r22, 0xB9 ; 185 2f1b8: 7f 4f sbci r23, 0xFF ; 255 2f1ba: 82 e9 ldi r24, 0x92 ; 146 2f1bc: 94 e1 ldi r25, 0x14 ; 20 2f1be: 0e 94 1d 77 call 0xee3a ; 0xee3a SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f1c2: a1 96 adiw r28, 0x21 ; 33 2f1c4: 2e ad ldd r18, Y+62 ; 0x3e 2f1c6: 3f ad ldd r19, Y+63 ; 0x3f 2f1c8: a1 97 sbiw r28, 0x21 ; 33 2f1ca: 30 93 a2 14 sts 0x14A2, r19 ; 0x8014a2 2f1ce: 20 93 a1 14 sts 0x14A1, r18 ; 0x8014a1 crmodTime = p.lastWriteTime; 2f1d2: 6f 96 adiw r28, 0x1f ; 31 2f1d4: 4e ad ldd r20, Y+62 ; 0x3e 2f1d6: 5f ad ldd r21, Y+63 ; 0x3f 2f1d8: 6f 97 sbiw r28, 0x1f ; 31 2f1da: 50 93 a0 14 sts 0x14A0, r21 ; 0x8014a0 2f1de: 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 ) ){ 2f1e2: 69 96 adiw r28, 0x19 ; 25 2f1e4: 8e ad ldd r24, Y+62 ; 0x3e 2f1e6: 9f ad ldd r25, Y+63 ; 0x3f 2f1e8: 69 97 sbiw r28, 0x19 ; 25 2f1ea: 28 17 cp r18, r24 2f1ec: 39 07 cpc r19, r25 2f1ee: 50 f0 brcs .+20 ; 0x2f204 2f1f0: 28 17 cp r18, r24 2f1f2: 39 07 cpc r19, r25 2f1f4: 99 f4 brne .+38 ; 0x2f21c 2f1f6: 67 96 adiw r28, 0x17 ; 23 2f1f8: 2e ad ldd r18, Y+62 ; 0x3e 2f1fa: 3f ad ldd r19, Y+63 ; 0x3f 2f1fc: 67 97 sbiw r28, 0x17 ; 23 2f1fe: 42 17 cp r20, r18 2f200: 53 07 cpc r21, r19 2f202: 60 f4 brcc .+24 ; 0x2f21c crmodDate = p.creationDate; 2f204: 90 93 a2 14 sts 0x14A2, r25 ; 0x8014a2 2f208: 80 93 a1 14 sts 0x14A1, r24 ; 0x8014a1 crmodTime = p.creationTime; 2f20c: 67 96 adiw r28, 0x17 ; 23 2f20e: 8e ad ldd r24, Y+62 ; 0x3e 2f210: 9f ad ldd r25, Y+63 ; 0x3f 2f212: 67 97 sbiw r28, 0x17 ; 23 2f214: 90 93 a0 14 sts 0x14A0, r25 ; 0x8014a0 2f218: 80 93 9f 14 sts 0x149F, r24 ; 0x80149f } //writeDate = p.lastAccessDate; if (match != NULL) { 2f21c: 61 14 cp r6, r1 2f21e: 71 04 cpc r7, r1 2f220: 59 f1 breq .+86 ; 0x2f278 if (strcasecmp(match, filename) == 0) return; 2f222: 62 e9 ldi r22, 0x92 ; 146 2f224: 74 e1 ldi r23, 0x14 ; 20 2f226: c3 01 movw r24, r6 2f228: 0f 94 5c e2 call 0x3c4b8 ; 0x3c4b8 2f22c: 89 2b or r24, r25 2f22e: 59 f5 brne .+86 ; 0x2f286 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f230: 80 91 9c 0e lds r24, 0x0E9C ; 0x800e9c 2f234: 81 50 subi r24, 0x01 ; 1 2f236: 80 93 9c 0e sts 0x0E9C, r24 ; 0x800e9c cnt++; break; } } } // while readDir } 2f23a: 0f b6 in r0, 0x3f ; 63 2f23c: f8 94 cli 2f23e: 3e be out 0x3e, r3 ; 62 2f240: 0f be out 0x3f, r0 ; 63 2f242: 2d be out 0x3d, r2 ; 61 2f244: ca 58 subi r28, 0x8A ; 138 2f246: df 4f sbci r29, 0xFF ; 255 2f248: 0f b6 in r0, 0x3f ; 63 2f24a: f8 94 cli 2f24c: de bf out 0x3e, r29 ; 62 2f24e: 0f be out 0x3f, r0 ; 63 2f250: cd bf out 0x3d, r28 ; 61 2f252: df 91 pop r29 2f254: cf 91 pop r28 2f256: 1f 91 pop r17 2f258: 0f 91 pop r16 2f25a: ff 90 pop r15 2f25c: ef 90 pop r14 2f25e: df 90 pop r13 2f260: cf 90 pop r12 2f262: bf 90 pop r11 2f264: af 90 pop r10 2f266: 9f 90 pop r9 2f268: 8f 90 pop r8 2f26a: 7f 90 pop r7 2f26c: 6f 90 pop r6 2f26e: 5f 90 pop r5 2f270: 4f 90 pop r4 2f272: 3f 90 pop r3 2f274: 2f 90 pop r2 2f276: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f278: 80 91 a8 17 lds r24, 0x17A8 ; 0x8017a8 2f27c: 90 91 a9 17 lds r25, 0x17A9 ; 0x8017a9 2f280: 48 16 cp r4, r24 2f282: 19 06 cpc r1, r25 2f284: a9 f2 breq .-86 ; 0x2f230 cnt++; 2f286: 43 94 inc r4 2f288: 74 cf rjmp .-280 ; 0x2f172 0002f28a : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f28a: cf 92 push r12 2f28c: df 92 push r13 2f28e: ef 92 push r14 2f290: ff 92 push r15 2f292: 0f 93 push r16 2f294: cf 93 push r28 2f296: df 93 push r29 2f298: cd b7 in r28, 0x3d ; 61 2f29a: de b7 in r29, 0x3e ; 62 2f29c: a3 97 sbiw r28, 0x23 ; 35 2f29e: 0f b6 in r0, 0x3f ; 63 2f2a0: f8 94 cli 2f2a2: de bf out 0x3e, r29 ; 62 2f2a4: 0f be out 0x3f, r0 ; 63 2f2a6: cd bf out 0x3d, r28 ; 61 2f2a8: 6c 01 movw r12, r24 { curDir=&workDir; 2f2aa: 89 e3 ldi r24, 0x39 ; 57 2f2ac: e8 2e mov r14, r24 2f2ae: 85 e1 ldi r24, 0x15 ; 21 2f2b0: f8 2e mov r15, r24 2f2b2: 8b e3 ldi r24, 0x3B ; 59 2f2b4: 95 e1 ldi r25, 0x15 ; 21 2f2b6: d7 01 movw r26, r14 2f2b8: 8d 93 st X+, r24 2f2ba: 9c 93 st X, r25 nrFiles=nr; 2f2bc: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 2f2c0: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 curDir->rewind(); 2f2c4: 0e 94 33 77 call 0xee66 ; 0xee66 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f2c8: 00 e0 ldi r16, 0x00 ; 0 2f2ca: 0e 7f andi r16, 0xFE ; 254 2f2cc: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f2ce: d7 01 movw r26, r14 2f2d0: ed 91 ld r30, X+ 2f2d2: fc 91 ld r31, X 2f2d4: 83 e2 ldi r24, 0x23 ; 35 2f2d6: de 01 movw r26, r28 2f2d8: 11 96 adiw r26, 0x01 ; 1 2f2da: 01 90 ld r0, Z+ 2f2dc: 0d 92 st X+, r0 2f2de: 8a 95 dec r24 2f2e0: e1 f7 brne .-8 ; 0x2f2da 2f2e2: 22 e0 ldi r18, 0x02 ; 2 2f2e4: a6 01 movw r20, r12 2f2e6: be 01 movw r22, r28 2f2e8: 6f 5f subi r22, 0xFF ; 255 2f2ea: 7f 4f sbci r23, 0xFF ; 255 2f2ec: 89 ef ldi r24, 0xF9 ; 249 2f2ee: 92 e0 ldi r25, 0x02 ; 2 2f2f0: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 2f2f4: ce 01 movw r24, r28 2f2f6: 01 96 adiw r24, 0x01 ; 1 2f2f8: 0e 94 38 77 call 0xee70 ; 0xee70 } 2f2fc: a3 96 adiw r28, 0x23 ; 35 2f2fe: 0f b6 in r0, 0x3f ; 63 2f300: f8 94 cli 2f302: de bf out 0x3e, r29 ; 62 2f304: 0f be out 0x3f, r0 ; 63 2f306: cd bf out 0x3d, r28 ; 61 2f308: df 91 pop r29 2f30a: cf 91 pop r28 2f30c: 0f 91 pop r16 2f30e: ff 90 pop r15 2f310: ef 90 pop r14 2f312: df 90 pop r13 2f314: cf 90 pop r12 2f316: 08 95 ret 0002f318 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f318: ef 92 push r14 2f31a: ff 92 push r15 2f31c: 0f 93 push r16 2f31e: cf 93 push r28 2f320: df 93 push r29 2f322: cd b7 in r28, 0x3d ; 61 2f324: de b7 in r29, 0x3e ; 62 2f326: a3 97 sbiw r28, 0x23 ; 35 2f328: 0f b6 in r0, 0x3f ; 63 2f32a: f8 94 cli 2f32c: de bf out 0x3e, r29 ; 62 2f32e: 0f be out 0x3f, r0 ; 63 2f330: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f332: 29 e3 ldi r18, 0x39 ; 57 2f334: e2 2e mov r14, r18 2f336: 25 e1 ldi r18, 0x15 ; 21 2f338: f2 2e mov r15, r18 2f33a: 2b e3 ldi r18, 0x3B ; 59 2f33c: 35 e1 ldi r19, 0x15 ; 21 2f33e: d7 01 movw r26, r14 2f340: 2d 93 st X+, r18 2f342: 3c 93 st X, r19 nrFiles = 0; 2f344: 10 92 a9 17 sts 0x17A9, r1 ; 0x8017a9 2f348: 10 92 a8 17 sts 0x17A8, r1 ; 0x8017a8 curDir->seekSet((uint32_t)entry << 5); 2f34c: b0 e0 ldi r27, 0x00 ; 0 2f34e: a0 e0 ldi r26, 0x00 ; 0 2f350: ac 01 movw r20, r24 2f352: bd 01 movw r22, r26 2f354: e5 e0 ldi r30, 0x05 ; 5 2f356: 44 0f add r20, r20 2f358: 55 1f adc r21, r21 2f35a: 66 1f adc r22, r22 2f35c: 77 1f adc r23, r23 2f35e: ea 95 dec r30 2f360: d1 f7 brne .-12 ; 0x2f356 2f362: c9 01 movw r24, r18 2f364: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 2f368: 00 e0 ldi r16, 0x00 ; 0 2f36a: 0e 7f andi r16, 0xFE ; 254 2f36c: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f36e: d7 01 movw r26, r14 2f370: ed 91 ld r30, X+ 2f372: fc 91 ld r31, X 2f374: 83 e2 ldi r24, 0x23 ; 35 2f376: de 01 movw r26, r28 2f378: 11 96 adiw r26, 0x01 ; 1 2f37a: 01 90 ld r0, Z+ 2f37c: 0d 92 st X+, r0 2f37e: 8a 95 dec r24 2f380: e1 f7 brne .-8 ; 0x2f37a 2f382: 22 e0 ldi r18, 0x02 ; 2 2f384: 50 e0 ldi r21, 0x00 ; 0 2f386: 40 e0 ldi r20, 0x00 ; 0 2f388: be 01 movw r22, r28 2f38a: 6f 5f subi r22, 0xFF ; 255 2f38c: 7f 4f sbci r23, 0xFF ; 255 2f38e: 89 ef ldi r24, 0xF9 ; 249 2f390: 92 e0 ldi r25, 0x02 ; 2 2f392: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 2f396: ce 01 movw r24, r28 2f398: 01 96 adiw r24, 0x01 ; 1 2f39a: 0e 94 38 77 call 0xee70 ; 0xee70 } 2f39e: a3 96 adiw r28, 0x23 ; 35 2f3a0: 0f b6 in r0, 0x3f ; 63 2f3a2: f8 94 cli 2f3a4: de bf out 0x3e, r29 ; 62 2f3a6: 0f be out 0x3f, r0 ; 63 2f3a8: cd bf out 0x3d, r28 ; 61 2f3aa: df 91 pop r29 2f3ac: cf 91 pop r28 2f3ae: 0f 91 pop r16 2f3b0: ff 90 pop r15 2f3b2: ef 90 pop r14 2f3b4: 08 95 ret 0002f3b6 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f3b6: cf 92 push r12 2f3b8: df 92 push r13 2f3ba: ef 92 push r14 2f3bc: ff 92 push r15 2f3be: 0f 93 push r16 2f3c0: cf 93 push r28 2f3c2: df 93 push r29 2f3c4: cd b7 in r28, 0x3d ; 61 2f3c6: de b7 in r29, 0x3e ; 62 2f3c8: a3 97 sbiw r28, 0x23 ; 35 2f3ca: 0f b6 in r0, 0x3f ; 63 2f3cc: f8 94 cli 2f3ce: de bf out 0x3e, r29 ; 62 2f3d0: 0f be out 0x3f, r0 ; 63 2f3d2: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f3d4: 89 e3 ldi r24, 0x39 ; 57 2f3d6: c8 2e mov r12, r24 2f3d8: 85 e1 ldi r24, 0x15 ; 21 2f3da: d8 2e mov r13, r24 2f3dc: 8b e3 ldi r24, 0x3B ; 59 2f3de: 95 e1 ldi r25, 0x15 ; 21 2f3e0: d6 01 movw r26, r12 2f3e2: 8d 93 st X+, r24 2f3e4: 9c 93 st X, r25 nrFiles=0; 2f3e6: 28 ea ldi r18, 0xA8 ; 168 2f3e8: e2 2e mov r14, r18 2f3ea: 27 e1 ldi r18, 0x17 ; 23 2f3ec: f2 2e mov r15, r18 2f3ee: f7 01 movw r30, r14 2f3f0: 11 82 std Z+1, r1 ; 0x01 2f3f2: 10 82 st Z, r1 curDir->rewind(); 2f3f4: 0e 94 33 77 call 0xee66 ; 0xee66 2f3f8: 00 e0 ldi r16, 0x00 ; 0 2f3fa: 0e 7f andi r16, 0xFE ; 254 2f3fc: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f3fe: d6 01 movw r26, r12 2f400: ed 91 ld r30, X+ 2f402: fc 91 ld r31, X 2f404: 83 e2 ldi r24, 0x23 ; 35 2f406: de 01 movw r26, r28 2f408: 11 96 adiw r26, 0x01 ; 1 2f40a: 01 90 ld r0, Z+ 2f40c: 0d 92 st X+, r0 2f40e: 8a 95 dec r24 2f410: e1 f7 brne .-8 ; 0x2f40a 2f412: 21 e0 ldi r18, 0x01 ; 1 2f414: 50 e0 ldi r21, 0x00 ; 0 2f416: 40 e0 ldi r20, 0x00 ; 0 2f418: be 01 movw r22, r28 2f41a: 6f 5f subi r22, 0xFF ; 255 2f41c: 7f 4f sbci r23, 0xFF ; 255 2f41e: 89 ef ldi r24, 0xF9 ; 249 2f420: 92 e0 ldi r25, 0x02 ; 2 2f422: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 2f426: ce 01 movw r24, r28 2f428: 01 96 adiw r24, 0x01 ; 1 2f42a: 0e 94 38 77 call 0xee70 ; 0xee70 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f42e: f7 01 movw r30, r14 2f430: 80 81 ld r24, Z 2f432: 91 81 ldd r25, Z+1 ; 0x01 2f434: a3 96 adiw r28, 0x23 ; 35 2f436: 0f b6 in r0, 0x3f ; 63 2f438: f8 94 cli 2f43a: de bf out 0x3e, r29 ; 62 2f43c: 0f be out 0x3f, r0 ; 63 2f43e: cd bf out 0x3d, r28 ; 61 2f440: df 91 pop r29 2f442: cf 91 pop r28 2f444: 0f 91 pop r16 2f446: ff 90 pop r15 2f448: ef 90 pop r14 2f44a: df 90 pop r13 2f44c: cf 90 pop r12 2f44e: 08 95 ret 0002f450 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f450: cf 93 push r28 2f452: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f454: 8f e2 ldi r24, 0x2F ; 47 2f456: 0e 94 3e 77 call 0xee7c ; 0xee7c { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f45a: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f45c: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f45e: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2f462: c8 17 cp r28, r24 2f464: 60 f4 brcc .+24 ; 0x2f47e { SERIAL_PROTOCOL(dir_names[i]); 2f466: cd 9f mul r28, r29 2f468: c0 01 movw r24, r0 2f46a: 11 24 eor r1, r1 2f46c: 80 52 subi r24, 0x20 ; 32 2f46e: 9b 4e sbci r25, 0xEB ; 235 2f470: 0e 94 1b 88 call 0x11036 ; 0x11036 2f474: 8f e2 ldi r24, 0x2F ; 47 2f476: 0e 94 3e 77 call 0xee7c ; 0xee7c } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f47a: cf 5f subi r28, 0xFF ; 255 2f47c: f0 cf rjmp .-32 ; 0x2f45e { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f47e: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2f482: 81 11 cpse r24, r1 2f484: 06 c0 rjmp .+12 ; 0x2f492 2f486: 82 e9 ldi r24, 0x92 ; 146 2f488: 94 e1 ldi r25, 0x14 ; 20 } 2f48a: df 91 pop r29 2f48c: cf 91 pop r28 2f48e: 0c 94 1b 88 jmp 0x11036 ; 0x11036 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f492: 87 ea ldi r24, 0xA7 ; 167 2f494: 94 e1 ldi r25, 0x14 ; 20 2f496: f9 cf rjmp .-14 ; 0x2f48a 0002f498 : 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) { 2f498: cf 92 push r12 2f49a: df 92 push r13 2f49c: ef 92 push r14 2f49e: ff 92 push r15 2f4a0: 6b 01 movw r12, r22 2f4a2: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f4a4: 88 ea ldi r24, 0xA8 ; 168 2f4a6: 9c e0 ldi r25, 0x0C ; 12 2f4a8: 0f 94 2b dc call 0x3b856 ; 0x3b856 2f4ac: ab 01 movw r20, r22 2f4ae: bc 01 movw r22, r24 2f4b0: 4c 0d add r20, r12 2f4b2: 5d 1d adc r21, r13 2f4b4: 6e 1d adc r22, r14 2f4b6: 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); 2f4b8: 88 ea ldi r24, 0xA8 ; 168 2f4ba: 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); } 2f4bc: ff 90 pop r15 2f4be: ef 90 pop r14 2f4c0: df 90 pop r13 2f4c2: 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); 2f4c4: 0d 94 79 dc jmp 0x3b8f2 ; 0x3b8f2 0002f4c8 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f4c8: cf 93 push r28 2f4ca: df 93 push r29 2f4cc: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f4ce: 0f 94 2b dc call 0x3b856 ; 0x3b856 if (val == EEPROM_EMPTY_VALUE32) { 2f4d2: 6f 3f cpi r22, 0xFF ; 255 2f4d4: 2f ef ldi r18, 0xFF ; 255 2f4d6: 72 07 cpc r23, r18 2f4d8: 82 07 cpc r24, r18 2f4da: 92 07 cpc r25, r18 2f4dc: 49 f4 brne .+18 ; 0x2f4f0 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); 2f4de: 40 e0 ldi r20, 0x00 ; 0 2f4e0: 50 e0 ldi r21, 0x00 ; 0 2f4e2: ba 01 movw r22, r20 2f4e4: ce 01 movw r24, r28 2f4e6: 0f 94 79 dc call 0x3b8f2 ; 0x3b8f2 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; 2f4ea: 60 e0 ldi r22, 0x00 ; 0 2f4ec: 70 e0 ldi r23, 0x00 ; 0 2f4ee: cb 01 movw r24, r22 } return val; } 2f4f0: df 91 pop r29 2f4f2: cf 91 pop r28 2f4f4: 08 95 ret 0002f4f6 : } // 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; 2f4f6: e8 e2 ldi r30, 0x28 ; 40 2f4f8: f7 e1 ldi r31, 0x17 ; 23 2f4fa: 40 81 ld r20, Z 2f4fc: 51 81 ldd r21, Z+1 ; 0x01 2f4fe: 62 81 ldd r22, Z+2 ; 0x02 2f500: 73 81 ldd r23, Z+3 ; 0x03 2f502: 48 0f add r20, r24 2f504: 59 1f adc r21, r25 2f506: 61 1d adc r22, r1 2f508: 71 1d adc r23, r1 2f50a: 40 83 st Z, r20 2f50c: 51 83 std Z+1, r21 ; 0x01 2f50e: 62 83 std Z+2, r22 ; 0x02 2f510: 73 83 std Z+3, r23 ; 0x03 } 2f512: 08 95 ret 0002f514 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f514: 0f 93 push r16 2f516: 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_ ){ 2f518: 60 91 3d 17 lds r22, 0x173D ; 0x80173d 2f51c: 70 91 3e 17 lds r23, 0x173E ; 0x80173e 2f520: 80 91 3f 17 lds r24, 0x173F ; 0x80173f 2f524: 90 91 40 17 lds r25, 0x1740 ; 0x801740 2f528: 00 91 91 0e lds r16, 0x0E91 ; 0x800e91 2f52c: 10 91 92 0e lds r17, 0x0E92 ; 0x800e92 2f530: 20 91 93 0e lds r18, 0x0E93 ; 0x800e93 2f534: 30 91 94 0e lds r19, 0x0E94 ; 0x800e94 2f538: 60 17 cp r22, r16 2f53a: 71 07 cpc r23, r17 2f53c: 82 07 cpc r24, r18 2f53e: 93 07 cpc r25, r19 2f540: 39 f1 breq .+78 ; 0x2f590 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f542: 40 e0 ldi r20, 0x00 ; 0 2f544: 0f 94 14 54 call 0x2a828 ; 0x2a828 2f548: 88 23 and r24, r24 2f54a: f9 f0 breq .+62 ; 0x2f58a return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f54c: 20 91 41 17 lds r18, 0x1741 ; 0x801741 2f550: 30 91 42 17 lds r19, 0x1742 ; 0x801742 2f554: 40 91 31 17 lds r20, 0x1731 ; 0x801731 2f558: 50 91 32 17 lds r21, 0x1732 ; 0x801732 2f55c: 60 91 33 17 lds r22, 0x1733 ; 0x801733 2f560: 70 91 34 17 lds r23, 0x1734 ; 0x801734 2f564: 42 1b sub r20, r18 2f566: 53 0b sbc r21, r19 2f568: 61 09 sbc r22, r1 2f56a: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f56c: 41 30 cpi r20, 0x01 ; 1 2f56e: 92 e0 ldi r25, 0x02 ; 2 2f570: 59 07 cpc r21, r25 2f572: 61 05 cpc r22, r1 2f574: 71 05 cpc r23, r1 2f576: 20 f0 brcs .+8 ; 0x2f580 2f578: 40 e0 ldi r20, 0x00 ; 0 2f57a: 52 e0 ldi r21, 0x02 ; 2 2f57c: 60 e0 ldi r22, 0x00 ; 0 2f57e: 70 e0 ldi r23, 0x00 ; 0 2f580: 43 56 subi r20, 0x63 ; 99 2f582: 51 4f sbci r21, 0xF1 ; 241 2f584: 9a e0 ldi r25, 0x0A ; 10 2f586: fa 01 movw r30, r20 2f588: 90 83 st Z, r25 } return true; } 2f58a: 1f 91 pop r17 2f58c: 0f 91 pop r16 2f58e: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f590: 81 e0 ldi r24, 0x01 ; 1 2f592: fb cf rjmp .-10 ; 0x2f58a 0002f594 : } static uint8_t twi_start(uint8_t address, uint8_t reg) 2f594: cf 93 push r28 2f596: df 93 push r29 2f598: d8 2f mov r29, r24 { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2f59a: 84 ea ldi r24, 0xA4 ; 164 2f59c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f5a0: 88 e0 ldi r24, 0x08 ; 8 2f5a2: 0f 94 c0 29 call 0x25380 ; 0x25380 2f5a6: 81 11 cpse r24, r1 2f5a8: 16 c0 rjmp .+44 ; 0x2f5d6 return 1; // send address TWDR = TW_WRITE | (address << 1); 2f5aa: 8a ee ldi r24, 0xEA ; 234 2f5ac: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f5b0: c4 e8 ldi r28, 0x84 ; 132 2f5b2: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f5b6: 88 e1 ldi r24, 0x18 ; 24 2f5b8: 0f 94 c0 29 call 0x25380 ; 0x25380 2f5bc: 81 11 cpse r24, r1 2f5be: 0f c0 rjmp .+30 ; 0x2f5de return 2; // send register TWDR = reg; 2f5c0: d0 93 bb 00 sts 0x00BB, r29 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f5c4: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 2f5c8: 88 e2 ldi r24, 0x28 ; 40 2f5ca: 0f 94 c0 29 call 0x25380 ; 0x25380 2f5ce: 88 23 and r24, r24 2f5d0: 19 f0 breq .+6 ; 0x2f5d8 return 3; 2f5d2: 83 e0 ldi r24, 0x03 ; 3 2f5d4: 01 c0 rjmp .+2 ; 0x2f5d8 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; 2f5d6: 81 e0 ldi r24, 0x01 ; 1 TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_DATA_ACK)) return 3; return 0; } 2f5d8: df 91 pop r29 2f5da: cf 91 pop r28 2f5dc: 08 95 ret // send address TWDR = TW_WRITE | (address << 1); TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_SLA_ACK)) return 2; 2f5de: 82 e0 ldi r24, 0x02 ; 2 2f5e0: fb cf rjmp .-10 ; 0x2f5d8 0002f5e2 : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2f5e2: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f5e4: f8 94 cli 2f5e6: 10 92 bc 17 sts 0x17BC, r1 ; 0x8017bc 2f5ea: 10 92 bb 17 sts 0x17BB, r1 ; 0x8017bb (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f5ee: 8f bf out 0x3f, r24 ; 63 } 2f5f0: 08 95 ret 0002f5f2 : 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); 2f5f2: 87 e6 ldi r24, 0x67 ; 103 2f5f4: 9f e0 ldi r25, 0x0F ; 15 2f5f6: 0f 94 23 dc call 0x3b846 ; 0x3b846 2f5fa: 91 e0 ldi r25, 0x01 ; 1 2f5fc: 81 11 cpse r24, r1 2f5fe: 01 c0 rjmp .+2 ; 0x2f602 2f600: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2f602: 81 e0 ldi r24, 0x01 ; 1 2f604: 20 91 aa 17 lds r18, 0x17AA ; 0x8017aa 2f608: 21 11 cpse r18, r1 2f60a: 01 c0 rjmp .+2 ; 0x2f60e 2f60c: 80 e0 ldi r24, 0x00 ; 0 2f60e: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2f610: 90 93 aa 17 sts 0x17AA, r25 ; 0x8017aa } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2f614: 87 e0 ldi r24, 0x07 ; 7 2f616: 9f e0 ldi r25, 0x0F ; 15 2f618: 0f 94 23 dc call 0x3b846 ; 0x3b846 2f61c: 91 e0 ldi r25, 0x01 ; 1 2f61e: 81 11 cpse r24, r1 2f620: 01 c0 rjmp .+2 ; 0x2f624 2f622: 90 e0 ldi r25, 0x00 ; 0 2f624: 90 93 ab 17 sts 0x17AB, r25 ; 0x8017ab runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2f628: 85 ed ldi r24, 0xD5 ; 213 2f62a: 9e e0 ldi r25, 0x0E ; 14 2f62c: 0f 94 23 dc call 0x3b846 ; 0x3b846 2f630: 91 e0 ldi r25, 0x01 ; 1 2f632: 81 11 cpse r24, r1 2f634: 01 c0 rjmp .+2 ; 0x2f638 2f636: 90 e0 ldi r25, 0x00 ; 0 2f638: 90 93 ac 17 sts 0x17AC, r25 ; 0x8017ac sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2f63c: 87 e4 ldi r24, 0x47 ; 71 2f63e: 9d e0 ldi r25, 0x0D ; 13 2f640: 0f 94 23 dc call 0x3b846 ; 0x3b846 if (sensorActionOnError == SensorActionOnError::_Undef) { 2f644: 8f 3f cpi r24, 0xFF ; 255 2f646: c9 f0 breq .+50 ; 0x2f67a 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); 2f648: 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)); 2f64c: 8d ea ldi r24, 0xAD ; 173 2f64e: 9c e0 ldi r25, 0x0C ; 12 2f650: 0f 94 23 dc call 0x3b846 ; 0x3b846 2f654: 91 e0 ldi r25, 0x01 ; 1 2f656: 81 11 cpse r24, r1 2f658: 01 c0 rjmp .+2 ; 0x2f65c 2f65a: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f65c: 90 93 b8 17 sts 0x17B8, r25 ; 0x8017b8 oldPos = pat9125_y; 2f660: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 2f664: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 2f668: 90 93 ba 17 sts 0x17BA, r25 ; 0x8017ba 2f66c: 80 93 b9 17 sts 0x17B9, r24 ; 0x8017b9 resetStepCount(); 2f670: 0f 94 f1 7a call 0x2f5e2 ; 0x2f5e2 jamErrCnt = 0; 2f674: 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)); } 2f678: 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; 2f67a: 10 92 b2 17 sts 0x17B2, r1 ; 0x8017b2 2f67e: e6 cf rjmp .-52 ; 0x2f64c 0002f680 : #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) { 2f680: 80 91 aa 17 lds r24, 0x17AA ; 0x8017aa 2f684: 83 30 cpi r24, 0x03 ; 3 2f686: 21 f4 brne .+8 ; 0x2f690 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2f688: 10 92 aa 17 sts 0x17AA, r1 ; 0x8017aa filter = 0; 2f68c: 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 2f690: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2f694: 20 e0 ldi r18, 0x00 ; 0 2f696: 30 e0 ldi r19, 0x00 ; 0 2f698: 40 ea ldi r20, 0xA0 ; 160 2f69a: 5f e3 ldi r21, 0x3F ; 63 2f69c: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 2f6a0: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 2f6a4: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 2f6a8: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 2f6ac: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 2f6b0: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 2f6b4: 70 93 be 17 sts 0x17BE, r23 ; 0x8017be 2f6b8: 60 93 bd 17 sts 0x17BD, r22 ; 0x8017bd void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2f6bc: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2f6be: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 2f6c0: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 2f6c2: 50 9a sbi 0x0a, 0 ; 10 2f6c4: 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); 2f6c6: 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); 2f6c8: 95 e0 ldi r25, 0x05 ; 5 2f6ca: 9a 95 dec r25 2f6cc: f1 f7 brne .-4 ; 0x2f6ca 2f6ce: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 2f6d0: 58 98 cbi 0x0b, 0 ; 11 2f6d2: 95 e0 ldi r25, 0x05 ; 5 2f6d4: 9a 95 dec r25 2f6d6: f1 f7 brne .-4 ; 0x2f6d4 2f6d8: 00 00 nop 2f6da: 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++) { 2f6dc: a1 f7 brne .-24 ; 0x2f6c6 WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2f6de: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 2f6e0: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2f6e2: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2f6e6: 8c 7f andi r24, 0xFC ; 252 2f6e8: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2f6ec: 8c e0 ldi r24, 0x0C ; 12 2f6ee: 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); 2f6f2: 84 ea ldi r24, 0xA4 ; 164 2f6f4: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2f6f8: 88 e0 ldi r24, 0x08 ; 8 2f6fa: 0f 94 c0 29 call 0x25380 ; 0x25380 2f6fe: 81 11 cpse r24, r1 2f700: 68 c0 rjmp .+208 ; 0x2f7d2 return 1; // send address TWDR = TW_WRITE | (address << 1); 2f702: 8a ee ldi r24, 0xEA ; 234 2f704: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2f708: 84 e8 ldi r24, 0x84 ; 132 2f70a: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2f70e: 88 e1 ldi r24, 0x18 ; 24 2f710: 0f 94 c0 29 call 0x25380 ; 0x25380 2f714: 81 11 cpse r24, r1 2f716: 5d c0 rjmp .+186 ; 0x2f7d2 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 2f718: 84 e9 ldi r24, 0x94 ; 148 2f71a: 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); 2f71e: 60 e0 ldi r22, 0x00 ; 0 2f720: 8f e7 ldi r24, 0x7F ; 127 2f722: 0f 94 15 c2 call 0x3842a ; 0x3842a // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f726: 80 e0 ldi r24, 0x00 ; 0 2f728: 0f 94 30 c2 call 0x38460 ; 0x38460 2f72c: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f730: 81 e0 ldi r24, 0x01 ; 1 2f732: 0f 94 30 c2 call 0x38460 ; 0x38460 2f736: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f73a: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 2f73e: 91 33 cpi r25, 0x31 ; 49 2f740: b9 f5 brne .+110 ; 0x2f7b0 2f742: 81 39 cpi r24, 0x91 ; 145 2f744: a9 f5 brne .+106 ; 0x2f7b0 } #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); 2f746: 67 e9 ldi r22, 0x97 ; 151 2f748: 86 e0 ldi r24, 0x06 ; 6 2f74a: 0f 94 15 c2 call 0x3842a ; 0x3842a #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2f74e: 8f e9 ldi r24, 0x9F ; 159 2f750: 9f e0 ldi r25, 0x0F ; 15 2f752: 01 97 sbiw r24, 0x01 ; 1 2f754: f1 f7 brne .-4 ; 0x2f752 2f756: 00 c0 rjmp .+0 ; 0x2f758 2f758: 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)) 2f75a: 82 e1 ldi r24, 0x12 ; 18 2f75c: 9b ea ldi r25, 0xAB ; 171 2f75e: 0f 94 5d c2 call 0x384ba ; 0x384ba 2f762: 88 23 and r24, r24 2f764: b1 f1 breq .+108 ; 0x2f7d2 2f766: 8f e3 ldi r24, 0x3F ; 63 2f768: 9c e9 ldi r25, 0x9C ; 156 2f76a: 01 97 sbiw r24, 0x01 ; 1 2f76c: f1 f7 brne .-4 ; 0x2f76a 2f76e: 00 c0 rjmp .+0 ; 0x2f770 2f770: 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); 2f772: 61 e0 ldi r22, 0x01 ; 1 2f774: 8f e7 ldi r24, 0x7F ; 127 2f776: 0f 94 15 c2 call 0x3842a ; 0x3842a //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2f77a: 8f ed ldi r24, 0xDF ; 223 2f77c: 9a ea ldi r25, 0xAA ; 170 2f77e: 0f 94 5d c2 call 0x384ba ; 0x384ba 2f782: 88 23 and r24, r24 2f784: 31 f1 breq .+76 ; 0x2f7d2 return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2f786: 60 e0 ldi r22, 0x00 ; 0 2f788: 8f e7 ldi r24, 0x7F ; 127 2f78a: 0f 94 15 c2 call 0x3842a ; 0x3842a // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2f78e: 60 e0 ldi r22, 0x00 ; 0 2f790: 89 e0 ldi r24, 0x09 ; 9 2f792: 0f 94 15 c2 call 0x3842a ; 0x3842a pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2f796: 80 e0 ldi r24, 0x00 ; 0 2f798: 0f 94 30 c2 call 0x38460 ; 0x38460 2f79c: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f7a0: 81 e0 ldi r24, 0x01 ; 1 2f7a2: 0f 94 30 c2 call 0x38460 ; 0x38460 2f7a6: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2f7aa: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2f7ae: 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); 2f7b0: 80 e0 ldi r24, 0x00 ; 0 2f7b2: 0f 94 30 c2 call 0x38460 ; 0x38460 2f7b6: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2f7ba: 81 e0 ldi r24, 0x01 ; 1 2f7bc: 0f 94 30 c2 call 0x38460 ; 0x38460 2f7c0: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2f7c4: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 2f7c8: 91 33 cpi r25, 0x31 ; 49 2f7ca: 19 f4 brne .+6 ; 0x2f7d2 2f7cc: 81 39 cpi r24, 0x91 ; 145 2f7ce: 09 f4 brne .+2 ; 0x2f7d2 2f7d0: ba cf rjmp .-140 ; 0x2f746 void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2f7d2: 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; 2f7d6: 83 e0 ldi r24, 0x03 ; 3 2f7d8: 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 } 2f7dc: 08 95 ret 0002f7de : 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() { 2f7de: cf 93 push r28 2f7e0: df 93 push r29 if (jamDetection) { 2f7e2: 80 91 b8 17 lds r24, 0x17B8 ; 0x8017b8 2f7e6: 88 23 and r24, r24 2f7e8: 09 f4 brne .+2 ; 0x2f7ec 2f7ea: 62 c0 rjmp .+196 ; 0x2f8b0 setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2f7ec: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f7ee: f8 94 cli 2f7f0: c0 91 bb 17 lds r28, 0x17BB ; 0x8017bb 2f7f4: d0 91 bc 17 lds r29, 0x17BC ; 0x8017bc (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f7f8: 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 2f7fa: ce 01 movw r24, r28 2f7fc: d7 ff sbrs r29, 7 2f7fe: 04 c0 rjmp .+8 ; 0x2f808 2f800: 88 27 eor r24, r24 2f802: 99 27 eor r25, r25 2f804: 8c 1b sub r24, r28 2f806: 9d 0b sbc r25, r29 2f808: 20 91 bd 17 lds r18, 0x17BD ; 0x8017bd 2f80c: 30 91 be 17 lds r19, 0x17BE ; 0x8017be 2f810: 82 17 cp r24, r18 2f812: 93 07 cpc r25, r19 2f814: 4c f1 brlt .+82 ; 0x2f868 resetStepCount(); 2f816: 0f 94 f1 7a call 0x2f5e2 ; 0x2f5e2 if (!pat9125_update()) { // get up to date data. reinit on error. 2f81a: 0f 94 7b c2 call 0x384f6 ; 0x384f6 2f81e: 81 11 cpse r24, r1 2f820: 02 c0 rjmp .+4 ; 0x2f826 init(); // try to reinit. 2f822: 0f 94 40 7b call 0x2f680 ; 0x2f680 } bool fsDir = (pat9125_y - oldPos) > 0; 2f826: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 2f82a: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 2f82e: 80 91 bf 17 lds r24, 0x17BF ; 0x8017bf 2f832: 40 91 b9 17 lds r20, 0x17B9 ; 0x8017b9 2f836: 50 91 ba 17 lds r21, 0x17BA ; 0x8017ba 2f83a: b9 01 movw r22, r18 2f83c: 64 1b sub r22, r20 2f83e: 75 0b sbc r23, r21 2f840: 41 e0 ldi r20, 0x01 ; 1 2f842: 16 16 cp r1, r22 2f844: 17 06 cpc r1, r23 2f846: 0c f0 brlt .+2 ; 0x2f84a 2f848: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2f84a: 91 e0 ldi r25, 0x01 ; 1 2f84c: 1c 16 cp r1, r28 2f84e: 1d 06 cpc r1, r29 2f850: 0c f0 brlt .+2 ; 0x2f854 2f852: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2f854: 49 17 cp r20, r25 2f856: 09 f4 brne .+2 ; 0x2f85a 2f858: 63 c0 rjmp .+198 ; 0x2f920 jamErrCnt++; 2f85a: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2f85c: 80 93 bf 17 sts 0x17BF, r24 ; 0x8017bf } oldPos = pat9125_y; 2f860: 30 93 ba 17 sts 0x17BA, r19 ; 0x8017ba 2f864: 20 93 b9 17 sts 0x17B9, r18 ; 0x8017b9 } if (jamErrCnt > 10) { 2f868: 80 91 bf 17 lds r24, 0x17BF ; 0x8017bf 2f86c: 8b 30 cpi r24, 0x0B ; 11 2f86e: 00 f1 brcs .+64 ; 0x2f8b0 jamErrCnt = 0; 2f870: 10 92 bf 17 sts 0x17BF, r1 ; 0x8017bf void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2f874: 10 92 ac 17 sts 0x17AC, r1 ; 0x8017ac autoLoadEnabled = false; 2f878: 10 92 ab 17 sts 0x17AB, r1 ; 0x8017ab jamDetection = false; 2f87c: 10 92 b8 17 sts 0x17B8, r1 ; 0x8017b8 stop_and_save_print_to_ram(0, 0); 2f880: 20 e0 ldi r18, 0x00 ; 0 2f882: 30 e0 ldi r19, 0x00 ; 0 2f884: a9 01 movw r20, r18 2f886: ca 01 movw r24, r20 2f888: b9 01 movw r22, r18 2f88a: 0e 94 3e 89 call 0x1127c ; 0x1127c restore_print_from_ram_and_continue(0); 2f88e: 60 e0 ldi r22, 0x00 ; 0 2f890: 70 e0 ldi r23, 0x00 ; 0 2f892: cb 01 movw r24, r22 2f894: 0e 94 4b 68 call 0xd096 ; 0xd096 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2f898: 85 e6 ldi r24, 0x65 ; 101 2f89a: 9f e0 ldi r25, 0x0F ; 15 2f89c: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2f8a0: 81 e0 ldi r24, 0x01 ; 1 2f8a2: 9f e0 ldi r25, 0x0F ; 15 2f8a4: 0e 94 22 76 call 0xec44 ; 0xec44 enquecommand_front_P(MSG_M600); 2f8a8: 8c ee ldi r24, 0xEC ; 236 2f8aa: 90 e7 ldi r25, 0x70 ; 112 2f8ac: 0f 94 04 75 call 0x2ea08 ; 0x2ea08 jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2f8b0: 6a e0 ldi r22, 0x0A ; 10 2f8b2: 70 e0 ldi r23, 0x00 ; 0 2f8b4: 83 eb ldi r24, 0xB3 ; 179 2f8b6: 97 e1 ldi r25, 0x17 ; 23 2f8b8: 0f 94 ad 29 call 0x2535a ; 0x2535a ::expired_cont(unsigned short)> 2f8bc: c8 2f mov r28, r24 2f8be: 88 23 and r24, r24 2f8c0: 39 f1 breq .+78 ; 0x2f910 pollingTimer.start(); 2f8c2: 83 eb ldi r24, 0xB3 ; 179 2f8c4: 97 e1 ldi r25, 0x17 ; 23 2f8c6: 0f 94 b4 29 call 0x25368 ; 0x25368 ::start()> if (!pat9125_update()) { 2f8ca: 0f 94 7b c2 call 0x384f6 ; 0x384f6 2f8ce: 81 11 cpse r24, r1 2f8d0: 02 c0 rjmp .+4 ; 0x2f8d6 init(); // try to reinit. 2f8d2: 0f 94 40 7b call 0x2f680 ; 0x2f680 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2f8d6: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 2f8da: 81 31 cpi r24, 0x11 ; 17 2f8dc: 30 f0 brcs .+12 ; 0x2f8ea 2f8de: c1 e0 ldi r28, 0x01 ; 1 2f8e0: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 2f8e4: 82 33 cpi r24, 0x32 ; 50 2f8e6: 08 f4 brcc .+2 ; 0x2f8ea 2f8e8: c0 e0 ldi r28, 0x00 ; 0 2f8ea: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 if (present != filterFilPresent) { 2f8ee: 20 91 b7 17 lds r18, 0x17B7 ; 0x8017b7 2f8f2: 30 e0 ldi r19, 0x00 ; 0 2f8f4: c2 17 cp r28, r18 2f8f6: 13 06 cpc r1, r19 2f8f8: c1 f0 breq .+48 ; 0x2f92a filter++; 2f8fa: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2f8fc: 80 93 b6 17 sts 0x17B6, r24 ; 0x8017b6 } if (filter >= filterCnt) { 2f900: 80 91 b6 17 lds r24, 0x17B6 ; 0x8017b6 2f904: 85 30 cpi r24, 0x05 ; 5 2f906: 20 f0 brcs .+8 ; 0x2f910 filter = 0; 2f908: 10 92 b6 17 sts 0x17B6, r1 ; 0x8017b6 filterFilPresent = present; 2f90c: c0 93 b7 17 sts 0x17B7, r28 ; 0x8017b7 } } return (filter == 0); // return stability 2f910: 81 e0 ldi r24, 0x01 ; 1 2f912: 90 91 b6 17 lds r25, 0x17B6 ; 0x8017b6 2f916: 91 11 cpse r25, r1 2f918: 80 e0 ldi r24, 0x00 ; 0 } 2f91a: df 91 pop r29 2f91c: cf 91 pop r28 2f91e: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2f920: 88 23 and r24, r24 2f922: 09 f4 brne .+2 ; 0x2f926 2f924: 9d cf rjmp .-198 ; 0x2f860 jamErrCnt--; 2f926: 81 50 subi r24, 0x01 ; 1 2f928: 99 cf rjmp .-206 ; 0x2f85c } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2f92a: 88 23 and r24, r24 2f92c: 49 f3 breq .-46 ; 0x2f900 filter--; 2f92e: 81 50 subi r24, 0x01 ; 1 2f930: e5 cf rjmp .-54 ; 0x2f8fc 0002f932 : * 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() { 2f932: 2f 92 push r2 2f934: 3f 92 push r3 2f936: 4f 92 push r4 2f938: 5f 92 push r5 2f93a: 6f 92 push r6 2f93c: 7f 92 push r7 2f93e: 8f 92 push r8 2f940: 9f 92 push r9 2f942: af 92 push r10 2f944: bf 92 push r11 2f946: cf 92 push r12 2f948: df 92 push r13 2f94a: ef 92 push r14 2f94c: ff 92 push r15 2f94e: 0f 93 push r16 2f950: 1f 93 push r17 2f952: cf 93 push r28 2f954: df 93 push r29 2f956: cd b7 in r28, 0x3d ; 61 2f958: de b7 in r29, 0x3e ; 62 2f95a: ed 97 sbiw r28, 0x3d ; 61 2f95c: 0f b6 in r0, 0x3f ; 63 2f95e: f8 94 cli 2f960: de bf out 0x3e, r29 ; 62 2f962: 0f be out 0x3f, r0 ; 63 2f964: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2f966: 10 92 32 16 sts 0x1632, r1 ; 0x801632 2f96a: 10 92 31 16 sts 0x1631, r1 ; 0x801631 lastSortedFilePosition = 0; 2f96e: 10 92 fc 16 sts 0x16FC, r1 ; 0x8016fc 2f972: 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 2f976: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f97a: 80 fd sbrc r24, 0 2f97c: ef c0 rjmp .+478 ; 0x2fb5c uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2f97e: 89 e0 ldi r24, 0x09 ; 9 2f980: 9f e0 ldi r25, 0x0F ; 15 2f982: 0f 94 23 dc call 0x3b846 ; 0x3b846 2f986: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2f988: 82 e0 ldi r24, 0x02 ; 2 2f98a: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2f98e: 0f 94 db 79 call 0x2f3b6 ; 0x2f3b6 2f992: 6c 01 movw r12, r24 if (fileCnt > 0) { 2f994: 00 97 sbiw r24, 0x00 ; 0 2f996: 09 f4 brne .+2 ; 0x2f99a 2f998: de c0 rjmp .+444 ; 0x2fb56 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2f99a: 85 36 cpi r24, 0x65 ; 101 2f99c: 91 05 cpc r25, r1 2f99e: 60 f0 brcs .+24 ; 0x2f9b8 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2f9a0: 32 e0 ldi r19, 0x02 ; 2 2f9a2: 33 16 cp r3, r19 2f9a4: 31 f0 breq .+12 ; 0x2f9b2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2f9a6: 80 e8 ldi r24, 0x80 ; 128 2f9a8: 9c e5 ldi r25, 0x5C ; 92 2f9aa: 0e 94 b3 72 call 0xe566 ; 0xe566 2f9ae: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 } fileCnt = SDSORT_LIMIT; 2f9b2: f4 e6 ldi r31, 0x64 ; 100 2f9b4: cf 2e mov r12, r31 2f9b6: d1 2c mov r13, r1 } sort_count = fileCnt; 2f9b8: d0 92 32 16 sts 0x1632, r13 ; 0x801632 2f9bc: c0 92 31 16 sts 0x1631, r12 ; 0x801631 2f9c0: 63 e3 ldi r22, 0x33 ; 51 2f9c2: 66 2e mov r6, r22 2f9c4: 66 e1 ldi r22, 0x16 ; 22 2f9c6: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f9c8: f1 2c mov r15, r1 2f9ca: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2f9cc: 7b e3 ldi r23, 0x3B ; 59 2f9ce: a7 2e mov r10, r23 2f9d0: 75 e1 ldi r23, 0x15 ; 21 2f9d2: b7 2e mov r11, r23 nrFiles = 1; 2f9d4: 88 24 eor r8, r8 2f9d6: 83 94 inc r8 2f9d8: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2f9da: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f9de: 80 fd sbrc r24, 0 2f9e0: bd c0 rjmp .+378 ; 0x2fb5c manage_heater(); 2f9e2: 0f 94 63 38 call 0x270c6 ; 0x270c6 if (i == 0) 2f9e6: e1 14 cp r14, r1 2f9e8: f1 04 cpc r15, r1 2f9ea: 09 f0 breq .+2 ; 0x2f9ee 2f9ec: d0 c0 rjmp .+416 ; 0x2fb8e getfilename(0); 2f9ee: 90 e0 ldi r25, 0x00 ; 0 2f9f0: 80 e0 ldi r24, 0x00 ; 0 2f9f2: 0f 94 45 79 call 0x2f28a ; 0x2f28a else getfilename_next(position); sort_entries[i] = position >> 5; 2f9f6: 80 91 a3 14 lds r24, 0x14A3 ; 0x8014a3 2f9fa: 90 91 a4 14 lds r25, 0x14A4 ; 0x8014a4 2f9fe: a0 91 a5 14 lds r26, 0x14A5 ; 0x8014a5 2fa02: b0 91 a6 14 lds r27, 0x14A6 ; 0x8014a6 2fa06: 55 e0 ldi r21, 0x05 ; 5 2fa08: b6 95 lsr r27 2fa0a: a7 95 ror r26 2fa0c: 97 95 ror r25 2fa0e: 87 95 ror r24 2fa10: 5a 95 dec r21 2fa12: d1 f7 brne .-12 ; 0x2fa08 2fa14: f3 01 movw r30, r6 2fa16: 81 93 st Z+, r24 2fa18: 91 93 st Z+, r25 2fa1a: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fa1c: ff ef ldi r31, 0xFF ; 255 2fa1e: ef 1a sub r14, r31 2fa20: ff 0a sbc r15, r31 2fa22: ce 14 cp r12, r14 2fa24: df 04 cpc r13, r15 2fa26: c9 f6 brne .-78 ; 0x2f9da else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2fa28: 21 e0 ldi r18, 0x01 ; 1 2fa2a: e2 16 cp r14, r18 2fa2c: f1 04 cpc r15, r1 2fa2e: 09 f4 brne .+2 ; 0x2fa32 2fa30: 92 c0 rjmp .+292 ; 0x2fb56 2fa32: 32 e0 ldi r19, 0x02 ; 2 2fa34: 33 16 cp r3, r19 2fa36: 09 f4 brne .+2 ; 0x2fa3a 2fa38: 8e c0 rjmp .+284 ; 0x2fb56 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2fa3a: 90 93 fc 16 sts 0x16FC, r25 ; 0x8016fc 2fa3e: 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)); 2fa42: 80 e7 ldi r24, 0x70 ; 112 2fa44: 9c e5 ldi r25, 0x5C ; 92 2fa46: 0e 94 b3 72 call 0xe566 ; 0xe566 2fa4a: ee 9c mul r14, r14 2fa4c: 90 01 movw r18, r0 2fa4e: ef 9c mul r14, r15 2fa50: 30 0d add r19, r0 2fa52: 30 0d add r19, r0 2fa54: 11 24 eor r1, r1 2fa56: bc 01 movw r22, r24 2fa58: c9 01 movw r24, r18 2fa5a: 96 95 lsr r25 2fa5c: 87 95 ror r24 2fa5e: 0f 94 ff cf call 0x39ffe ; 0x39ffe 2fa62: 35 e3 ldi r19, 0x35 ; 53 2fa64: a3 2e mov r10, r19 2fa66: 36 e1 ldi r19, 0x16 ; 22 2fa68: 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; 2fa6a: 91 2c mov r9, r1 2fa6c: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2fa6e: cc 24 eor r12, r12 2fa70: c3 94 inc r12 2fa72: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2fa74: c4 01 movw r24, r8 2fa76: 0f 94 d0 cf call 0x39fa0 ; 0x39fa0 counter += i; 2fa7a: 8c 0c add r8, r12 2fa7c: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2fa7e: f5 01 movw r30, r10 2fa80: 01 90 ld r0, Z+ 2fa82: f0 81 ld r31, Z 2fa84: e0 2d mov r30, r0 2fa86: f9 af std Y+57, r31 ; 0x39 2fa88: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2fa8a: cf 01 movw r24, r30 2fa8c: 0f 94 8c 79 call 0x2f318 ; 0x2f318 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2fa90: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2fa94: 62 e9 ldi r22, 0x92 ; 146 2fa96: 74 e1 ldi r23, 0x14 ; 20 2fa98: 88 23 and r24, r24 2fa9a: 11 f0 breq .+4 ; 0x2faa0 2fa9c: 67 ea ldi r22, 0xA7 ; 167 2fa9e: 74 e1 ldi r23, 0x14 ; 20 2faa0: ce 01 movw r24, r28 2faa2: 01 96 adiw r24, 0x01 ; 1 2faa4: 0f 94 8e e2 call 0x3c51c ; 0x3c51c crmod_date_bckp = crmodDate; 2faa8: 60 90 a1 14 lds r6, 0x14A1 ; 0x8014a1 2faac: 70 90 a2 14 lds r7, 0x14A2 ; 0x8014a2 crmod_time_bckp = crmodTime; 2fab0: 20 91 9f 14 lds r18, 0x149F ; 0x80149f 2fab4: 30 91 a0 14 lds r19, 0x14A0 ; 0x8014a0 2fab8: 3b af std Y+59, r19 ; 0x3b 2faba: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2fabc: 20 90 dc 14 lds r2, 0x14DC ; 0x8014dc 2fac0: bf aa std Y+55, r11 ; 0x37 2fac2: ae aa std Y+54, r10 ; 0x36 2fac4: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fac6: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2faca: 80 fd sbrc r24, 0 2facc: 47 c0 rjmp .+142 ; 0x2fb5c printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2face: 0f 94 63 38 call 0x270c6 ; 0x270c6 const uint16_t o2 = sort_entries[j - 1]; 2fad2: c8 01 movw r24, r16 2fad4: 01 97 sbiw r24, 0x01 ; 1 2fad6: 9d af std Y+61, r25 ; 0x3d 2fad8: 8c af std Y+60, r24 ; 0x3c 2fada: ee a9 ldd r30, Y+54 ; 0x36 2fadc: ff a9 ldd r31, Y+55 ; 0x37 2fade: 52 90 ld r5, -Z 2fae0: 42 90 ld r4, -Z 2fae2: ff ab std Y+55, r31 ; 0x37 2fae4: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fae6: c2 01 movw r24, r4 2fae8: 0f 94 8c 79 call 0x2f318 ; 0x2f318 char *name2 = LONGEST_FILENAME; // use the string in-place 2faec: 80 91 a7 14 lds r24, 0x14A7 ; 0x8014a7 2faf0: 62 e9 ldi r22, 0x92 ; 146 2faf2: 74 e1 ldi r23, 0x14 ; 20 2faf4: 88 23 and r24, r24 2faf6: 11 f0 breq .+4 ; 0x2fafc 2faf8: 67 ea ldi r22, 0xA7 ; 167 2fafa: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2fafc: 31 10 cpse r3, r1 2fafe: 8a c0 rjmp .+276 ; 0x2fc14 2fb00: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2fb04: 28 12 cpse r2, r24 2fb06: 83 c0 rjmp .+262 ; 0x2fc0e #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fb08: 80 91 a1 14 lds r24, 0x14A1 ; 0x8014a1 2fb0c: 90 91 a2 14 lds r25, 0x14A2 ; 0x8014a2 2fb10: 68 16 cp r6, r24 2fb12: 79 06 cpc r7, r25 2fb14: 09 f0 breq .+2 ; 0x2fb18 2fb16: 6c c0 rjmp .+216 ; 0x2fbf0 2fb18: 80 91 9f 14 lds r24, 0x149F ; 0x80149f 2fb1c: 90 91 a0 14 lds r25, 0x14A0 ; 0x8014a0 2fb20: 2a ad ldd r18, Y+58 ; 0x3a 2fb22: 3b ad ldd r19, Y+59 ; 0x3b 2fb24: 82 17 cp r24, r18 2fb26: 93 07 cpc r25, r19 2fb28: 08 f0 brcs .+2 ; 0x2fb2c 2fb2a: 66 c0 rjmp .+204 ; 0x2fbf8 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fb2c: 00 0f add r16, r16 2fb2e: 11 1f adc r17, r17 2fb30: f8 01 movw r30, r16 2fb32: ed 5c subi r30, 0xCD ; 205 2fb34: f9 4e sbci r31, 0xE9 ; 233 2fb36: 28 ad ldd r18, Y+56 ; 0x38 2fb38: 39 ad ldd r19, Y+57 ; 0x39 2fb3a: 31 83 std Z+1, r19 ; 0x01 2fb3c: 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){ 2fb3e: 3f ef ldi r19, 0xFF ; 255 2fb40: c3 1a sub r12, r19 2fb42: d3 0a sbc r13, r19 2fb44: 82 e0 ldi r24, 0x02 ; 2 2fb46: a8 0e add r10, r24 2fb48: b1 1c adc r11, r1 2fb4a: ec 14 cp r14, r12 2fb4c: fd 04 cpc r15, r13 2fb4e: 09 f0 breq .+2 ; 0x2fb52 2fb50: 91 cf rjmp .-222 ; 0x2fa74 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fb52: 0f 94 f1 cf call 0x39fe2 ; 0x39fe2 } } KEEPALIVE_STATE(NOT_BUSY); 2fb56: 81 e0 ldi r24, 0x01 ; 1 2fb58: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be } 2fb5c: ed 96 adiw r28, 0x3d ; 61 2fb5e: 0f b6 in r0, 0x3f ; 63 2fb60: f8 94 cli 2fb62: de bf out 0x3e, r29 ; 62 2fb64: 0f be out 0x3f, r0 ; 63 2fb66: cd bf out 0x3d, r28 ; 61 2fb68: df 91 pop r29 2fb6a: cf 91 pop r28 2fb6c: 1f 91 pop r17 2fb6e: 0f 91 pop r16 2fb70: ff 90 pop r15 2fb72: ef 90 pop r14 2fb74: df 90 pop r13 2fb76: cf 90 pop r12 2fb78: bf 90 pop r11 2fb7a: af 90 pop r10 2fb7c: 9f 90 pop r9 2fb7e: 8f 90 pop r8 2fb80: 7f 90 pop r7 2fb82: 6f 90 pop r6 2fb84: 5f 90 pop r5 2fb86: 4f 90 pop r4 2fb88: 3f 90 pop r3 2fb8a: 2f 90 pop r2 2fb8c: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fb8e: 40 91 a3 14 lds r20, 0x14A3 ; 0x8014a3 2fb92: 50 91 a4 14 lds r21, 0x14A4 ; 0x8014a4 2fb96: 60 91 a5 14 lds r22, 0x14A5 ; 0x8014a5 2fb9a: 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; 2fb9e: b0 92 3a 15 sts 0x153A, r11 ; 0x80153a 2fba2: a0 92 39 15 sts 0x1539, r10 ; 0x801539 nrFiles = 1; 2fba6: 90 92 a9 17 sts 0x17A9, r9 ; 0x8017a9 2fbaa: 80 92 a8 17 sts 0x17A8, r8 ; 0x8017a8 curDir->seekSet(position); 2fbae: 8b e3 ldi r24, 0x3B ; 59 2fbb0: 95 e1 ldi r25, 0x15 ; 21 2fbb2: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 2fbb6: 1e 7f andi r17, 0xFE ; 254 2fbb8: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fbba: e0 91 39 15 lds r30, 0x1539 ; 0x801539 2fbbe: f0 91 3a 15 lds r31, 0x153A ; 0x80153a 2fbc2: 83 e2 ldi r24, 0x23 ; 35 2fbc4: de 01 movw r26, r28 2fbc6: 11 96 adiw r26, 0x01 ; 1 2fbc8: 01 90 ld r0, Z+ 2fbca: 0d 92 st X+, r0 2fbcc: 8a 95 dec r24 2fbce: e1 f7 brne .-8 ; 0x2fbc8 2fbd0: 01 2f mov r16, r17 2fbd2: 22 e0 ldi r18, 0x02 ; 2 2fbd4: 50 e0 ldi r21, 0x00 ; 0 2fbd6: 40 e0 ldi r20, 0x00 ; 0 2fbd8: be 01 movw r22, r28 2fbda: 6f 5f subi r22, 0xFF ; 255 2fbdc: 7f 4f sbci r23, 0xFF ; 255 2fbde: 89 ef ldi r24, 0xF9 ; 249 2fbe0: 92 e0 ldi r25, 0x02 ; 2 2fbe2: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 2fbe6: ce 01 movw r24, r28 2fbe8: 01 96 adiw r24, 0x01 ; 1 2fbea: 0e 94 38 77 call 0xee70 ; 0xee70 2fbee: 03 cf rjmp .-506 ; 0x2f9f6 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)) 2fbf0: 86 15 cp r24, r6 2fbf2: 97 05 cpc r25, r7 2fbf4: 08 f4 brcc .+2 ; 0x2fbf8 2fbf6: 9a cf rjmp .-204 ; 0x2fb2c break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fbf8: ee a9 ldd r30, Y+54 ; 0x36 2fbfa: ff a9 ldd r31, Y+55 ; 0x37 2fbfc: 53 82 std Z+3, r5 ; 0x03 2fbfe: 42 82 std Z+2, r4 ; 0x02 2fc00: 0c ad ldd r16, Y+60 ; 0x3c 2fc02: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fc04: 01 15 cp r16, r1 2fc06: 11 05 cpc r17, r1 2fc08: 09 f0 breq .+2 ; 0x2fc0c 2fc0a: 5d cf rjmp .-326 ; 0x2fac6 2fc0c: 8f cf rjmp .-226 ; 0x2fb2c 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)) 2fc0e: 22 20 and r2, r2 2fc10: 99 f3 breq .-26 ; 0x2fbf8 2fc12: 8c cf rjmp .-232 ; 0x2fb2c 2fc14: 31 e0 ldi r19, 0x01 ; 1 2fc16: 33 12 cpse r3, r19 2fc18: ef cf rjmp .-34 ; 0x2fbf8 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fc1a: 80 91 dc 14 lds r24, 0x14DC ; 0x8014dc 2fc1e: 28 12 cpse r2, r24 2fc20: 07 c0 rjmp .+14 ; 0x2fc30 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fc22: ce 01 movw r24, r28 2fc24: 01 96 adiw r24, 0x01 ; 1 2fc26: 0f 94 5c e2 call 0x3c4b8 ; 0x3c4b8 2fc2a: 97 fd sbrc r25, 7 2fc2c: e5 cf rjmp .-54 ; 0x2fbf8 2fc2e: 7e cf rjmp .-260 ; 0x2fb2c 2fc30: 21 10 cpse r2, r1 2fc32: e2 cf rjmp .-60 ; 0x2fbf8 2fc34: 7b cf rjmp .-266 ; 0x2fb2c 0002fc36 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fc36: cf 92 push r12 2fc38: df 92 push r13 2fc3a: ef 92 push r14 2fc3c: ff 92 push r15 2fc3e: 0f 93 push r16 2fc40: 1f 93 push r17 2fc42: cf 93 push r28 2fc44: df 93 push r29 2fc46: cd b7 in r28, 0x3d ; 61 2fc48: de b7 in r29, 0x3e ; 62 2fc4a: a3 97 sbiw r28, 0x23 ; 35 2fc4c: 0f b6 in r0, 0x3f ; 63 2fc4e: f8 94 cli 2fc50: de bf out 0x3e, r29 ; 62 2fc52: 0f be out 0x3f, r0 ; 63 2fc54: cd bf out 0x3d, r28 ; 61 2fc56: 7c 01 movw r14, r24 2fc58: 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) {} 2fc5a: 19 82 std Y+1, r1 ; 0x01 2fc5c: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fc5e: 80 91 3e 15 lds r24, 0x153E ; 0x80153e parent=&workDir; 2fc62: 9b e3 ldi r25, 0x3B ; 59 2fc64: c9 2e mov r12, r25 2fc66: 95 e1 ldi r25, 0x15 ; 21 2fc68: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fc6a: 81 11 cpse r24, r1 2fc6c: 04 c0 rjmp .+8 ; 0x2fc76 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fc6e: 86 e1 ldi r24, 0x16 ; 22 2fc70: c8 2e mov r12, r24 2fc72: 85 e1 ldi r24, 0x15 ; 21 2fc74: 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); 2fc76: 21 e0 ldi r18, 0x01 ; 1 2fc78: a7 01 movw r20, r14 2fc7a: b6 01 movw r22, r12 2fc7c: ce 01 movw r24, r28 2fc7e: 01 96 adiw r24, 0x01 ; 1 2fc80: 0f 94 1f 64 call 0x2c83e ; 0x2c83e 2fc84: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fc86: 88 23 and r24, r24 2fc88: 21 f1 breq .+72 ; 0x2fcd2 2fc8a: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2fc8e: 85 30 cpi r24, 0x05 ; 5 2fc90: 00 f5 brcc .+64 ; 0x2fcd2 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fc92: 29 e0 ldi r18, 0x09 ; 9 2fc94: 82 9f mul r24, r18 2fc96: c0 01 movw r24, r0 2fc98: 11 24 eor r1, r1 2fc9a: b7 01 movw r22, r14 2fc9c: 80 52 subi r24, 0x20 ; 32 2fc9e: 9b 4e sbci r25, 0xEB ; 235 2fca0: 0f 94 8e e2 call 0x3c51c ; 0x3c51c puts(relpath); 2fca4: c7 01 movw r24, r14 2fca6: 0f 94 b2 e2 call 0x3c564 ; 0x3c564 if (workDirDepth < MAX_DIR_DEPTH) { 2fcaa: 80 91 30 16 lds r24, 0x1630 ; 0x801630 2fcae: 86 30 cpi r24, 0x06 ; 6 2fcb0: 80 f1 brcs .+96 ; 0x2fd12 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fcb2: 83 e2 ldi r24, 0x23 ; 35 2fcb4: fe 01 movw r30, r28 2fcb6: 31 96 adiw r30, 0x01 ; 1 2fcb8: ab e3 ldi r26, 0x3B ; 59 2fcba: b5 e1 ldi r27, 0x15 ; 21 2fcbc: 01 90 ld r0, Z+ 2fcbe: 0d 92 st X+, r0 2fcc0: 8a 95 dec r24 2fcc2: e1 f7 brne .-8 ; 0x2fcbc #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fcc4: 00 23 and r16, r16 2fcc6: 09 f4 brne .+2 ; 0x2fcca 2fcc8: 4c c0 rjmp .+152 ; 0x2fd62 presort(); 2fcca: 0f 94 99 7c call 0x2f932 ; 0x2f932 else presort_flag = true; #endif return 1; 2fcce: 10 2f mov r17, r16 2fcd0: 0c c0 rjmp .+24 ; 0x2fcea if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fcd2: 80 ed ldi r24, 0xD0 ; 208 2fcd4: 9b ea ldi r25, 0xAB ; 171 2fcd6: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fcda: 86 ed ldi r24, 0xD6 ; 214 2fcdc: 90 e7 ldi r25, 0x70 ; 112 2fcde: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(relpath); 2fce2: c7 01 movw r24, r14 2fce4: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e return 0; 2fce8: 10 e0 ldi r17, 0x00 ; 0 2fcea: ce 01 movw r24, r28 2fcec: 01 96 adiw r24, 0x01 ; 1 2fcee: 0e 94 38 77 call 0xee70 ; 0xee70 else presort_flag = true; #endif return 1; } } 2fcf2: 81 2f mov r24, r17 2fcf4: a3 96 adiw r28, 0x23 ; 35 2fcf6: 0f b6 in r0, 0x3f ; 63 2fcf8: f8 94 cli 2fcfa: de bf out 0x3e, r29 ; 62 2fcfc: 0f be out 0x3f, r0 ; 63 2fcfe: cd bf out 0x3d, r28 ; 61 2fd00: df 91 pop r29 2fd02: cf 91 pop r28 2fd04: 1f 91 pop r17 2fd06: 0f 91 pop r16 2fd08: ff 90 pop r15 2fd0a: ef 90 pop r14 2fd0c: df 90 pop r13 2fd0e: cf 90 pop r12 2fd10: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fd12: 8f 5f subi r24, 0xFF ; 255 2fd14: 80 93 30 16 sts 0x1630, r24 ; 0x801630 workDirParents[d+1] = workDirParents[d]; 2fd18: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fd1a: 81 50 subi r24, 0x01 ; 1 2fd1c: c8 f0 brcs .+50 ; 0x2fd50 workDirParents[d+1] = workDirParents[d]; 2fd1e: 28 2f mov r18, r24 2fd20: 30 e0 ldi r19, 0x00 ; 0 2fd22: a9 01 movw r20, r18 2fd24: 4f 5f subi r20, 0xFF ; 255 2fd26: 5f 4f sbci r21, 0xFF ; 255 2fd28: 94 9f mul r25, r20 2fd2a: d0 01 movw r26, r0 2fd2c: 95 9f mul r25, r21 2fd2e: b0 0d add r27, r0 2fd30: 11 24 eor r1, r1 2fd32: a2 5a subi r26, 0xA2 ; 162 2fd34: ba 4e sbci r27, 0xEA ; 234 2fd36: 92 9f mul r25, r18 2fd38: f0 01 movw r30, r0 2fd3a: 93 9f mul r25, r19 2fd3c: f0 0d add r31, r0 2fd3e: 11 24 eor r1, r1 2fd40: e2 5a subi r30, 0xA2 ; 162 2fd42: fa 4e sbci r31, 0xEA ; 234 2fd44: 29 2f mov r18, r25 2fd46: 01 90 ld r0, Z+ 2fd48: 0d 92 st X+, r0 2fd4a: 2a 95 dec r18 2fd4c: e1 f7 brne .-8 ; 0x2fd46 2fd4e: e5 cf rjmp .-54 ; 0x2fd1a workDirParents[0]=*parent; 2fd50: 83 e2 ldi r24, 0x23 ; 35 2fd52: f6 01 movw r30, r12 2fd54: ae e5 ldi r26, 0x5E ; 94 2fd56: b5 e1 ldi r27, 0x15 ; 21 2fd58: 01 90 ld r0, Z+ 2fd5a: 0d 92 st X+, r0 2fd5c: 8a 95 dec r24 2fd5e: e1 f7 brne .-8 ; 0x2fd58 2fd60: a8 cf rjmp .-176 ; 0x2fcb2 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fd62: 81 e0 ldi r24, 0x01 ; 1 2fd64: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df 2fd68: c0 cf rjmp .-128 ; 0x2fcea 0002fd6a : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fd6a: 93 e2 ldi r25, 0x23 ; 35 2fd6c: e6 e1 ldi r30, 0x16 ; 22 2fd6e: f5 e1 ldi r31, 0x15 ; 21 2fd70: ab e3 ldi r26, 0x3B ; 59 2fd72: b5 e1 ldi r27, 0x15 ; 21 2fd74: 01 90 ld r0, Z+ 2fd76: 0d 92 st X+, r0 2fd78: 9a 95 dec r25 2fd7a: e1 f7 brne .-8 ; 0x2fd74 workDirDepth = 0; 2fd7c: 10 92 30 16 sts 0x1630, r1 ; 0x801630 curDir=&workDir; 2fd80: 2b e3 ldi r18, 0x3B ; 59 2fd82: 35 e1 ldi r19, 0x15 ; 21 2fd84: 30 93 3a 15 sts 0x153A, r19 ; 0x80153a 2fd88: 20 93 39 15 sts 0x1539, r18 ; 0x801539 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fd8c: 81 11 cpse r24, r1 presort(); 2fd8e: 0d 94 99 7c jmp 0x2f932 ; 0x2f932 else presort_flag = true; 2fd92: 81 e0 ldi r24, 0x01 ; 1 2fd94: 80 93 df 14 sts 0x14DF, r24 ; 0x8014df #endif } 2fd98: 08 95 ret 0002fd9a : * * @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) 2fd9a: 8f 92 push r8 2fd9c: 9f 92 push r9 2fd9e: af 92 push r10 2fda0: bf 92 push r11 2fda2: cf 92 push r12 2fda4: df 92 push r13 2fda6: ef 92 push r14 2fda8: ff 92 push r15 2fdaa: 0f 93 push r16 2fdac: 1f 93 push r17 2fdae: cf 93 push r28 2fdb0: df 93 push r29 2fdb2: cd b7 in r28, 0x3d ; 61 2fdb4: de b7 in r29, 0x3e ; 62 2fdb6: 2d 97 sbiw r28, 0x0d ; 13 2fdb8: 0f b6 in r0, 0x3f ; 63 2fdba: f8 94 cli 2fdbc: de bf out 0x3e, r29 ; 62 2fdbe: 0f be out 0x3f, r0 ; 63 2fdc0: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2fdc2: 26 e1 ldi r18, 0x16 ; 22 2fdc4: 35 e1 ldi r19, 0x15 ; 21 2fdc6: 30 93 3a 15 sts 0x153A, r19 ; 0x80153a 2fdca: 20 93 39 15 sts 0x1539, r18 ; 0x801539 if (!fileName) 2fdce: dc 01 movw r26, r24 2fdd0: ed 91 ld r30, X+ 2fdd2: fc 91 ld r31, X 2fdd4: 30 97 sbiw r30, 0x00 ; 0 2fdd6: a1 f4 brne .+40 ; 0x2fe00 } else //relative path { curDir = &workDir; } return 1; 2fdd8: 81 e0 ldi r24, 0x01 ; 1 } 2fdda: 2d 96 adiw r28, 0x0d ; 13 2fddc: 0f b6 in r0, 0x3f ; 63 2fdde: f8 94 cli 2fde0: de bf out 0x3e, r29 ; 62 2fde2: 0f be out 0x3f, r0 ; 63 2fde4: cd bf out 0x3d, r28 ; 61 2fde6: df 91 pop r29 2fde8: cf 91 pop r28 2fdea: 1f 91 pop r17 2fdec: 0f 91 pop r16 2fdee: ff 90 pop r15 2fdf0: ef 90 pop r14 2fdf2: df 90 pop r13 2fdf4: cf 90 pop r12 2fdf6: bf 90 pop r11 2fdf8: af 90 pop r10 2fdfa: 9f 90 pop r9 2fdfc: 8f 90 pop r8 2fdfe: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2fe00: 20 81 ld r18, Z 2fe02: 2f 32 cpi r18, 0x2F ; 47 2fe04: 09 f0 breq .+2 ; 0x2fe08 2fe06: 47 c0 rjmp .+142 ; 0x2fe96 2fe08: 6c 01 movw r12, r24 { cdroot(false); 2fe0a: 80 e0 ldi r24, 0x00 ; 0 2fe0c: 0f 94 b5 7e call 0x2fd6a ; 0x2fd6a dirname_start = fileName + 1; 2fe10: f6 01 movw r30, r12 2fe12: 00 81 ld r16, Z 2fe14: 11 81 ldd r17, Z+1 ; 0x01 2fe16: 0f 5f subi r16, 0xFF ; 255 2fe18: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2fe1a: 9b e3 ldi r25, 0x3B ; 59 2fe1c: 89 2e mov r8, r25 2fe1e: 95 e1 ldi r25, 0x15 ; 21 2fe20: 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) 2fe22: d8 01 movw r26, r16 2fe24: 8c 91 ld r24, X 2fe26: 88 23 and r24, r24 2fe28: b9 f2 breq .-82 ; 0x2fdd8 { dirname_end = strchr(dirname_start, '/'); 2fe2a: 6f e2 ldi r22, 0x2F ; 47 2fe2c: 70 e0 ldi r23, 0x00 ; 0 2fe2e: c8 01 movw r24, r16 2fe30: 0f 94 7a e2 call 0x3c4f4 ; 0x3c4f4 2fe34: 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) 2fe36: 00 97 sbiw r24, 0x00 ; 0 2fe38: 51 f1 breq .+84 ; 0x2fe8e 2fe3a: 08 17 cp r16, r24 2fe3c: 19 07 cpc r17, r25 2fe3e: 38 f5 brcc .+78 ; 0x2fe8e { 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); 2fe40: 7c 01 movw r14, r24 2fe42: e0 1a sub r14, r16 2fe44: f1 0a sbc r15, r17 2fe46: bd e0 ldi r27, 0x0D ; 13 2fe48: eb 16 cp r14, r27 2fe4a: f1 04 cpc r15, r1 2fe4c: 18 f0 brcs .+6 ; 0x2fe54 2fe4e: 8c e0 ldi r24, 0x0C ; 12 2fe50: e8 2e mov r14, r24 2fe52: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2fe54: a7 01 movw r20, r14 2fe56: b8 01 movw r22, r16 2fe58: ce 01 movw r24, r28 2fe5a: 01 96 adiw r24, 0x01 ; 1 2fe5c: 0f 94 a3 e2 call 0x3c546 ; 0x3c546 subdirname[len] = 0; 2fe60: e1 e0 ldi r30, 0x01 ; 1 2fe62: f0 e0 ldi r31, 0x00 ; 0 2fe64: ec 0f add r30, r28 2fe66: fd 1f adc r31, r29 2fe68: ee 0d add r30, r14 2fe6a: ff 1d adc r31, r15 2fe6c: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2fe6e: 60 e0 ldi r22, 0x00 ; 0 2fe70: ce 01 movw r24, r28 2fe72: 01 96 adiw r24, 0x01 ; 1 2fe74: 0f 94 1b 7e call 0x2fc36 ; 0x2fc36 2fe78: 88 23 and r24, r24 2fe7a: 09 f4 brne .+2 ; 0x2fe7e 2fe7c: ae cf rjmp .-164 ; 0x2fdda return 0; curDir = &workDir; 2fe7e: 90 92 3a 15 sts 0x153A, r9 ; 0x80153a 2fe82: 80 92 39 15 sts 0x1539, r8 ; 0x801539 dirname_start = dirname_end + 1; 2fe86: 85 01 movw r16, r10 2fe88: 0f 5f subi r16, 0xFF ; 255 2fe8a: 1f 4f sbci r17, 0xFF ; 255 2fe8c: ca cf rjmp .-108 ; 0x2fe22 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2fe8e: f6 01 movw r30, r12 2fe90: 11 83 std Z+1, r17 ; 0x01 2fe92: 00 83 st Z, r16 2fe94: a1 cf rjmp .-190 ; 0x2fdd8 } } else //relative path { curDir = &workDir; 2fe96: 8b e3 ldi r24, 0x3B ; 59 2fe98: 95 e1 ldi r25, 0x15 ; 21 2fe9a: 90 93 3a 15 sts 0x153A, r25 ; 0x80153a 2fe9e: 80 93 39 15 sts 0x1539, r24 ; 0x801539 2fea2: 9a cf rjmp .-204 ; 0x2fdd8 0002fea4 : 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*/){ 2fea4: bf 92 push r11 2fea6: cf 92 push r12 2fea8: df 92 push r13 2feaa: ef 92 push r14 2feac: ff 92 push r15 2feae: 0f 93 push r16 2feb0: 1f 93 push r17 2feb2: cf 93 push r28 2feb4: df 93 push r29 2feb6: 1f 92 push r1 2feb8: 1f 92 push r1 2feba: cd b7 in r28, 0x3d ; 61 2febc: de b7 in r29, 0x3e ; 62 if(!mounted) 2febe: 20 91 91 14 lds r18, 0x1491 ; 0x801491 2fec2: 22 23 and r18, r18 2fec4: 09 f4 brne .+2 ; 0x2fec8 2fec6: ef c0 rjmp .+478 ; 0x300a6 2fec8: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2feca: 80 91 23 17 lds r24, 0x1723 ; 0x801723 2fece: 88 23 and r24, r24 2fed0: 09 f4 brne .+2 ; 0x2fed4 2fed2: 04 c1 rjmp .+520 ; 0x300dc if(!replace_current){ 2fed4: 61 11 cpse r22, r1 2fed6: f6 c0 rjmp .+492 ; 0x300c4 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2fed8: d0 90 43 17 lds r13, 0x1743 ; 0x801743 2fedc: dd 20 and r13, r13 2fede: 21 f0 breq .+8 ; 0x2fee8 // 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); 2fee0: 8a ea ldi r24, 0xAA ; 170 2fee2: 9a ea ldi r25, 0xAA ; 170 2fee4: 0e 94 11 7a call 0xf422 ; 0xf422 return; } SERIAL_ECHO_START; 2fee8: 80 ed ldi r24, 0xD0 ; 208 2feea: 9b ea ldi r25, 0xAB ; 171 2feec: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(ofSubroutineCallTgt); 2fef0: 81 e9 ldi r24, 0x91 ; 145 2fef2: 9a ea ldi r25, 0xAA ; 170 2fef4: 0e 94 57 77 call 0xeeae ; 0xeeae 2fef8: c7 01 movw r24, r14 2fefa: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2fefe: 86 e8 ldi r24, 0x86 ; 134 2ff00: 9a ea ldi r25, 0xAA ; 170 2ff02: 0e 94 57 77 call 0xeeae ; 0xeeae //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2ff06: 00 91 43 17 lds r16, 0x1743 ; 0x801743 2ff0a: 25 e5 ldi r18, 0x55 ; 85 2ff0c: 02 9f mul r16, r18 2ff0e: 80 01 movw r16, r0 2ff10: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2ff12: 08 5b subi r16, 0xB8 ; 184 2ff14: 18 4e sbci r17, 0xE8 ; 232 2ff16: 8f e2 ldi r24, 0x2F ; 47 2ff18: f8 01 movw r30, r16 2ff1a: 81 93 st Z+, r24 2ff1c: 8f 01 movw r16, r30 2ff1e: cc 24 eor r12, r12 2ff20: c3 94 inc r12 for(uint8_t i=0;i 2ff2a: d8 16 cp r13, r24 2ff2c: b0 f4 brcc .+44 ; 0x2ff5a { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2ff2e: db 9c mul r13, r11 2ff30: c0 01 movw r24, r0 2ff32: 11 24 eor r1, r1 2ff34: b8 01 movw r22, r16 2ff36: 82 5a subi r24, 0xA2 ; 162 2ff38: 9a 4e sbci r25, 0xEA ; 234 2ff3a: 0f 94 80 58 call 0x2b100 ; 0x2b100 2ff3e: c8 01 movw r24, r16 2ff40: 8c 01 movw r16, r24 2ff42: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2ff44: f8 01 movw r30, r16 2ff46: 20 81 ld r18, Z 2ff48: 22 23 and r18, r18 2ff4a: 29 f0 breq .+10 ; 0x2ff56 2ff4c: f4 e5 ldi r31, 0x54 ; 84 2ff4e: fc 15 cp r31, r12 2ff50: 10 f0 brcs .+4 ; 0x2ff56 {t++;cnt++;} //crawl counter forward. 2ff52: c3 94 inc r12 2ff54: f5 cf rjmp .-22 ; 0x2ff40 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) 2ff5a: 27 e4 ldi r18, 0x47 ; 71 2ff5c: 2c 15 cp r18, r12 2ff5e: 08 f4 brcc .+2 ; 0x2ff62 2ff60: ae c0 rjmp .+348 ; 0x300be file.getFilename(t); 2ff62: b8 01 movw r22, r16 2ff64: 80 e2 ldi r24, 0x20 ; 32 2ff66: 97 e1 ldi r25, 0x17 ; 23 2ff68: 0f 94 80 58 call 0x2b100 ; 0x2b100 SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2ff6c: 80 91 43 17 lds r24, 0x1743 ; 0x801743 2ff70: f5 e5 ldi r31, 0x55 ; 85 2ff72: 8f 9f mul r24, r31 2ff74: c0 01 movw r24, r0 2ff76: 11 24 eor r1, r1 2ff78: 88 5b subi r24, 0xB8 ; 184 2ff7a: 98 4e sbci r25, 0xE8 ; 232 2ff7c: 0e 94 1b 88 call 0x11036 ; 0x11036 SERIAL_ECHORPGM(ofPos); 2ff80: 80 e8 ldi r24, 0x80 ; 128 2ff82: 9a ea ldi r25, 0xAA ; 170 2ff84: 0e 94 57 77 call 0xeeae ; 0xeeae } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2ff88: 60 91 a4 17 lds r22, 0x17A4 ; 0x8017a4 2ff8c: 70 91 a5 17 lds r23, 0x17A5 ; 0x8017a5 2ff90: 80 91 a6 17 lds r24, 0x17A6 ; 0x8017a6 2ff94: 90 91 a7 17 lds r25, 0x17A7 ; 0x8017a7 2ff98: 4a e0 ldi r20, 0x0A ; 10 2ff9a: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2ff9e: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2ffa2: 80 91 43 17 lds r24, 0x1743 ; 0x801743 2ffa6: 24 e0 ldi r18, 0x04 ; 4 2ffa8: 82 9f mul r24, r18 2ffaa: f0 01 movw r30, r0 2ffac: 11 24 eor r1, r1 2ffae: ec 5b subi r30, 0xBC ; 188 2ffb0: f8 4e sbci r31, 0xE8 ; 232 2ffb2: 40 91 a4 17 lds r20, 0x17A4 ; 0x8017a4 2ffb6: 50 91 a5 17 lds r21, 0x17A5 ; 0x8017a5 2ffba: 60 91 a6 17 lds r22, 0x17A6 ; 0x8017a6 2ffbe: 70 91 a7 17 lds r23, 0x17A7 ; 0x8017a7 2ffc2: 40 83 st Z, r20 2ffc4: 51 83 std Z+1, r21 ; 0x01 2ffc6: 62 83 std Z+2, r22 ; 0x02 2ffc8: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2ffca: 8f 5f subi r24, 0xFF ; 255 2ffcc: 80 93 43 17 sts 0x1743, r24 ; 0x801743 } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2ffd0: 80 e2 ldi r24, 0x20 ; 32 2ffd2: 97 e1 ldi r25, 0x17 ; 23 2ffd4: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee 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; 2ffd8: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 2ffdc: fa 82 std Y+2, r15 ; 0x02 2ffde: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2ffe0: ce 01 movw r24, r28 2ffe2: 01 96 adiw r24, 0x01 ; 1 2ffe4: 0f 94 cd 7e call 0x2fd9a ; 0x2fd9a 2ffe8: 88 23 and r24, r24 2ffea: 09 f4 brne .+2 ; 0x2ffee 2ffec: 5c c0 rjmp .+184 ; 0x300a6 */ 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) ){ 2ffee: 49 81 ldd r20, Y+1 ; 0x01 2fff0: 5a 81 ldd r21, Y+2 ; 0x02 2fff2: 60 91 39 15 lds r22, 0x1539 ; 0x801539 2fff6: 70 91 3a 15 lds r23, 0x153A ; 0x80153a 2fffa: 21 e0 ldi r18, 0x01 ; 1 2fffc: 80 e2 ldi r24, 0x20 ; 32 2fffe: 97 e1 ldi r25, 0x17 ; 23 30000: 0f 94 1f 64 call 0x2c83e ; 0x2c83e 30004: 88 23 and r24, r24 30006: 09 f4 brne .+2 ; 0x3000a 30008: 77 c0 rjmp .+238 ; 0x300f8 // compute the block to start with if( ! gfComputeNextFileBlock() ) 3000a: 80 e2 ldi r24, 0x20 ; 32 3000c: 97 e1 ldi r25, 0x17 ; 23 3000e: 0f 94 20 56 call 0x2ac40 ; 0x2ac40 30012: 88 23 and r24, r24 30014: 09 f4 brne .+2 ; 0x30018 30016: 70 c0 rjmp .+224 ; 0x300f8 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; 30018: 80 91 41 17 lds r24, 0x1741 ; 0x801741 3001c: 90 91 42 17 lds r25, 0x1742 ; 0x801742 30020: 83 56 subi r24, 0x63 ; 99 30022: 91 4f sbci r25, 0xF1 ; 241 30024: 90 93 3c 17 sts 0x173C, r25 ; 0x80173c 30028: 80 93 3b 17 sts 0x173B, r24 ; 0x80173b return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 3002c: 89 81 ldd r24, Y+1 ; 0x01 3002e: 9a 81 ldd r25, Y+2 ; 0x02 30030: 0f 94 45 79 call 0x2f28a ; 0x2f28a filesize = file.fileSize(); 30034: 80 91 31 17 lds r24, 0x1731 ; 0x801731 30038: 90 91 32 17 lds r25, 0x1732 ; 0x801732 3003c: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30040: b0 91 34 17 lds r27, 0x1734 ; 0x801734 30044: 80 93 9d 17 sts 0x179D, r24 ; 0x80179d 30048: 90 93 9e 17 sts 0x179E, r25 ; 0x80179e 3004c: a0 93 9f 17 sts 0x179F, r26 ; 0x80179f 30050: b0 93 a0 17 sts 0x17A0, r27 ; 0x8017a0 SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 30054: 80 e5 ldi r24, 0x50 ; 80 30056: 9a ea ldi r25, 0xAA ; 170 30058: 0e 94 57 77 call 0xeeae ; 0xeeae printAbsFilenameFast(); 3005c: 0f 94 28 7a call 0x2f450 ; 0x2f450 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 30060: 88 e4 ldi r24, 0x48 ; 72 30062: 9a ea ldi r25, 0xAA ; 170 30064: 0e 94 57 77 call 0xeeae ; 0xeeae } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 30068: 60 91 9d 17 lds r22, 0x179D ; 0x80179d 3006c: 70 91 9e 17 lds r23, 0x179E ; 0x80179e 30070: 80 91 9f 17 lds r24, 0x179F ; 0x80179f 30074: 90 91 a0 17 lds r25, 0x17A0 ; 0x8017a0 30078: 4a e0 ldi r20, 0x0A ; 10 3007a: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 3007e: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 30082: 10 92 a4 17 sts 0x17A4, r1 ; 0x8017a4 30086: 10 92 a5 17 sts 0x17A5, r1 ; 0x8017a5 3008a: 10 92 a6 17 sts 0x17A6, r1 ; 0x8017a6 3008e: 10 92 a7 17 sts 0x17A7, r1 ; 0x8017a7 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30092: 8a e3 ldi r24, 0x3A ; 58 30094: 9a ea ldi r25, 0xAA ; 170 30096: 0e 94 82 79 call 0xf304 ; 0xf304 lcd_setstatuspgm(ofFileSelected); 3009a: 8a e3 ldi r24, 0x3A ; 58 3009c: 9a ea ldi r25, 0xAA ; 170 3009e: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 scrollstuff = 0; 300a2: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 300a6: 0f 90 pop r0 300a8: 0f 90 pop r0 300aa: df 91 pop r29 300ac: cf 91 pop r28 300ae: 1f 91 pop r17 300b0: 0f 91 pop r16 300b2: ff 90 pop r15 300b4: ef 90 pop r14 300b6: df 90 pop r13 300b8: cf 90 pop r12 300ba: bf 90 pop r11 300bc: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 300be: f8 01 movw r30, r16 300c0: 10 82 st Z, r1 300c2: 54 cf rjmp .-344 ; 0x2ff6c SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 300c4: 80 ed ldi r24, 0xD0 ; 208 300c6: 9b ea ldi r25, 0xAB ; 171 300c8: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(ofNowDoingFile); 300cc: 8f e6 ldi r24, 0x6F ; 111 300ce: 9a ea ldi r25, 0xAA ; 170 300d0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(name); 300d4: c7 01 movw r24, r14 300d6: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 300da: 7a cf rjmp .-268 ; 0x2ffd0 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 300dc: 10 92 43 17 sts 0x1743, r1 ; 0x801743 SERIAL_ECHO_START; 300e0: 80 ed ldi r24, 0xD0 ; 208 300e2: 9b ea ldi r25, 0xAB ; 171 300e4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(ofNowFreshFile); 300e8: 8e e5 ldi r24, 0x5E ; 94 300ea: 9a ea ldi r25, 0xAA ; 170 300ec: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(name); 300f0: c7 01 movw r24, r14 300f2: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 300f6: 70 cf rjmp .-288 ; 0x2ffd8 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 300f8: 82 ec ldi r24, 0xC2 ; 194 300fa: 90 e7 ldi r25, 0x70 ; 112 300fc: 0e 94 57 77 call 0xeeae ; 0xeeae 30100: 89 81 ldd r24, Y+1 ; 0x01 30102: 9a 81 ldd r25, Y+2 ; 0x02 30104: 0e 94 1b 88 call 0x11036 ; 0x11036 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30108: 8e e2 ldi r24, 0x2E ; 46 3010a: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3010e: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 30112: c9 cf rjmp .-110 ; 0x300a6 00030114 : void CardReader::printingHasFinished() { st_synchronize(); 30114: 0f 94 ef 42 call 0x285de ; 0x285de file.close(); 30118: 80 e2 ldi r24, 0x20 ; 32 3011a: 97 e1 ldi r25, 0x17 ; 23 3011c: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 30120: 80 91 43 17 lds r24, 0x1743 ; 0x801743 30124: 88 23 and r24, r24 30126: 69 f1 breq .+90 ; 0x30182 { file_subcall_ctr--; 30128: 81 50 subi r24, 0x01 ; 1 3012a: 80 93 43 17 sts 0x1743, r24 ; 0x801743 openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 3012e: 25 e5 ldi r18, 0x55 ; 85 30130: 82 9f mul r24, r18 30132: c0 01 movw r24, r0 30134: 11 24 eor r1, r1 30136: 61 e0 ldi r22, 0x01 ; 1 30138: 88 5b subi r24, 0xB8 ; 184 3013a: 98 4e sbci r25, 0xE8 ; 232 3013c: 0f 94 52 7f call 0x2fea4 ; 0x2fea4 setIndex(filespos[file_subcall_ctr]); 30140: e0 91 43 17 lds r30, 0x1743 ; 0x801743 30144: 84 e0 ldi r24, 0x04 ; 4 30146: e8 9f mul r30, r24 30148: f0 01 movw r30, r0 3014a: 11 24 eor r1, r1 3014c: ec 5b subi r30, 0xBC ; 188 3014e: f8 4e sbci r31, 0xE8 ; 232 30150: 60 81 ld r22, Z 30152: 71 81 ldd r23, Z+1 ; 0x01 30154: 82 81 ldd r24, Z+2 ; 0x02 30156: 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);}; 30158: 60 93 a4 17 sts 0x17A4, r22 ; 0x8017a4 3015c: 70 93 a5 17 sts 0x17A5, r23 ; 0x8017a5 30160: 80 93 a6 17 sts 0x17A6, r24 ; 0x8017a6 30164: 90 93 a7 17 sts 0x17A7, r25 ; 0x8017a7 30168: 0f 94 a3 75 call 0x2eb46 ; 0x2eb46 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 3016c: 80 91 91 14 lds r24, 0x1491 ; 0x801491 30170: 88 23 and r24, r24 30172: 71 f0 breq .+28 ; 0x30190 { sdprinting = true; 30174: 81 e0 ldi r24, 0x01 ; 1 30176: 80 93 90 14 sts 0x1490, r24 ; 0x801490 3017a: 85 e0 ldi r24, 0x05 ; 5 3017c: 80 93 b8 0d sts 0x0DB8, r24 ; 0x800db8 <_ZL13printer_state.lto_priv.401> 30180: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 30182: 10 92 90 14 sts 0x1490, r1 ; 0x801490 30186: 83 e0 ldi r24, 0x03 ; 3 30188: 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(); 3018c: 0c 94 6f 82 jmp 0x104de ; 0x104de autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 30190: 08 95 ret 00030192 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 30192: cf 92 push r12 30194: df 92 push r13 30196: ef 92 push r14 30198: ff 92 push r15 3019a: 0f 93 push r16 3019c: 1f 93 push r17 3019e: cf 93 push r28 301a0: df 93 push r29 301a2: 08 2f mov r16, r24 { mounted = false; 301a4: 10 92 91 14 sts 0x1491, r1 ; 0x801491 if(root.isOpen()) 301a8: 80 91 19 15 lds r24, 0x1519 ; 0x801519 301ac: 88 23 and r24, r24 301ae: 21 f0 breq .+8 ; 0x301b8 root.close(); 301b0: 86 e1 ldi r24, 0x16 ; 22 301b2: 95 e1 ldi r25, 0x15 ; 21 301b4: 0f 94 77 58 call 0x2b0ee ; 0x2b0ee * \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; 301b8: 10 92 00 17 sts 0x1700, r1 ; 0x801700 301bc: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 301c0: 0f 94 53 29 call 0x252a6 ; 0x252a6 301c4: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 301c6: 0f 94 c6 74 call 0x2e98c ; 0x2e98c SET_OUTPUT(SDSS); 301ca: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 301ce: 80 64 ori r24, 0x40 ; 64 301d0: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 301d4: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 301d6: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 301d8: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 301da: 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); 301dc: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 301de: 85 e0 ldi r24, 0x05 ; 5 301e0: 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); 301e4: 82 e5 ldi r24, 0x52 ; 82 301e6: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 301e8: 1d bc out 0x2d, r1 ; 45 301ea: 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); 301ec: 8f ef ldi r24, 0xFF ; 255 301ee: 0f 94 4c 52 call 0x2a498 ; 0x2a498 301f2: 11 50 subi r17, 0x01 ; 1 301f4: d9 f7 brne .-10 ; 0x301ec WRITE(MISO, 1); // temporarily enable the MISO line pullup 301f6: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 301f8: 20 e0 ldi r18, 0x00 ; 0 301fa: 30 e0 ldi r19, 0x00 ; 0 301fc: a9 01 movw r20, r18 301fe: 60 e0 ldi r22, 0x00 ; 0 30200: 8d ef ldi r24, 0xFD ; 253 30202: 96 e1 ldi r25, 0x16 ; 22 30204: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 30208: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 3020c: 81 30 cpi r24, 0x01 ; 1 3020e: 61 f0 breq .+24 ; 0x30228 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30210: 0f 94 53 29 call 0x252a6 ; 0x252a6 30214: 6c 1b sub r22, r28 30216: 7d 0b sbc r23, r29 30218: 61 3d cpi r22, 0xD1 ; 209 3021a: 77 40 sbci r23, 0x07 ; 7 3021c: 68 f3 brcs .-38 ; 0x301f8 WRITE(MISO, 0); // disable the MISO line pullup 3021e: 2b 98 cbi 0x05, 3 ; 5 30220: 81 e0 ldi r24, 0x01 ; 1 30222: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd 30226: 22 c0 rjmp .+68 ; 0x3026c error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 30228: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 3022a: 0f 94 53 29 call 0x252a6 ; 0x252a6 3022e: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 30230: 8d e2 ldi r24, 0x2D ; 45 30232: 9a ea ldi r25, 0xAA ; 170 30234: 0e 94 82 79 call 0xf304 ; 0xf304 spiSend(0XFF); 30238: 8f ef ldi r24, 0xFF ; 255 3023a: 0f 94 4c 52 call 0x2a498 ; 0x2a498 while ((status_ = spiRec()) != 0xFF) 3023e: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30242: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30246: 8f 3f cpi r24, 0xFF ; 255 30248: 59 f1 breq .+86 ; 0x302a0 { spiSend(0XFF); 3024a: 8f ef ldi r24, 0xFF ; 255 3024c: 0f 94 4c 52 call 0x2a498 ; 0x2a498 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 30250: 0f 94 53 29 call 0x252a6 ; 0x252a6 30254: 6c 1b sub r22, r28 30256: 7d 0b sbc r23, r29 30258: 62 32 cpi r22, 0x22 ; 34 3025a: 71 05 cpc r23, r1 3025c: 80 f3 brcs .-32 ; 0x3023e 3025e: 82 e0 ldi r24, 0x02 ; 2 30260: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 30264: 8c e1 ldi r24, 0x1C ; 28 30266: 9a ea ldi r25, 0xAA ; 170 30268: 0e 94 82 79 call 0xf304 ; 0xf304 #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 3026c: 0f 94 c6 74 call 0x2e98c ; 0x2e98c #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 30270: 80 ed ldi r24, 0xD0 ; 208 30272: 9b ea ldi r25, 0xAB ; 171 30274: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 30278: 85 eb ldi r24, 0xB5 ; 181 3027a: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 3027c: 0e 94 82 79 call 0xf304 ; 0xf304 } if (mounted) 30280: 80 91 91 14 lds r24, 0x1491 ; 0x801491 30284: 88 23 and r24, r24 30286: 09 f4 brne .+2 ; 0x3028a 30288: 9a c0 rjmp .+308 ; 0x303be { cdroot(doPresort); 3028a: 80 2f mov r24, r16 } } 3028c: df 91 pop r29 3028e: cf 91 pop r28 30290: 1f 91 pop r17 30292: 0f 91 pop r16 30294: ff 90 pop r15 30296: ef 90 pop r14 30298: df 90 pop r13 3029a: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 3029c: 0d 94 b5 7e jmp 0x2fd6a ; 0x2fd6a goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 302a0: 2a ea ldi r18, 0xAA ; 170 302a2: 31 e0 ldi r19, 0x01 ; 1 302a4: 40 e0 ldi r20, 0x00 ; 0 302a6: 50 e0 ldi r21, 0x00 ; 0 302a8: 68 e0 ldi r22, 0x08 ; 8 302aa: 8d ef ldi r24, 0xFD ; 253 302ac: 96 e1 ldi r25, 0x16 ; 22 302ae: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 302b2: 82 ff sbrs r24, 2 302b4: 2b c0 rjmp .+86 ; 0x3030c 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;} 302b6: 81 e0 ldi r24, 0x01 ; 1 302b8: 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; 302bc: 80 91 00 17 lds r24, 0x1700 ; 0x801700 302c0: c1 2c mov r12, r1 302c2: d1 2c mov r13, r1 302c4: 76 01 movw r14, r12 302c6: 82 30 cpi r24, 0x02 ; 2 302c8: 29 f4 brne .+10 ; 0x302d4 302ca: c1 2c mov r12, r1 302cc: d1 2c mov r13, r1 302ce: e1 2c mov r14, r1 302d0: 80 e4 ldi r24, 0x40 ; 64 302d2: 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); 302d4: 20 e0 ldi r18, 0x00 ; 0 302d6: 30 e0 ldi r19, 0x00 ; 0 302d8: a9 01 movw r20, r18 302da: 67 e3 ldi r22, 0x37 ; 55 302dc: 8d ef ldi r24, 0xFD ; 253 302de: 96 e1 ldi r25, 0x16 ; 22 302e0: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 return cardCommand(cmd, arg); 302e4: a7 01 movw r20, r14 302e6: 96 01 movw r18, r12 302e8: 69 e2 ldi r22, 0x29 ; 41 302ea: 8d ef ldi r24, 0xFD ; 253 302ec: 96 e1 ldi r25, 0x16 ; 22 302ee: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 302f2: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 302f6: 88 23 and r24, r24 302f8: b1 f0 breq .+44 ; 0x30326 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 302fa: 0f 94 53 29 call 0x252a6 ; 0x252a6 302fe: 6c 1b sub r22, r28 30300: 7d 0b sbc r23, r29 30302: 61 3d cpi r22, 0xD1 ; 209 30304: 77 40 sbci r23, 0x07 ; 7 30306: 30 f3 brcs .-52 ; 0x302d4 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30308: 8a e0 ldi r24, 0x0A ; 10 3030a: 8b cf rjmp .-234 ; 0x30222 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 3030c: 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(); 3030e: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30312: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30316: 11 50 subi r17, 0x01 ; 1 30318: d1 f7 brne .-12 ; 0x3030e if (status_ != 0XAA) { 3031a: 8a 3a cpi r24, 0xAA ; 170 3031c: 11 f0 breq .+4 ; 0x30322 3031e: 82 e0 ldi r24, 0x02 ; 2 30320: 80 cf rjmp .-256 ; 0x30222 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;} 30322: 82 e0 ldi r24, 0x02 ; 2 30324: c9 cf rjmp .-110 ; 0x302b8 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 30326: 80 91 00 17 lds r24, 0x1700 ; 0x801700 3032a: 82 30 cpi r24, 0x02 ; 2 3032c: d1 f4 brne .+52 ; 0x30362 if (cardCommand(CMD58, 0)) { 3032e: 20 e0 ldi r18, 0x00 ; 0 30330: 30 e0 ldi r19, 0x00 ; 0 30332: a9 01 movw r20, r18 30334: 6a e3 ldi r22, 0x3A ; 58 30336: 8d ef ldi r24, 0xFD ; 253 30338: 96 e1 ldi r25, 0x16 ; 22 3033a: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 3033e: 88 23 and r24, r24 30340: 11 f0 breq .+4 ; 0x30346 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30342: 88 e0 ldi r24, 0x08 ; 8 30344: 6e cf rjmp .-292 ; 0x30222 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 30346: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 3034a: 80 7c andi r24, 0xC0 ; 192 3034c: 80 3c cpi r24, 0xC0 ; 192 3034e: 19 f4 brne .+6 ; 0x30356 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;} 30350: 83 e0 ldi r24, 0x03 ; 3 30352: 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(); 30356: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 3035a: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 3035e: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 } chipSelectHigh(); 30362: 0f 94 c6 74 call 0x2e98c ; 0x2e98c bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 30366: 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);} 3036a: 81 e0 ldi r24, 0x01 ; 1 3036c: 0f 94 c2 68 call 0x2d184 ; 0x2d184 30370: 81 11 cpse r24, r1 30372: 0c c0 rjmp .+24 ; 0x3038c 30374: 80 e0 ldi r24, 0x00 ; 0 30376: 0f 94 c2 68 call 0x2d184 ; 0x2d184 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 3037a: 81 11 cpse r24, r1 3037c: 07 c0 rjmp .+14 ; 0x3038c { SERIAL_ERROR_START; 3037e: 88 ea ldi r24, 0xA8 ; 168 30380: 9b ea ldi r25, 0xAB ; 171 30382: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 30386: 82 ea ldi r24, 0xA2 ; 162 30388: 90 e7 ldi r25, 0x70 ; 112 3038a: 78 cf rjmp .-272 ; 0x3027c } else if (!root.openRoot(&volume)) 3038c: 62 e0 ldi r22, 0x02 ; 2 3038e: 77 e1 ldi r23, 0x17 ; 23 30390: 86 e1 ldi r24, 0x16 ; 22 30392: 95 e1 ldi r25, 0x15 ; 21 30394: 0f 94 d0 55 call 0x2aba0 ; 0x2aba0 30398: 81 11 cpse r24, r1 3039a: 07 c0 rjmp .+14 ; 0x303aa { SERIAL_ERROR_START; 3039c: 88 ea ldi r24, 0xA8 ; 168 3039e: 9b ea ldi r25, 0xAB ; 171 303a0: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 303a4: 82 e9 ldi r24, 0x92 ; 146 303a6: 90 e7 ldi r25, 0x70 ; 112 303a8: 69 cf rjmp .-302 ; 0x3027c } else { mounted = true; 303aa: 81 e0 ldi r24, 0x01 ; 1 303ac: 80 93 91 14 sts 0x1491, r24 ; 0x801491 SERIAL_ECHO_START; 303b0: 80 ed ldi r24, 0xD0 ; 208 303b2: 9b ea ldi r25, 0xAB ; 171 303b4: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 303b8: 87 e8 ldi r24, 0x87 ; 135 303ba: 90 e7 ldi r25, 0x70 ; 112 303bc: 5f cf rjmp .-322 ; 0x3027c if (mounted) { cdroot(doPresort); } } 303be: df 91 pop r29 303c0: cf 91 pop r28 303c2: 1f 91 pop r17 303c4: 0f 91 pop r16 303c6: ff 90 pop r15 303c8: ef 90 pop r14 303ca: df 90 pop r13 303cc: cf 90 pop r12 303ce: 08 95 ret 000303d0 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 303d0: 4f 92 push r4 303d2: 5f 92 push r5 303d4: 6f 92 push r6 303d6: 7f 92 push r7 303d8: 8f 92 push r8 303da: 9f 92 push r9 303dc: af 92 push r10 303de: bf 92 push r11 303e0: cf 92 push r12 303e2: df 92 push r13 303e4: ef 92 push r14 303e6: ff 92 push r15 303e8: 4b 01 movw r8, r22 303ea: 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]; 303ec: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 303f0: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 303f4: 07 2e mov r0, r23 303f6: 00 0c add r0, r0 303f8: 88 0b sbc r24, r24 303fa: 99 0b sbc r25, r25 303fc: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> if (!degTargetHotend(extruder)) 30400: 20 e0 ldi r18, 0x00 ; 0 30402: 30 e0 ldi r19, 0x00 ; 0 30404: a9 01 movw r20, r18 30406: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 3040a: 88 23 and r24, r24 3040c: d1 f0 breq .+52 ; 0x30442 #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; 3040e: 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; 30412: cc 24 eor r12, r12 30414: ca 94 dec r12 30416: dc 2c mov r13, r12 30418: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 3041a: 98 ee ldi r25, 0xE8 ; 232 3041c: 49 2e mov r4, r25 3041e: 93 e0 ldi r25, 0x03 ; 3 30420: 59 2e mov r5, r25 30422: 61 2c mov r6, r1 30424: 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) || 30426: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 <_ZL13cancel_heatup.lto_priv.408> 3042a: 81 11 cpse r24, r1 3042c: 0a c0 rjmp .+20 ; 0x30442 3042e: 2f ef ldi r18, 0xFF ; 255 30430: c2 16 cp r12, r18 30432: d2 06 cpc r13, r18 30434: e2 06 cpc r14, r18 30436: f2 06 cpc r15, r18 30438: 89 f4 brne .+34 ; 0x3045c (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) { 3043a: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 3043e: 82 30 cpi r24, 0x02 ; 2 30440: b9 f4 brne .+46 ; 0x30470 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 30442: ff 90 pop r15 30444: ef 90 pop r14 30446: df 90 pop r13 30448: cf 90 pop r12 3044a: bf 90 pop r11 3044c: af 90 pop r10 3044e: 9f 90 pop r9 30450: 8f 90 pop r8 30452: 7f 90 pop r7 30454: 6f 90 pop r6 30456: 5f 90 pop r5 30458: 4f 90 pop r4 3045a: 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) || 3045c: f7 fc sbrc r15, 7 3045e: f1 cf rjmp .-30 ; 0x30442 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 30460: 0f 94 53 29 call 0x252a6 ; 0x252a6 30464: 6c 19 sub r22, r12 30466: 7d 09 sbc r23, r13 30468: 68 3b cpi r22, 0xB8 ; 184 3046a: 7b 40 sbci r23, 0x0B ; 11 3046c: 30 f3 brcs .-52 ; 0x3043a 3046e: e9 cf rjmp .-46 ; 0x30442 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) 30470: 0f 94 53 29 call 0x252a6 ; 0x252a6 30474: 68 19 sub r22, r8 30476: 79 09 sbc r23, r9 30478: 8a 09 sbc r24, r10 3047a: 9b 09 sbc r25, r11 3047c: 69 3e cpi r22, 0xE9 ; 233 3047e: 73 40 sbci r23, 0x03 ; 3 30480: 81 05 cpc r24, r1 30482: 91 05 cpc r25, r1 30484: f0 f1 brcs .+124 ; 0x30502 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 30486: 89 e1 ldi r24, 0x19 ; 25 30488: 9a ea ldi r25, 0xAA ; 170 3048a: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 3048e: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 30492: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 30496: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 3049a: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 3049e: 41 e0 ldi r20, 0x01 ; 1 304a0: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 304a4: 85 e1 ldi r24, 0x15 ; 21 304a6: 9a ea ldi r25, 0xAA ; 170 304a8: 0e 94 57 77 call 0xeeae ; 0xeeae 304ac: 60 e0 ldi r22, 0x00 ; 0 304ae: 70 e0 ldi r23, 0x00 ; 0 304b0: cb 01 movw r24, r22 304b2: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 304b6: 81 e1 ldi r24, 0x11 ; 17 304b8: 9a ea ldi r25, 0xAA ; 170 304ba: 0e 94 57 77 call 0xeeae ; 0xeeae if (residencyStart > -1) 304be: f7 fc sbrc r15, 7 304c0: 52 c0 rjmp .+164 ; 0x30566 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 304c2: 0f 94 53 29 call 0x252a6 ; 0x252a6 304c6: 46 01 movw r8, r12 304c8: 57 01 movw r10, r14 304ca: 58 eb ldi r21, 0xB8 ; 184 304cc: 85 0e add r8, r21 304ce: 5b e0 ldi r21, 0x0B ; 11 304d0: 95 1e adc r9, r21 304d2: a1 1c adc r10, r1 304d4: b1 1c adc r11, r1 304d6: a5 01 movw r20, r10 304d8: 94 01 movw r18, r8 304da: 26 1b sub r18, r22 304dc: 37 0b sbc r19, r23 304de: 48 0b sbc r20, r24 304e0: 59 0b sbc r21, r25 304e2: ca 01 movw r24, r20 304e4: b9 01 movw r22, r18 304e6: a3 01 movw r20, r6 304e8: 92 01 movw r18, r4 304ea: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 304ee: ca 01 movw r24, r20 304f0: b9 01 movw r22, r18 304f2: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 304f6: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 304fa: 0f 94 53 29 call 0x252a6 ; 0x252a6 304fe: 4b 01 movw r8, r22 30500: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 30502: 90 e0 ldi r25, 0x00 ; 0 30504: 80 e0 ldi r24, 0x00 ; 0 30506: 0e 94 eb 8c call 0x119d6 ; 0x119d6 #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))) || 3050a: 3f ef ldi r19, 0xFF ; 255 3050c: c3 16 cp r12, r19 3050e: d3 06 cpc r13, r19 30510: e3 06 cpc r14, r19 30512: f3 06 cpc r15, r19 30514: 09 f0 breq .+2 ; 0x30518 30516: 46 c0 rjmp .+140 ; 0x305a4 } 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))) || 30518: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf <_ZL16target_direction.lto_priv.532> 3051c: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 30520: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 30524: 88 23 and r24, r24 30526: 19 f1 breq .+70 ; 0x3056e 30528: 07 2e mov r0, r23 3052a: 00 0c add r0, r0 3052c: 88 0b sbc r24, r24 3052e: 99 0b sbc r25, r25 30530: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 30534: 20 e0 ldi r18, 0x00 ; 0 30536: 30 e0 ldi r19, 0x00 ; 0 30538: 40 e8 ldi r20, 0x80 ; 128 3053a: 5f e3 ldi r21, 0x3F ; 63 3053c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 30540: 9b 01 movw r18, r22 30542: ac 01 movw r20, r24 30544: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 30548: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 3054c: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 30550: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 30554: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 30558: 87 fd sbrc r24, 7 3055a: 65 cf rjmp .-310 ; 0x30426 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 3055c: 0f 94 53 29 call 0x252a6 ; 0x252a6 30560: 6b 01 movw r12, r22 30562: 7c 01 movw r14, r24 30564: 60 cf rjmp .-320 ; 0x30426 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30566: 8f e3 ldi r24, 0x3F ; 63 30568: 0e 94 3e 77 call 0xee7c ; 0xee7c 3056c: c4 cf rjmp .-120 ; 0x304f6 3056e: 07 2e mov r0, r23 30570: 00 0c add r0, r0 30572: 88 0b sbc r24, r24 30574: 99 0b sbc r25, r25 30576: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__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))) || 3057a: 20 e0 ldi r18, 0x00 ; 0 3057c: 30 e0 ldi r19, 0x00 ; 0 3057e: 40 e8 ldi r20, 0x80 ; 128 30580: 5f e3 ldi r21, 0x3F ; 63 30582: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 30586: 9b 01 movw r18, r22 30588: ac 01 movw r20, r24 3058a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 3058e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 30592: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 30596: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 3059a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 3059e: 18 16 cp r1, r24 305a0: ec f6 brge .-70 ; 0x3055c 305a2: 41 cf rjmp .-382 ; 0x30426 305a4: f7 fc sbrc r15, 7 305a6: 3f cf rjmp .-386 ; 0x30426 305a8: 60 91 b6 0d lds r22, 0x0DB6 ; 0x800db6 305ac: 70 91 b7 0d lds r23, 0x0DB7 ; 0x800db7 305b0: 07 2e mov r0, r23 305b2: 00 0c add r0, r0 305b4: 88 0b sbc r24, r24 305b6: 99 0b sbc r25, r25 305b8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 305bc: 9b 01 movw r18, r22 305be: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 305c0: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 305c4: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 305c8: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 305cc: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 305d0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 305d4: 9f 77 andi r25, 0x7F ; 127 305d6: 20 e0 ldi r18, 0x00 ; 0 305d8: 30 e0 ldi r19, 0x00 ; 0 305da: 40 ea ldi r20, 0xA0 ; 160 305dc: 50 e4 ldi r21, 0x40 ; 64 305de: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 305e2: 18 16 cp r1, r24 305e4: 0c f0 brlt .+2 ; 0x305e8 305e6: 1f cf rjmp .-450 ; 0x30426 305e8: b9 cf rjmp .-142 ; 0x3055c 000305ea : // 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) { 305ea: 1f 93 push r17 305ec: cf 93 push r28 305ee: df 93 push r29 305f0: ec 01 movw r28, r24 305f2: 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()) { 305f4: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 305f8: 83 30 cpi r24, 0x03 ; 3 305fa: 09 f4 brne .+2 ; 0x305fe 305fc: 4e c0 rjmp .+156 ; 0x3069a 305fe: 8c 31 cpi r24, 0x1C ; 28 30600: 09 f4 brne .+2 ; 0x30604 30602: 52 c0 rjmp .+164 ; 0x306a8 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 30604: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 30608: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 3060c: 8c 17 cp r24, r28 3060e: 9d 07 cpc r25, r29 30610: 79 f1 breq .+94 ; 0x30670 lastErrorCode = ec; 30612: d0 93 b3 13 sts 0x13B3, r29 ; 0x8013b3 30616: c0 93 b2 13 sts 0x13B2, r28 ; 0x8013b2 lastErrorSource = res; 3061a: 10 93 b4 13 sts 0x13B4, r17 ; 0x8013b4 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 3061e: ce 01 movw r24, r28 30620: 0f 94 f3 c5 call 0x38be6 ; 0x38be6 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); 30624: e8 2f mov r30, r24 30626: f0 e0 ldi r31, 0x00 ; 0 30628: ee 0f add r30, r30 3062a: ff 1f adc r31, r31 3062c: eb 5b subi r30, 0xBB ; 187 3062e: f6 45 sbci r31, 0x56 ; 86 30630: 85 91 lpm r24, Z+ 30632: 94 91 lpm r25, Z 30634: 02 96 adiw r24, 0x02 ; 2 30636: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 3063a: c1 30 cpi r28, 0x01 ; 1 3063c: d1 05 cpc r29, r1 3063e: c1 f0 breq .+48 ; 0x30670 30640: cc 30 cpi r28, 0x0C ; 12 30642: 80 e8 ldi r24, 0x80 ; 128 30644: d8 07 cpc r29, r24 30646: a1 f0 breq .+40 ; 0x30670 30648: c9 32 cpi r28, 0x29 ; 41 3064a: 80 e8 ldi r24, 0x80 ; 128 3064c: d8 07 cpc r29, r24 3064e: 81 f0 breq .+32 ; 0x30670 IncrementMMUFails(); 30650: 0f 94 f5 c4 call 0x389ea ; 0x389ea | (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 30654: ce 01 movw r24, r28 30656: 88 27 eor r24, r24 30658: 9e 77 andi r25, 0x7E ; 126 3065a: 89 2b or r24, r25 3065c: 49 f0 breq .+18 ; 0x30670 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 3065e: 80 91 c0 13 lds r24, 0x13C0 ; 0x8013c0 30662: 90 91 c1 13 lds r25, 0x13C1 ; 0x8013c1 30666: 01 96 adiw r24, 0x01 ; 1 30668: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 3066c: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 30670: 80 91 9f 13 lds r24, 0x139F ; 0x80139f 30674: 88 23 and r24, r24 30676: d9 f0 breq .+54 ; 0x306ae return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 30678: 11 e0 ldi r17, 0x01 ; 1 3067a: 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) { 3067e: ce 01 movw r24, r28 30680: 0f 94 7e c8 call 0x390fc ; 0x390fc 30684: 8f 3f cpi r24, 0xFF ; 255 30686: 99 f0 breq .+38 ; 0x306ae void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 30688: 10 93 a0 13 sts 0x13A0, r17 ; 0x8013a0 logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 3068c: 82 e3 ldi r24, 0x32 ; 50 3068e: 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"); } 30690: df 91 pop r29 30692: cf 91 pop r28 30694: 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"); 30696: 0c 94 82 79 jmp 0xf304 ; 0xf304 // 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; 3069a: 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(); 3069e: 0f 94 ca c1 call 0x38394 ; 0x38394 // 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; 306a2: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac 306a6: ae cf rjmp .-164 ; 0x30604 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; 306a8: 10 92 bc 13 sts 0x13BC, r1 ; 0x8013bc 306ac: f8 cf rjmp .-16 ; 0x3069e 306ae: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 306b2: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 306b6: 81 11 cpse r24, r1 306b8: 06 c0 rjmp .+12 ; 0x306c6 306ba: 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"); } 306bc: df 91 pop r29 306be: cf 91 pop r28 306c0: 1f 91 pop r17 306c2: 0d 94 44 c7 jmp 0x38e88 ; 0x38e88 306c6: df 91 pop r29 306c8: cf 91 pop r28 306ca: 1f 91 pop r17 306cc: 08 95 ret 000306ce : * \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) { 306ce: 2f 92 push r2 306d0: 3f 92 push r3 306d2: 4f 92 push r4 306d4: 5f 92 push r5 306d6: 6f 92 push r6 306d8: 7f 92 push r7 306da: 8f 92 push r8 306dc: 9f 92 push r9 306de: af 92 push r10 306e0: bf 92 push r11 306e2: cf 92 push r12 306e4: df 92 push r13 306e6: ef 92 push r14 306e8: ff 92 push r15 306ea: 0f 93 push r16 306ec: 1f 93 push r17 306ee: cf 93 push r28 306f0: df 93 push r29 306f2: 00 d0 rcall .+0 ; 0x306f4 306f4: 1f 92 push r1 306f6: cd b7 in r28, 0x3d ; 61 306f8: de b7 in r29, 0x3e ; 62 306fa: 5c 01 movw r10, r24 306fc: 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; 306fe: 80 91 23 17 lds r24, 0x1723 ; 0x801723 30702: 81 30 cpi r24, 0x01 ; 1 30704: 09 f0 breq .+2 ; 0x30708 30706: de c0 rjmp .+444 ; 0x308c4 30708: 80 91 21 17 lds r24, 0x1721 ; 0x801721 3070c: 81 ff sbrs r24, 1 3070e: da c0 rjmp .+436 ; 0x308c4 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 30710: 82 fd sbrc r24, 2 30712: bc c0 rjmp .+376 ; 0x3088c * \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) { 30714: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30716: 21 2c mov r2, r1 30718: 32 e0 ldi r19, 0x02 ; 2 3071a: 33 2e mov r3, r19 3071c: 00 91 28 17 lds r16, 0x1728 ; 0x801728 30720: 10 91 29 17 lds r17, 0x1729 ; 0x801729 30724: 20 91 2a 17 lds r18, 0x172A ; 0x80172a 30728: 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) { 3072c: e1 14 cp r14, r1 3072e: f1 04 cpc r15, r1 30730: 09 f4 brne .+2 ; 0x30734 30732: 30 c1 rjmp .+608 ; 0x30994 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 30734: 80 91 39 17 lds r24, 0x1739 ; 0x801739 30738: 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);} 3073c: dc 01 movw r26, r24 3073e: 14 96 adiw r26, 0x04 ; 4 30740: 7c 90 ld r7, X 30742: 7a 94 dec r7 30744: b9 01 movw r22, r18 30746: a8 01 movw r20, r16 30748: 29 e0 ldi r18, 0x09 ; 9 3074a: 76 95 lsr r23 3074c: 67 95 ror r22 3074e: 57 95 ror r21 30750: 47 95 ror r20 30752: 2a 95 dec r18 30754: d1 f7 brne .-12 ; 0x3074a 30756: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 30758: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 3075a: 71 10 cpse r7, r1 3075c: 25 c0 rjmp .+74 ; 0x307a8 3075e: 01 15 cp r16, r1 30760: 11 05 cpc r17, r1 30762: 11 f5 brne .+68 ; 0x307a8 30764: 40 91 24 17 lds r20, 0x1724 ; 0x801724 30768: 50 91 25 17 lds r21, 0x1725 ; 0x801725 3076c: 60 91 26 17 lds r22, 0x1726 ; 0x801726 30770: 70 91 27 17 lds r23, 0x1727 ; 0x801727 // start of new cluster if (curCluster_ == 0) { 30774: 41 15 cp r20, r1 30776: 51 05 cpc r21, r1 30778: 61 05 cpc r22, r1 3077a: 71 05 cpc r23, r1 3077c: 09 f0 breq .+2 ; 0x30780 3077e: a8 c0 rjmp .+336 ; 0x308d0 if (firstCluster_ == 0) { 30780: 80 91 35 17 lds r24, 0x1735 ; 0x801735 30784: 90 91 36 17 lds r25, 0x1736 ; 0x801736 30788: a0 91 37 17 lds r26, 0x1737 ; 0x801737 3078c: b0 91 38 17 lds r27, 0x1738 ; 0x801738 30790: 00 97 sbiw r24, 0x00 ; 0 30792: a1 05 cpc r26, r1 30794: b1 05 cpc r27, r1 30796: 09 f0 breq .+2 ; 0x3079a 30798: b4 c0 rjmp .+360 ; 0x30902 } 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; 3079a: 80 e2 ldi r24, 0x20 ; 32 3079c: 97 e1 ldi r25, 0x17 ; 23 3079e: 0f 94 2d 57 call 0x2ae5a ; 0x2ae5a 307a2: 88 23 and r24, r24 307a4: 09 f4 brne .+2 ; 0x307a8 307a6: 8e c0 rjmp .+284 ; 0x308c4 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 307a8: c1 01 movw r24, r2 307aa: 80 1b sub r24, r16 307ac: 91 0b sbc r25, r17 307ae: 67 01 movw r12, r14 307b0: 8e 15 cp r24, r14 307b2: 9f 05 cpc r25, r15 307b4: 08 f4 brcc .+2 ; 0x307b8 307b6: 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; 307b8: e0 91 39 17 lds r30, 0x1739 ; 0x801739 307bc: f0 91 3a 17 lds r31, 0x173A ; 0x80173a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 307c0: 80 91 24 17 lds r24, 0x1724 ; 0x801724 307c4: 90 91 25 17 lds r25, 0x1725 ; 0x801725 307c8: a0 91 26 17 lds r26, 0x1726 ; 0x801726 307cc: b0 91 27 17 lds r27, 0x1727 ; 0x801727 307d0: 02 97 sbiw r24, 0x02 ; 2 307d2: a1 09 sbc r26, r1 307d4: b1 09 sbc r27, r1 307d6: 25 85 ldd r18, Z+13 ; 0x0d 307d8: 04 c0 rjmp .+8 ; 0x307e2 307da: 88 0f add r24, r24 307dc: 99 1f adc r25, r25 307de: aa 1f adc r26, r26 307e0: bb 1f adc r27, r27 307e2: 2a 95 dec r18 307e4: d2 f7 brpl .-12 ; 0x307da 307e6: 46 85 ldd r20, Z+14 ; 0x0e 307e8: 57 85 ldd r21, Z+15 ; 0x0f 307ea: 60 89 ldd r22, Z+16 ; 0x10 307ec: 71 89 ldd r23, Z+17 ; 0x11 307ee: 84 0f add r24, r20 307f0: 95 1f adc r25, r21 307f2: a6 1f adc r26, r22 307f4: b7 1f adc r27, r23 307f6: 9c 01 movw r18, r24 307f8: ad 01 movw r20, r26 307fa: 27 0d add r18, r7 307fc: 31 1d adc r19, r1 307fe: 41 1d adc r20, r1 30800: 51 1d adc r21, r1 30802: 29 01 movw r4, r18 30804: 3a 01 movw r6, r20 if (n == 512) { 30806: c1 14 cp r12, r1 30808: 32 e0 ldi r19, 0x02 ; 2 3080a: d3 06 cpc r13, r19 3080c: 09 f0 breq .+2 ; 0x30810 3080e: 8a c0 rjmp .+276 ; 0x30924 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 30810: 80 91 91 0e lds r24, 0x0E91 ; 0x800e91 30814: 90 91 92 0e lds r25, 0x0E92 ; 0x800e92 30818: a0 91 93 0e lds r26, 0x0E93 ; 0x800e93 3081c: b0 91 94 0e lds r27, 0x0E94 ; 0x800e94 30820: 48 16 cp r4, r24 30822: 59 06 cpc r5, r25 30824: 6a 06 cpc r6, r26 30826: 7b 06 cpc r7, r27 30828: 69 f4 brne .+26 ; 0x30844 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; 3082a: 10 92 99 0e sts 0x0E99, r1 ; 0x800e99 cacheBlockNumber_ = blockNumber; 3082e: 8f ef ldi r24, 0xFF ; 255 30830: 9f ef ldi r25, 0xFF ; 255 30832: dc 01 movw r26, r24 30834: 80 93 91 0e sts 0x0E91, r24 ; 0x800e91 30838: 90 93 92 0e sts 0x0E92, r25 ; 0x800e92 3083c: a0 93 93 0e sts 0x0E93, r26 ; 0x800e93 30840: 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); 30844: 95 01 movw r18, r10 30846: b3 01 movw r22, r6 30848: a2 01 movw r20, r4 3084a: 80 91 9a 0e lds r24, 0x0E9A ; 0x800e9a 3084e: 90 91 9b 0e lds r25, 0x0E9B ; 0x800e9b 30852: 0f 94 b8 52 call 0x2a570 ; 0x2a570 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 30856: 88 23 and r24, r24 30858: a9 f1 breq .+106 ; 0x308c4 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 3085a: 80 91 28 17 lds r24, 0x1728 ; 0x801728 3085e: 90 91 29 17 lds r25, 0x1729 ; 0x801729 30862: a0 91 2a 17 lds r26, 0x172A ; 0x80172a 30866: b0 91 2b 17 lds r27, 0x172B ; 0x80172b 3086a: 8c 0d add r24, r12 3086c: 9d 1d adc r25, r13 3086e: a1 1d adc r26, r1 30870: b1 1d adc r27, r1 30872: 80 93 28 17 sts 0x1728, r24 ; 0x801728 30876: 90 93 29 17 sts 0x1729, r25 ; 0x801729 3087a: a0 93 2a 17 sts 0x172A, r26 ; 0x80172a 3087e: b0 93 2b 17 sts 0x172B, r27 ; 0x80172b src += n; 30882: ac 0c add r10, r12 30884: bd 1c adc r11, r13 nToWrite -= n; 30886: ec 18 sub r14, r12 30888: fd 08 sbc r15, r13 3088a: 48 cf rjmp .-368 ; 0x3071c // 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_) { 3088c: 40 91 31 17 lds r20, 0x1731 ; 0x801731 30890: 50 91 32 17 lds r21, 0x1732 ; 0x801732 30894: 60 91 33 17 lds r22, 0x1733 ; 0x801733 30898: 70 91 34 17 lds r23, 0x1734 ; 0x801734 3089c: 80 91 28 17 lds r24, 0x1728 ; 0x801728 308a0: 90 91 29 17 lds r25, 0x1729 ; 0x801729 308a4: a0 91 2a 17 lds r26, 0x172A ; 0x80172a 308a8: b0 91 2b 17 lds r27, 0x172B ; 0x80172b 308ac: 48 17 cp r20, r24 308ae: 59 07 cpc r21, r25 308b0: 6a 07 cpc r22, r26 308b2: 7b 07 cpc r23, r27 308b4: 09 f4 brne .+2 ; 0x308b8 308b6: 2e cf rjmp .-420 ; 0x30714 } /** 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);} 308b8: 80 e2 ldi r24, 0x20 ; 32 308ba: 97 e1 ldi r25, 0x17 ; 23 308bc: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 if (!seekEnd()) goto fail; 308c0: 81 11 cpse r24, r1 308c2: 28 cf rjmp .-432 ; 0x30714 } return nbyte; fail: // return for write error writeError = true; 308c4: 81 e0 ldi r24, 0x01 ; 1 308c6: 80 93 20 17 sts 0x1720, r24 ; 0x801720 return -1; 308ca: 8f ef ldi r24, 0xFF ; 255 308cc: 9f ef ldi r25, 0xFF ; 255 308ce: 81 c0 rjmp .+258 ; 0x309d2 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 308d0: 9e 01 movw r18, r28 308d2: 2f 5f subi r18, 0xFF ; 255 308d4: 3f 4f sbci r19, 0xFF ; 255 308d6: 0f 94 e3 54 call 0x2a9c6 ; 0x2a9c6 308da: 88 23 and r24, r24 308dc: 99 f3 breq .-26 ; 0x308c4 if (vol_->isEOC(next)) { 308de: 89 81 ldd r24, Y+1 ; 0x01 308e0: 9a 81 ldd r25, Y+2 ; 0x02 308e2: ab 81 ldd r26, Y+3 ; 0x03 308e4: 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; 308e6: e0 91 39 17 lds r30, 0x1739 ; 0x801739 308ea: f0 91 3a 17 lds r31, 0x173A ; 0x80173a 308ee: 27 89 ldd r18, Z+23 ; 0x17 308f0: 20 31 cpi r18, 0x10 ; 16 308f2: 81 f4 brne .+32 ; 0x30914 308f4: 88 3f cpi r24, 0xF8 ; 248 308f6: ef ef ldi r30, 0xFF ; 255 308f8: 9e 07 cpc r25, r30 308fa: a1 05 cpc r26, r1 308fc: b1 05 cpc r27, r1 308fe: 08 f0 brcs .+2 ; 0x30902 30900: 4c cf rjmp .-360 ; 0x3079a // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 30902: 80 93 24 17 sts 0x1724, r24 ; 0x801724 30906: 90 93 25 17 sts 0x1725, r25 ; 0x801725 3090a: a0 93 26 17 sts 0x1726, r26 ; 0x801726 3090e: b0 93 27 17 sts 0x1727, r27 ; 0x801727 30912: 4a cf rjmp .-364 ; 0x307a8 return cluster >= FAT32EOC_MIN; 30914: 88 3f cpi r24, 0xF8 ; 248 30916: ff ef ldi r31, 0xFF ; 255 30918: 9f 07 cpc r25, r31 3091a: af 07 cpc r26, r31 3091c: ff e0 ldi r31, 0x0F ; 15 3091e: bf 07 cpc r27, r31 30920: 80 f3 brcs .-32 ; 0x30902 30922: 3b cf rjmp .-394 ; 0x3079a // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30924: 01 15 cp r16, r1 30926: 11 05 cpc r17, r1 30928: 69 f5 brne .+90 ; 0x30984 3092a: 40 91 28 17 lds r20, 0x1728 ; 0x801728 3092e: 50 91 29 17 lds r21, 0x1729 ; 0x801729 30932: 60 91 2a 17 lds r22, 0x172A ; 0x80172a 30936: 70 91 2b 17 lds r23, 0x172B ; 0x80172b 3093a: 80 91 31 17 lds r24, 0x1731 ; 0x801731 3093e: 90 91 32 17 lds r25, 0x1732 ; 0x801732 30942: a0 91 33 17 lds r26, 0x1733 ; 0x801733 30946: b0 91 34 17 lds r27, 0x1734 ; 0x801734 3094a: 48 17 cp r20, r24 3094c: 59 07 cpc r21, r25 3094e: 6a 07 cpc r22, r26 30950: 7b 07 cpc r23, r27 30952: c0 f0 brcs .+48 ; 0x30984 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30954: 0f 94 1c 53 call 0x2a638 ; 0x2a638 30958: 88 23 and r24, r24 3095a: 09 f4 brne .+2 ; 0x3095e 3095c: b3 cf rjmp .-154 ; 0x308c4 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; 3095e: 81 e0 ldi r24, 0x01 ; 1 30960: 80 93 99 0e sts 0x0E99, r24 ; 0x800e99 cacheBlockNumber_ = blockNumber; 30964: 40 92 91 0e sts 0x0E91, r4 ; 0x800e91 30968: 50 92 92 0e sts 0x0E92, r5 ; 0x800e92 3096c: 60 92 93 0e sts 0x0E93, r6 ; 0x800e93 30970: 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); 30974: a6 01 movw r20, r12 30976: b5 01 movw r22, r10 30978: c8 01 movw r24, r16 3097a: 83 56 subi r24, 0x63 ; 99 3097c: 91 4f sbci r25, 0xF1 ; 241 3097e: 0f 94 4c e2 call 0x3c498 ; 0x3c498 30982: 6b cf rjmp .-298 ; 0x3085a 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; 30984: 41 e0 ldi r20, 0x01 ; 1 30986: c3 01 movw r24, r6 30988: b2 01 movw r22, r4 3098a: 0f 94 14 54 call 0x2a828 ; 0x2a828 3098e: 81 11 cpse r24, r1 30990: f1 cf rjmp .-30 ; 0x30974 30992: 98 cf rjmp .-208 ; 0x308c4 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30994: 80 91 31 17 lds r24, 0x1731 ; 0x801731 30998: 90 91 32 17 lds r25, 0x1732 ; 0x801732 3099c: a0 91 33 17 lds r26, 0x1733 ; 0x801733 309a0: b0 91 34 17 lds r27, 0x1734 ; 0x801734 309a4: 80 17 cp r24, r16 309a6: 91 07 cpc r25, r17 309a8: a2 07 cpc r26, r18 309aa: b3 07 cpc r27, r19 309ac: 68 f4 brcc .+26 ; 0x309c8 309ae: 80 91 21 17 lds r24, 0x1721 ; 0x801721 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 309b2: 00 93 31 17 sts 0x1731, r16 ; 0x801731 309b6: 10 93 32 17 sts 0x1732, r17 ; 0x801732 309ba: 20 93 33 17 sts 0x1733, r18 ; 0x801733 309be: 30 93 34 17 sts 0x1734, r19 ; 0x801734 flags_ |= F_FILE_DIR_DIRTY; 309c2: 80 68 ori r24, 0x80 ; 128 309c4: 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) { 309c8: 80 91 21 17 lds r24, 0x1721 ; 0x801721 309cc: 83 fd sbrc r24, 3 309ce: 18 c0 rjmp .+48 ; 0x30a00 if (!sync()) goto fail; } return nbyte; 309d0: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 309d2: 0f 90 pop r0 309d4: 0f 90 pop r0 309d6: 0f 90 pop r0 309d8: 0f 90 pop r0 309da: df 91 pop r29 309dc: cf 91 pop r28 309de: 1f 91 pop r17 309e0: 0f 91 pop r16 309e2: ff 90 pop r15 309e4: ef 90 pop r14 309e6: df 90 pop r13 309e8: cf 90 pop r12 309ea: bf 90 pop r11 309ec: af 90 pop r10 309ee: 9f 90 pop r9 309f0: 8f 90 pop r8 309f2: 7f 90 pop r7 309f4: 6f 90 pop r6 309f6: 5f 90 pop r5 309f8: 4f 90 pop r4 309fa: 3f 90 pop r3 309fc: 2f 90 pop r2 309fe: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30a00: 80 e2 ldi r24, 0x20 ; 32 30a02: 97 e1 ldi r25, 0x17 ; 23 30a04: 0f 94 42 58 call 0x2b084 ; 0x2b084 30a08: 81 11 cpse r24, r1 30a0a: e2 cf rjmp .-60 ; 0x309d0 30a0c: 5b cf rjmp .-330 ; 0x308c4 00030a0e : #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) { 30a0e: 0f 93 push r16 30a10: cf 93 push r28 30a12: df 93 push r29 30a14: cd b7 in r28, 0x3d ; 61 30a16: de b7 in r29, 0x3e ; 62 30a18: a3 97 sbiw r28, 0x23 ; 35 30a1a: 0f b6 in r0, 0x3f ; 63 30a1c: f8 94 cli 30a1e: de bf out 0x3e, r29 ; 62 30a20: 0f be out 0x3f, r0 ; 63 30a22: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30a24: 20 91 31 16 lds r18, 0x1631 ; 0x801631 30a28: 30 91 32 16 lds r19, 0x1632 ; 0x801632 30a2c: 82 17 cp r24, r18 30a2e: 93 07 cpc r25, r19 30a30: d8 f4 brcc .+54 ; 0x30a68 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30a32: 61 30 cpi r22, 0x01 ; 1 30a34: 31 f4 brne .+12 ; 0x30a42 30a36: 21 50 subi r18, 0x01 ; 1 30a38: 31 09 sbc r19, r1 30a3a: a9 01 movw r20, r18 30a3c: 48 1b sub r20, r24 30a3e: 59 0b sbc r21, r25 30a40: ca 01 movw r24, r20 30a42: 88 0f add r24, r24 30a44: 99 1f adc r25, r25 30a46: fc 01 movw r30, r24 30a48: ed 5c subi r30, 0xCD ; 205 30a4a: f9 4e sbci r31, 0xE9 ; 233 30a4c: 80 81 ld r24, Z 30a4e: 91 81 ldd r25, Z+1 ; 0x01 30a50: 0f 94 8c 79 call 0x2f318 ; 0x2f318 else getfilename_afterMaxSorting(nr); } 30a54: a3 96 adiw r28, 0x23 ; 35 30a56: 0f b6 in r0, 0x3f ; 63 30a58: f8 94 cli 30a5a: de bf out 0x3e, r29 ; 62 30a5c: 0f be out 0x3f, r0 ; 63 30a5e: cd bf out 0x3d, r28 ; 61 30a60: df 91 pop r29 30a62: cf 91 pop r28 30a64: 0f 91 pop r16 30a66: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30a68: 4b e3 ldi r20, 0x3B ; 59 30a6a: 55 e1 ldi r21, 0x15 ; 21 30a6c: 50 93 3a 15 sts 0x153A, r21 ; 0x80153a 30a70: 40 93 39 15 sts 0x1539, r20 ; 0x801539 nrFiles = entry - sort_count + 1; 30a74: 82 1b sub r24, r18 30a76: 93 0b sbc r25, r19 30a78: 01 96 adiw r24, 0x01 ; 1 30a7a: 90 93 a9 17 sts 0x17A9, r25 ; 0x8017a9 30a7e: 80 93 a8 17 sts 0x17A8, r24 ; 0x8017a8 curDir->seekSet(lastSortedFilePosition << 5); 30a82: 40 91 fb 16 lds r20, 0x16FB ; 0x8016fb 30a86: 50 91 fc 16 lds r21, 0x16FC ; 0x8016fc 30a8a: 85 e0 ldi r24, 0x05 ; 5 30a8c: 44 0f add r20, r20 30a8e: 55 1f adc r21, r21 30a90: 8a 95 dec r24 30a92: e1 f7 brne .-8 ; 0x30a8c 30a94: 70 e0 ldi r23, 0x00 ; 0 30a96: 60 e0 ldi r22, 0x00 ; 0 30a98: 8b e3 ldi r24, 0x3B ; 59 30a9a: 95 e1 ldi r25, 0x15 ; 21 30a9c: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30aa0: 00 e0 ldi r16, 0x00 ; 0 30aa2: 0e 7f andi r16, 0xFE ; 254 30aa4: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30aa6: e0 91 39 15 lds r30, 0x1539 ; 0x801539 30aaa: f0 91 3a 15 lds r31, 0x153A ; 0x80153a 30aae: 83 e2 ldi r24, 0x23 ; 35 30ab0: de 01 movw r26, r28 30ab2: 11 96 adiw r26, 0x01 ; 1 30ab4: 01 90 ld r0, Z+ 30ab6: 0d 92 st X+, r0 30ab8: 8a 95 dec r24 30aba: e1 f7 brne .-8 ; 0x30ab4 30abc: 22 e0 ldi r18, 0x02 ; 2 30abe: 50 e0 ldi r21, 0x00 ; 0 30ac0: 40 e0 ldi r20, 0x00 ; 0 30ac2: be 01 movw r22, r28 30ac4: 6f 5f subi r22, 0xFF ; 255 30ac6: 7f 4f sbci r23, 0xFF ; 255 30ac8: 89 ef ldi r24, 0xF9 ; 249 30aca: 92 e0 ldi r25, 0x02 ; 2 30acc: 0f 94 16 77 call 0x2ee2c ; 0x2ee2c 30ad0: ce 01 movw r24, r28 30ad2: 01 96 adiw r24, 0x01 ; 1 30ad4: 0e 94 38 77 call 0xee70 ; 0xee70 30ad8: bd cf rjmp .-134 ; 0x30a54 00030ada : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30ada: 0f 93 push r16 30adc: 1f 93 push r17 30ade: cf 93 push r28 30ae0: df 93 push r29 30ae2: 1f 92 push r1 30ae4: 1f 92 push r1 30ae6: cd b7 in r28, 0x3d ; 61 30ae8: de b7 in r29, 0x3e ; 62 { if(!mounted) 30aea: 20 91 91 14 lds r18, 0x1491 ; 0x801491 30aee: 22 23 and r18, r18 30af0: 69 f1 breq .+90 ; 0x30b4c 30af2: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30af4: 80 91 23 17 lds r24, 0x1723 ; 0x801723 30af8: 88 23 and r24, r24 30afa: 79 f1 breq .+94 ; 0x30b5a SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30afc: 89 e5 ldi r24, 0x59 ; 89 30afe: 98 ea ldi r25, 0xA8 ; 168 30b00: 0e 94 82 79 call 0xf304 ; 0xf304 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; 30b04: 10 92 90 14 sts 0x1490, r1 ; 0x801490 const char *fname=name; 30b08: 1a 83 std Y+2, r17 ; 0x02 30b0a: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30b0c: ce 01 movw r24, r28 30b0e: 01 96 adiw r24, 0x01 ; 1 30b10: 0f 94 cd 7e call 0x2fd9a ; 0x2fd9a 30b14: 88 23 and r24, r24 30b16: d1 f0 breq .+52 ; 0x30b4c return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30b18: 49 81 ldd r20, Y+1 ; 0x01 30b1a: 5a 81 ldd r21, Y+2 ; 0x02 30b1c: 60 91 39 15 lds r22, 0x1539 ; 0x801539 30b20: 70 91 3a 15 lds r23, 0x153A ; 0x80153a 30b24: 26 e5 ldi r18, 0x56 ; 86 30b26: 80 e2 ldi r24, 0x20 ; 32 30b28: 97 e1 ldi r25, 0x17 ; 23 30b2a: 0f 94 1f 64 call 0x2c83e ; 0x2c83e 30b2e: 81 11 cpse r24, r1 30b30: 22 c0 rjmp .+68 ; 0x30b76 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30b32: 82 ec ldi r24, 0xC2 ; 194 30b34: 90 e7 ldi r25, 0x70 ; 112 30b36: 0e 94 57 77 call 0xeeae ; 0xeeae 30b3a: 89 81 ldd r24, Y+1 ; 0x01 30b3c: 9a 81 ldd r25, Y+2 ; 0x02 30b3e: 0e 94 1b 88 call 0x11036 ; 0x11036 30b42: 8e e2 ldi r24, 0x2E ; 46 30b44: 0e 94 3e 77 call 0xee7c ; 0xee7c } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30b48: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30b4c: 0f 90 pop r0 30b4e: 0f 90 pop r0 30b50: df 91 pop r29 30b52: cf 91 pop r28 30b54: 1f 91 pop r17 30b56: 0f 91 pop r16 30b58: 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 30b5a: 10 92 43 17 sts 0x1743, r1 ; 0x801743 SERIAL_ECHO_START; 30b5e: 80 ed ldi r24, 0xD0 ; 208 30b60: 9b ea ldi r25, 0xAB ; 171 30b62: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHORPGM(ofNowFreshFile); 30b66: 8e e5 ldi r24, 0x5E ; 94 30b68: 9a ea ldi r25, 0xAA ; 170 30b6a: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN(name); 30b6e: c8 01 movw r24, r16 30b70: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 30b74: c7 cf rjmp .-114 ; 0x30b04 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; 30b76: 81 e0 ldi r24, 0x01 ; 1 30b78: 80 93 8e 14 sts 0x148E, r24 ; 0x80148e getfilename(0, fname); 30b7c: 89 81 ldd r24, Y+1 ; 0x01 30b7e: 9a 81 ldd r25, Y+2 ; 0x02 30b80: 0f 94 45 79 call 0x2f28a ; 0x2f28a SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30b84: 87 e4 ldi r24, 0x47 ; 71 30b86: 98 ea ldi r25, 0xA8 ; 168 30b88: 0e 94 57 77 call 0xeeae ; 0xeeae printAbsFilenameFast(); 30b8c: 0f 94 28 7a call 0x2f450 ; 0x2f450 SERIAL_PROTOCOLLN(); 30b90: 0f 94 04 d6 call 0x3ac08 ; 0x3ac08 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30b94: 8a e3 ldi r24, 0x3A ; 58 30b96: 9a ea ldi r25, 0xAA ; 170 30b98: 0e 94 82 79 call 0xf304 ; 0xf304 lcd_setstatuspgm(ofFileSelected); 30b9c: 8a e3 ldi r24, 0x3A ; 58 30b9e: 9a ea ldi r25, 0xAA ; 170 30ba0: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 scrollstuff = 0; 30ba4: 10 92 b9 0d sts 0x0DB9, r1 ; 0x800db9 30ba8: d1 cf rjmp .-94 ; 0x30b4c 00030baa : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30baa: 0f 93 push r16 30bac: 1f 93 push r17 30bae: cf 93 push r28 30bb0: df 93 push r29 30bb2: ec 01 movw r28, r24 { memset(ip, 0, 4); 30bb4: 84 e0 ldi r24, 0x04 ; 4 30bb6: fe 01 movw r30, r28 30bb8: 11 92 st Z+, r1 30bba: 8a 95 dec r24 30bbc: e9 f7 brne .-6 ; 0x30bb8 /** 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 30bbe: 23 e0 ldi r18, 0x03 ; 3 30bc0: 30 ea ldi r19, 0xA0 ; 160 30bc2: 4a e0 ldi r20, 0x0A ; 10 30bc4: 50 e9 ldi r21, 0x90 ; 144 30bc6: 60 e3 ldi r22, 0x30 ; 48 30bc8: 8d ef ldi r24, 0xFD ; 253 30bca: 96 e1 ldi r25, 0x16 ; 22 30bcc: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 30bd0: 88 23 and r24, r24 30bd2: 91 f0 breq .+36 ; 0x30bf8 30bd4: 23 e0 ldi r18, 0x03 ; 3 30bd6: 30 ea ldi r19, 0xA0 ; 160 30bd8: 4a e0 ldi r20, 0x0A ; 10 30bda: 50 e9 ldi r21, 0x90 ; 144 30bdc: 61 e1 ldi r22, 0x11 ; 17 30bde: 8d ef ldi r24, 0xFD ; 253 30be0: 96 e1 ldi r25, 0x16 ; 22 30be2: 0f 94 58 52 call 0x2a4b0 ; 0x2a4b0 30be6: 88 23 and r24, r24 30be8: 39 f0 breq .+14 ; 0x30bf8 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30bea: 80 e8 ldi r24, 0x80 ; 128 30bec: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30bf0: 0f 94 c6 74 call 0x2e98c ; 0x2e98c return false; 30bf4: 80 e0 ldi r24, 0x00 ; 0 30bf6: 2f c0 rjmp .+94 ; 0x30c56 //------------------------------------------------------------------------------ /** 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(); 30bf8: 0f 94 53 29 call 0x252a6 ; 0x252a6 30bfc: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30bfe: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30c02: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 30c06: 8f 3f cpi r24, 0xFF ; 255 30c08: 69 f4 brne .+26 ; 0x30c24 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30c0a: 0f 94 53 29 call 0x252a6 ; 0x252a6 30c0e: 60 1b sub r22, r16 30c10: 71 0b sbc r23, r17 30c12: 6d 32 cpi r22, 0x2D ; 45 30c14: 71 40 sbci r23, 0x01 ; 1 30c16: 98 f3 brcs .-26 ; 0x30bfe 30c18: 81 e1 ldi r24, 0x11 ; 17 30c1a: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd goto fail; } return true; fail: chipSelectHigh(); 30c1e: 0f 94 c6 74 call 0x2e98c ; 0x2e98c 30c22: e6 cf rjmp .-52 ; 0x30bf0 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30c24: 8e 3f cpi r24, 0xFE ; 254 30c26: 11 f0 breq .+4 ; 0x30c2c 30c28: 8f e0 ldi r24, 0x0F ; 15 30c2a: f7 cf rjmp .-18 ; 0x30c1a 30c2c: 8e 01 movw r16, r28 30c2e: 0c 5f subi r16, 0xFC ; 252 30c30: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30c32: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30c36: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30c38: c0 17 cp r28, r16 30c3a: d1 07 cpc r29, r17 30c3c: d1 f7 brne .-12 ; 0x30c32 30c3e: ce ef ldi r28, 0xFE ; 254 30c40: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30c42: 0f 94 51 52 call 0x2a4a2 ; 0x2a4a2 30c46: 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) { 30c48: e1 f7 brne .-8 ; 0x30c42 spiRec(); } chipSelectHigh(); 30c4a: 0f 94 c6 74 call 0x2e98c ; 0x2e98c spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30c4e: 8f ef ldi r24, 0xFF ; 255 30c50: 0f 94 4c 52 call 0x2a498 ; 0x2a498 30c54: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30c56: df 91 pop r29 30c58: cf 91 pop r28 30c5a: 1f 91 pop r17 30c5c: 0f 91 pop r16 30c5e: 08 95 ret 00030c60 : } 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) 30c60: 8f 92 push r8 30c62: 9f 92 push r9 30c64: af 92 push r10 30c66: bf 92 push r11 30c68: cf 92 push r12 30c6a: df 92 push r13 30c6c: ef 92 push r14 30c6e: ff 92 push r15 30c70: 0f 93 push r16 30c72: 1f 93 push r17 30c74: cf 93 push r28 30c76: df 93 push r29 30c78: 1f 92 push r1 30c7a: cd b7 in r28, 0x3d ; 61 30c7c: de b7 in r29, 0x3e ; 62 30c7e: 6b 01 movw r12, r22 30c80: 7c 01 movw r14, r24 30c82: 49 01 movw r8, r18 30c84: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30c86: 03 30 cpi r16, 0x03 ; 3 30c88: 19 f4 brne .+6 ; 0x30c90 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30c8a: 8c e5 ldi r24, 0x5C ; 92 30c8c: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30c8e: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30c90: 81 14 cp r8, r1 30c92: 91 04 cpc r9, r1 30c94: a1 04 cpc r10, r1 30c96: b1 04 cpc r11, r1 30c98: 09 f4 brne .+2 ; 0x30c9c 30c9a: 59 c0 rjmp .+178 ; 0x30d4e #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30c9c: 8e 2d mov r24, r14 30c9e: 0e 94 b8 76 call 0xed70 ; 0xed70 #endif print_hex_byte((val >> 8) & 0xFF); 30ca2: 8d 2d mov r24, r13 30ca4: 0e 94 b8 76 call 0xed70 ; 0xed70 print_hex_byte(val & 0xFF); 30ca8: 8c 2d mov r24, r12 30caa: 0e 94 b8 76 call 0xed70 ; 0xed70 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30cae: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30cb2: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30cb6: 80 e2 ldi r24, 0x20 ; 32 30cb8: 90 e0 ldi r25, 0x00 ; 0 30cba: 0f 94 8b da call 0x3b516 ; 0x3b516 uint8_t count_line = countperline; 30cbe: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30cc0: 19 82 std Y+1, r1 ; 0x01 switch (type) 30cc2: 01 30 cpi r16, 0x01 ; 1 30cc4: b1 f1 breq .+108 ; 0x30d32 30cc6: 88 f1 brcs .+98 ; 0x30d2a 30cc8: 03 30 cpi r16, 0x03 ; 3 30cca: b9 f1 breq .+110 ; 0x30d3a case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30ccc: 8f ef ldi r24, 0xFF ; 255 30cce: c8 1a sub r12, r24 30cd0: d8 0a sbc r13, r24 30cd2: e8 0a sbc r14, r24 30cd4: f8 0a sbc r15, r24 putchar(' '); 30cd6: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30cda: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30cde: 80 e2 ldi r24, 0x20 ; 32 30ce0: 90 e0 ldi r25, 0x00 ; 0 30ce2: 0f 94 8b da call 0x3b516 ; 0x3b516 print_hex_byte(data); 30ce6: 89 81 ldd r24, Y+1 ; 0x01 30ce8: 0e 94 b8 76 call 0xed70 ; 0xed70 count_line--; 30cec: 11 50 subi r17, 0x01 ; 1 count--; 30cee: 81 e0 ldi r24, 0x01 ; 1 30cf0: 88 1a sub r8, r24 30cf2: 91 08 sbc r9, r1 30cf4: a1 08 sbc r10, r1 30cf6: 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)) 30cf8: 0f b6 in r0, 0x3f ; 63 30cfa: 07 fe sbrs r0, 7 30cfc: 06 c0 rjmp .+12 ; 0x30d0a 30cfe: c4 01 movw r24, r8 30d00: 9f 71 andi r25, 0x1F ; 31 30d02: 89 2b or r24, r25 30d04: 11 f4 brne .+4 ; 0x30d0a manage_heater(); 30d06: 0f 94 63 38 call 0x270c6 ; 0x270c6 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30d0a: 81 14 cp r8, r1 30d0c: 91 04 cpc r9, r1 30d0e: a1 04 cpc r10, r1 30d10: b1 04 cpc r11, r1 30d12: 11 f0 breq .+4 ; 0x30d18 30d14: 11 11 cpse r17, r1 30d16: d4 cf rjmp .-88 ; 0x30cc0 // 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'); 30d18: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 30d1c: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 30d20: 8a e0 ldi r24, 0x0A ; 10 30d22: 90 e0 ldi r25, 0x00 ; 0 30d24: 0f 94 8b da call 0x3b516 ; 0x3b516 30d28: b3 cf rjmp .-154 ; 0x30c90 while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30d2a: f6 01 movw r30, r12 30d2c: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30d2e: 89 83 std Y+1, r24 ; 0x01 30d30: cd cf rjmp .-102 ; 0x30ccc 30d32: c6 01 movw r24, r12 30d34: 0f 94 23 dc call 0x3b846 ; 0x3b846 30d38: fa cf rjmp .-12 ; 0x30d2e 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; 30d3a: 21 e0 ldi r18, 0x01 ; 1 30d3c: 30 e0 ldi r19, 0x00 ; 0 30d3e: ae 01 movw r20, r28 30d40: 4f 5f subi r20, 0xFF ; 255 30d42: 5f 4f sbci r21, 0xFF ; 255 30d44: c7 01 movw r24, r14 30d46: b6 01 movw r22, r12 30d48: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc 30d4c: bf cf rjmp .-130 ; 0x30ccc if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30d4e: 0f 90 pop r0 30d50: df 91 pop r29 30d52: cf 91 pop r28 30d54: 1f 91 pop r17 30d56: 0f 91 pop r16 30d58: ff 90 pop r15 30d5a: ef 90 pop r14 30d5c: df 90 pop r13 30d5e: cf 90 pop r12 30d60: bf 90 pop r11 30d62: af 90 pop r10 30d64: 9f 90 pop r9 30d66: 8f 90 pop r8 30d68: 08 95 ret 00030d6a : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 30d6a: cf 93 push r28 30d6c: 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; 30d6e: ca ea ldi r28, 0xAA ; 170 30d70: d7 e1 ldi r29, 0x17 ; 23 30d72: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 30d74: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 30d76: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 30d78: 80 91 8f 0e lds r24, 0x0E8F ; 0x800e8f 30d7c: 90 91 90 0e lds r25, 0x0E90 ; 0x800e90 30d80: 98 8b std Y+16, r25 ; 0x10 30d82: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 30d84: 0f 94 f1 7a call 0x2f5e2 ; 0x2f5e2 jamErrCnt = 0; 30d88: 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"); } 30d8a: df 91 pop r29 30d8c: cf 91 pop r28 30d8e: 08 95 ret 00030d90 : //! //! @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) 30d90: cf 92 push r12 30d92: df 92 push r13 30d94: ef 92 push r14 30d96: ff 92 push r15 30d98: 69 01 movw r12, r18 30d9a: 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); 30d9c: 2d ec ldi r18, 0xCD ; 205 30d9e: 3c ec ldi r19, 0xCC ; 204 30da0: 4c e4 ldi r20, 0x4C ; 76 30da2: 5e e3 ldi r21, 0x3E ; 62 30da4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 30da8: 2d ec ldi r18, 0xCD ; 205 30daa: 3c ec ldi r19, 0xCC ; 204 30dac: 4c e4 ldi r20, 0x4C ; 76 30dae: 5e e3 ldi r21, 0x3E ; 62 30db0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 30db4: 2d ef ldi r18, 0xFD ; 253 30db6: 3d ea ldi r19, 0xAD ; 173 30db8: 40 e0 ldi r20, 0x00 ; 0 30dba: 5d e3 ldi r21, 0x3D ; 61 30dbc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 30dc0: a7 01 movw r20, r14 30dc2: 96 01 movw r18, r12 30dc4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 30dc8: 24 e2 ldi r18, 0x24 ; 36 30dca: 30 ef ldi r19, 0xF0 ; 240 30dcc: 49 e1 ldi r20, 0x19 ; 25 30dce: 50 e4 ldi r21, 0x40 ; 64 30dd0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> } 30dd4: ff 90 pop r15 30dd6: ef 90 pop r14 30dd8: df 90 pop r13 30dda: cf 90 pop r12 30ddc: 08 95 ret 00030dde : //! //! 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) 30dde: 2f 92 push r2 30de0: 3f 92 push r3 30de2: 4f 92 push r4 30de4: 5f 92 push r5 30de6: 6f 92 push r6 30de8: 7f 92 push r7 30dea: 8f 92 push r8 30dec: 9f 92 push r9 30dee: af 92 push r10 30df0: bf 92 push r11 30df2: cf 92 push r12 30df4: df 92 push r13 30df6: ef 92 push r14 30df8: ff 92 push r15 30dfa: 0f 93 push r16 30dfc: 1f 93 push r17 30dfe: cf 93 push r28 30e00: df 93 push r29 30e02: 00 d0 rcall .+0 ; 0x30e04 30e04: 1f 92 push r1 30e06: 1f 92 push r1 30e08: cd b7 in r28, 0x3d ; 61 30e0a: de b7 in r29, 0x3e ; 62 30e0c: 8c 83 std Y+4, r24 ; 0x04 30e0e: 4a 01 movw r8, r20 30e10: 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); 30e12: 23 e4 ldi r18, 0x43 ; 67 30e14: 3d ec ldi r19, 0xCD ; 205 30e16: 4f e2 ldi r20, 0x2F ; 47 30e18: 5d e3 ldi r21, 0x3D ; 61 30e1a: cb 01 movw r24, r22 30e1c: b4 01 movw r22, r8 30e1e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 30e22: 6b 01 movw r12, r22 30e24: 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); 30e26: 20 e0 ldi r18, 0x00 ; 0 30e28: 30 e0 ldi r19, 0x00 ; 0 30e2a: 40 ea ldi r20, 0xA0 ; 160 30e2c: 51 e4 ldi r21, 0x41 ; 65 30e2e: c5 01 movw r24, r10 30e30: b4 01 movw r22, r8 30e32: 0f 94 c8 86 call 0x30d90 ; 0x30d90 30e36: 56 2e mov r5, r22 30e38: 47 2e mov r4, r23 30e3a: 38 2e mov r3, r24 30e3c: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 30e3e: a7 01 movw r20, r14 30e40: 96 01 movw r18, r12 30e42: c5 01 movw r24, r10 30e44: b4 01 movw r22, r8 30e46: 0f 94 c8 86 call 0x30d90 ; 0x30d90 30e4a: 69 83 std Y+1, r22 ; 0x01 30e4c: 7a 83 std Y+2, r23 ; 0x02 30e4e: 8b 83 std Y+3, r24 ; 0x03 30e50: 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) 30e52: bc 80 ldd r11, Y+4 ; 0x04 30e54: 8b 2d mov r24, r11 30e56: 90 e0 ldi r25, 0x00 ; 0 30e58: 9c 01 movw r18, r24 30e5a: 2d 5f subi r18, 0xFD ; 253 30e5c: 3f 4f sbci r19, 0xFF ; 255 30e5e: 3d 83 std Y+5, r19 ; 0x05 30e60: 2c 83 std Y+4, r18 ; 0x04 30e62: 0b 2d mov r16, r11 30e64: 10 e0 ldi r17, 0x00 ; 0 30e66: 8c 81 ldd r24, Y+4 ; 0x04 30e68: 9d 81 ldd r25, Y+5 ; 0x05 30e6a: 80 17 cp r24, r16 30e6c: 91 07 cpc r25, r17 30e6e: 0c f4 brge .+2 ; 0x30e72 30e70: a1 c0 rjmp .+322 ; 0x30fb4 { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 30e72: 2f 92 push r2 30e74: 3f 92 push r3 30e76: 4f 92 push r4 30e78: 5f 92 push r5 30e7a: b8 01 movw r22, r16 30e7c: 01 2e mov r0, r17 30e7e: 00 0c add r0, r0 30e80: 88 0b sbc r24, r24 30e82: 99 0b sbc r25, r25 30e84: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 30e88: a7 01 movw r20, r14 30e8a: 96 01 movw r18, r12 30e8c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 30e90: 9b 01 movw r18, r22 30e92: ac 01 movw r20, r24 30e94: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 30e98: 9b 01 movw r18, r22 30e9a: ac 01 movw r20, r24 30e9c: 60 e0 ldi r22, 0x00 ; 0 30e9e: 70 e0 ldi r23, 0x00 ; 0 30ea0: 8c e0 ldi r24, 0x0C ; 12 30ea2: 92 e4 ldi r25, 0x42 ; 66 30ea4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 30ea8: 9f 93 push r25 30eaa: 8f 93 push r24 30eac: 7f 93 push r23 30eae: 6f 93 push r22 30eb0: 1f 92 push r1 30eb2: 96 e4 ldi r25, 0x46 ; 70 30eb4: 9f 93 push r25 30eb6: 22 e3 ldi r18, 0x32 ; 50 30eb8: 38 ea ldi r19, 0xA8 ; 168 30eba: 3f 93 push r19 30ebc: 2f 93 push r18 30ebe: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 30ec2: b8 01 movw r22, r16 30ec4: 66 0f add r22, r22 30ec6: 77 1f adc r23, r23 30ec8: 6f 5f subi r22, 0xFF ; 255 30eca: 7f 4f sbci r23, 0xFF ; 255 30ecc: 07 2e mov r0, r23 30ece: 00 0c add r0, r0 30ed0: 88 0b sbc r24, r24 30ed2: 99 0b sbc r25, r25 30ed4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 30ed8: a7 01 movw r20, r14 30eda: 96 01 movw r18, r12 30edc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 30ee0: 9b 01 movw r18, r22 30ee2: ac 01 movw r20, r24 30ee4: 60 e0 ldi r22, 0x00 ; 0 30ee6: 70 e0 ldi r23, 0x00 ; 0 30ee8: 8c e0 ldi r24, 0x0C ; 12 30eea: 92 e4 ldi r25, 0x42 ; 66 30eec: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 30ef0: 96 2e mov r9, r22 30ef2: 87 2e mov r8, r23 30ef4: 78 2e mov r7, r24 30ef6: 69 2e mov r6, r25 30ef8: af 92 push r10 30efa: 9b 81 ldd r25, Y+3 ; 0x03 30efc: 9f 93 push r25 30efe: 2a 81 ldd r18, Y+2 ; 0x02 30f00: 2f 93 push r18 30f02: 39 81 ldd r19, Y+1 ; 0x01 30f04: 3f 93 push r19 30f06: 6f 92 push r6 30f08: 7f 92 push r7 30f0a: 8f 92 push r8 30f0c: 9f 92 push r9 30f0e: 1f 92 push r1 30f10: 86 e4 ldi r24, 0x46 ; 70 30f12: 8f 93 push r24 30f14: 22 e3 ldi r18, 0x32 ; 50 30f16: 38 ea ldi r19, 0xA8 ; 168 30f18: 3f 93 push r19 30f1a: 2f 93 push r18 30f1c: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 30f20: 2f 92 push r2 30f22: 3f 92 push r3 30f24: 4f 92 push r4 30f26: 5f 92 push r5 30f28: 6f 92 push r6 30f2a: 7f 92 push r7 30f2c: 8f 92 push r8 30f2e: 9f 92 push r9 30f30: 1f 92 push r1 30f32: 92 e3 ldi r25, 0x32 ; 50 30f34: 9f 93 push r25 30f36: 22 e3 ldi r18, 0x32 ; 50 30f38: 38 ea ldi r19, 0xA8 ; 168 30f3a: 3f 93 push r19 30f3c: 2f 93 push r18 30f3e: 0e 94 bd 88 call 0x1117a ; 0x1117a enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 30f42: 0f b6 in r0, 0x3f ; 63 30f44: f8 94 cli 30f46: de bf out 0x3e, r29 ; 62 30f48: 0f be out 0x3f, r0 ; 63 30f4a: cd bf out 0x3d, r28 ; 61 30f4c: af 92 push r10 30f4e: 3b 81 ldd r19, Y+3 ; 0x03 30f50: 3f 93 push r19 30f52: 8a 81 ldd r24, Y+2 ; 0x02 30f54: 8f 93 push r24 30f56: 99 81 ldd r25, Y+1 ; 0x01 30f58: 9f 93 push r25 30f5a: b8 01 movw r22, r16 30f5c: 6f 5f subi r22, 0xFF ; 255 30f5e: 7f 4f sbci r23, 0xFF ; 255 30f60: 07 2e mov r0, r23 30f62: 00 0c add r0, r0 30f64: 88 0b sbc r24, r24 30f66: 99 0b sbc r25, r25 30f68: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 30f6c: a7 01 movw r20, r14 30f6e: 96 01 movw r18, r12 30f70: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 30f74: 9b 01 movw r18, r22 30f76: ac 01 movw r20, r24 30f78: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 30f7c: 9b 01 movw r18, r22 30f7e: ac 01 movw r20, r24 30f80: 60 e0 ldi r22, 0x00 ; 0 30f82: 70 e0 ldi r23, 0x00 ; 0 30f84: 8c e0 ldi r24, 0x0C ; 12 30f86: 92 e4 ldi r25, 0x42 ; 66 30f88: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 30f8c: 9f 93 push r25 30f8e: 8f 93 push r24 30f90: 7f 93 push r23 30f92: 6f 93 push r22 30f94: 1f 92 push r1 30f96: 22 e3 ldi r18, 0x32 ; 50 30f98: 2f 93 push r18 30f9a: 82 e3 ldi r24, 0x32 ; 50 30f9c: 98 ea ldi r25, 0xA8 ; 168 30f9e: 9f 93 push r25 30fa0: 8f 93 push r24 30fa2: 0e 94 bd 88 call 0x1117a ; 0x1117a 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) 30fa6: b3 94 inc r11 30fa8: 0f b6 in r0, 0x3f ; 63 30faa: f8 94 cli 30fac: de bf out 0x3e, r29 ; 62 30fae: 0f be out 0x3f, r0 ; 63 30fb0: cd bf out 0x3d, r28 ; 61 30fb2: 57 cf rjmp .-338 ; 0x30e62 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); } } 30fb4: 0f 90 pop r0 30fb6: 0f 90 pop r0 30fb8: 0f 90 pop r0 30fba: 0f 90 pop r0 30fbc: 0f 90 pop r0 30fbe: df 91 pop r29 30fc0: cf 91 pop r28 30fc2: 1f 91 pop r17 30fc4: 0f 91 pop r16 30fc6: ff 90 pop r15 30fc8: ef 90 pop r14 30fca: df 90 pop r13 30fcc: cf 90 pop r12 30fce: bf 90 pop r11 30fd0: af 90 pop r10 30fd2: 9f 90 pop r9 30fd4: 8f 90 pop r8 30fd6: 7f 90 pop r7 30fd8: 6f 90 pop r6 30fda: 5f 90 pop r5 30fdc: 4f 90 pop r4 30fde: 3f 90 pop r3 30fe0: 2f 90 pop r2 30fe2: 08 95 ret 00030fe4 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30fe4: 9f b7 in r25, 0x3f ; 63 30fe6: 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)); 30fe8: 80 e1 ldi r24, 0x10 ; 16 30fea: e3 ea ldi r30, 0xA3 ; 163 30fec: f6 e0 ldi r31, 0x06 ; 6 30fee: a3 eb ldi r26, 0xB3 ; 179 30ff0: b6 e0 ldi r27, 0x06 ; 6 30ff2: 01 90 ld r0, Z+ 30ff4: 0d 92 st X+, r0 30ff6: 8a 95 dec r24 30ff8: e1 f7 brne .-8 ; 0x30ff2 CRITICAL_SECTION_END; 30ffa: 9f bf out 0x3f, r25 ; 63 } 30ffc: 08 95 ret 00030ffe : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30ffe: 89 e0 ldi r24, 0x09 ; 9 31000: 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])) 31004: ef e6 ldi r30, 0x6F ; 111 31006: f8 ea ldi r31, 0xA8 ; 168 31008: 85 91 lpm r24, Z+ 3100a: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 3100c: 0e 94 b3 72 call 0xe566 ; 0xe566 31010: 0c 94 64 f1 jmp 0x1e2c8 ; 0x1e2c8 00031014 : 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){ 31014: cf 93 push r28 31016: c8 2f mov r28, r24 extruder = ex; 31018: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 3101c: 80 ed ldi r24, 0xD0 ; 208 3101e: 9b ea ldi r25, 0xAB ; 171 31020: 0e 94 57 77 call 0xeeae ; 0xeeae 31024: 8c e2 ldi r24, 0x2C ; 44 31026: 98 ea ldi r25, 0xA8 ; 168 31028: 0e 94 57 77 call 0xeeae ; 0xeeae 3102c: 82 e2 ldi r24, 0x22 ; 34 3102e: 98 ea ldi r25, 0xA8 ; 168 31030: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN((int)ex); 31034: 8c 2f mov r24, r28 31036: 90 e0 ldi r25, 0x00 ; 0 } 31038: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 3103a: 0d 94 fc 74 jmp 0x2e9f8 ; 0x2e9f8 0003103e : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 3103e: 0f 93 push r16 31040: 1f 93 push r17 31042: cf 93 push r28 31044: df 93 push r29 31046: 00 d0 rcall .+0 ; 0x31048 31048: 00 d0 rcall .+0 ; 0x3104a 3104a: 1f 92 push r1 3104c: 1f 92 push r1 3104e: cd b7 in r28, 0x3d ; 61 31050: de b7 in r29, 0x3e ; 62 31052: 08 ee ldi r16, 0xE8 ; 232 31054: 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; 31056: 1d 82 std Y+5, r1 ; 0x05 31058: 1e 82 std Y+6, r1 ; 0x06 3105a: 1f 82 std Y+7, r1 ; 0x07 3105c: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 3105e: 19 82 std Y+1, r1 ; 0x01 31060: 1a 82 std Y+2, r1 ; 0x02 31062: 1b 82 std Y+3, r1 ; 0x03 31064: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 31066: ae 01 movw r20, r28 31068: 4b 5f subi r20, 0xFB ; 251 3106a: 5f 4f sbci r21, 0xFF ; 255 3106c: 6f e6 ldi r22, 0x6F ; 111 3106e: 80 e0 ldi r24, 0x00 ; 0 31070: 0f 94 f8 23 call 0x247f0 ; 0x247f0 tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 31074: ae 01 movw r20, r28 31076: 4f 5f subi r20, 0xFF ; 255 31078: 5f 4f sbci r21, 0xFF ; 255 3107a: 6f e6 ldi r22, 0x6F ; 111 3107c: 81 e0 ldi r24, 0x01 ; 1 3107e: 0f 94 f8 23 call 0x247f0 ; 0x247f0 // 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); 31082: 8d 81 ldd r24, Y+5 ; 0x05 31084: 9e 81 ldd r25, Y+6 ; 0x06 31086: af 81 ldd r26, Y+7 ; 0x07 31088: b8 85 ldd r27, Y+8 ; 0x08 3108a: b7 fd sbrc r27, 7 3108c: 07 c0 rjmp .+14 ; 0x3109c tmc2130_check_overtemp(); 3108e: 0f 94 ee 29 call 0x253dc ; 0x253dc 31092: 01 50 subi r16, 0x01 ; 1 31094: 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)) 31096: f9 f6 brne .-66 ; 0x31056 31098: 80 e0 ldi r24, 0x00 ; 0 3109a: 09 c0 rjmp .+18 ; 0x310ae 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); 3109c: 89 81 ldd r24, Y+1 ; 0x01 3109e: 9a 81 ldd r25, Y+2 ; 0x02 310a0: ab 81 ldd r26, Y+3 ; 0x03 310a2: bc 81 ldd r27, Y+4 ; 0x04 310a4: b7 ff sbrs r27, 7 310a6: f3 cf rjmp .-26 ; 0x3108e tmc2130_check_overtemp(); 310a8: 0f 94 ee 29 call 0x253dc ; 0x253dc 310ac: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 310ae: 28 96 adiw r28, 0x08 ; 8 310b0: 0f b6 in r0, 0x3f ; 63 310b2: f8 94 cli 310b4: de bf out 0x3e, r29 ; 62 310b6: 0f be out 0x3f, r0 ; 63 310b8: cd bf out 0x3d, r28 ; 61 310ba: df 91 pop r29 310bc: cf 91 pop r28 310be: 1f 91 pop r17 310c0: 0f 91 pop r16 310c2: 08 95 ret 000310c4 : 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) { 310c4: 1f 93 push r17 310c6: cf 93 push r28 310c8: df 93 push r29 310ca: ec 01 movw r28, r24 310cc: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 310ce: 0f 94 ef 42 call 0x285de ; 0x285de 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))); 310d2: fe 01 movw r30, r28 310d4: 34 96 adiw r30, 0x04 ; 4 310d6: 25 91 lpm r18, Z+ 310d8: 35 91 lpm r19, Z+ 310da: 45 91 lpm r20, Z+ 310dc: 54 91 lpm r21, Z 310de: fe 01 movw r30, r28 310e0: 65 91 lpm r22, Z+ 310e2: 75 91 lpm r23, Z+ 310e4: 85 91 lpm r24, Z+ 310e6: 94 91 lpm r25, Z 310e8: 0f 94 b8 c5 call 0x38b70 ; 0x38b70 step++; 310ec: 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) { 310ee: 11 50 subi r17, 0x01 ; 1 310f0: 81 f7 brne .-32 ; 0x310d2 310f2: 0f 94 ef 42 call 0x285de ; 0x285de // 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(); } 310f6: df 91 pop r29 310f8: cf 91 pop r28 310fa: 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(); 310fc: 0d 94 b6 c5 jmp 0x38b6c ; 0x38b6c 00031100 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 31100: 0e 94 97 67 call 0xcf2e ; 0xcf2e 31104: 81 11 cpse r24, r1 31106: 04 c0 rjmp .+8 ; 0x31110 lcd_setstatuspgm(MSG_WELCOME); 31108: 83 e7 ldi r24, 0x73 ; 115 3110a: 90 e7 ldi r25, 0x70 ; 112 3110c: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 } custom_message_type = CustomMsg::Status; 31110: 10 92 c4 06 sts 0x06C4, r1 ; 0x8006c4 } 31114: 08 95 ret 00031116 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 31116: 80 91 ba 13 lds r24, 0x13BA ; 0x8013ba 3111a: 88 23 and r24, r24 3111c: 11 f0 breq .+4 ; 0x31122 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; 3111e: 81 e0 ldi r24, 0x01 ; 1 31120: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 31122: 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; } } 31124: 08 95 ret 00031126 : } 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) 31126: 2f 92 push r2 31128: 3f 92 push r3 3112a: 4f 92 push r4 3112c: 5f 92 push r5 3112e: 6f 92 push r6 31130: 7f 92 push r7 31132: 8f 92 push r8 31134: 9f 92 push r9 31136: af 92 push r10 31138: bf 92 push r11 3113a: cf 92 push r12 3113c: df 92 push r13 3113e: ef 92 push r14 31140: ff 92 push r15 31142: 0f 93 push r16 31144: 1f 93 push r17 31146: cf 93 push r28 31148: df 93 push r29 3114a: cd b7 in r28, 0x3d ; 61 3114c: de b7 in r29, 0x3e ; 62 3114e: 2d 97 sbiw r28, 0x0d ; 13 31150: 0f b6 in r0, 0x3f ; 63 31152: f8 94 cli 31154: de bf out 0x3e, r29 ; 62 31156: 0f be out 0x3f, r0 ; 63 31158: cd bf out 0x3d, r28 ; 61 3115a: 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; 3115c: 41 2c mov r4, r1 3115e: 51 2c mov r5, r1 31160: 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; 31162: 6e 31 cpi r22, 0x1E ; 30 31164: 90 f0 brcs .+36 ; 0x3118a 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 31166: 69 3c cpi r22, 0xC9 ; 201 31168: 08 f0 brcs .+2 ; 0x3116c 3116a: 68 ec ldi r22, 0xC8 ; 200 3116c: 70 e0 ldi r23, 0x00 ; 0 3116e: 68 51 subi r22, 0x18 ; 24 31170: 7c 4f sbci r23, 0xFC ; 252 31172: 90 e0 ldi r25, 0x00 ; 0 31174: 80 e0 ldi r24, 0x00 ; 0 31176: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 3117a: 20 e0 ldi r18, 0x00 ; 0 3117c: 30 e0 ldi r19, 0x00 ; 0 3117e: 4a e7 ldi r20, 0x7A ; 122 31180: 54 e4 ldi r21, 0x44 ; 68 31182: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 31186: 2b 01 movw r4, r22 31188: 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) 3118a: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 3118e: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 31192: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 31196: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 3119a: 89 83 std Y+1, r24 ; 0x01 3119c: 9a 83 std Y+2, r25 ; 0x02 3119e: ab 83 std Y+3, r26 ; 0x03 311a0: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 311a2: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 311a6: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 311aa: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 311ae: 8d 83 std Y+5, r24 ; 0x05 311b0: 9e 83 std Y+6, r25 ; 0x06 311b2: 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); 311b4: 20 e0 ldi r18, 0x00 ; 0 311b6: 30 e0 ldi r19, 0x00 ; 0 311b8: 47 ef ldi r20, 0xF7 ; 247 311ba: 50 e0 ldi r21, 0x00 ; 0 311bc: 69 ee ldi r22, 0xE9 ; 233 311be: 8e 2d mov r24, r14 311c0: 0f 94 52 24 call 0x248a4 ; 0x248a4 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 311c4: 81 2c mov r8, r1 311c6: 91 2c mov r9, r1 311c8: 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 311ca: 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 311cc: 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 311ce: 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 311d0: 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 311d2: 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) 311d4: 2f 2c mov r2, r15 311d6: 31 2c mov r3, r1 311d8: 8f 2d mov r24, r15 311da: 8f 71 andi r24, 0x1F ; 31 311dc: 88 87 std Y+8, r24 ; 0x08 311de: 81 11 cpse r24, r1 311e0: 03 c0 rjmp .+6 ; 0x311e8 reg = 0; 311e2: 81 2c mov r8, r1 311e4: 91 2c mov r9, r1 311e6: 54 01 movw r10, r8 311e8: b1 01 movw r22, r2 311ea: 03 2c mov r0, r3 311ec: 00 0c add r0, r0 311ee: 88 0b sbc r24, r24 311f0: 99 0b sbc r25, r25 311f2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 311f6: 2b ed ldi r18, 0xDB ; 219 311f8: 3f e0 ldi r19, 0x0F ; 15 311fa: 49 ec ldi r20, 0xC9 ; 201 311fc: 50 e4 ldi r21, 0x40 ; 64 311fe: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 31202: 6a 87 std Y+10, r22 ; 0x0a 31204: 7b 87 std Y+11, r23 ; 0x0b 31206: 8c 87 std Y+12, r24 ; 0x0c 31208: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 3120a: 20 e0 ldi r18, 0x00 ; 0 3120c: 30 e0 ldi r19, 0x00 ; 0 3120e: a9 01 movw r20, r18 31210: c3 01 movw r24, r6 31212: b2 01 movw r22, r4 31214: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 31218: 81 11 cpse r24, r1 3121a: 4d c0 rjmp .+154 ; 0x312b6 vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 3121c: 2b ed ldi r18, 0xDB ; 219 3121e: 3f e0 ldi r19, 0x0F ; 15 31220: 49 e4 ldi r20, 0x49 ; 73 31222: 50 e4 ldi r21, 0x40 ; 64 31224: 6a 85 ldd r22, Y+10 ; 0x0a 31226: 7b 85 ldd r23, Y+11 ; 0x0b 31228: 8c 85 ldd r24, Y+12 ; 0x0c 3122a: 9d 85 ldd r25, Y+13 ; 0x0d 3122c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31230: 20 e0 ldi r18, 0x00 ; 0 31232: 30 e0 ldi r19, 0x00 ; 0 31234: 40 e8 ldi r20, 0x80 ; 128 31236: 5a e3 ldi r21, 0x3A ; 58 31238: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3123c: 0f 94 0b e1 call 0x3c216 ; 0x3c216 31240: 20 e0 ldi r18, 0x00 ; 0 31242: 30 e0 ldi r19, 0x00 ; 0 31244: 48 e7 ldi r20, 0x78 ; 120 31246: 53 e4 ldi r21, 0x43 ; 67 31248: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3124c: 20 e0 ldi r18, 0x00 ; 0 3124e: 30 e0 ldi r19, 0x00 ; 0 31250: 40 e0 ldi r20, 0x00 ; 0 31252: 5f e3 ldi r21, 0x3F ; 63 31254: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31258: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 3125c: cc 24 eor r12, r12 3125e: ca 94 dec r12 31260: 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 31262: 8c 2d mov r24, r12 31264: 99 85 ldd r25, Y+9 ; 0x09 31266: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 31268: 8d 15 cp r24, r13 3126a: f9 f0 breq .+62 ; 0x312aa else if (dA == d1) b = 1; //delta == delta1 => bit=1 3126c: 80 17 cp r24, r16 3126e: 09 f4 brne .+2 ; 0x31272 31270: 71 c0 rjmp .+226 ; 0x31354 else { if (dA < d0) // delta < delta0 => switch wbit down 31272: 8d 15 cp r24, r13 31274: 0c f0 brlt .+2 ; 0x31278 31276: 53 c0 rjmp .+166 ; 0x3131e { //printf("dn\n"); b = 0; switch (dA) 31278: 88 23 and r24, r24 3127a: e9 f1 breq .+122 ; 0x312f6 3127c: 81 30 cpi r24, 0x01 ; 1 3127e: 09 f4 brne .+2 ; 0x31282 31280: 44 c0 rjmp .+136 ; 0x3130a 31282: 8f 3f cpi r24, 0xFF ; 255 31284: 09 f0 breq .+2 ; 0x31288 31286: 81 c0 rjmp .+258 ; 0x3138a { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 31288: e2 e0 ldi r30, 0x02 ; 2 3128a: f0 e0 ldi r31, 0x00 ; 0 3128c: ec 0f add r30, r28 3128e: fd 1f adc r31, r29 31290: e1 0f add r30, r17 31292: f1 1d adc r31, r1 31294: 10 82 st Z, r1 31296: 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++; } 31298: e5 e0 ldi r30, 0x05 ; 5 3129a: f0 e0 ldi r31, 0x00 ; 0 3129c: ec 0f add r30, r28 3129e: fd 1f adc r31, r29 312a0: e1 0f add r30, r17 312a2: f1 1d adc r31, r1 312a4: f0 82 st Z, r15 312a6: 1f 5f subi r17, 0xFF ; 255 312a8: 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) 312aa: 14 30 cpi r17, 0x04 ; 4 312ac: 08 f4 brcc .+2 ; 0x312b0 312ae: 56 c0 rjmp .+172 ; 0x3135c 312b0: 6c c0 rjmp .+216 ; 0x3138a 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); 312b2: f8 2e mov r15, r24 312b4: 8f cf rjmp .-226 ; 0x311d4 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); 312b6: 20 e0 ldi r18, 0x00 ; 0 312b8: 30 e0 ldi r19, 0x00 ; 0 312ba: 40 e8 ldi r20, 0x80 ; 128 312bc: 5a e3 ldi r21, 0x3A ; 58 312be: 6a 85 ldd r22, Y+10 ; 0x0a 312c0: 7b 85 ldd r23, Y+11 ; 0x0b 312c2: 8c 85 ldd r24, Y+12 ; 0x0c 312c4: 9d 85 ldd r25, Y+13 ; 0x0d 312c6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 312ca: 0f 94 0b e1 call 0x3c216 ; 0x3c216 312ce: a3 01 movw r20, r6 312d0: 92 01 movw r18, r4 312d2: 0f 94 bb e0 call 0x3c176 ; 0x3c176 312d6: 20 e0 ldi r18, 0x00 ; 0 312d8: 30 e0 ldi r19, 0x00 ; 0 312da: 47 e7 ldi r20, 0x77 ; 119 312dc: 53 e4 ldi r21, 0x43 ; 67 312de: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 312e2: 20 e0 ldi r18, 0x00 ; 0 312e4: 30 e0 ldi r19, 0x00 ; 0 312e6: 40 e0 ldi r20, 0x00 ; 0 312e8: 5f e3 ldi r21, 0x3F ; 63 312ea: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 312ee: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 312f2: c6 2e mov r12, r22 312f4: b6 cf rjmp .-148 ; 0x31262 //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; 312f6: e2 e0 ldi r30, 0x02 ; 2 312f8: f0 e0 ldi r31, 0x00 ; 0 312fa: ec 0f add r30, r28 312fc: fd 1f adc r31, r29 312fe: e1 0f add r30, r17 31300: f1 1d adc r31, r1 31302: 91 e0 ldi r25, 0x01 ; 1 31304: 90 83 st Z, r25 31306: 01 e0 ldi r16, 0x01 ; 1 31308: c7 cf rjmp .-114 ; 0x31298 case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 3130a: e2 e0 ldi r30, 0x02 ; 2 3130c: f0 e0 ldi r31, 0x00 ; 0 3130e: ec 0f add r30, r28 31310: fd 1f adc r31, r29 31312: e1 0f add r30, r17 31314: f1 1d adc r31, r1 31316: 92 e0 ldi r25, 0x02 ; 2 31318: 90 83 st Z, r25 3131a: 02 e0 ldi r16, 0x02 ; 2 3131c: bd cf rjmp .-134 ; 0x31298 default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 3131e: 08 17 cp r16, r24 31320: a4 f5 brge .+104 ; 0x3138a { //printf("up\n"); b = 1; switch (dA) 31322: 82 30 cpi r24, 0x02 ; 2 31324: 09 f4 brne .+2 ; 0x31328 31326: 80 c0 rjmp .+256 ; 0x31428 31328: 83 30 cpi r24, 0x03 ; 3 3132a: 09 f4 brne .+2 ; 0x3132e 3132c: 88 c0 rjmp .+272 ; 0x3143e 3132e: 81 30 cpi r24, 0x01 ; 1 31330: 61 f5 brne .+88 ; 0x3138a { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 31332: e2 e0 ldi r30, 0x02 ; 2 31334: f0 e0 ldi r31, 0x00 ; 0 31336: ec 0f add r30, r28 31338: fd 1f adc r31, r29 3133a: e1 0f add r30, r17 3133c: f1 1d adc r31, r1 3133e: 80 83 st Z, r24 31340: 01 e0 ldi r16, 0x01 ; 1 31342: 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++; } 31344: e5 e0 ldi r30, 0x05 ; 5 31346: f0 e0 ldi r31, 0x00 ; 0 31348: ec 0f add r30, r28 3134a: fd 1f adc r31, r29 3134c: e1 0f add r30, r17 3134e: f1 1d adc r31, r1 31350: f0 82 st Z, r15 31352: 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) 31354: 14 30 cpi r17, 0x04 ; 4 31356: c8 f4 brcc .+50 ; 0x3138a //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 31358: 68 94 set 3135a: b7 f8 bld r11, 7 if ((i & 31) == 31) 3135c: 88 85 ldd r24, Y+8 ; 0x08 3135e: 8f 31 cpi r24, 0x1F ; 31 31360: 09 f0 breq .+2 ; 0x31364 31362: 78 c0 rjmp .+240 ; 0x31454 tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 31364: b1 01 movw r22, r2 31366: e5 e0 ldi r30, 0x05 ; 5 31368: 75 95 asr r23 3136a: 67 95 ror r22 3136c: ea 95 dec r30 3136e: e1 f7 brne .-8 ; 0x31368 //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); 31370: 60 5a subi r22, 0xA0 ; 160 31372: 60 68 ori r22, 0x80 ; 128 31374: a5 01 movw r20, r10 31376: 94 01 movw r18, r8 31378: 8e 2d mov r24, r14 3137a: 0f 94 52 24 call 0x248a4 ; 0x248a4 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); 3137e: 81 e0 ldi r24, 0x01 ; 1 31380: 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; 31382: 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); 31384: 9f ef ldi r25, 0xFF ; 255 31386: f9 12 cpse r15, r25 31388: 94 cf rjmp .-216 ; 0x312b2 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; 3138a: 2a 81 ldd r18, Y+2 ; 0x02 3138c: 30 e0 ldi r19, 0x00 ; 0 3138e: 50 e0 ldi r21, 0x00 ; 0 31390: 40 e0 ldi r20, 0x00 ; 0 31392: 82 e0 ldi r24, 0x02 ; 2 31394: 22 0f add r18, r18 31396: 33 1f adc r19, r19 31398: 44 1f adc r20, r20 3139a: 55 1f adc r21, r21 3139c: 8a 95 dec r24 3139e: d1 f7 brne .-12 ; 0x31394 val |= ((uint32_t)w2) << 4; 313a0: 8b 80 ldd r8, Y+3 ; 0x03 313a2: 91 2c mov r9, r1 313a4: b1 2c mov r11, r1 313a6: a1 2c mov r10, r1 313a8: 94 e0 ldi r25, 0x04 ; 4 313aa: 88 0c add r8, r8 313ac: 99 1c adc r9, r9 313ae: aa 1c adc r10, r10 313b0: bb 1c adc r11, r11 313b2: 9a 95 dec r25 313b4: d1 f7 brne .-12 ; 0x313aa 313b6: 82 2a or r8, r18 313b8: 93 2a or r9, r19 313ba: a4 2a or r10, r20 313bc: 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); 313be: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 313c0: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 313c2: 8c 81 ldd r24, Y+4 ; 0x04 313c4: 90 e0 ldi r25, 0x00 ; 0 313c6: b0 e0 ldi r27, 0x00 ; 0 313c8: a0 e0 ldi r26, 0x00 ; 0 313ca: 9c 01 movw r18, r24 313cc: ad 01 movw r20, r26 313ce: 66 e0 ldi r22, 0x06 ; 6 313d0: 22 0f add r18, r18 313d2: 33 1f adc r19, r19 313d4: 44 1f adc r20, r20 313d6: 55 1f adc r21, r21 313d8: 6a 95 dec r22 313da: d1 f7 brne .-12 ; 0x313d0 313dc: 28 29 or r18, r8 313de: 39 29 or r19, r9 313e0: 4a 29 or r20, r10 313e2: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 313e4: 8d 81 ldd r24, Y+5 ; 0x05 313e6: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 313e8: 8e 81 ldd r24, Y+6 ; 0x06 313ea: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 313ec: 8f 81 ldd r24, Y+7 ; 0x07 313ee: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 313f0: 68 ee ldi r22, 0xE8 ; 232 313f2: 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]); } 313f4: 2d 96 adiw r28, 0x0d ; 13 313f6: 0f b6 in r0, 0x3f ; 63 313f8: f8 94 cli 313fa: de bf out 0x3e, r29 ; 62 313fc: 0f be out 0x3f, r0 ; 63 313fe: cd bf out 0x3d, r28 ; 61 31400: df 91 pop r29 31402: cf 91 pop r28 31404: 1f 91 pop r17 31406: 0f 91 pop r16 31408: ff 90 pop r15 3140a: ef 90 pop r14 3140c: df 90 pop r13 3140e: cf 90 pop r12 31410: bf 90 pop r11 31412: af 90 pop r10 31414: 9f 90 pop r9 31416: 8f 90 pop r8 31418: 7f 90 pop r7 3141a: 6f 90 pop r6 3141c: 5f 90 pop r5 3141e: 4f 90 pop r4 31420: 3f 90 pop r3 31422: 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); 31424: 0d 94 52 24 jmp 0x248a4 ; 0x248a4 //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; 31428: e2 e0 ldi r30, 0x02 ; 2 3142a: f0 e0 ldi r31, 0x00 ; 0 3142c: ec 0f add r30, r28 3142e: fd 1f adc r31, r29 31430: e1 0f add r30, r17 31432: f1 1d adc r31, r1 31434: 80 83 st Z, r24 31436: 02 e0 ldi r16, 0x02 ; 2 31438: dd 24 eor r13, r13 3143a: d3 94 inc r13 3143c: 83 cf rjmp .-250 ; 0x31344 case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 3143e: e2 e0 ldi r30, 0x02 ; 2 31440: f0 e0 ldi r31, 0x00 ; 0 31442: ec 0f add r30, r28 31444: fd 1f adc r31, r29 31446: e1 0f add r30, r17 31448: f1 1d adc r31, r1 3144a: 80 83 st Z, r24 3144c: 03 e0 ldi r16, 0x03 ; 3 3144e: f2 e0 ldi r31, 0x02 ; 2 31450: df 2e mov r13, r31 31452: 78 cf rjmp .-272 ; 0x31344 //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; 31454: b6 94 lsr r11 31456: a7 94 ror r10 31458: 97 94 ror r9 3145a: 87 94 ror r8 3145c: 90 cf rjmp .-224 ; 0x3137e 0003145e : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 3145e: 8f 92 push r8 31460: 9f 92 push r9 31462: af 92 push r10 31464: bf 92 push r11 31466: cf 92 push r12 31468: df 92 push r13 3146a: ef 92 push r14 3146c: ff 92 push r15 3146e: 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]) { 31472: 88 23 and r24, r24 31474: 09 f4 brne .+2 ; 0x31478 31476: 9d c0 rjmp .+314 ; 0x315b2 31478: 91 11 cpse r25, r1 3147a: 92 c0 rjmp .+292 ; 0x315a0 st_synchronize(); 3147c: 0f 94 ef 42 call 0x285de ; 0x285de set_destination_to_current(); 31480: 0e 94 41 68 call 0xd082 ; 0xd082 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 31484: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 31488: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 3148c: 07 2e mov r0, r23 3148e: 00 0c add r0, r0 31490: 88 0b sbc r24, r24 31492: 99 0b sbc r25, r25 31494: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 31498: 20 91 41 0e lds r18, 0x0E41 ; 0x800e41 3149c: 30 91 42 0e lds r19, 0x0E42 ; 0x800e42 314a0: 40 91 43 0e lds r20, 0x0E43 ; 0x800e43 314a4: 50 91 44 0e lds r21, 0x0E44 ; 0x800e44 314a8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 314ac: 2a e0 ldi r18, 0x0A ; 10 314ae: 37 ed ldi r19, 0xD7 ; 215 314b0: 43 e2 ldi r20, 0x23 ; 35 314b2: 5c e3 ldi r21, 0x3C ; 60 314b4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 314b8: 20 91 9e 06 lds r18, 0x069E ; 0x80069e 314bc: 30 91 9f 06 lds r19, 0x069F ; 0x80069f 314c0: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 314c4: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 314c8: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 314cc: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 314d0: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 314d4: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 314d8: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); 314dc: 8e e9 ldi r24, 0x9E ; 158 314de: 96 e0 ldi r25, 0x06 ; 6 314e0: 0f 94 c5 63 call 0x2c78a ; 0x2c78a float oldFeedrate = feedrate; 314e4: c0 90 b8 02 lds r12, 0x02B8 ; 0x8002b8 314e8: d0 90 b9 02 lds r13, 0x02B9 ; 0x8002b9 314ec: e0 90 ba 02 lds r14, 0x02BA ; 0x8002ba 314f0: f0 90 bb 02 lds r15, 0x02BB ; 0x8002bb feedrate=cs.retract_feedrate*60; 314f4: 20 e0 ldi r18, 0x00 ; 0 314f6: 30 e0 ldi r19, 0x00 ; 0 314f8: 40 e7 ldi r20, 0x70 ; 112 314fa: 52 e4 ldi r21, 0x42 ; 66 314fc: 60 91 45 0e lds r22, 0x0E45 ; 0x800e45 31500: 70 91 46 0e lds r23, 0x0E46 ; 0x800e46 31504: 80 91 47 0e lds r24, 0x0E47 ; 0x800e47 31508: 90 91 48 0e lds r25, 0x0E48 ; 0x800e48 3150c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 31510: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 31514: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 31518: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 3151c: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb retracted[active_extruder]=true; 31520: 81 e0 ldi r24, 0x01 ; 1 31522: 80 93 8e 06 sts 0x068E, r24 ; 0x80068e prepare_move(); 31526: 90 e0 ldi r25, 0x00 ; 0 31528: 80 e0 ldi r24, 0x00 ; 0 3152a: 0e 94 0f 6c call 0xd81e ; 0xd81e if(cs.retract_zlift) { 3152e: 20 e0 ldi r18, 0x00 ; 0 31530: 30 e0 ldi r19, 0x00 ; 0 31532: a9 01 movw r20, r18 31534: 60 91 49 0e lds r22, 0x0E49 ; 0x800e49 31538: 70 91 4a 0e lds r23, 0x0E4A ; 0x800e4a 3153c: 80 91 4b 0e lds r24, 0x0E4B ; 0x800e4b 31540: 90 91 4c 0e lds r25, 0x0E4C ; 0x800e4c 31544: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 31548: 88 23 and r24, r24 3154a: 11 f1 breq .+68 ; 0x31590 st_synchronize(); 3154c: 0f 94 ef 42 call 0x285de ; 0x285de current_position[Z_AXIS]-=cs.retract_zlift; 31550: 20 91 49 0e lds r18, 0x0E49 ; 0x800e49 31554: 30 91 4a 0e lds r19, 0x0E4A ; 0x800e4a 31558: 40 91 4b 0e lds r20, 0x0E4B ; 0x800e4b 3155c: 50 91 4c 0e lds r21, 0x0E4C ; 0x800e4c 31560: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31564: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 31568: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3156c: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31570: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 31574: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 31578: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3157c: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31580: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_position_curposXYZE(); 31584: 0f 94 10 bf call 0x37e20 ; 0x37e20 prepare_move(); 31588: 90 e0 ldi r25, 0x00 ; 0 3158a: 80 e0 ldi r24, 0x00 ; 0 3158c: 0e 94 0f 6c call 0xd81e ; 0xd81e } feedrate = oldFeedrate; 31590: c0 92 b8 02 sts 0x02B8, r12 ; 0x8002b8 31594: d0 92 b9 02 sts 0x02B9, r13 ; 0x8002b9 31598: e0 92 ba 02 sts 0x02BA, r14 ; 0x8002ba 3159c: 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 315a0: ff 90 pop r15 315a2: ef 90 pop r14 315a4: df 90 pop r13 315a6: cf 90 pop r12 315a8: bf 90 pop r11 315aa: af 90 pop r10 315ac: 9f 90 pop r9 315ae: 8f 90 pop r8 315b0: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 315b2: 99 23 and r25, r25 315b4: a9 f3 breq .-22 ; 0x315a0 st_synchronize(); 315b6: 0f 94 ef 42 call 0x285de ; 0x285de set_destination_to_current(); 315ba: 0e 94 41 68 call 0xd082 ; 0xd082 float oldFeedrate = feedrate; 315be: 80 90 b8 02 lds r8, 0x02B8 ; 0x8002b8 315c2: 90 90 b9 02 lds r9, 0x02B9 ; 0x8002b9 315c6: a0 90 ba 02 lds r10, 0x02BA ; 0x8002ba 315ca: b0 90 bb 02 lds r11, 0x02BB ; 0x8002bb feedrate=cs.retract_recover_feedrate*60; 315ce: 20 e0 ldi r18, 0x00 ; 0 315d0: 30 e0 ldi r19, 0x00 ; 0 315d2: 40 e7 ldi r20, 0x70 ; 112 315d4: 52 e4 ldi r21, 0x42 ; 66 315d6: 60 91 51 0e lds r22, 0x0E51 ; 0x800e51 315da: 70 91 52 0e lds r23, 0x0E52 ; 0x800e52 315de: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 315e2: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 315e6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 315ea: 60 93 b8 02 sts 0x02B8, r22 ; 0x8002b8 315ee: 70 93 b9 02 sts 0x02B9, r23 ; 0x8002b9 315f2: 80 93 ba 02 sts 0x02BA, r24 ; 0x8002ba 315f6: 90 93 bb 02 sts 0x02BB, r25 ; 0x8002bb if(cs.retract_zlift) { 315fa: c0 90 49 0e lds r12, 0x0E49 ; 0x800e49 315fe: d0 90 4a 0e lds r13, 0x0E4A ; 0x800e4a 31602: e0 90 4b 0e lds r14, 0x0E4B ; 0x800e4b 31606: f0 90 4c 0e lds r15, 0x0E4C ; 0x800e4c 3160a: 20 e0 ldi r18, 0x00 ; 0 3160c: 30 e0 ldi r19, 0x00 ; 0 3160e: a9 01 movw r20, r18 31610: c7 01 movw r24, r14 31612: b6 01 movw r22, r12 31614: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 31618: 88 23 and r24, r24 3161a: e1 f0 breq .+56 ; 0x31654 current_position[Z_AXIS]+=cs.retract_zlift; 3161c: a7 01 movw r20, r14 3161e: 96 01 movw r18, r12 31620: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31624: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 31628: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3162c: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31630: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31634: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 31638: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3163c: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31640: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_position_curposXYZE(); 31644: 0f 94 10 bf call 0x37e20 ; 0x37e20 prepare_move(); 31648: 90 e0 ldi r25, 0x00 ; 0 3164a: 80 e0 ldi r24, 0x00 ; 0 3164c: 0e 94 0f 6c call 0xd81e ; 0xd81e st_synchronize(); 31650: 0f 94 ef 42 call 0x285de ; 0x285de } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 31654: 20 91 4d 0e lds r18, 0x0E4D ; 0x800e4d 31658: 30 91 4e 0e lds r19, 0x0E4E ; 0x800e4e 3165c: 40 91 4f 0e lds r20, 0x0E4F ; 0x800e4f 31660: 50 91 50 0e lds r21, 0x0E50 ; 0x800e50 31664: 60 91 41 0e lds r22, 0x0E41 ; 0x800e41 31668: 70 91 42 0e lds r23, 0x0E42 ; 0x800e42 3166c: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 31670: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 31674: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31678: 6b 01 movw r12, r22 3167a: 7c 01 movw r14, r24 3167c: 60 91 bc 02 lds r22, 0x02BC ; 0x8002bc 31680: 70 91 bd 02 lds r23, 0x02BD ; 0x8002bd 31684: 07 2e mov r0, r23 31686: 00 0c add r0, r0 31688: 88 0b sbc r24, r24 3168a: 99 0b sbc r25, r25 3168c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 31690: 9b 01 movw r18, r22 31692: ac 01 movw r20, r24 31694: c7 01 movw r24, r14 31696: b6 01 movw r22, r12 31698: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3169c: 2a e0 ldi r18, 0x0A ; 10 3169e: 37 ed ldi r19, 0xD7 ; 215 316a0: 43 e2 ldi r20, 0x23 ; 35 316a2: 5c e3 ldi r21, 0x3C ; 60 316a4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 316a8: 9b 01 movw r18, r22 316aa: ac 01 movw r20, r24 316ac: 60 91 9e 06 lds r22, 0x069E ; 0x80069e 316b0: 70 91 9f 06 lds r23, 0x069F ; 0x80069f 316b4: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 316b8: 90 91 a1 06 lds r25, 0x06A1 ; 0x8006a1 316bc: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 316c0: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 316c4: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 316c8: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 316cc: 90 93 a1 06 sts 0x06A1, r25 ; 0x8006a1 plan_set_e_position(current_position[E_AXIS]); 316d0: 8e e9 ldi r24, 0x9E ; 158 316d2: 96 e0 ldi r25, 0x06 ; 6 316d4: 0f 94 c5 63 call 0x2c78a ; 0x2c78a retracted[active_extruder]=false; 316d8: 10 92 8e 06 sts 0x068E, r1 ; 0x80068e prepare_move(); 316dc: 90 e0 ldi r25, 0x00 ; 0 316de: 80 e0 ldi r24, 0x00 ; 0 316e0: 0e 94 0f 6c call 0xd81e ; 0xd81e feedrate = oldFeedrate; 316e4: 80 92 b8 02 sts 0x02B8, r8 ; 0x8002b8 316e8: 90 92 b9 02 sts 0x02B9, r9 ; 0x8002b9 316ec: a0 92 ba 02 sts 0x02BA, r10 ; 0x8002ba 316f0: b0 92 bb 02 sts 0x02BB, r11 ; 0x8002bb 316f4: 55 cf rjmp .-342 ; 0x315a0 000316f6 : 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) 316f6: ef 92 push r14 316f8: ff 92 push r15 316fa: 0f 93 push r16 316fc: 1f 93 push r17 316fe: cf 93 push r28 31700: c8 2f mov r28, r24 31702: 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; 31704: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 31708: c1 30 cpi r28, 0x01 ; 1 3170a: b9 f0 breq .+46 ; 0x3173a 3170c: c2 30 cpi r28, 0x02 ; 2 3170e: c1 f0 breq .+48 ; 0x31740 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31710: 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) 31712: 48 17 cp r20, r24 31714: 21 f0 breq .+8 ; 0x3171e tmc2130_set_dir(axis, dir); 31716: 64 2f mov r22, r20 31718: 8c 2f mov r24, r28 3171a: 0f 94 b5 23 call 0x2476a ; 0x2476a 3171e: 8b e9 ldi r24, 0x9B ; 155 31720: e8 2e mov r14, r24 31722: 8f e0 ldi r24, 0x0F ; 15 31724: f8 2e mov r15, r24 while (steps--) 31726: 01 50 subi r16, 0x01 ; 1 31728: 11 09 sbc r17, r1 3172a: 70 f0 brcs .+28 ; 0x31748 { tmc2130_do_step(axis); 3172c: 8c 2f mov r24, r28 3172e: 0f 94 a4 23 call 0x24748 ; 0x24748 31732: c7 01 movw r24, r14 31734: 01 97 sbiw r24, 0x01 ; 1 31736: f1 f7 brne .-4 ; 0x31734 31738: f6 cf rjmp .-20 ; 0x31726 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 3173a: 86 95 lsr r24 3173c: 8c 27 eor r24, r28 3173e: e8 cf rjmp .-48 ; 0x31710 case Z_AXIS: return _GET_DIR_Z; 31740: 82 fb bst r24, 2 31742: 88 27 eor r24, r24 31744: 80 f9 bld r24, 0 31746: e5 cf rjmp .-54 ; 0x31712 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 31748: cf 91 pop r28 3174a: 1f 91 pop r17 3174c: 0f 91 pop r16 3174e: ff 90 pop r15 31750: ef 90 pop r14 31752: 08 95 ret 00031754 : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 31754: 8f 92 push r8 31756: 9f 92 push r9 31758: af 92 push r10 3175a: bf 92 push r11 3175c: cf 92 push r12 3175e: df 92 push r13 31760: ef 92 push r14 31762: ff 92 push r15 31764: 0f 93 push r16 31766: 1f 93 push r17 31768: cf 93 push r28 3176a: c8 2f mov r28, r24 3176c: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 3176e: c6 2e mov r12, r22 31770: d1 2c mov r13, r1 31772: 1f 93 push r17 31774: 4f 93 push r20 31776: 83 e0 ldi r24, 0x03 ; 3 31778: 8f 93 push r24 3177a: 88 ee ldi r24, 0xE8 ; 232 3177c: 8f 93 push r24 3177e: 1f 92 push r1 31780: 82 e0 ldi r24, 0x02 ; 2 31782: 8f 93 push r24 31784: 1f 92 push r1 31786: 6f 93 push r22 31788: 1f 92 push r1 3178a: cf 93 push r28 3178c: 89 ee ldi r24, 0xE9 ; 233 3178e: 96 ea ldi r25, 0xA6 ; 166 31790: 9f 93 push r25 31792: 8f 93 push r24 31794: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 31798: 8d b7 in r24, 0x3d ; 61 3179a: 9e b7 in r25, 0x3e ; 62 3179c: 0c 96 adiw r24, 0x0c ; 12 3179e: 0f b6 in r0, 0x3f ; 63 317a0: f8 94 cli 317a2: 9e bf out 0x3e, r25 ; 62 317a4: 0f be out 0x3f, r0 ; 63 317a6: 8d bf out 0x3d, r24 ; 61 317a8: 90 e0 ldi r25, 0x00 ; 0 317aa: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 317ac: 40 e0 ldi r20, 0x00 ; 0 317ae: 51 e0 ldi r21, 0x01 ; 1 317b0: 28 2f mov r18, r24 317b2: ba 01 movw r22, r20 317b4: 08 2e mov r0, r24 317b6: 02 c0 rjmp .+4 ; 0x317bc 317b8: 76 95 lsr r23 317ba: 67 95 ror r22 317bc: 0a 94 dec r0 317be: e2 f7 brpl .-8 ; 0x317b8 317c0: 06 17 cp r16, r22 317c2: 17 07 cpc r17, r23 317c4: 29 f0 breq .+10 ; 0x317d0 317c6: 01 96 adiw r24, 0x01 ; 1 317c8: 88 30 cpi r24, 0x08 ; 8 317ca: 91 05 cpc r25, r1 317cc: 89 f7 brne .-30 ; 0x317b0 317ce: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 317d0: e2 2e mov r14, r18 317d2: f1 2c mov r15, r1 317d4: 88 e0 ldi r24, 0x08 ; 8 317d6: 90 e0 ldi r25, 0x00 ; 0 317d8: 8e 19 sub r24, r14 317da: 9f 09 sbc r25, r15 317dc: 24 e0 ldi r18, 0x04 ; 4 317de: 30 e0 ldi r19, 0x00 ; 0 317e0: 59 01 movw r10, r18 317e2: 02 c0 rjmp .+4 ; 0x317e8 317e4: aa 0c add r10, r10 317e6: bb 1c adc r11, r11 317e8: 8a 95 dec r24 317ea: e2 f7 brpl .-8 ; 0x317e4 uint16_t mscnt = tmc2130_rd_MSCNT(axis); 317ec: 8c 2f mov r24, r28 317ee: 0f 94 7c 24 call 0x248f8 ; 0x248f8 317f2: 9c 01 movw r18, r24 317f4: 90 e0 ldi r25, 0x00 ; 0 317f6: c4 30 cpi r28, 0x04 ; 4 317f8: 28 f4 brcc .+10 ; 0x31804 317fa: ec 2f mov r30, r28 317fc: f0 e0 ldi r31, 0x00 ; 0 317fe: e0 5e subi r30, 0xE0 ; 224 31800: fc 4f sbci r31, 0xFC ; 252 31802: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 31804: 0e 2c mov r0, r14 31806: 02 c0 rjmp .+4 ; 0x3180c 31808: 36 95 lsr r19 3180a: 27 95 ror r18 3180c: 0a 94 dec r0 3180e: e2 f7 brpl .-8 ; 0x31808 31810: 86 01 movw r16, r12 31812: 02 1b sub r16, r18 31814: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 31816: 95 01 movw r18, r10 31818: 36 95 lsr r19 3181a: 27 95 ror r18 { dir ^= 1; 3181c: 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)) 3181e: 20 17 cp r18, r16 31820: 31 07 cpc r19, r17 31822: 74 f1 brlt .+92 ; 0x31880 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; 31824: 91 11 cpse r25, r1 31826: 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) 31828: 17 ff sbrs r17, 7 3182a: 05 c0 rjmp .+10 ; 0x31836 { dir ^= 1; 3182c: 81 e0 ldi r24, 0x01 ; 1 3182e: 68 27 eor r22, r24 steps = -steps; 31830: 11 95 neg r17 31832: 01 95 neg r16 31834: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 31836: 8c 2f mov r24, r28 31838: 0f 94 b5 23 call 0x2476a ; 0x2476a mscnt = tmc2130_rd_MSCNT(axis); 3183c: 8c 2f mov r24, r28 3183e: 0f 94 7c 24 call 0x248f8 ; 0x248f8 31842: b1 2c mov r11, r1 31844: a1 2c mov r10, r1 31846: 2b e9 ldi r18, 0x9B ; 155 31848: 82 2e mov r8, r18 3184a: 2f e0 ldi r18, 0x0F ; 15 3184c: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 3184e: 0a 15 cp r16, r10 31850: 1b 05 cpc r17, r11 31852: f1 f0 breq .+60 ; 0x31890 31854: 2f ef ldi r18, 0xFF ; 255 31856: a2 1a sub r10, r18 31858: b2 0a sbc r11, r18 3185a: 0e 2c mov r0, r14 3185c: 02 c0 rjmp .+4 ; 0x31862 3185e: 96 95 lsr r25 31860: 87 95 ror r24 31862: 0a 94 dec r0 31864: e2 f7 brpl .-8 ; 0x3185e 31866: 8c 15 cp r24, r12 31868: 9d 05 cpc r25, r13 3186a: 91 f0 breq .+36 ; 0x31890 { tmc2130_do_step(axis); 3186c: 8c 2f mov r24, r28 3186e: 0f 94 a4 23 call 0x24748 ; 0x24748 31872: c4 01 movw r24, r8 31874: 01 97 sbiw r24, 0x01 ; 1 31876: f1 f7 brne .-4 ; 0x31874 delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 31878: 8c 2f mov r24, r28 3187a: 0f 94 7c 24 call 0x248f8 ; 0x248f8 3187e: e7 cf rjmp .-50 ; 0x3184e { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 31880: 91 11 cpse r25, r1 31882: 01 c0 rjmp .+2 ; 0x31886 31884: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 31886: c5 01 movw r24, r10 31888: 80 1b sub r24, r16 3188a: 91 0b sbc r25, r17 3188c: 8c 01 movw r16, r24 3188e: cc cf rjmp .-104 ; 0x31828 { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 31890: cf 91 pop r28 31892: 1f 91 pop r17 31894: 0f 91 pop r16 31896: ff 90 pop r15 31898: ef 90 pop r14 3189a: df 90 pop r13 3189c: cf 90 pop r12 3189e: bf 90 pop r11 318a0: af 90 pop r10 318a2: 9f 90 pop r9 318a4: 8f 90 pop r8 318a6: 08 95 ret 000318a8 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 318a8: 10 92 c2 13 sts 0x13C2, r1 ; 0x8013c2 memset(z_values, 0, sizeof(z_values)); 318ac: e3 ec ldi r30, 0xC3 ; 195 318ae: f3 e1 ldi r31, 0x13 ; 19 318b0: 84 ec ldi r24, 0xC4 ; 196 318b2: df 01 movw r26, r30 318b4: 1d 92 st X+, r1 318b6: 8a 95 dec r24 318b8: e9 f7 brne .-6 ; 0x318b4 } 318ba: 08 95 ret 000318bc : 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 318bc: 2f 92 push r2 318be: 3f 92 push r3 318c0: 4f 92 push r4 318c2: 5f 92 push r5 318c4: 6f 92 push r6 318c6: 7f 92 push r7 318c8: 8f 92 push r8 318ca: 9f 92 push r9 318cc: af 92 push r10 318ce: bf 92 push r11 318d0: cf 92 push r12 318d2: df 92 push r13 318d4: ef 92 push r14 318d6: ff 92 push r15 318d8: 0f 93 push r16 318da: 1f 93 push r17 318dc: cf 93 push r28 318de: df 93 push r29 318e0: 00 d0 rcall .+0 ; 0x318e2 318e2: 1f 92 push r1 318e4: cd b7 in r28, 0x3d ; 61 318e6: de b7 in r29, 0x3e ; 62 318e8: 4b 01 movw r8, r22 318ea: 5c 01 movw r10, r24 318ec: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 318ee: 81 e0 ldi r24, 0x01 ; 1 318f0: 80 93 8d 06 sts 0x068D, r24 ; 0x80068d #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 318f4: 80 91 8c 06 lds r24, 0x068C ; 0x80068c ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 318f8: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 318fa: 81 30 cpi r24, 0x01 ; 1 318fc: 19 f4 brne .+6 ; 0x31904 { FORCE_HIGH_POWER_START; 318fe: 0e 94 b7 66 call 0xcd6e ; 0xcd6e bHighPowerForced = true; 31902: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31904: 20 91 b7 02 lds r18, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 31908: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 3190a: 81 e0 ldi r24, 0x01 ; 1 3190c: 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); 31910: 80 e0 ldi r24, 0x00 ; 0 31912: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 31916: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 31918: 0f 94 f7 4d call 0x29bee ; 0x29bee // move down until you find the bed current_position[Z_AXIS] = minimum_z; 3191c: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 31920: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 31924: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 31928: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 3192c: 65 e5 ldi r22, 0x55 ; 85 3192e: 75 e5 ldi r23, 0x55 ; 85 31930: 85 e5 ldi r24, 0x55 ; 85 31932: 91 e4 ldi r25, 0x41 ; 65 31934: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 // 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(); 31938: 0f 94 31 cc call 0x39862 ; 0x39862 if (! endstop_z_hit_on_purpose()) 3193c: 0f 94 f7 4d call 0x29bee ; 0x29bee 31940: 8c 83 std Y+4, r24 ; 0x04 31942: 88 23 and r24, r24 31944: 09 f4 brne .+2 ; 0x31948 31946: f9 c0 rjmp .+498 ; 0x31b3a { //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)) 31948: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 3194c: 86 ff sbrs r24, 6 3194e: f5 c0 rjmp .+490 ; 0x31b3a { //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) 31950: 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; 31952: c1 2c mov r12, r1 31954: d1 2c mov r13, r1 31956: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 31958: 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) 3195a: 8b 81 ldd r24, Y+3 ; 0x03 3195c: 80 17 cp r24, r16 3195e: 08 f0 brcs .+2 ; 0x31962 31960: a8 c0 rjmp .+336 ; 0x31ab2 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 31962: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 31966: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 3196a: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3196e: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 31972: 20 e0 ldi r18, 0x00 ; 0 31974: 30 e0 ldi r19, 0x00 ; 0 31976: 40 e0 ldi r20, 0x00 ; 0 31978: 5f e3 ldi r21, 0x3F ; 63 3197a: 31 10 cpse r3, r1 3197c: 04 c0 rjmp .+8 ; 0x31986 3197e: 2d ec ldi r18, 0xCD ; 205 31980: 3c ec ldi r19, 0xCC ; 204 31982: 4c e4 ldi r20, 0x4C ; 76 31984: 5e e3 ldi r21, 0x3E ; 62 31986: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3198a: 2b 01 movw r4, r22 3198c: 3c 01 movw r6, r24 3198e: 40 92 9a 06 sts 0x069A, r4 ; 0x80069a 31992: 50 92 9b 06 sts 0x069B, r5 ; 0x80069b 31996: 60 92 9c 06 sts 0x069C, r6 ; 0x80069c 3199a: 70 92 9d 06 sts 0x069D, r7 ; 0x80069d float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 3199e: 65 e5 ldi r22, 0x55 ; 85 319a0: 75 e5 ldi r23, 0x55 ; 85 319a2: 85 e5 ldi r24, 0x55 ; 85 319a4: 91 e4 ldi r25, 0x41 ; 65 319a6: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 319aa: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 319ae: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 319b2: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 319b6: 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)); 319ba: 65 e5 ldi r22, 0x55 ; 85 319bc: 75 e5 ldi r23, 0x55 ; 85 319be: 85 e5 ldi r24, 0x55 ; 85 319c0: 90 e4 ldi r25, 0x40 ; 64 319c2: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 // 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(); 319c6: 0f 94 31 cc call 0x39862 ; 0x39862 //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) { 319ca: a3 01 movw r20, r6 319cc: 92 01 movw r18, r4 319ce: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 319d2: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 319d6: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 319da: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 319de: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 319e2: 9f 77 andi r25, 0x7F ; 127 319e4: 2d ec ldi r18, 0xCD ; 205 319e6: 3c ec ldi r19, 0xCC ; 204 319e8: 4c ec ldi r20, 0xCC ; 204 319ea: 5c e3 ldi r21, 0x3C ; 60 319ec: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 319f0: 87 ff sbrs r24, 7 319f2: 16 c0 rjmp .+44 ; 0x31a20 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 319f4: 60 e0 ldi r22, 0x00 ; 0 319f6: 70 e0 ldi r23, 0x00 ; 0 319f8: 80 e0 ldi r24, 0x00 ; 0 319fa: 9f e3 ldi r25, 0x3F ; 63 319fc: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 current_position[Z_AXIS] = minimum_z; 31a00: 80 92 9a 06 sts 0x069A, r8 ; 0x80069a 31a04: 90 92 9b 06 sts 0x069B, r9 ; 0x80069b 31a08: a0 92 9c 06 sts 0x069C, r10 ; 0x80069c 31a0c: b0 92 9d 06 sts 0x069D, r11 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31a10: 65 e5 ldi r22, 0x55 ; 85 31a12: 75 e5 ldi r23, 0x55 ; 85 31a14: 85 e5 ldi r24, 0x55 ; 85 31a16: 90 e4 ldi r25, 0x40 ; 64 31a18: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 // 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(); 31a1c: 0f 94 31 cc call 0x39862 ; 0x39862 } if (!endstop_z_hit_on_purpose()) 31a20: 0f 94 f7 4d call 0x29bee ; 0x29bee 31a24: 28 2e mov r2, r24 31a26: 88 23 and r24, r24 31a28: 09 f4 brne .+2 ; 0x31a2c 31a2a: 87 c0 rjmp .+270 ; 0x31b3a { //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)) { 31a2c: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 31a30: 86 ff sbrs r24, 6 31a32: 83 c0 rjmp .+262 ; 0x31b3a 31a34: 40 90 9a 06 lds r4, 0x069A ; 0x80069a 31a38: 50 90 9b 06 lds r5, 0x069B ; 0x80069b 31a3c: 60 90 9c 06 lds r6, 0x069C ; 0x80069c 31a40: 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; 31a44: 2b 81 ldd r18, Y+3 ; 0x03 31a46: 22 23 and r18, r18 31a48: d9 f0 breq .+54 ; 0x31a80 31a4a: 62 2f mov r22, r18 31a4c: 70 e0 ldi r23, 0x00 ; 0 31a4e: 90 e0 ldi r25, 0x00 ; 0 31a50: 80 e0 ldi r24, 0x00 ; 0 31a52: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 31a56: 9b 01 movw r18, r22 31a58: ac 01 movw r20, r24 31a5a: c7 01 movw r24, r14 31a5c: b6 01 movw r22, r12 31a5e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 31a62: 9b 01 movw r18, r22 31a64: ac 01 movw r20, r24 31a66: c3 01 movw r24, r6 31a68: b2 01 movw r22, r4 31a6a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 31a6e: 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 31a70: 2d ec ldi r18, 0xCD ; 205 31a72: 3c ec ldi r19, 0xCC ; 204 31a74: 4c e4 ldi r20, 0x4C ; 76 31a76: 5d e3 ldi r21, 0x3D ; 61 31a78: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 31a7c: 18 16 cp r1, r24 31a7e: 64 f0 brlt .+24 ; 0x31a98 #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]; 31a80: a3 01 movw r20, r6 31a82: 92 01 movw r18, r4 31a84: c7 01 movw r24, r14 31a86: b6 01 movw r22, r12 31a88: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31a8c: 6b 01 movw r12, r22 31a8e: 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) 31a90: 2b 81 ldd r18, Y+3 ; 0x03 31a92: 2f 5f subi r18, 0xFF ; 255 31a94: 2b 83 std Y+3, r18 ; 0x03 31a96: 61 cf rjmp .-318 ; 0x3195a 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 31a98: 31 10 cpse r3, r1 31a9a: 4f c0 rjmp .+158 ; 0x31b3a //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 31a9c: 84 ef ldi r24, 0xF4 ; 244 31a9e: 91 e0 ldi r25, 0x01 ; 1 31aa0: 0e 94 eb 8c call 0x119d6 ; 0x119d6 //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; 31aa4: 32 2c mov r3, r2 i = -1; 31aa6: 8f ef ldi r24, 0xFF ; 255 31aa8: 8b 83 std Y+3, r24 ; 0x03 z = 0; 31aaa: c1 2c mov r12, r1 31aac: d1 2c mov r13, r1 31aae: 76 01 movw r14, r12 31ab0: ef cf rjmp .-34 ; 0x31a90 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31ab2: 02 30 cpi r16, 0x02 ; 2 31ab4: 68 f5 brcc .+90 ; 0x31b10 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31ab6: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31aba: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31abe: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31ac2: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31ac6: 8a 81 ldd r24, Y+2 ; 0x02 31ac8: 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); 31acc: 89 81 ldd r24, Y+1 ; 0x01 31ace: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31ad2: 11 23 and r17, r17 31ad4: 19 f0 breq .+6 ; 0x31adc 31ad6: 80 e0 ldi r24, 0x00 ; 0 31ad8: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #endif bedPWMDisabled = 0; 31adc: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31ae0: 8c 81 ldd r24, Y+4 ; 0x04 31ae2: 0f 90 pop r0 31ae4: 0f 90 pop r0 31ae6: 0f 90 pop r0 31ae8: 0f 90 pop r0 31aea: df 91 pop r29 31aec: cf 91 pop r28 31aee: 1f 91 pop r17 31af0: 0f 91 pop r16 31af2: ff 90 pop r15 31af4: ef 90 pop r14 31af6: df 90 pop r13 31af8: cf 90 pop r12 31afa: bf 90 pop r11 31afc: af 90 pop r10 31afe: 9f 90 pop r9 31b00: 8f 90 pop r8 31b02: 7f 90 pop r7 31b04: 6f 90 pop r6 31b06: 5f 90 pop r5 31b08: 4f 90 pop r4 31b0a: 3f 90 pop r3 31b0c: 2f 90 pop r2 31b0e: 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); 31b10: 60 2f mov r22, r16 31b12: 70 e0 ldi r23, 0x00 ; 0 31b14: 90 e0 ldi r25, 0x00 ; 0 31b16: 80 e0 ldi r24, 0x00 ; 0 31b18: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 31b1c: 9b 01 movw r18, r22 31b1e: ac 01 movw r20, r24 31b20: c7 01 movw r24, r14 31b22: b6 01 movw r22, r12 31b24: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 31b28: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 31b2c: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 31b30: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 31b34: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d 31b38: c6 cf rjmp .-116 ; 0x31ac6 31b3a: 2a 81 ldd r18, Y+2 ; 0x02 31b3c: 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); 31b40: 89 81 ldd r24, Y+1 ; 0x01 31b42: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31b46: 11 23 and r17, r17 31b48: 19 f0 breq .+6 ; 0x31b50 31b4a: 80 e0 ldi r24, 0x00 ; 0 31b4c: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #endif bedPWMDisabled = 0; 31b50: 10 92 8d 06 sts 0x068D, r1 ; 0x80068d return false; 31b54: 1c 82 std Y+4, r1 ; 0x04 31b56: c4 cf rjmp .-120 ; 0x31ae0 00031b58 : //! @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) 31b58: 2f 92 push r2 31b5a: 3f 92 push r3 31b5c: 4f 92 push r4 31b5e: 5f 92 push r5 31b60: 6f 92 push r6 31b62: 7f 92 push r7 31b64: 8f 92 push r8 31b66: 9f 92 push r9 31b68: af 92 push r10 31b6a: bf 92 push r11 31b6c: cf 92 push r12 31b6e: df 92 push r13 31b70: ef 92 push r14 31b72: ff 92 push r15 31b74: 0f 93 push r16 31b76: 1f 93 push r17 31b78: cf 93 push r28 31b7a: df 93 push r29 31b7c: cd b7 in r28, 0x3d ; 61 31b7e: de b7 in r29, 0x3e ; 62 31b80: ce 5c subi r28, 0xCE ; 206 31b82: d1 09 sbc r29, r1 31b84: 0f b6 in r0, 0x3f ; 63 31b86: f8 94 cli 31b88: de bf out 0x3e, r29 ; 62 31b8a: 0f be out 0x3f, r0 ; 63 31b8c: cd bf out 0x3d, r28 ; 61 31b8e: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 31b90: 81 e0 ldi r24, 0x01 ; 1 31b92: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #endif // TMC2130 FORCE_BL_ON_START; 31b96: 81 e0 ldi r24, 0x01 ; 1 31b98: 0e 94 50 8a call 0x114a0 ; 0x114a0 // Only Z calibration? if (!onlyZ) 31b9c: 11 11 cpse r17, r1 31b9e: 04 c0 rjmp .+8 ; 0x31ba8 { disable_heater(); 31ba0: 0f 94 1f 2f call 0x25e3e ; 0x25e3e eeprom_adjust_bed_reset(); //reset bed level correction 31ba4: 0e 94 9f 76 call 0xed3e ; 0xed3e } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 31ba8: 80 e0 ldi r24, 0x00 ; 0 31baa: 0e 94 2c 6f call 0xde58 ; 0xde58 // Let the planner use the uncorrected coordinates. mbl.reset(); 31bae: 0f 94 54 8c call 0x318a8 ; 0x318a8 // 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(); 31bb2: 0f 94 3d ce call 0x39c7a ; 0x39c7a babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 31bb6: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 31bba: 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)); 31bbe: ef e8 ldi r30, 0x8F ; 143 31bc0: f6 e0 ldi r31, 0x06 ; 6 31bc2: 83 e0 ldi r24, 0x03 ; 3 31bc4: df 01 movw r26, r30 31bc6: 1d 92 st X+, r1 31bc8: 8a 95 dec r24 31bca: e9 f7 brne .-6 ; 0x31bc6 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 31bcc: 81 e0 ldi r24, 0x01 ; 1 31bce: 0e 94 ef 66 call 0xcdde ; 0xcdde 31bd2: c7 55 subi r28, 0x57 ; 87 31bd4: df 4f sbci r29, 0xFF ; 255 31bd6: 99 83 std Y+1, r25 ; 0x01 31bd8: 88 83 st Y, r24 31bda: c9 5a subi r28, 0xA9 ; 169 31bdc: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 31bde: 8b e0 ldi r24, 0x0B ; 11 31be0: 9c e5 ldi r25, 0x5C ; 92 31be2: 0e 94 b3 72 call 0xe566 ; 0xe566 31be6: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 raise_z_above(MESH_HOME_Z_SEARCH); 31bea: 60 e0 ldi r22, 0x00 ; 0 31bec: 70 e0 ldi r23, 0x00 ; 0 31bee: 80 ea ldi r24, 0xA0 ; 160 31bf0: 90 e4 ldi r25, 0x40 ; 64 31bf2: 0e 94 67 6e call 0xdcce ; 0xdcce } /**/ void home_xy() { set_destination_to_current(); 31bf6: 0e 94 41 68 call 0xd082 ; 0xd082 homeaxis(X_AXIS); 31bfa: 50 e0 ldi r21, 0x00 ; 0 31bfc: 40 e0 ldi r20, 0x00 ; 0 31bfe: 61 e0 ldi r22, 0x01 ; 1 31c00: 80 e0 ldi r24, 0x00 ; 0 31c02: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 homeaxis(Y_AXIS); 31c06: 50 e0 ldi r21, 0x00 ; 0 31c08: 40 e0 ldi r20, 0x00 ; 0 31c0a: 61 e0 ldi r22, 0x01 ; 1 31c0c: 81 e0 ldi r24, 0x01 ; 1 31c0e: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 plan_set_position_curposXYZE(); 31c12: 0f 94 10 bf call 0x37e20 ; 0x37e20 endstops_hit_on_purpose(); 31c16: 0f 94 05 4e call 0x29c0a ; 0x29c0a 31c1a: 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; 31c1e: 20 e0 ldi r18, 0x00 ; 0 31c20: 30 e0 ldi r19, 0x00 ; 0 31c22: 40 ea ldi r20, 0xA0 ; 160 31c24: 50 e4 ldi r21, 0x40 ; 64 31c26: 60 91 92 06 lds r22, 0x0692 ; 0x800692 31c2a: 70 91 93 06 lds r23, 0x0693 ; 0x800693 31c2e: 80 91 94 06 lds r24, 0x0694 ; 0x800694 31c32: 90 91 95 06 lds r25, 0x0695 ; 0x800695 31c36: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31c3a: 60 93 92 06 sts 0x0692, r22 ; 0x800692 31c3e: 70 93 93 06 sts 0x0693, r23 ; 0x800693 31c42: 80 93 94 06 sts 0x0694, r24 ; 0x800694 31c46: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] += 5; 31c4a: 20 e0 ldi r18, 0x00 ; 0 31c4c: 30 e0 ldi r19, 0x00 ; 0 31c4e: 40 ea ldi r20, 0xA0 ; 160 31c50: 50 e4 ldi r21, 0x40 ; 64 31c52: 60 91 96 06 lds r22, 0x0696 ; 0x800696 31c56: 70 91 97 06 lds r23, 0x0697 ; 0x800697 31c5a: 80 91 98 06 lds r24, 0x0698 ; 0x800698 31c5e: 90 91 99 06 lds r25, 0x0699 ; 0x800699 31c62: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 31c66: 60 93 96 06 sts 0x0696, r22 ; 0x800696 31c6a: 70 93 97 06 sts 0x0697, r23 ; 0x800697 31c6e: 80 93 98 06 sts 0x0698, r24 ; 0x800698 31c72: 90 93 99 06 sts 0x0699, r25 ; 0x800699 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31c76: 60 e0 ldi r22, 0x00 ; 0 31c78: 70 e0 ldi r23, 0x00 ; 0 31c7a: 80 ea ldi r24, 0xA0 ; 160 31c7c: 91 e4 ldi r25, 0x41 ; 65 31c7e: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 31c82: 0f 94 ef 42 call 0x285de ; 0x285de // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 31c86: 0e 94 45 73 call 0xe68a ; 0xe68a 31c8a: e5 96 adiw r28, 0x35 ; 53 31c8c: 8f af std Y+63, r24 ; 0x3f 31c8e: e5 97 sbiw r28, 0x35 ; 53 31c90: 81 11 cpse r24, r1 31c92: 04 c0 rjmp .+8 ; 0x31c9c //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 31c94: e5 96 adiw r28, 0x35 ; 53 31c96: 1f ae std Y+63, r1 ; 0x3f 31c98: e5 97 sbiw r28, 0x35 ; 53 31c9a: 74 c4 rjmp .+2280 ; 0x32584 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 31c9c: 8f ec ldi r24, 0xCF ; 207 31c9e: 9b e5 ldi r25, 0x5B ; 91 31ca0: 0e 94 b3 72 call 0xe566 ; 0xe566 31ca4: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 if(onlyZ){ 31ca8: 11 23 and r17, r17 31caa: 09 f4 brne .+2 ; 0x31cae 31cac: 46 c4 rjmp .+2188 ; 0x3253a prompt_steel_sheet_on_bed(true); 31cae: 81 e0 ldi r24, 0x01 ; 1 31cb0: 0f 94 a0 0c call 0x21940 ; 0x21940 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 31cb4: 8d e9 ldi r24, 0x9D ; 157 31cb6: 9b e5 ldi r25, 0x5B ; 91 31cb8: 0e 94 b3 72 call 0xe566 ; 0xe566 31cbc: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_puts_at_P(0,3,_n("1/9")); 31cc0: 4f e6 ldi r20, 0x6F ; 111 31cc2: 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")); 31cc4: 63 e0 ldi r22, 0x03 ; 3 31cc6: 80 e0 ldi r24, 0x00 ; 0 31cc8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 } refresh_cmd_timeout(); 31ccc: 0e 94 ca 66 call 0xcd94 ; 0xcd94 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 31cd0: 11 11 cpse r17, r1 31cd2: 1b c0 rjmp .+54 ; 0x31d0a { KEEPALIVE_STATE(PAUSED_FOR_USER); 31cd4: 84 e0 ldi r24, 0x04 ; 4 31cd6: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be prompt_steel_sheet_on_bed(false); 31cda: 80 e0 ldi r24, 0x00 ; 0 31cdc: 0f 94 a0 0c call 0x21940 ; 0x21940 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 31ce0: 83 ee ldi r24, 0xE3 ; 227 31ce2: 9a e5 ldi r25, 0x5A ; 90 31ce4: 0e 94 b3 72 call 0xe566 ; 0xe566 31ce8: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 KEEPALIVE_STATE(IN_HANDLER); 31cec: 82 e0 ldi r24, 0x02 ; 2 31cee: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 31cf2: 8b e7 ldi r24, 0x7B ; 123 31cf4: 9b e5 ldi r25, 0x5B ; 91 31cf6: 0e 94 b3 72 call 0xe566 ; 0xe566 31cfa: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_puts_at_P(0,3,_n("1/4")); 31cfe: 47 e6 ldi r20, 0x67 ; 103 31d00: 50 e7 ldi r21, 0x70 ; 112 31d02: 63 e0 ldi r22, 0x03 ; 3 31d04: 80 e0 ldi r24, 0x00 ; 0 31d06: 0e 94 fb 6e call 0xddf6 ; 0xddf6 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31d0a: 00 91 b7 02 lds r16, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> check_endstops = check; 31d0e: 10 92 b7 02 sts 0x02B7, r1 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 31d12: 60 e0 ldi r22, 0x00 ; 0 31d14: 70 e0 ldi r23, 0x00 ; 0 31d16: 80 e8 ldi r24, 0x80 ; 128 31d18: 9f eb ldi r25, 0xBF ; 191 31d1a: 0e 94 e8 6d call 0xdbd0 ; 0xdbd0 // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31d1e: c1 2c mov r12, r1 31d20: d1 2c mov r13, r1 31d22: b0 ea ldi r27, 0xA0 ; 160 31d24: eb 2e mov r14, r27 31d26: b0 e4 ldi r27, 0x40 ; 64 31d28: fb 2e mov r15, r27 31d2a: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31d2e: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31d32: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31d36: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31d3a: 81 e0 ldi r24, 0x01 ; 1 31d3c: 80 93 b7 02 sts 0x02B7, r24 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 31d40: 84 e0 ldi r24, 0x04 ; 4 31d42: 0f 94 df 25 call 0x24bbe ; 0x24bbe #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31d46: 60 e0 ldi r22, 0x00 ; 0 31d48: 70 e0 ldi r23, 0x00 ; 0 31d4a: 80 ea ldi r24, 0xA0 ; 160 31d4c: 91 e4 ldi r25, 0x41 ; 65 31d4e: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 31d52: 0f 94 ef 42 call 0x285de ; 0x285de #ifdef TMC2130 tmc2130_home_exit(); 31d56: 0f 94 b0 25 call 0x24b60 ; 0x24b60 31d5a: 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)) && 31d5e: 82 e0 ldi r24, 0x02 ; 2 31d60: 0f 94 db 42 call 0x285b6 ; 0x285b6 31d64: 2d ec ldi r18, 0xCD ; 205 31d66: 3c ec ldi r19, 0xCC ; 204 31d68: 44 ea ldi r20, 0xA4 ; 164 31d6a: 50 e4 ldi r21, 0x40 ; 64 31d6c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 31d70: 18 16 cp r1, r24 31d72: 0c f4 brge .+2 ; 0x31d76 31d74: eb c3 rjmp .+2006 ; 0x3254c (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 31d76: 82 e0 ldi r24, 0x02 ; 2 31d78: 0f 94 db 42 call 0x285b6 ; 0x285b6 #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)) && 31d7c: 23 e3 ldi r18, 0x33 ; 51 31d7e: 33 e3 ldi r19, 0x33 ; 51 31d80: 4b e9 ldi r20, 0x9B ; 155 31d82: 50 e4 ldi r21, 0x40 ; 64 31d84: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 31d88: 87 fd sbrc r24, 7 31d8a: e0 c3 rjmp .+1984 ; 0x3254c (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 31d8c: 11 11 cpse r17, r1 31d8e: e3 c3 rjmp .+1990 ; 0x32556 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 31d90: 80 e1 ldi r24, 0x10 ; 16 31d92: 0e 94 44 ee call 0x1dc88 ; 0x1dc88 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 31d96: 81 ea ldi r24, 0xA1 ; 161 31d98: 9d e0 ldi r25, 0x0D ; 13 31d9a: 0f 94 23 dc call 0x3b846 ; 0x3b846 31d9e: bb e0 ldi r27, 0x0B ; 11 31da0: 8b 9f mul r24, r27 31da2: c0 01 movw r24, r0 31da4: 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); 31da6: 70 e0 ldi r23, 0x00 ; 0 31da8: 60 e0 ldi r22, 0x00 ; 0 31daa: 80 5b subi r24, 0xB0 ; 176 31dac: 92 4f sbci r25, 0xF2 ; 242 31dae: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca } 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(); 31db2: 0e 94 ca 66 call 0xcd94 ; 0xcd94 // 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); 31db6: e3 ec ldi r30, 0xC3 ; 195 31db8: f3 e1 ldi r31, 0x13 ; 19 31dba: 84 ec ldi r24, 0xC4 ; 196 31dbc: df 01 movw r26, r30 31dbe: 1d 92 st X+, r1 31dc0: 8a 95 dec r24 31dc2: e9 f7 brne .-6 ; 0x31dbe { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 31dc4: 8d e0 ldi r24, 0x0D ; 13 31dc6: 96 ea ldi r25, 0xA6 ; 166 31dc8: 0e 94 57 77 call 0xeeae ; 0xeeae MYSERIAL.println(int(iteration + 1)); 31dcc: 81 e0 ldi r24, 0x01 ; 1 31dce: 90 e0 ldi r25, 0x00 ; 0 31dd0: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 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)); 31dd4: 8b e7 ldi r24, 0x7B ; 123 31dd6: 9b e5 ldi r25, 0x5B ; 91 31dd8: 0e 94 b3 72 call 0xe566 ; 0xe566 31ddc: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 #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; 31de0: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 31de4: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 31de8: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 31dec: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d 31df0: b2 e0 ldi r27, 0x02 ; 2 31df2: e1 96 adiw r28, 0x31 ; 49 31df4: bf af std Y+63, r27 ; 0x3f 31df6: e1 97 sbiw r28, 0x31 ; 49 31df8: 28 ee ldi r18, 0xE8 ; 232 31dfa: 35 ea ldi r19, 0xA5 ; 165 31dfc: cd 56 subi r28, 0x6D ; 109 31dfe: df 4f sbci r29, 0xFF ; 255 31e00: 39 83 std Y+1, r19 ; 0x01 31e02: 28 83 st Y, r18 31e04: c3 59 subi r28, 0x93 ; 147 31e06: d0 40 sbci r29, 0x00 ; 0 31e08: 42 ec ldi r20, 0xC2 ; 194 31e0a: 53 e1 ldi r21, 0x13 ; 19 31e0c: cf 56 subi r28, 0x6F ; 111 31e0e: df 4f sbci r29, 0xFF ; 255 31e10: 59 83 std Y+1, r21 ; 0x01 31e12: 48 83 st Y, r20 31e14: c1 59 subi r28, 0x91 ; 145 31e16: d0 40 sbci r29, 0x00 ; 0 31e18: a0 96 adiw r28, 0x20 ; 32 31e1a: 5f af std Y+63, r21 ; 0x3f 31e1c: 4e af std Y+62, r20 ; 0x3e 31e1e: a0 97 sbiw r28, 0x20 ; 32 31e20: e0 96 adiw r28, 0x30 ; 48 31e22: 3f af std Y+63, r19 ; 0x3f 31e24: 2e af std Y+62, r18 ; 0x3e 31e26: 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; 31e28: a7 96 adiw r28, 0x27 ; 39 31e2a: 1f ae std Y+63, r1 ; 0x3f 31e2c: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 31e2e: 31 2c mov r3, r1 31e30: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 31e32: 0e 94 ca 66 call 0xcd94 ; 0xcd94 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 31e36: 63 e0 ldi r22, 0x03 ; 3 31e38: 80 e0 ldi r24, 0x00 ; 0 31e3a: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%d/4"),(k+1)); 31e3e: bf ef ldi r27, 0xFF ; 255 31e40: 2b 1a sub r2, r27 31e42: 3b 0a sbc r3, r27 31e44: 3f 92 push r3 31e46: 2f 92 push r2 31e48: e8 e0 ldi r30, 0x08 ; 8 31e4a: f6 ea ldi r31, 0xA6 ; 166 31e4c: ff 93 push r31 31e4e: ef 93 push r30 31e50: 0e 94 c0 6e call 0xdd80 ; 0xdd80 } #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); 31e54: 65 e5 ldi r22, 0x55 ; 85 31e56: 75 e5 ldi r23, 0x55 ; 85 31e58: 85 e5 ldi r24, 0x55 ; 85 31e5a: 91 e4 ldi r25, 0x41 ; 65 31e5c: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 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); 31e60: e0 96 adiw r28, 0x30 ; 48 31e62: ee ad ldd r30, Y+62 ; 0x3e 31e64: ff ad ldd r31, Y+63 ; 0x3f 31e66: e0 97 sbiw r28, 0x30 ; 48 31e68: 85 91 lpm r24, Z+ 31e6a: 95 91 lpm r25, Z+ 31e6c: a5 91 lpm r26, Z+ 31e6e: b4 91 lpm r27, Z 31e70: 80 93 92 06 sts 0x0692, r24 ; 0x800692 31e74: 90 93 93 06 sts 0x0693, r25 ; 0x800693 31e78: a0 93 94 06 sts 0x0694, r26 ; 0x800694 31e7c: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 31e80: e0 96 adiw r28, 0x30 ; 48 31e82: ee ad ldd r30, Y+62 ; 0x3e 31e84: ff ad ldd r31, Y+63 ; 0x3f 31e86: e0 97 sbiw r28, 0x30 ; 48 31e88: 34 96 adiw r30, 0x04 ; 4 31e8a: 85 91 lpm r24, Z+ 31e8c: 95 91 lpm r25, Z+ 31e8e: a5 91 lpm r26, Z+ 31e90: b4 91 lpm r27, Z 31e92: 80 93 96 06 sts 0x0696, r24 ; 0x800696 31e96: 90 93 97 06 sts 0x0697, r25 ; 0x800697 31e9a: a0 93 98 06 sts 0x0698, r26 ; 0x800698 31e9e: 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); 31ea2: 60 e0 ldi r22, 0x00 ; 0 31ea4: 70 e0 ldi r23, 0x00 ; 0 31ea6: 88 e4 ldi r24, 0x48 ; 72 31ea8: 92 e4 ldi r25, 0x42 ; 66 31eaa: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 31eae: 4d e6 ldi r20, 0x6D ; 109 31eb0: 54 ea ldi r21, 0xA4 ; 164 31eb2: 5f 93 push r21 31eb4: 4f 93 push r20 31eb6: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 31eba: 4c e5 ldi r20, 0x5C ; 92 31ebc: 54 ea ldi r21, 0xA4 ; 164 31ebe: 63 e0 ldi r22, 0x03 ; 3 31ec0: 84 e0 ldi r24, 0x04 ; 4 31ec2: 0e 94 fb 6e call 0xddf6 ; 0xddf6 // disable heaters and stop motion before we initialize sm4 disable_heater(); 31ec6: 0f 94 1f 2f call 0x25e3e ; 0x25e3e st_synchronize(); 31eca: 0f 94 ef 42 call 0x285de ; 0x285de // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 31ece: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 31ed2: 8d 7f andi r24, 0xFD ; 253 31ed4: 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" ); 31ed8: 0f b6 in r0, 0x3f ; 63 31eda: f8 94 cli 31edc: a8 95 wdr 31ede: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31ee2: 88 61 ori r24, 0x18 ; 24 31ee4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31ee8: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 31eec: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 31eee: 10 92 89 06 sts 0x0689, r1 ; 0x800689 31ef2: 10 92 88 06 sts 0x0688, r1 ; 0x800688 sm4_update_pos_cb = xyzcal_update_pos; 31ef6: 8d e2 ldi r24, 0x2D ; 45 31ef8: 9d ec ldi r25, 0xCD ; 205 31efa: 90 93 87 06 sts 0x0687, r25 ; 0x800687 31efe: 80 93 86 06 sts 0x0686, r24 ; 0x800686 sm4_calc_delay_cb = xyzcal_calc_delay; 31f02: a8 e2 ldi r26, 0x28 ; 40 31f04: bd ec ldi r27, 0xCD ; 205 31f06: b0 93 85 06 sts 0x0685, r27 ; 0x800685 31f0a: 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]); 31f0e: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 31f12: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 31f16: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 31f1a: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 31f1e: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 31f22: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 31f26: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 31f2a: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 31f2e: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 31f32: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 31f36: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 31f3a: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 31f3e: 3f 93 push r19 31f40: 2f 93 push r18 31f42: 1f 93 push r17 31f44: 0f 93 push r16 31f46: 7f 93 push r23 31f48: 6f 93 push r22 31f4a: 5f 93 push r21 31f4c: 4f 93 push r20 31f4e: bf 93 push r27 31f50: af 93 push r26 31f52: 9f 93 push r25 31f54: 8f 93 push r24 31f56: ec e0 ldi r30, 0x0C ; 12 31f58: f5 ea ldi r31, 0xA5 ; 165 31f5a: ff 93 push r31 31f5c: ef 93 push r30 31f5e: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca int16_t x0 = _X; 31f62: 40 90 b3 06 lds r4, 0x06B3 ; 0x8006b3 31f66: 50 90 b4 06 lds r5, 0x06B4 ; 0x8006b4 31f6a: 60 90 b5 06 lds r6, 0x06B5 ; 0x8006b5 31f6e: 70 90 b6 06 lds r7, 0x06B6 ; 0x8006b6 31f72: b4 2c mov r11, r4 31f74: a5 2c mov r10, r5 int16_t y0 = _Y; 31f76: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 31f7a: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 31f7e: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 31f82: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 31f86: a6 96 adiw r28, 0x26 ; 38 31f88: 8c af std Y+60, r24 ; 0x3c 31f8a: 9d af std Y+61, r25 ; 0x3d 31f8c: ae af std Y+62, r26 ; 0x3e 31f8e: bf af std Y+63, r27 ; 0x3f 31f90: a6 97 sbiw r28, 0x26 ; 38 31f92: a3 96 adiw r28, 0x23 ; 35 31f94: 9f ac ldd r9, Y+63 ; 0x3f 31f96: a3 97 sbiw r28, 0x23 ; 35 31f98: a4 96 adiw r28, 0x24 ; 36 31f9a: 8f ac ldd r8, Y+63 ; 0x3f 31f9c: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 31f9e: c0 90 bb 06 lds r12, 0x06BB ; 0x8006bb 31fa2: d0 90 bc 06 lds r13, 0x06BC ; 0x8006bc 31fa6: e0 90 bd 06 lds r14, 0x06BD ; 0x8006bd 31faa: f0 90 be 06 lds r15, 0x06BE ; 0x8006be 31fae: 0f b6 in r0, 0x3f ; 63 31fb0: f8 94 cli 31fb2: de bf out 0x3e, r29 ; 62 31fb4: 0f be out 0x3f, r0 ; 63 31fb6: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 31fb8: b5 e0 ldi r27, 0x05 ; 5 31fba: cb 16 cp r12, r27 31fbc: b7 ef ldi r27, 0xF7 ; 247 31fbe: db 06 cpc r13, r27 31fc0: 0c f4 brge .+2 ; 0x31fc4 31fc2: 40 c3 rjmp .+1664 ; 0x32644 } 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; 31fc4: 1a 82 std Y+2, r1 ; 0x02 31fc6: 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); 31fc8: 1f 92 push r1 31fca: 1f 92 push r1 31fcc: e3 e0 ldi r30, 0x03 ; 3 31fce: ef 93 push r30 31fd0: f4 e8 ldi r31, 0x84 ; 132 31fd2: ff 93 push r31 31fd4: 1f 92 push r1 31fd6: 24 e6 ldi r18, 0x64 ; 100 31fd8: 2f 93 push r18 31fda: df 92 push r13 31fdc: cf 92 push r12 31fde: 8f 92 push r8 31fe0: 9f 92 push r9 31fe2: af 92 push r10 31fe4: bf 92 push r11 31fe6: 43 e8 ldi r20, 0x83 ; 131 31fe8: 54 ea ldi r21, 0xA4 ; 164 31fea: 5f 93 push r21 31fec: 4f 93 push r20 31fee: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if (!ret && (ad < 720)) 31ff2: 0f b6 in r0, 0x3f ; 63 31ff4: f8 94 cli 31ff6: de bf out 0x3e, r29 ; 62 31ff8: 0f be out 0x3f, r0 ; 63 31ffa: cd bf out 0x3d, r28 ; 61 31ffc: 89 81 ldd r24, Y+1 ; 0x01 31ffe: 9a 81 ldd r25, Y+2 ; 0x02 32000: 80 3d cpi r24, 0xD0 ; 208 32002: 92 40 sbci r25, 0x02 ; 2 32004: 08 f4 brcc .+2 ; 0x32008 32006: e9 c2 rjmp .+1490 ; 0x325da if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 32008: 89 81 ldd r24, Y+1 ; 0x01 3200a: 9a 81 ldd r25, Y+2 ; 0x02 3200c: 80 3a cpi r24, 0xA0 ; 160 3200e: 95 40 sbci r25, 0x05 ; 5 32010: 10 f0 brcs .+4 ; 0x32016 32012: 0d 94 f7 9e jmp 0x33dee ; 0x33dee if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 32016: 9e 01 movw r18, r28 32018: 2f 5f subi r18, 0xFF ; 255 3201a: 3f 4f sbci r19, 0xFF ; 255 3201c: 79 01 movw r14, r18 3201e: 10 e0 ldi r17, 0x00 ; 0 32020: 00 e0 ldi r16, 0x00 ; 0 32022: 2c e7 ldi r18, 0x7C ; 124 32024: 3c ef ldi r19, 0xFC ; 252 32026: a6 01 movw r20, r12 32028: 44 56 subi r20, 0x64 ; 100 3202a: 51 09 sbc r21, r1 3202c: 69 2d mov r22, r9 3202e: 78 2d mov r23, r8 32030: 8b 2d mov r24, r11 32032: 9a 2d mov r25, r10 32034: 0f 94 82 6e call 0x2dd04 ; 0x2dd04 32038: 88 23 and r24, r24 3203a: 11 f4 brne .+4 ; 0x32040 3203c: 0d 94 f7 9e jmp 0x33dee ; 0x33dee ad += 720; 32040: 89 81 ldd r24, Y+1 ; 0x01 32042: 9a 81 ldd r25, Y+2 ; 0x02 32044: 80 53 subi r24, 0x30 ; 48 32046: 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); 32048: c0 90 bb 06 lds r12, 0x06BB ; 0x8006bb 3204c: d0 90 bc 06 lds r13, 0x06BC ; 0x8006bc 32050: e0 90 bd 06 lds r14, 0x06BD ; 0x8006bd 32054: f0 90 be 06 lds r15, 0x06BE ; 0x8006be 32058: 00 91 b7 06 lds r16, 0x06B7 ; 0x8006b7 3205c: 10 91 b8 06 lds r17, 0x06B8 ; 0x8006b8 32060: 20 91 b9 06 lds r18, 0x06B9 ; 0x8006b9 32064: 30 91 ba 06 lds r19, 0x06BA ; 0x8006ba 32068: 40 91 b3 06 lds r20, 0x06B3 ; 0x8006b3 3206c: 50 91 b4 06 lds r21, 0x06B4 ; 0x8006b4 32070: 60 91 b5 06 lds r22, 0x06B5 ; 0x8006b5 32074: 70 91 b6 06 lds r23, 0x06B6 ; 0x8006b6 32078: 9f 93 push r25 3207a: 8f 93 push r24 3207c: df 92 push r13 3207e: cf 92 push r12 32080: 1f 93 push r17 32082: 0f 93 push r16 32084: 5f 93 push r21 32086: 4f 93 push r20 32088: 88 ee ldi r24, 0xE8 ; 232 3208a: 94 ea ldi r25, 0xA4 ; 164 3208c: 9f 93 push r25 3208e: 8f 93 push r24 32090: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca /// 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); 32094: 40 91 bb 06 lds r20, 0x06BB ; 0x8006bb 32098: 50 91 bc 06 lds r21, 0x06BC ; 0x8006bc 3209c: 60 91 bd 06 lds r22, 0x06BD ; 0x8006bd 320a0: 70 91 be 06 lds r23, 0x06BE ; 0x8006be 320a4: 48 54 subi r20, 0x48 ; 72 320a6: 51 09 sbc r21, r1 320a8: 00 e0 ldi r16, 0x00 ; 0 320aa: 28 ec ldi r18, 0xC8 ; 200 320ac: 30 e0 ldi r19, 0x00 ; 0 320ae: a3 96 adiw r28, 0x23 ; 35 320b0: 6f ad ldd r22, Y+63 ; 0x3f 320b2: a3 97 sbiw r28, 0x23 ; 35 320b4: a4 96 adiw r28, 0x24 ; 36 320b6: 7f ad ldd r23, Y+63 ; 0x3f 320b8: a4 97 sbiw r28, 0x24 ; 36 320ba: c2 01 movw r24, r4 320bc: 0e 94 7c eb call 0x1d6f8 ; 0x1d6f8 /// 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; 320c0: 20 91 b3 06 lds r18, 0x06B3 ; 0x8006b3 320c4: 30 91 b4 06 lds r19, 0x06B4 ; 0x8006b4 320c8: 40 91 b5 06 lds r20, 0x06B5 ; 0x8006b5 320cc: 50 91 b6 06 lds r21, 0x06B6 ; 0x8006b6 320d0: 6e 96 adiw r28, 0x1e ; 30 320d2: 2c af std Y+60, r18 ; 0x3c 320d4: 3d af std Y+61, r19 ; 0x3d 320d6: 4e af std Y+62, r20 ; 0x3e 320d8: 5f af std Y+63, r21 ; 0x3f 320da: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 320dc: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 320e0: 90 91 b8 06 lds r25, 0x06B8 ; 0x8006b8 320e4: a0 91 b9 06 lds r26, 0x06B9 ; 0x8006b9 320e8: b0 91 ba 06 lds r27, 0x06BA ; 0x8006ba 320ec: ae 96 adiw r28, 0x2e ; 46 320ee: 8c af std Y+60, r24 ; 0x3c 320f0: 9d af std Y+61, r25 ; 0x3d 320f2: ae af std Y+62, r26 ; 0x3e 320f4: bf af std Y+63, r27 ; 0x3f 320f6: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 320f8: 20 91 bb 06 lds r18, 0x06BB ; 0x8006bb 320fc: 30 91 bc 06 lds r19, 0x06BC ; 0x8006bc 32100: 40 91 bd 06 lds r20, 0x06BD ; 0x8006bd 32104: 50 91 be 06 lds r21, 0x06BE ; 0x8006be 32108: e9 96 adiw r28, 0x39 ; 57 3210a: 2c af std Y+60, r18 ; 0x3c 3210c: 3d af std Y+61, r19 ; 0x3d 3210e: 4e af std Y+62, r20 ; 0x3e 32110: 5f af std Y+63, r21 ; 0x3f 32112: e9 97 sbiw r28, 0x39 ; 57 32114: a5 ec ldi r26, 0xC5 ; 197 32116: ba e0 ldi r27, 0x0A ; 10 32118: 0f b6 in r0, 0x3f ; 63 3211a: f8 94 cli 3211c: de bf out 0x3e, r29 ; 62 3211e: 0f be out 0x3f, r0 ; 63 32120: cd bf out 0x3d, r28 ; 61 32122: 90 e0 ldi r25, 0x00 ; 0 32124: 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)); 32126: fc 01 movw r30, r24 32128: ed 57 subi r30, 0x7D ; 125 3212a: fa 45 sbci r31, 0x5A ; 90 3212c: 25 91 lpm r18, Z+ 3212e: 34 91 lpm r19, Z 32130: 2d 93 st X+, r18 32132: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 32134: fc 01 movw r30, r24 32136: e5 59 subi r30, 0x95 ; 149 32138: fa 45 sbci r31, 0x5A ; 90 3213a: 25 91 lpm r18, Z+ 3213c: 34 91 lpm r19, Z 3213e: 57 96 adiw r26, 0x17 ; 23 32140: 3c 93 st X, r19 32142: 2e 93 st -X, r18 32144: 56 97 sbiw r26, 0x16 ; 22 32146: 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++){ 32148: 88 31 cpi r24, 0x18 ; 24 3214a: 91 05 cpc r25, r1 3214c: 61 f7 brne .-40 ; 0x32126 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); 3214e: e7 96 adiw r28, 0x37 ; 55 32150: 4e ad ldd r20, Y+62 ; 0x3e 32152: 5f ad ldd r21, Y+63 ; 0x3f 32154: e7 97 sbiw r28, 0x37 ; 55 32156: ac 96 adiw r28, 0x2c ; 44 32158: 6e ad ldd r22, Y+62 ; 0x3e 3215a: 7f ad ldd r23, Y+63 ; 0x3f 3215c: ac 97 sbiw r28, 0x2c ; 44 3215e: 6c 96 adiw r28, 0x1c ; 28 32160: 8e ad ldd r24, Y+62 ; 0x3e 32162: 9f ad ldd r25, Y+63 ; 0x3f 32164: 6c 97 sbiw r28, 0x1c ; 28 32166: 0f 94 be 6f call 0x2df7c ; 0x2df7c 3216a: 25 ec ldi r18, 0xC5 ; 197 3216c: 36 e0 ldi r19, 0x06 ; 6 3216e: a4 96 adiw r28, 0x24 ; 36 32170: 3f af std Y+63, r19 ; 0x3f 32172: 2e af std Y+62, r18 ; 0x3e 32174: a4 97 sbiw r28, 0x24 ; 36 32176: 79 01 movw r14, r18 32178: f0 e2 ldi r31, 0x20 ; 32 3217a: 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]); 3217c: ae e2 ldi r26, 0x2E ; 46 3217e: ca 2e mov r12, r26 32180: a5 ea ldi r26, 0xA5 ; 165 32182: da 2e mov r13, r26 } DBG(endl); 32184: 03 e8 ldi r16, 0x83 ; 131 32186: 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); 32188: 57 01 movw r10, r14 3218a: e0 e2 ldi r30, 0x20 ; 32 3218c: 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]); 3218e: d5 01 movw r26, r10 32190: 8d 91 ld r24, X+ 32192: 5d 01 movw r10, r26 32194: 1f 92 push r1 32196: 8f 93 push r24 32198: df 92 push r13 3219a: cf 92 push r12 3219c: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 321a0: 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){ 321a2: 0f 90 pop r0 321a4: 0f 90 pop r0 321a6: 0f 90 pop r0 321a8: 0f 90 pop r0 321aa: 81 10 cpse r8, r1 321ac: f0 cf rjmp .-32 ; 0x3218e DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 321ae: 1f 93 push r17 321b0: 0f 93 push r16 321b2: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 321b6: 9a 94 dec r9 321b8: b0 e2 ldi r27, 0x20 ; 32 321ba: eb 0e add r14, r27 321bc: 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){ 321be: 0f 90 pop r0 321c0: 0f 90 pop r0 321c2: 91 10 cpse r9, r1 321c4: e1 cf rjmp .-62 ; 0x32188 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 321c6: 1f 93 push r17 321c8: 0f 93 push r16 321ca: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 321ce: 65 ec ldi r22, 0xC5 ; 197 321d0: 7a e0 ldi r23, 0x0A ; 10 321d2: 0f 90 pop r0 321d4: 0f 90 pop r0 321d6: e5 ec ldi r30, 0xC5 ; 197 321d8: 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; 321da: 90 e0 ldi r25, 0x00 ; 0 321dc: 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; 321de: 50 e0 ldi r21, 0x00 ; 0 321e0: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 321e2: 21 91 ld r18, Z+ 321e4: 21 11 cpse r18, r1 321e6: 6d c4 rjmp .+2266 ; 0x32ac2 ++mins; 321e8: 4f 5f subi r20, 0xFF ; 255 321ea: 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){ 321ec: 6e 17 cp r22, r30 321ee: 7f 07 cpc r23, r31 321f0: c1 f7 brne .-16 ; 0x321e2 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 321f2: 9a 01 movw r18, r20 321f4: 28 0f add r18, r24 321f6: 39 1f adc r19, r25 321f8: 25 38 cpi r18, 0x85 ; 133 321fa: 33 40 sbci r19, 0x03 ; 3 321fc: a4 f0 brlt .+40 ; 0x32226 && mins > threshold_extreme 321fe: 43 33 cpi r20, 0x33 ; 51 32200: 51 05 cpc r21, r1 32202: 8c f0 brlt .+34 ; 0x32226 && maxs > threshold_extreme 32204: 83 33 cpi r24, 0x33 ; 51 32206: 91 05 cpc r25, r1 32208: 74 f0 brlt .+28 ; 0x32226 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 3220a: 20 e0 ldi r18, 0x00 ; 0 3220c: 34 e0 ldi r19, 0x04 ; 4 3220e: 24 1b sub r18, r20 32210: 35 0b sbc r19, r21 32212: 28 1b sub r18, r24 32214: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 32216: 24 17 cp r18, r20 32218: 35 07 cpc r19, r21 3221a: 2c f4 brge .+10 ; 0x32226 } 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; 3221c: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 3221e: 28 17 cp r18, r24 32220: 39 07 cpc r19, r25 32222: 0c f4 brge .+2 ; 0x32226 32224: 3f c2 rjmp .+1150 ; 0x326a4 } /// 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; 32226: 66 96 adiw r28, 0x16 ; 22 32228: 1f ae std Y+63, r1 ; 0x3f 3222a: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 3222c: 62 96 adiw r28, 0x12 ; 18 3222e: 1f ae std Y+63, r1 ; 0x3f 32230: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 32232: 22 96 adiw r28, 0x02 ; 2 32234: 1f ae std Y+63, r1 ; 0x3f 32236: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 32238: 19 82 std Y+1, r1 ; 0x01 3223a: ae 01 movw r20, r28 3223c: 4f 5a subi r20, 0xAF ; 175 3223e: 5f 4f sbci r21, 0xFF ; 255 32240: be 01 movw r22, r28 32242: 6b 5a subi r22, 0xAB ; 171 32244: 7f 4f sbci r23, 0xFF ; 255 32246: 85 ec ldi r24, 0xC5 ; 197 32248: 9a e0 ldi r25, 0x0A ; 10 3224a: 0f 94 e5 67 call 0x2cfca ; 0x2cfca 3224e: 08 2f mov r16, r24 32250: ae 01 movw r20, r28 32252: 4f 5f subi r20, 0xFF ; 255 32254: 5f 4f sbci r21, 0xFF ; 255 32256: be 01 movw r22, r28 32258: 6f 5b subi r22, 0xBF ; 191 3225a: 7f 4f sbci r23, 0xFF ; 255 3225c: 8d ed ldi r24, 0xDD ; 221 3225e: 9a e0 ldi r25, 0x0A ; 10 32260: 0f 94 e5 67 call 0x2cfca ; 0x2cfca 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; 32264: 66 96 adiw r28, 0x16 ; 22 32266: 6f ad ldd r22, Y+63 ; 0x3f 32268: 66 97 sbiw r28, 0x16 ; 22 row = r08; 3226a: 62 96 adiw r28, 0x12 ; 18 3226c: 1f ad ldd r17, Y+63 ; 0x3f 3226e: 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){ 32270: 80 17 cp r24, r16 32272: 28 f0 brcs .+10 ; 0x3227e col = c08; row = r08; return match08; } col = c10; 32274: 22 96 adiw r28, 0x02 ; 2 32276: 6f ad ldd r22, Y+63 ; 0x3f 32278: 22 97 sbiw r28, 0x02 ; 2 row = r10; 3227a: 19 81 ldd r17, Y+1 ; 0x01 3227c: 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){ 3227e: 08 35 cpi r16, 0x58 ; 88 32280: 08 f4 brcc .+2 ; 0x32284 32282: 24 c4 rjmp .+2120 ; 0x32acc /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 32284: 70 e0 ldi r23, 0x00 ; 0 32286: 90 e0 ldi r25, 0x00 ; 0 32288: 80 e0 ldi r24, 0x00 ; 0 3228a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3228e: 20 e0 ldi r18, 0x00 ; 0 32290: 30 e0 ldi r19, 0x00 ; 0 32292: 40 eb ldi r20, 0xB0 ; 176 32294: 50 e4 ldi r21, 0x40 ; 64 32296: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3229a: 2b 01 movw r4, r22 3229c: 3c 01 movw r6, r24 3229e: 65 96 adiw r28, 0x15 ; 21 322a0: 4c ae std Y+60, r4 ; 0x3c 322a2: 5d ae std Y+61, r5 ; 0x3d 322a4: 6e ae std Y+62, r6 ; 0x3e 322a6: 7f ae std Y+63, r7 ; 0x3f 322a8: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 322aa: 61 2f mov r22, r17 322ac: 70 e0 ldi r23, 0x00 ; 0 322ae: 90 e0 ldi r25, 0x00 ; 0 322b0: 80 e0 ldi r24, 0x00 ; 0 322b2: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 322b6: 20 e0 ldi r18, 0x00 ; 0 322b8: 30 e0 ldi r19, 0x00 ; 0 322ba: 40 eb ldi r20, 0xB0 ; 176 322bc: 50 e4 ldi r21, 0x40 ; 64 322be: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 322c2: 4b 01 movw r8, r22 322c4: 5c 01 movw r10, r24 322c6: 25 96 adiw r28, 0x05 ; 5 322c8: 8c ae std Y+60, r8 ; 0x3c 322ca: 9d ae std Y+61, r9 ; 0x3d 322cc: ae ae std Y+62, r10 ; 0x3e 322ce: bf ae std Y+63, r11 ; 0x3f 322d0: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 322d2: 20 e0 ldi r18, 0x00 ; 0 322d4: 30 e0 ldi r19, 0x00 ; 0 322d6: 40 e9 ldi r20, 0x90 ; 144 322d8: 50 e4 ldi r21, 0x40 ; 64 322da: 29 83 std Y+1, r18 ; 0x01 322dc: 3a 83 std Y+2, r19 ; 0x02 322de: 4b 83 std Y+3, r20 ; 0x03 322e0: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 322e2: ae 01 movw r20, r28 322e4: 4f 5f subi r20, 0xFF ; 255 322e6: 5f 4f sbci r21, 0xFF ; 255 322e8: be 01 movw r22, r28 322ea: 6f 5b subi r22, 0xBF ; 191 322ec: 7f 4f sbci r23, 0xFF ; 255 322ee: ce 01 movw r24, r28 322f0: 8f 5a subi r24, 0xAF ; 175 322f2: 9f 4f sbci r25, 0xFF ; 255 322f4: 0f 94 02 6b call 0x2d604 ; 0x2d604 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 322f8: a3 01 movw r20, r6 322fa: 92 01 movw r18, r4 322fc: 65 96 adiw r28, 0x15 ; 21 322fe: 6c ad ldd r22, Y+60 ; 0x3c 32300: 7d ad ldd r23, Y+61 ; 0x3d 32302: 8e ad ldd r24, Y+62 ; 0x3e 32304: 9f ad ldd r25, Y+63 ; 0x3f 32306: 65 97 sbiw r28, 0x15 ; 21 32308: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3230c: 6b 01 movw r12, r22 3230e: 7c 01 movw r14, r24 32310: 9f 77 andi r25, 0x7F ; 127 32312: 20 e0 ldi r18, 0x00 ; 0 32314: 30 e0 ldi r19, 0x00 ; 0 32316: 40 e4 ldi r20, 0x40 ; 64 32318: 50 e4 ldi r21, 0x40 ; 64 3231a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 3231e: 18 16 cp r1, r24 32320: 34 f1 brlt .+76 ; 0x3236e 32322: a5 01 movw r20, r10 32324: 94 01 movw r18, r8 32326: 25 96 adiw r28, 0x05 ; 5 32328: 6c ad ldd r22, Y+60 ; 0x3c 3232a: 7d ad ldd r23, Y+61 ; 0x3d 3232c: 8e ad ldd r24, Y+62 ; 0x3e 3232e: 9f ad ldd r25, Y+63 ; 0x3f 32330: 25 97 sbiw r28, 0x05 ; 5 32332: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 32336: 9f 77 andi r25, 0x7F ; 127 32338: 20 e0 ldi r18, 0x00 ; 0 3233a: 30 e0 ldi r19, 0x00 ; 0 3233c: 40 e4 ldi r20, 0x40 ; 64 3233e: 50 e4 ldi r21, 0x40 ; 64 32340: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 32344: 18 16 cp r1, r24 32346: 9c f0 brlt .+38 ; 0x3236e 32348: 20 e0 ldi r18, 0x00 ; 0 3234a: 30 e0 ldi r19, 0x00 ; 0 3234c: 40 ea ldi r20, 0xA0 ; 160 3234e: 50 e4 ldi r21, 0x40 ; 64 32350: 69 81 ldd r22, Y+1 ; 0x01 32352: 7a 81 ldd r23, Y+2 ; 0x02 32354: 8b 81 ldd r24, Y+3 ; 0x03 32356: 9c 81 ldd r25, Y+4 ; 0x04 32358: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3235c: 9f 77 andi r25, 0x7F ; 127 3235e: 20 e0 ldi r18, 0x00 ; 0 32360: 30 e0 ldi r19, 0x00 ; 0 32362: 40 e4 ldi r20, 0x40 ; 64 32364: 50 e4 ldi r21, 0x40 ; 64 32366: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 3236a: 18 16 cp r1, r24 3236c: bc f5 brge .+110 ; 0x323dc //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 3236e: 20 e0 ldi r18, 0x00 ; 0 32370: 30 e0 ldi r19, 0x00 ; 0 32372: 40 ea ldi r20, 0xA0 ; 160 32374: 50 e4 ldi r21, 0x40 ; 64 32376: 69 81 ldd r22, Y+1 ; 0x01 32378: 7a 81 ldd r23, Y+2 ; 0x02 3237a: 8b 81 ldd r24, Y+3 ; 0x03 3237c: 9c 81 ldd r25, Y+4 ; 0x04 3237e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 32382: 9f 93 push r25 32384: 8f 93 push r24 32386: 7f 93 push r23 32388: 6f 93 push r22 3238a: a5 01 movw r20, r10 3238c: 94 01 movw r18, r8 3238e: 25 96 adiw r28, 0x05 ; 5 32390: 6c ad ldd r22, Y+60 ; 0x3c 32392: 7d ad ldd r23, Y+61 ; 0x3d 32394: 8e ad ldd r24, Y+62 ; 0x3e 32396: 9f ad ldd r25, Y+63 ; 0x3f 32398: 25 97 sbiw r28, 0x05 ; 5 3239a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3239e: 9f 93 push r25 323a0: 8f 93 push r24 323a2: 7f 93 push r23 323a4: 6f 93 push r22 323a6: ff 92 push r15 323a8: ef 92 push r14 323aa: df 92 push r13 323ac: cf 92 push r12 323ae: 8f e4 ldi r24, 0x4F ; 79 323b0: 95 ea ldi r25, 0xA5 ; 165 323b2: 9f 93 push r25 323b4: 8f 93 push r24 323b6: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 323ba: 65 96 adiw r28, 0x15 ; 21 323bc: 4c ae std Y+60, r4 ; 0x3c 323be: 5d ae std Y+61, r5 ; 0x3d 323c0: 6e ae std Y+62, r6 ; 0x3e 323c2: 7f ae std Y+63, r7 ; 0x3f 323c4: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 323c6: 25 96 adiw r28, 0x05 ; 5 323c8: 8c ae std Y+60, r8 ; 0x3c 323ca: 9d ae std Y+61, r9 ; 0x3d 323cc: ae ae std Y+62, r10 ; 0x3e 323ce: bf ae std Y+63, r11 ; 0x3f 323d0: 25 97 sbiw r28, 0x05 ; 5 323d2: 0f b6 in r0, 0x3f ; 63 323d4: f8 94 cli 323d6: de bf out 0x3e, r29 ; 62 323d8: 0f be out 0x3f, r0 ; 63 323da: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 323dc: 20 e0 ldi r18, 0x00 ; 0 323de: 30 e0 ldi r19, 0x00 ; 0 323e0: 48 e7 ldi r20, 0x78 ; 120 323e2: 51 e4 ldi r21, 0x41 ; 65 323e4: 65 96 adiw r28, 0x15 ; 21 323e6: 6c ad ldd r22, Y+60 ; 0x3c 323e8: 7d ad ldd r23, Y+61 ; 0x3d 323ea: 8e ad ldd r24, Y+62 ; 0x3e 323ec: 9f ad ldd r25, Y+63 ; 0x3f 323ee: 65 97 sbiw r28, 0x15 ; 21 323f0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 323f4: 20 e0 ldi r18, 0x00 ; 0 323f6: 30 e0 ldi r19, 0x00 ; 0 323f8: 40 e8 ldi r20, 0x80 ; 128 323fa: 52 e4 ldi r21, 0x42 ; 66 323fc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32400: 6b 01 movw r12, r22 32402: 7c 01 movw r14, r24 32404: 6c 96 adiw r28, 0x1c ; 28 32406: ae ad ldd r26, Y+62 ; 0x3e 32408: bf ad ldd r27, Y+63 ; 0x3f 3240a: 6c 97 sbiw r28, 0x1c ; 28 3240c: bd 01 movw r22, r26 3240e: bb 0f add r27, r27 32410: 88 0b sbc r24, r24 32412: 99 0b sbc r25, r25 32414: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 32418: 9b 01 movw r18, r22 3241a: ac 01 movw r20, r24 3241c: c7 01 movw r24, r14 3241e: b6 01 movw r22, r12 32420: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32424: 6b 01 movw r12, r22 32426: 7c 01 movw r14, r24 32428: 65 96 adiw r28, 0x15 ; 21 3242a: cc ae std Y+60, r12 ; 0x3c 3242c: dd ae std Y+61, r13 ; 0x3d 3242e: ee ae std Y+62, r14 ; 0x3e 32430: ff ae std Y+63, r15 ; 0x3f 32432: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 32434: 20 e0 ldi r18, 0x00 ; 0 32436: 30 e0 ldi r19, 0x00 ; 0 32438: 48 e7 ldi r20, 0x78 ; 120 3243a: 51 e4 ldi r21, 0x41 ; 65 3243c: 25 96 adiw r28, 0x05 ; 5 3243e: 6c ad ldd r22, Y+60 ; 0x3c 32440: 7d ad ldd r23, Y+61 ; 0x3d 32442: 8e ad ldd r24, Y+62 ; 0x3e 32444: 9f ad ldd r25, Y+63 ; 0x3f 32446: 25 97 sbiw r28, 0x05 ; 5 32448: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3244c: 20 e0 ldi r18, 0x00 ; 0 3244e: 30 e0 ldi r19, 0x00 ; 0 32450: 40 e8 ldi r20, 0x80 ; 128 32452: 52 e4 ldi r21, 0x42 ; 66 32454: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32458: 4b 01 movw r8, r22 3245a: 5c 01 movw r10, r24 3245c: ac 96 adiw r28, 0x2c ; 44 3245e: ee ad ldd r30, Y+62 ; 0x3e 32460: ff ad ldd r31, Y+63 ; 0x3f 32462: ac 97 sbiw r28, 0x2c ; 44 32464: bf 01 movw r22, r30 32466: ff 0f add r31, r31 32468: 88 0b sbc r24, r24 3246a: 99 0b sbc r25, r25 3246c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 32470: 9b 01 movw r18, r22 32472: ac 01 movw r20, r24 32474: c5 01 movw r24, r10 32476: b4 01 movw r22, r8 32478: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3247c: 25 96 adiw r28, 0x05 ; 5 3247e: 6c af std Y+60, r22 ; 0x3c 32480: 7d af std Y+61, r23 ; 0x3d 32482: 8e af std Y+62, r24 ; 0x3e 32484: 9f af std Y+63, r25 ; 0x3f 32486: 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; 32488: 2a e0 ldi r18, 0x0A ; 10 3248a: 37 ed ldi r19, 0xD7 ; 215 3248c: 43 e2 ldi r20, 0x23 ; 35 3248e: 5c e3 ldi r21, 0x3C ; 60 32490: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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)); 32494: 9f 93 push r25 32496: 8f 93 push r24 32498: 7f 93 push r23 3249a: 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; 3249c: 2a e0 ldi r18, 0x0A ; 10 3249e: 37 ed ldi r19, 0xD7 ; 215 324a0: 43 e2 ldi r20, 0x23 ; 35 324a2: 5c e3 ldi r21, 0x3C ; 60 324a4: c7 01 movw r24, r14 324a6: b6 01 movw r22, r12 324a8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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)); 324ac: 9f 93 push r25 324ae: 8f 93 push r24 324b0: 7f 93 push r23 324b2: 6f 93 push r22 324b4: 83 e3 ldi r24, 0x33 ; 51 324b6: 95 ea ldi r25, 0xA5 ; 165 324b8: 9f 93 push r25 324ba: 8f 93 push r24 324bc: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 324c0: 20 e0 ldi r18, 0x00 ; 0 324c2: 30 e0 ldi r19, 0x00 ; 0 324c4: 40 e0 ldi r20, 0x00 ; 0 324c6: 5f e3 ldi r21, 0x3F ; 63 324c8: 25 96 adiw r28, 0x05 ; 5 324ca: 6c ad ldd r22, Y+60 ; 0x3c 324cc: 7d ad ldd r23, Y+61 ; 0x3d 324ce: 8e ad ldd r24, Y+62 ; 0x3e 324d0: 9f ad ldd r25, Y+63 ; 0x3f 324d2: 25 97 sbiw r28, 0x05 ; 5 324d4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 324d8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 324dc: 6b 01 movw r12, r22 324de: 20 e0 ldi r18, 0x00 ; 0 324e0: 30 e0 ldi r19, 0x00 ; 0 324e2: 40 e0 ldi r20, 0x00 ; 0 324e4: 5f e3 ldi r21, 0x3F ; 63 324e6: 65 96 adiw r28, 0x15 ; 21 324e8: 6c ad ldd r22, Y+60 ; 0x3c 324ea: 7d ad ldd r23, Y+61 ; 0x3d 324ec: 8e ad ldd r24, Y+62 ; 0x3e 324ee: 9f ad ldd r25, Y+63 ; 0x3f 324f0: 65 97 sbiw r28, 0x15 ; 21 324f2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 324f6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 324fa: 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); 324fc: 00 e0 ldi r16, 0x00 ; 0 324fe: 28 ec ldi r18, 0xC8 ; 200 32500: 30 e0 ldi r19, 0x00 ; 0 32502: e7 96 adiw r28, 0x37 ; 55 32504: 4e ad ldd r20, Y+62 ; 0x3e 32506: 5f ad ldd r21, Y+63 ; 0x3f 32508: e7 97 sbiw r28, 0x37 ; 55 3250a: b6 01 movw r22, r12 3250c: 0e 94 7c eb call 0x1d6f8 ; 0x1d6f8 32510: 0f b6 in r0, 0x3f ; 63 32512: f8 94 cli 32514: de bf out 0x3e, r29 ; 62 32516: 0f be out 0x3f, r0 ; 63 32518: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 3251a: 10 e0 ldi r17, 0x00 ; 0 3251c: 85 ea ldi r24, 0xA5 ; 165 3251e: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 32520: a4 96 adiw r28, 0x24 ; 36 32522: ae ad ldd r26, Y+62 ; 0x3e 32524: bf ad ldd r27, Y+63 ; 0x3f 32526: a4 97 sbiw r28, 0x24 ; 36 32528: 1d 92 st X+, r1 3252a: a4 96 adiw r28, 0x24 ; 36 3252c: bf af std Y+63, r27 ; 0x3f 3252e: ae af std Y+62, r26 ; 0x3e 32530: 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++) 32532: 8a 17 cp r24, r26 32534: 9b 07 cpc r25, r27 32536: a1 f7 brne .-24 ; 0x32520 32538: b5 c0 rjmp .+362 ; 0x326a4 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)); 3253a: 8b e7 ldi r24, 0x7B ; 123 3253c: 9b e5 ldi r25, 0x5B ; 91 3253e: 0e 94 b3 72 call 0xe566 ; 0xe566 32542: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 lcd_puts_at_P(0,3,_n("1/4")); 32546: 4b e6 ldi r20, 0x6B ; 107 32548: 50 e7 ldi r21, 0x70 ; 112 3254a: bc cb rjmp .-2184 ; 0x31cc4 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 3254c: 89 e1 ldi r24, 0x19 ; 25 3254e: 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); 32550: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 32554: 9f cb rjmp .-2242 ; 0x31c94 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); 32556: c7 55 subi r28, 0x57 ; 87 32558: df 4f sbci r29, 0xFF ; 255 3255a: 88 81 ld r24, Y 3255c: 99 81 ldd r25, Y+1 ; 0x01 3255e: c9 5a subi r28, 0xA9 ; 169 32560: d0 40 sbci r29, 0x00 ; 0 32562: 0e 94 d5 66 call 0xcdaa ; 0xcdaa // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 32566: 0f 94 a2 ce call 0x39d44 ; 0x39d44 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 3256a: 0f 94 40 cc call 0x39880 ; 0x39880 //FIXME bool result = sample_mesh_and_store_reference(); 3256e: 0f 94 4f ca call 0x3949e ; 0x3949e 32572: e5 96 adiw r28, 0x35 ; 53 32574: 8f af std Y+63, r24 ; 0x3f 32576: e5 97 sbiw r28, 0x35 ; 53 if (result) 32578: 88 23 and r24, r24 3257a: 09 f4 brne .+2 ; 0x3257e 3257c: 8b cb rjmp .-2282 ; 0x31c94 { calibration_status_set(CALIBRATION_STATUS_Z); 3257e: 84 e0 ldi r24, 0x04 ; 4 32580: 0e 94 99 ee call 0x1dd32 ; 0x1dd32 } else { // Timeouted. } lcd_update_enable(true); 32584: 81 e0 ldi r24, 0x01 ; 1 32586: 0e 94 2c 6f call 0xde58 ; 0xde58 #ifdef TMC2130 FORCE_HIGH_POWER_END; 3258a: 80 e0 ldi r24, 0x00 ; 0 3258c: 0e 94 b7 66 call 0xcd6e ; 0xcd6e #endif // TMC2130 FORCE_BL_ON_END; 32590: 80 e0 ldi r24, 0x00 ; 0 32592: 0e 94 50 8a call 0x114a0 ; 0x114a0 return final_result; } 32596: e5 96 adiw r28, 0x35 ; 53 32598: 8f ad ldd r24, Y+63 ; 0x3f 3259a: e5 97 sbiw r28, 0x35 ; 53 3259c: c2 53 subi r28, 0x32 ; 50 3259e: df 4f sbci r29, 0xFF ; 255 325a0: 0f b6 in r0, 0x3f ; 63 325a2: f8 94 cli 325a4: de bf out 0x3e, r29 ; 62 325a6: 0f be out 0x3f, r0 ; 63 325a8: cd bf out 0x3d, r28 ; 61 325aa: df 91 pop r29 325ac: cf 91 pop r28 325ae: 1f 91 pop r17 325b0: 0f 91 pop r16 325b2: ff 90 pop r15 325b4: ef 90 pop r14 325b6: df 90 pop r13 325b8: cf 90 pop r12 325ba: bf 90 pop r11 325bc: af 90 pop r10 325be: 9f 90 pop r9 325c0: 8f 90 pop r8 325c2: 7f 90 pop r7 325c4: 6f 90 pop r6 325c6: 5f 90 pop r5 325c8: 4f 90 pop r4 325ca: 3f 90 pop r3 325cc: 2f 90 pop r2 325ce: 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) { 325d0: e1 e0 ldi r30, 0x01 ; 1 325d2: e1 96 adiw r28, 0x31 ; 49 325d4: ef af std Y+63, r30 ; 0x3f 325d6: e1 97 sbiw r28, 0x31 ; 49 325d8: 0f cc rjmp .-2018 ; 0x31df8 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) 325da: fe 01 movw r30, r28 325dc: 31 96 adiw r30, 0x01 ; 1 325de: 7f 01 movw r14, r30 325e0: 10 e0 ldi r17, 0x00 ; 0 325e2: 00 e0 ldi r16, 0x00 ; 0 325e4: 24 e8 ldi r18, 0x84 ; 132 325e6: 33 e0 ldi r19, 0x03 ; 3 325e8: a6 01 movw r20, r12 325ea: 69 2d mov r22, r9 325ec: 78 2d mov r23, r8 325ee: 8b 2d mov r24, r11 325f0: 9a 2d mov r25, r10 325f2: 0f 94 82 6e call 0x2dd04 ; 0x2dd04 ad += 0; if (!ret && (ad < 1440)) 325f6: 88 23 and r24, r24 325f8: 09 f4 brne .+2 ; 0x325fc 325fa: 06 cd rjmp .-1524 ; 0x32008 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; 325fc: 89 81 ldd r24, Y+1 ; 0x01 325fe: 9a 81 ldd r25, Y+2 ; 0x02 32600: 23 cd rjmp .-1466 ; 0x32048 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)) 32602: 89 81 ldd r24, Y+1 ; 0x01 32604: 9a 81 ldd r25, Y+2 ; 0x02 32606: 80 34 cpi r24, 0x40 ; 64 32608: 9b 40 sbci r25, 0x0B ; 11 3260a: b8 f4 brcc .+46 ; 0x3263a if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 3260c: ce 01 movw r24, r28 3260e: 01 96 adiw r24, 0x01 ; 1 32610: 7c 01 movw r14, r24 32612: 04 eb ldi r16, 0xB4 ; 180 32614: 10 e0 ldi r17, 0x00 ; 0 32616: 2c e7 ldi r18, 0x7C ; 124 32618: 3c ef ldi r19, 0xFC ; 252 3261a: a6 01 movw r20, r12 3261c: 4c 52 subi r20, 0x2C ; 44 3261e: 51 40 sbci r21, 0x01 ; 1 32620: 69 2d mov r22, r9 32622: 78 2d mov r23, r8 32624: 8b 2d mov r24, r11 32626: 9a 2d mov r25, r10 32628: 0f 94 82 6e call 0x2dd04 ; 0x2dd04 3262c: 88 23 and r24, r24 3262e: 29 f0 breq .+10 ; 0x3263a ad += 2160; 32630: 89 81 ldd r24, Y+1 ; 0x01 32632: 9a 81 ldd r25, Y+2 ; 0x02 32634: 80 59 subi r24, 0x90 ; 144 32636: 97 4f sbci r25, 0xF7 ; 247 32638: 07 cd rjmp .-1522 ; 0x32048 /// 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; 3263a: 90 e9 ldi r25, 0x90 ; 144 3263c: c9 1a sub r12, r25 3263e: 91 e0 ldi r25, 0x01 ; 1 32640: d9 0a sbc r13, r25 32642: ba cc rjmp .-1676 ; 0x31fb8 } //@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]); 32644: 00 91 bb 06 lds r16, 0x06BB ; 0x8006bb 32648: 10 91 bc 06 lds r17, 0x06BC ; 0x8006bc 3264c: 20 91 bd 06 lds r18, 0x06BD ; 0x8006bd 32650: 30 91 be 06 lds r19, 0x06BE ; 0x8006be 32654: 40 91 b7 06 lds r20, 0x06B7 ; 0x8006b7 32658: 50 91 b8 06 lds r21, 0x06B8 ; 0x8006b8 3265c: 60 91 b9 06 lds r22, 0x06B9 ; 0x8006b9 32660: 70 91 ba 06 lds r23, 0x06BA ; 0x8006ba 32664: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 32668: 90 91 b4 06 lds r25, 0x06B4 ; 0x8006b4 3266c: a0 91 b5 06 lds r26, 0x06B5 ; 0x8006b5 32670: b0 91 b6 06 lds r27, 0x06B6 ; 0x8006b6 32674: 3f 93 push r19 32676: 2f 93 push r18 32678: 1f 93 push r17 3267a: 0f 93 push r16 3267c: 7f 93 push r23 3267e: 6f 93 push r22 32680: 5f 93 push r21 32682: 4f 93 push r20 32684: bf 93 push r27 32686: af 93 push r26 32688: 9f 93 push r25 3268a: 8f 93 push r24 3268c: 8b eb ldi r24, 0xBB ; 187 3268e: 94 ea ldi r25, 0xA4 ; 164 32690: 9f 93 push r25 32692: 8f 93 push r24 32694: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 32698: 0f b6 in r0, 0x3f ; 63 3269a: f8 94 cli 3269c: de bf out 0x3e, r29 ; 62 3269e: 0f be out 0x3f, r0 ; 63 326a0: 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; 326a2: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 326a4: 8b e9 ldi r24, 0x9B ; 155 326a6: 95 ea ldi r25, 0xA5 ; 165 326a8: 9f 93 push r25 326aa: 8f 93 push r24 326ac: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca lcd_set_cursor(4,3); 326b0: 63 e0 ldi r22, 0x03 ; 3 326b2: 84 e0 ldi r24, 0x04 ; 4 326b4: 0e 94 e7 6e call 0xddce ; 0xddce lcd_space(16); 326b8: 80 e1 ldi r24, 0x10 ; 16 326ba: 0e 94 dd 6e call 0xddba ; 0xddba // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 326be: 0f 94 83 c0 call 0x38106 ; 0x38106 : "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" ); 326c2: 88 e1 ldi r24, 0x18 ; 24 326c4: 98 e2 ldi r25, 0x28 ; 40 326c6: 0f b6 in r0, 0x3f ; 63 326c8: f8 94 cli 326ca: a8 95 wdr 326cc: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 326d0: 0f be out 0x3f, r0 ; 63 326d2: 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); 326d6: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 326da: 80 64 ori r24, 0x40 ; 64 326dc: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 326e0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 326e4: 82 60 ori r24, 0x02 ; 2 326e6: 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){ 326ea: 0f 90 pop r0 326ec: 0f 90 pop r0 326ee: 1d 3f cpi r17, 0xFD ; 253 326f0: 09 f4 brne .+2 ; 0x326f4 326f2: ee c1 rjmp .+988 ; 0x32ad0 326f4: 1f 3f cpi r17, 0xFF ; 255 326f6: 11 f4 brne .+4 ; 0x326fc 326f8: 0d 94 b3 9e jmp 0x33d66 ; 0x33d66 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); 326fc: 20 e0 ldi r18, 0x00 ; 0 326fe: 30 e0 ldi r19, 0x00 ; 0 32700: a9 01 movw r20, r18 32702: a0 96 adiw r28, 0x20 ; 32 32704: ee ad ldd r30, Y+62 ; 0x3e 32706: ff ad ldd r31, Y+63 ; 0x3f 32708: a0 97 sbiw r28, 0x20 ; 32 3270a: 61 81 ldd r22, Z+1 ; 0x01 3270c: 72 81 ldd r23, Z+2 ; 0x02 3270e: 83 81 ldd r24, Z+3 ; 0x03 32710: 94 81 ldd r25, Z+4 ; 0x04 32712: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 32716: 20 91 92 06 lds r18, 0x0692 ; 0x800692 3271a: 30 91 93 06 lds r19, 0x0693 ; 0x800693 3271e: 40 91 94 06 lds r20, 0x0694 ; 0x800694 32722: 50 91 95 06 lds r21, 0x0695 ; 0x800695 32726: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3272a: a0 96 adiw r28, 0x20 ; 32 3272c: ae ad ldd r26, Y+62 ; 0x3e 3272e: bf ad ldd r27, Y+63 ; 0x3f 32730: a0 97 sbiw r28, 0x20 ; 32 32732: 11 96 adiw r26, 0x01 ; 1 32734: 6d 93 st X+, r22 32736: 7d 93 st X+, r23 32738: 8d 93 st X+, r24 3273a: 9c 93 st X, r25 3273c: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 3273e: c0 90 96 06 lds r12, 0x0696 ; 0x800696 32742: d0 90 97 06 lds r13, 0x0697 ; 0x800697 32746: e0 90 98 06 lds r14, 0x0698 ; 0x800698 3274a: 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); 3274e: 20 e0 ldi r18, 0x00 ; 0 32750: 30 e0 ldi r19, 0x00 ; 0 32752: a9 01 movw r20, r18 32754: 15 96 adiw r26, 0x05 ; 5 32756: 6d 91 ld r22, X+ 32758: 7d 91 ld r23, X+ 3275a: 8d 91 ld r24, X+ 3275c: 9c 91 ld r25, X 3275e: 18 97 sbiw r26, 0x08 ; 8 32760: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 32764: a7 01 movw r20, r14 32766: 96 01 movw r18, r12 32768: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3276c: a0 96 adiw r28, 0x20 ; 32 3276e: ee ad ldd r30, Y+62 ; 0x3e 32770: ff ad ldd r31, Y+63 ; 0x3f 32772: a0 97 sbiw r28, 0x20 ; 32 32774: 65 83 std Z+5, r22 ; 0x05 32776: 76 83 std Z+6, r23 ; 0x06 32778: 87 83 std Z+7, r24 ; 0x07 3277a: 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) 3277c: 20 e0 ldi r18, 0x00 ; 0 3277e: 30 e0 ldi r19, 0x00 ; 0 32780: 40 e8 ldi r20, 0x80 ; 128 32782: 50 ec ldi r21, 0xC0 ; 192 32784: c7 01 movw r24, r14 32786: b6 01 movw r22, r12 32788: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 3278c: 87 ff sbrs r24, 7 3278e: 0c c0 rjmp .+24 ; 0x327a8 current_position[Y_AXIS] = Y_MIN_POS; 32790: 80 e0 ldi r24, 0x00 ; 0 32792: 90 e0 ldi r25, 0x00 ; 0 32794: a0 e8 ldi r26, 0x80 ; 128 32796: b0 ec ldi r27, 0xC0 ; 192 32798: 80 93 96 06 sts 0x0696, r24 ; 0x800696 3279c: 90 93 97 06 sts 0x0697, r25 ; 0x800697 327a0: a0 93 98 06 sts 0x0698, r26 ; 0x800698 327a4: 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; 327a8: 20 e0 ldi r18, 0x00 ; 0 327aa: 30 e0 ldi r19, 0x00 ; 0 327ac: 40 e4 ldi r20, 0x40 ; 64 327ae: 50 e4 ldi r21, 0x40 ; 64 327b0: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 327b4: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 327b8: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 327bc: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 327c0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 327c4: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 327c8: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 327cc: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 327d0: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d 327d4: e0 96 adiw r28, 0x30 ; 48 327d6: 2e ad ldd r18, Y+62 ; 0x3e 327d8: 3f ad ldd r19, Y+63 ; 0x3f 327da: e0 97 sbiw r28, 0x30 ; 48 327dc: 28 5f subi r18, 0xF8 ; 248 327de: 3f 4f sbci r19, 0xFF ; 255 327e0: e0 96 adiw r28, 0x30 ; 48 327e2: 3f af std Y+63, r19 ; 0x3f 327e4: 2e af std Y+62, r18 ; 0x3e 327e6: e0 97 sbiw r28, 0x30 ; 48 327e8: a0 96 adiw r28, 0x20 ; 32 327ea: 4e ad ldd r20, Y+62 ; 0x3e 327ec: 5f ad ldd r21, Y+63 ; 0x3f 327ee: a0 97 sbiw r28, 0x20 ; 32 327f0: 48 5f subi r20, 0xF8 ; 248 327f2: 5f 4f sbci r21, 0xFF ; 255 327f4: a0 96 adiw r28, 0x20 ; 32 327f6: 5f af std Y+63, r21 ; 0x3f 327f8: 4e af std Y+62, r20 ; 0x3e 327fa: 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) { 327fc: 54 e0 ldi r21, 0x04 ; 4 327fe: 25 16 cp r2, r21 32800: 31 04 cpc r3, r1 32802: 09 f0 breq .+2 ; 0x32806 32804: 16 cb rjmp .-2516 ; 0x31e32 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 32806: a7 96 adiw r28, 0x27 ; 39 32808: 6f ad ldd r22, Y+63 ; 0x3f 3280a: a7 97 sbiw r28, 0x27 ; 39 3280c: 66 23 and r22, r22 3280e: 31 f0 breq .+12 ; 0x3281c 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) { 32810: e1 96 adiw r28, 0x31 ; 49 32812: 8f ad ldd r24, Y+63 ; 0x3f 32814: e1 97 sbiw r28, 0x31 ; 49 32816: 81 30 cpi r24, 0x01 ; 1 32818: 09 f0 breq .+2 ; 0x3281c 3281a: da ce rjmp .-588 ; 0x325d0 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 3281c: 86 e4 ldi r24, 0x46 ; 70 3281e: 90 e7 ldi r25, 0x70 ; 112 32820: 9f 93 push r25 32822: 8f 93 push r24 32824: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 32828: 90 e0 ldi r25, 0x00 ; 0 3282a: 80 e0 ldi r24, 0x00 ; 0 3282c: 0e 94 eb 8c call 0x119d6 ; 0x119d6 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) { 32830: 0f 90 pop r0 32832: 0f 90 pop r0 32834: 20 e0 ldi r18, 0x00 ; 0 32836: 30 e0 ldi r19, 0x00 ; 0 32838: 40 e9 ldi r20, 0x90 ; 144 3283a: 50 ec ldi r21, 0xC0 ; 192 3283c: 60 91 c7 13 lds r22, 0x13C7 ; 0x8013c7 32840: 70 91 c8 13 lds r23, 0x13C8 ; 0x8013c8 32844: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 32848: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 3284c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 32850: 87 ff sbrs r24, 7 32852: 45 c1 rjmp .+650 ; 0x32ade too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 32854: 87 ee ldi r24, 0xE7 ; 231 32856: 95 ea ldi r25, 0xA5 ; 165 32858: 0e 94 82 79 call 0xf304 ; 0xf304 SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 3285c: 85 eb ldi r24, 0xB5 ; 181 3285e: 95 ea ldi r25, 0xA5 ; 165 32860: 0e 94 57 77 call 0xeeae ; 0xeeae else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 32864: 60 91 c7 13 lds r22, 0x13C7 ; 0x8013c7 32868: 70 91 c8 13 lds r23, 0x13C8 ; 0x8013c8 3286c: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 32870: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 32874: 42 e0 ldi r20, 0x02 ; 2 32876: 0f 94 8e d5 call 0x3ab1c ; 0x3ab1c MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 3287a: 81 eb ldi r24, 0xB1 ; 177 3287c: 95 ea ldi r25, 0xA5 ; 165 3287e: 0e 94 57 77 call 0xeeae ; 0xeeae MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 32882: 60 e0 ldi r22, 0x00 ; 0 32884: 70 e0 ldi r23, 0x00 ; 0 32886: 80 e9 ldi r24, 0x90 ; 144 32888: 90 ec ldi r25, 0xC0 ; 192 3288a: 0f 94 bb 74 call 0x2e976 ; 0x2e976 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 3288e: 92 e0 ldi r25, 0x02 ; 2 32890: af 96 adiw r28, 0x2f ; 47 32892: 9f af std Y+63, r25 ; 0x3f 32894: 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; 32896: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 3289a: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 3289e: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 328a2: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 cntr[1] = 0.f; 328a6: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 328aa: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 328ae: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 328b2: 10 92 fa 13 sts 0x13FA, r1 ; 0x8013fa 328b6: a4 e6 ldi r26, 0x64 ; 100 328b8: e6 96 adiw r28, 0x36 ; 54 328ba: af af std Y+63, r26 ; 0x3f 328bc: 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; 328be: a2 96 adiw r28, 0x22 ; 34 328c0: 1c ae std Y+60, r1 ; 0x3c 328c2: 1d ae std Y+61, r1 ; 0x3d 328c4: 1e ae std Y+62, r1 ; 0x3e 328c6: 1f ae std Y+63, r1 ; 0x3f 328c8: 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; 328ca: a6 96 adiw r28, 0x26 ; 38 328cc: 1c ae std Y+60, r1 ; 0x3c 328ce: 1d ae std Y+61, r1 ; 0x3d 328d0: 1e ae std Y+62, r1 ; 0x3e 328d2: 1f ae std Y+63, r1 ; 0x3f 328d4: 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 }; 328d6: fe 01 movw r30, r28 328d8: 31 96 adiw r30, 0x01 ; 1 328da: 68 96 adiw r28, 0x18 ; 24 328dc: ff af std Y+63, r31 ; 0x3f 328de: ee af std Y+62, r30 ; 0x3e 328e0: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 328e2: 9e 01 movw r18, r28 328e4: 2f 5b subi r18, 0xBF ; 191 328e6: 3f 4f sbci r19, 0xFF ; 255 328e8: 6a 96 adiw r28, 0x1a ; 26 328ea: 3f af std Y+63, r19 ; 0x3f 328ec: 2e af std Y+62, r18 ; 0x3e 328ee: 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; 328f0: a6 96 adiw r28, 0x26 ; 38 328f2: 6c ad ldd r22, Y+60 ; 0x3c 328f4: 7d ad ldd r23, Y+61 ; 0x3d 328f6: 8e ad ldd r24, Y+62 ; 0x3e 328f8: 9f ad ldd r25, Y+63 ; 0x3f 328fa: a6 97 sbiw r28, 0x26 ; 38 328fc: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 32900: 6e 96 adiw r28, 0x1e ; 30 32902: 6c af std Y+60, r22 ; 0x3c 32904: 7d af std Y+61, r23 ; 0x3d 32906: 8e af std Y+62, r24 ; 0x3e 32908: 9f af std Y+63, r25 ; 0x3f 3290a: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 3290c: a6 96 adiw r28, 0x26 ; 38 3290e: 6c ad ldd r22, Y+60 ; 0x3c 32910: 7d ad ldd r23, Y+61 ; 0x3d 32912: 8e ad ldd r24, Y+62 ; 0x3e 32914: 9f ad ldd r25, Y+63 ; 0x3f 32916: a6 97 sbiw r28, 0x26 ; 38 32918: 0f 94 0b e1 call 0x3c216 ; 0x3c216 3291c: cb 57 subi r28, 0x7B ; 123 3291e: df 4f sbci r29, 0xFF ; 255 32920: 68 83 st Y, r22 32922: 79 83 std Y+1, r23 ; 0x01 32924: 8a 83 std Y+2, r24 ; 0x02 32926: 9b 83 std Y+3, r25 ; 0x03 32928: c5 58 subi r28, 0x85 ; 133 3292a: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 3292c: a2 96 adiw r28, 0x22 ; 34 3292e: 6c ad ldd r22, Y+60 ; 0x3c 32930: 7d ad ldd r23, Y+61 ; 0x3d 32932: 8e ad ldd r24, Y+62 ; 0x3e 32934: 9f ad ldd r25, Y+63 ; 0x3f 32936: a2 97 sbiw r28, 0x22 ; 34 32938: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 3293c: c7 57 subi r28, 0x77 ; 119 3293e: df 4f sbci r29, 0xFF ; 255 32940: 68 83 st Y, r22 32942: 79 83 std Y+1, r23 ; 0x01 32944: 8a 83 std Y+2, r24 ; 0x02 32946: 9b 83 std Y+3, r25 ; 0x03 32948: c9 58 subi r28, 0x89 ; 137 3294a: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 3294c: a2 96 adiw r28, 0x22 ; 34 3294e: 6c ad ldd r22, Y+60 ; 0x3c 32950: 7d ad ldd r23, Y+61 ; 0x3d 32952: 8e ad ldd r24, Y+62 ; 0x3e 32954: 9f ad ldd r25, Y+63 ; 0x3f 32956: a2 97 sbiw r28, 0x22 ; 34 32958: 0f 94 0b e1 call 0x3c216 ; 0x3c216 3295c: cb 56 subi r28, 0x6B ; 107 3295e: df 4f sbci r29, 0xFF ; 255 32960: 68 83 st Y, r22 32962: 79 83 std Y+1, r23 ; 0x01 32964: 8a 83 std Y+2, r24 ; 0x02 32966: 9b 83 std Y+3, r25 ; 0x03 32968: c5 59 subi r28, 0x95 ; 149 3296a: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 3296c: 68 96 adiw r28, 0x18 ; 24 3296e: ae ad ldd r26, Y+62 ; 0x3e 32970: bf ad ldd r27, Y+63 ; 0x3f 32972: 68 97 sbiw r28, 0x18 ; 24 32974: e0 e4 ldi r30, 0x40 ; 64 32976: 1d 92 st X+, r1 32978: ea 95 dec r30 3297a: e9 f7 brne .-6 ; 0x32976 float b[4] = { 0.f }; 3297c: 80 e1 ldi r24, 0x10 ; 16 3297e: 6a 96 adiw r28, 0x1a ; 26 32980: ae ad ldd r26, Y+62 ; 0x3e 32982: bf ad ldd r27, Y+63 ; 0x3f 32984: 6a 97 sbiw r28, 0x1a ; 26 32986: 1d 92 st X+, r1 32988: 8a 95 dec r24 3298a: e9 f7 brne .-6 ; 0x32986 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 3298c: 90 e0 ldi r25, 0x00 ; 0 3298e: 80 e0 ldi r24, 0x00 ; 0 32990: 0e 94 eb 8c call 0x119d6 ; 0x119d6 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); 32994: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 32998: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 3299c: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 329a0: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 329a4: c5 55 subi r28, 0x55 ; 85 329a6: df 4f sbci r29, 0xFF ; 255 329a8: 28 83 st Y, r18 329aa: 39 83 std Y+1, r19 ; 0x01 329ac: 4a 83 std Y+2, r20 ; 0x02 329ae: 5b 83 std Y+3, r21 ; 0x03 329b0: cb 5a subi r28, 0xAB ; 171 329b2: 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); 329b4: 80 91 f7 13 lds r24, 0x13F7 ; 0x8013f7 329b8: 90 91 f8 13 lds r25, 0x13F8 ; 0x8013f8 329bc: a0 91 f9 13 lds r26, 0x13F9 ; 0x8013f9 329c0: b0 91 fa 13 lds r27, 0x13FA ; 0x8013fa 329c4: c1 55 subi r28, 0x51 ; 81 329c6: df 4f sbci r29, 0xFF ; 255 329c8: 88 83 st Y, r24 329ca: 99 83 std Y+1, r25 ; 0x01 329cc: aa 83 std Y+2, r26 ; 0x02 329ce: bb 83 std Y+3, r27 ; 0x03 329d0: cf 5a subi r28, 0xAF ; 175 329d2: d0 40 sbci r29, 0x00 ; 0 329d4: de 01 movw r26, r28 329d6: af 5b subi r26, 0xBF ; 191 329d8: bf 4f sbci r27, 0xFF ; 255 329da: c7 56 subi r28, 0x67 ; 103 329dc: df 4f sbci r29, 0xFF ; 255 329de: b9 83 std Y+1, r27 ; 0x01 329e0: a8 83 st Y, r26 329e2: c9 59 subi r28, 0x99 ; 153 329e4: d0 40 sbci r29, 0x00 ; 0 329e6: fe 01 movw r30, r28 329e8: 31 96 adiw r30, 0x01 ; 1 329ea: ac 96 adiw r28, 0x2c ; 44 329ec: ff af std Y+63, r31 ; 0x3f 329ee: ee af std Y+62, r30 ; 0x3e 329f0: 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) { 329f2: 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])); 329f4: cb 56 subi r28, 0x6B ; 107 329f6: df 4f sbci r29, 0xFF ; 255 329f8: 28 81 ld r18, Y 329fa: 39 81 ldd r19, Y+1 ; 0x01 329fc: 4a 81 ldd r20, Y+2 ; 0x02 329fe: 5b 81 ldd r21, Y+3 ; 0x03 32a00: c5 59 subi r28, 0x95 ; 149 32a02: d0 40 sbci r29, 0x00 ; 0 32a04: 50 58 subi r21, 0x80 ; 128 32a06: ed 96 adiw r28, 0x3d ; 61 32a08: 2c af std Y+60, r18 ; 0x3c 32a0a: 3d af std Y+61, r19 ; 0x3d 32a0c: 4e af std Y+62, r20 ; 0x3e 32a0e: 5f af std Y+63, r21 ; 0x3f 32a10: 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])); 32a12: c7 57 subi r28, 0x77 ; 119 32a14: df 4f sbci r29, 0xFF ; 255 32a16: 88 81 ld r24, Y 32a18: 99 81 ldd r25, Y+1 ; 0x01 32a1a: aa 81 ldd r26, Y+2 ; 0x02 32a1c: bb 81 ldd r27, Y+3 ; 0x03 32a1e: c9 58 subi r28, 0x89 ; 137 32a20: d0 40 sbci r29, 0x00 ; 0 32a22: b0 58 subi r27, 0x80 ; 128 32a24: c3 58 subi r28, 0x83 ; 131 32a26: df 4f sbci r29, 0xFF ; 255 32a28: 88 83 st Y, r24 32a2a: 99 83 std Y+1, r25 ; 0x01 32a2c: aa 83 std Y+2, r26 ; 0x02 32a2e: bb 83 std Y+3, r27 ; 0x03 32a30: cd 57 subi r28, 0x7D ; 125 32a32: 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]) : 32a34: cb 57 subi r28, 0x7B ; 123 32a36: df 4f sbci r29, 0xFF ; 255 32a38: 28 81 ld r18, Y 32a3a: 39 81 ldd r19, Y+1 ; 0x01 32a3c: 4a 81 ldd r20, Y+2 ; 0x02 32a3e: 5b 81 ldd r21, Y+3 ; 0x03 32a40: c5 58 subi r28, 0x85 ; 133 32a42: d0 40 sbci r29, 0x00 ; 0 32a44: 50 58 subi r21, 0x80 ; 128 32a46: cf 57 subi r28, 0x7F ; 127 32a48: df 4f sbci r29, 0xFF ; 255 32a4a: 28 83 st Y, r18 32a4c: 39 83 std Y+1, r19 ; 0x01 32a4e: 4a 83 std Y+2, r20 ; 0x02 32a50: 5b 83 std Y+3, r21 ; 0x03 32a52: c1 58 subi r28, 0x81 ; 129 32a54: 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) { 32a56: ac 96 adiw r28, 0x2c ; 44 32a58: 2e ac ldd r2, Y+62 ; 0x3e 32a5a: 3f ac ldd r3, Y+63 ; 0x3f 32a5c: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 32a5e: 10 e0 ldi r17, 0x00 ; 0 32a60: 62 ec ldi r22, 0xC2 ; 194 32a62: 46 2e mov r4, r22 32a64: 63 e1 ldi r22, 0x13 ; 19 32a66: 56 2e mov r5, r22 32a68: 74 e0 ldi r23, 0x04 ; 4 32a6a: 77 2e mov r7, r23 acc = 0; 32a6c: c1 2c mov r12, r1 32a6e: d1 2c mov r13, r1 32a70: 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) { 32a72: 01 30 cpi r16, 0x01 ; 1 32a74: 11 f4 brne .+4 ; 0x32a7a 32a76: 0d 94 67 9f jmp 0x33ece ; 0x33ece 32a7a: 11 30 cpi r17, 0x01 ; 1 32a7c: 11 f4 brne .+4 ; 0x32a82 32a7e: 0d 94 19 9f jmp 0x33e32 ; 0x33e32 float a = (r == 0) ? 1.f : 32a82: 00 23 and r16, r16 32a84: 11 f4 brne .+4 ; 0x32a8a 32a86: 0d 94 59 9f jmp 0x33eb2 ; 0x33eb2 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32a8a: 02 30 cpi r16, 0x02 ; 2 32a8c: 61 f5 brne .+88 ; 0x32ae6 32a8e: d2 01 movw r26, r4 32a90: 11 96 adiw r26, 0x01 ; 1 32a92: 2d 91 ld r18, X+ 32a94: 3d 91 ld r19, X+ 32a96: 4d 91 ld r20, X+ 32a98: 5c 91 ld r21, X 32a9a: 14 97 sbiw r26, 0x04 ; 4 32a9c: cf 57 subi r28, 0x7F ; 127 32a9e: df 4f sbci r29, 0xFF ; 255 32aa0: 68 81 ld r22, Y 32aa2: 79 81 ldd r23, Y+1 ; 0x01 32aa4: 8a 81 ldd r24, Y+2 ; 0x02 32aa6: 9b 81 ldd r25, Y+3 ; 0x03 32aa8: c1 58 subi r28, 0x81 ; 129 32aaa: d0 40 sbci r29, 0x00 ; 0 32aac: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32ab0: 4b 01 movw r8, r22 32ab2: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 32ab4: 11 11 cpse r17, r1 32ab6: 25 c0 rjmp .+74 ; 0x32b02 32ab8: 60 e0 ldi r22, 0x00 ; 0 32aba: 70 e0 ldi r23, 0x00 ; 0 32abc: 80 e8 ldi r24, 0x80 ; 128 32abe: 9f e3 ldi r25, 0x3F ; 63 32ac0: 35 c0 rjmp .+106 ; 0x32b2c int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 32ac2: 2f 3f cpi r18, 0xFF ; 255 32ac4: 09 f0 breq .+2 ; 0x32ac8 32ac6: 92 cb rjmp .-2268 ; 0x321ec ++maxs; 32ac8: 01 96 adiw r24, 0x01 ; 1 32aca: 90 cb rjmp .-2272 ; 0x321ec /// 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; 32acc: 1f ef ldi r17, 0xFF ; 255 32ace: 26 cd rjmp .-1460 ; 0x3251c 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; 32ad0: e5 96 adiw r28, 0x35 ; 53 32ad2: bf ad ldd r27, Y+63 ; 0x3f 32ad4: e5 97 sbiw r28, 0x35 ; 53 32ad6: a7 96 adiw r28, 0x27 ; 39 32ad8: bf af std Y+63, r27 ; 0x3f 32ada: a7 97 sbiw r28, 0x27 ; 39 32adc: 0f ce rjmp .-994 ; 0x326fc // 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; 32ade: af 96 adiw r28, 0x2f ; 47 32ae0: 1f ae std Y+63, r1 ; 0x3f 32ae2: af 97 sbiw r28, 0x2f ; 47 32ae4: d8 ce rjmp .-592 ; 0x32896 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]) : 32ae6: f2 01 movw r30, r4 32ae8: 25 81 ldd r18, Z+5 ; 0x05 32aea: 36 81 ldd r19, Z+6 ; 0x06 32aec: 47 81 ldd r20, Z+7 ; 0x07 32aee: 50 85 ldd r21, Z+8 ; 0x08 32af0: c3 58 subi r28, 0x83 ; 131 32af2: df 4f sbci r29, 0xFF ; 255 32af4: 68 81 ld r22, Y 32af6: 79 81 ldd r23, Y+1 ; 0x01 32af8: 8a 81 ldd r24, Y+2 ; 0x02 32afa: 9b 81 ldd r25, Y+3 ; 0x03 32afc: cd 57 subi r28, 0x7D ; 125 32afe: d0 40 sbci r29, 0x00 ; 0 32b00: d5 cf rjmp .-86 ; 0x32aac (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 32b02: 12 30 cpi r17, 0x02 ; 2 32b04: 11 f0 breq .+4 ; 0x32b0a 32b06: 0d 94 5a 9e jmp 0x33cb4 ; 0x33cb4 32b0a: d2 01 movw r26, r4 32b0c: 11 96 adiw r26, 0x01 ; 1 32b0e: 2d 91 ld r18, X+ 32b10: 3d 91 ld r19, X+ 32b12: 4d 91 ld r20, X+ 32b14: 5c 91 ld r21, X 32b16: 14 97 sbiw r26, 0x04 ; 4 32b18: cf 57 subi r28, 0x7F ; 127 32b1a: df 4f sbci r29, 0xFF ; 255 32b1c: 68 81 ld r22, Y 32b1e: 79 81 ldd r23, Y+1 ; 0x01 32b20: 8a 81 ldd r24, Y+2 ; 0x02 32b22: 9b 81 ldd r25, Y+3 ; 0x03 32b24: c1 58 subi r28, 0x81 ; 129 32b26: d0 40 sbci r29, 0x00 ; 0 32b28: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 32b2c: 9b 01 movw r18, r22 32b2e: ac 01 movw r20, r24 32b30: c5 01 movw r24, r10 32b32: b4 01 movw r22, r8 32b34: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32b38: 9b 01 movw r18, r22 32b3a: ac 01 movw r20, r24 32b3c: c7 01 movw r24, r14 32b3e: b6 01 movw r22, r12 32b40: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32b44: 6b 01 movw r12, r22 32b46: 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) { 32b48: 01 11 cpse r16, r1 32b4a: 0d 94 71 9f jmp 0x33ee2 ; 0x33ee2 32b4e: 7a 94 dec r7 32b50: f8 e0 ldi r31, 0x08 ; 8 32b52: 4f 0e add r4, r31 32b54: 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) { 32b56: 71 10 cpse r7, r1 32b58: 8c cf rjmp .-232 ; 0x32a72 (-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; 32b5a: d1 01 movw r26, r2 32b5c: cd 92 st X+, r12 32b5e: dd 92 st X+, r13 32b60: ed 92 st X+, r14 32b62: fd 92 st X+, r15 32b64: 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) { 32b66: 1f 5f subi r17, 0xFF ; 255 32b68: 14 30 cpi r17, 0x04 ; 4 32b6a: 09 f0 breq .+2 ; 0x32b6e 32b6c: 79 cf rjmp .-270 ; 0x32a60 32b6e: 38 ee ldi r19, 0xE8 ; 232 32b70: 23 2e mov r2, r19 32b72: 35 ea ldi r19, 0xA5 ; 165 32b74: 33 2e mov r3, r19 32b76: e2 ec ldi r30, 0xC2 ; 194 32b78: f3 e1 ldi r31, 0x13 ; 19 32b7a: a8 96 adiw r28, 0x28 ; 40 32b7c: ff af std Y+63, r31 ; 0x3f 32b7e: ee af std Y+62, r30 ; 0x3e 32b80: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 32b82: c3 57 subi r28, 0x73 ; 115 32b84: df 4f sbci r29, 0xFF ; 255 32b86: 18 82 st Y, r1 32b88: cd 58 subi r28, 0x8D ; 141 32b8a: d0 40 sbci r29, 0x00 ; 0 32b8c: c3 56 subi r28, 0x63 ; 99 32b8e: df 4f sbci r29, 0xFF ; 255 32b90: 18 82 st Y, r1 32b92: cd 59 subi r28, 0x9D ; 157 32b94: d0 40 sbci r29, 0x00 ; 0 32b96: cf 55 subi r28, 0x5F ; 95 32b98: df 4f sbci r29, 0xFF ; 255 32b9a: 18 82 st Y, r1 32b9c: c1 5a subi r28, 0xA1 ; 161 32b9e: d0 40 sbci r29, 0x00 ; 0 32ba0: 10 e0 ldi r17, 0x00 ; 0 32ba2: a8 96 adiw r28, 0x28 ; 40 32ba4: ae ad ldd r26, Y+62 ; 0x3e 32ba6: bf ad ldd r27, Y+63 ; 0x3f 32ba8: a8 97 sbiw r28, 0x28 ; 40 32baa: 11 96 adiw r26, 0x01 ; 1 32bac: 2d 91 ld r18, X+ 32bae: 3d 91 ld r19, X+ 32bb0: 4d 91 ld r20, X+ 32bb2: 5c 91 ld r21, X 32bb4: 14 97 sbiw r26, 0x04 ; 4 32bb6: e4 96 adiw r28, 0x34 ; 52 32bb8: 2c af std Y+60, r18 ; 0x3c 32bba: 3d af std Y+61, r19 ; 0x3d 32bbc: 4e af std Y+62, r20 ; 0x3e 32bbe: 5f af std Y+63, r21 ; 0x3f 32bc0: e4 97 sbiw r28, 0x34 ; 52 32bc2: 15 96 adiw r26, 0x05 ; 5 32bc4: 4d 90 ld r4, X+ 32bc6: 5d 90 ld r5, X+ 32bc8: 6d 90 ld r6, X+ 32bca: 7c 90 ld r7, X 32bcc: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 32bce: 00 23 and r16, r16 32bd0: 11 f4 brne .+4 ; 0x32bd6 32bd2: 0d 94 8d 9e jmp 0x33d1a ; 0x33d1a ((r == 1) ? 0.f : 32bd6: 81 2c mov r8, r1 32bd8: 91 2c mov r9, r1 32bda: 54 01 movw r10, r8 32bdc: 01 30 cpi r16, 0x01 ; 1 32bde: 81 f0 breq .+32 ; 0x32c00 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 32be0: 02 30 cpi r16, 0x02 ; 2 32be2: 11 f0 breq .+4 ; 0x32be8 32be4: 0d 94 81 9e jmp 0x33d02 ; 0x33d02 32be8: cf 57 subi r28, 0x7F ; 127 32bea: df 4f sbci r29, 0xFF ; 255 32bec: 68 81 ld r22, Y 32bee: 79 81 ldd r23, Y+1 ; 0x01 32bf0: 8a 81 ldd r24, Y+2 ; 0x02 32bf2: 9b 81 ldd r25, Y+3 ; 0x03 32bf4: c1 58 subi r28, 0x81 ; 129 32bf6: d0 40 sbci r29, 0x00 ; 0 32bf8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32bfc: 4b 01 movw r8, r22 32bfe: 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); 32c00: e4 96 adiw r28, 0x34 ; 52 32c02: 2c ad ldd r18, Y+60 ; 0x3c 32c04: 3d ad ldd r19, Y+61 ; 0x3d 32c06: 4e ad ldd r20, Y+62 ; 0x3e 32c08: 5f ad ldd r21, Y+63 ; 0x3f 32c0a: e4 97 sbiw r28, 0x34 ; 52 32c0c: 6e 96 adiw r28, 0x1e ; 30 32c0e: 6c ad ldd r22, Y+60 ; 0x3c 32c10: 7d ad ldd r23, Y+61 ; 0x3d 32c12: 8e ad ldd r24, Y+62 ; 0x3e 32c14: 9f ad ldd r25, Y+63 ; 0x3f 32c16: 6e 97 sbiw r28, 0x1e ; 30 32c18: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32c1c: 6b 01 movw r12, r22 32c1e: 7c 01 movw r14, r24 32c20: f1 01 movw r30, r2 32c22: 25 91 lpm r18, Z+ 32c24: 35 91 lpm r19, Z+ 32c26: 45 91 lpm r20, Z+ 32c28: 54 91 lpm r21, Z 32c2a: cb 55 subi r28, 0x5B ; 91 32c2c: df 4f sbci r29, 0xFF ; 255 32c2e: 28 83 st Y, r18 32c30: 39 83 std Y+1, r19 ; 0x01 32c32: 4a 83 std Y+2, r20 ; 0x02 32c34: 5b 83 std Y+3, r21 ; 0x03 32c36: c5 5a subi r28, 0xA5 ; 165 32c38: d0 40 sbci r29, 0x00 ; 0 32c3a: a3 01 movw r20, r6 32c3c: 92 01 movw r18, r4 32c3e: cb 56 subi r28, 0x6B ; 107 32c40: df 4f sbci r29, 0xFF ; 255 32c42: 68 81 ld r22, Y 32c44: 79 81 ldd r23, Y+1 ; 0x01 32c46: 8a 81 ldd r24, Y+2 ; 0x02 32c48: 9b 81 ldd r25, Y+3 ; 0x03 32c4a: c5 59 subi r28, 0x95 ; 149 32c4c: d0 40 sbci r29, 0x00 ; 0 32c4e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32c52: 9b 01 movw r18, r22 32c54: ac 01 movw r20, r24 32c56: c7 01 movw r24, r14 32c58: b6 01 movw r22, r12 32c5a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 32c5e: c5 55 subi r28, 0x55 ; 85 32c60: df 4f sbci r29, 0xFF ; 255 32c62: 28 81 ld r18, Y 32c64: 39 81 ldd r19, Y+1 ; 0x01 32c66: 4a 81 ldd r20, Y+2 ; 0x02 32c68: 5b 81 ldd r21, Y+3 ; 0x03 32c6a: cb 5a subi r28, 0xAB ; 171 32c6c: d0 40 sbci r29, 0x00 ; 0 32c6e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32c72: cb 55 subi r28, 0x5B ; 91 32c74: df 4f sbci r29, 0xFF ; 255 32c76: 28 81 ld r18, Y 32c78: 39 81 ldd r19, Y+1 ; 0x01 32c7a: 4a 81 ldd r20, Y+2 ; 0x02 32c7c: 5b 81 ldd r21, Y+3 ; 0x03 32c7e: c5 5a subi r28, 0xA5 ; 165 32c80: d0 40 sbci r29, 0x00 ; 0 32c82: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 32c86: a5 01 movw r20, r10 32c88: 94 01 movw r18, r8 32c8a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32c8e: c3 57 subi r28, 0x73 ; 115 32c90: df 4f sbci r29, 0xFF ; 255 32c92: 28 81 ld r18, Y 32c94: cd 58 subi r28, 0x8D ; 141 32c96: d0 40 sbci r29, 0x00 ; 0 32c98: c3 56 subi r28, 0x63 ; 99 32c9a: df 4f sbci r29, 0xFF ; 255 32c9c: 38 81 ld r19, Y 32c9e: cd 59 subi r28, 0x9D ; 157 32ca0: d0 40 sbci r29, 0x00 ; 0 32ca2: cf 55 subi r28, 0x5F ; 95 32ca4: df 4f sbci r29, 0xFF ; 255 32ca6: 48 81 ld r20, Y 32ca8: c1 5a subi r28, 0xA1 ; 161 32caa: d0 40 sbci r29, 0x00 ; 0 32cac: 51 2f mov r21, r17 32cae: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32cb2: c3 57 subi r28, 0x73 ; 115 32cb4: df 4f sbci r29, 0xFF ; 255 32cb6: 68 83 st Y, r22 32cb8: 79 83 std Y+1, r23 ; 0x01 32cba: 8a 83 std Y+2, r24 ; 0x02 32cbc: 9b 83 std Y+3, r25 ; 0x03 32cbe: cd 58 subi r28, 0x8D ; 141 32cc0: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 32cc2: 00 23 and r16, r16 32cc4: 11 f4 brne .+4 ; 0x32cca 32cc6: 0d 94 95 9e jmp 0x33d2a ; 0x33d2a ((r == 1) ? 1.f : 32cca: 01 30 cpi r16, 0x01 ; 1 32ccc: 11 f4 brne .+4 ; 0x32cd2 32cce: 0d 94 9a 9e jmp 0x33d34 ; 0x33d34 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 32cd2: 02 30 cpi r16, 0x02 ; 2 32cd4: 61 f0 breq .+24 ; 0x32cee 32cd6: a3 01 movw r20, r6 32cd8: 92 01 movw r18, r4 32cda: ed 96 adiw r28, 0x3d ; 61 32cdc: 6c ad ldd r22, Y+60 ; 0x3c 32cde: 7d ad ldd r23, Y+61 ; 0x3d 32ce0: 8e ad ldd r24, Y+62 ; 0x3e 32ce2: 9f ad ldd r25, Y+63 ; 0x3f 32ce4: ed 97 sbiw r28, 0x3d ; 61 32ce6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32cea: 6b 01 movw r12, r22 32cec: 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); 32cee: f1 01 movw r30, r2 32cf0: 34 96 adiw r30, 0x04 ; 4 32cf2: 85 90 lpm r8, Z+ 32cf4: 95 90 lpm r9, Z+ 32cf6: a5 90 lpm r10, Z+ 32cf8: b4 90 lpm r11, Z 32cfa: e4 96 adiw r28, 0x34 ; 52 32cfc: 2c ad ldd r18, Y+60 ; 0x3c 32cfe: 3d ad ldd r19, Y+61 ; 0x3d 32d00: 4e ad ldd r20, Y+62 ; 0x3e 32d02: 5f ad ldd r21, Y+63 ; 0x3f 32d04: e4 97 sbiw r28, 0x34 ; 52 32d06: cb 57 subi r28, 0x7B ; 123 32d08: df 4f sbci r29, 0xFF ; 255 32d0a: 68 81 ld r22, Y 32d0c: 79 81 ldd r23, Y+1 ; 0x01 32d0e: 8a 81 ldd r24, Y+2 ; 0x02 32d10: 9b 81 ldd r25, Y+3 ; 0x03 32d12: c5 58 subi r28, 0x85 ; 133 32d14: d0 40 sbci r29, 0x00 ; 0 32d16: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32d1a: e4 96 adiw r28, 0x34 ; 52 32d1c: 6c af std Y+60, r22 ; 0x3c 32d1e: 7d af std Y+61, r23 ; 0x3d 32d20: 8e af std Y+62, r24 ; 0x3e 32d22: 9f af std Y+63, r25 ; 0x3f 32d24: e4 97 sbiw r28, 0x34 ; 52 32d26: a3 01 movw r20, r6 32d28: 92 01 movw r18, r4 32d2a: c7 57 subi r28, 0x77 ; 119 32d2c: df 4f sbci r29, 0xFF ; 255 32d2e: 68 81 ld r22, Y 32d30: 79 81 ldd r23, Y+1 ; 0x01 32d32: 8a 81 ldd r24, Y+2 ; 0x02 32d34: 9b 81 ldd r25, Y+3 ; 0x03 32d36: c9 58 subi r28, 0x89 ; 137 32d38: d0 40 sbci r29, 0x00 ; 0 32d3a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32d3e: 9b 01 movw r18, r22 32d40: ac 01 movw r20, r24 32d42: e4 96 adiw r28, 0x34 ; 52 32d44: 6c ad ldd r22, Y+60 ; 0x3c 32d46: 7d ad ldd r23, Y+61 ; 0x3d 32d48: 8e ad ldd r24, Y+62 ; 0x3e 32d4a: 9f ad ldd r25, Y+63 ; 0x3f 32d4c: e4 97 sbiw r28, 0x34 ; 52 32d4e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32d52: c1 55 subi r28, 0x51 ; 81 32d54: df 4f sbci r29, 0xFF ; 255 32d56: 28 81 ld r18, Y 32d58: 39 81 ldd r19, Y+1 ; 0x01 32d5a: 4a 81 ldd r20, Y+2 ; 0x02 32d5c: 5b 81 ldd r21, Y+3 ; 0x03 32d5e: cf 5a subi r28, 0xAF ; 175 32d60: d0 40 sbci r29, 0x00 ; 0 32d62: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32d66: a5 01 movw r20, r10 32d68: 94 01 movw r18, r8 32d6a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 32d6e: a7 01 movw r20, r14 32d70: 96 01 movw r18, r12 32d72: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 32d76: c3 57 subi r28, 0x73 ; 115 32d78: df 4f sbci r29, 0xFF ; 255 32d7a: 28 81 ld r18, Y 32d7c: 39 81 ldd r19, Y+1 ; 0x01 32d7e: 4a 81 ldd r20, Y+2 ; 0x02 32d80: 5b 81 ldd r21, Y+3 ; 0x03 32d82: cd 58 subi r28, 0x8D ; 141 32d84: d0 40 sbci r29, 0x00 ; 0 32d86: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 32d8a: c3 57 subi r28, 0x73 ; 115 32d8c: df 4f sbci r29, 0xFF ; 255 32d8e: 68 83 st Y, r22 32d90: cd 58 subi r28, 0x8D ; 141 32d92: d0 40 sbci r29, 0x00 ; 0 32d94: c3 56 subi r28, 0x63 ; 99 32d96: df 4f sbci r29, 0xFF ; 255 32d98: 78 83 st Y, r23 32d9a: cd 59 subi r28, 0x9D ; 157 32d9c: d0 40 sbci r29, 0x00 ; 0 32d9e: cf 55 subi r28, 0x5F ; 95 32da0: df 4f sbci r29, 0xFF ; 255 32da2: 88 83 st Y, r24 32da4: c1 5a subi r28, 0xA1 ; 161 32da6: d0 40 sbci r29, 0x00 ; 0 32da8: 19 2f mov r17, r25 32daa: a8 96 adiw r28, 0x28 ; 40 32dac: 4e ad ldd r20, Y+62 ; 0x3e 32dae: 5f ad ldd r21, Y+63 ; 0x3f 32db0: a8 97 sbiw r28, 0x28 ; 40 32db2: 48 5f subi r20, 0xF8 ; 248 32db4: 5f 4f sbci r21, 0xFF ; 255 32db6: a8 96 adiw r28, 0x28 ; 40 32db8: 5f af std Y+63, r21 ; 0x3f 32dba: 4e af std Y+62, r20 ; 0x3e 32dbc: a8 97 sbiw r28, 0x28 ; 40 32dbe: 58 e0 ldi r21, 0x08 ; 8 32dc0: 25 0e add r2, r21 32dc2: 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) { 32dc4: a2 ee ldi r26, 0xE2 ; 226 32dc6: b3 e1 ldi r27, 0x13 ; 19 32dc8: a8 96 adiw r28, 0x28 ; 40 32dca: ee ad ldd r30, Y+62 ; 0x3e 32dcc: ff ad ldd r31, Y+63 ; 0x3f 32dce: a8 97 sbiw r28, 0x28 ; 40 32dd0: ae 17 cp r26, r30 32dd2: bf 07 cpc r27, r31 32dd4: 09 f0 breq .+2 ; 0x32dd8 32dd6: e5 ce rjmp .-566 ; 0x32ba2 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; 32dd8: 90 58 subi r25, 0x80 ; 128 32dda: c7 56 subi r28, 0x67 ; 103 32ddc: df 4f sbci r29, 0xFF ; 255 32dde: a8 81 ld r26, Y 32de0: b9 81 ldd r27, Y+1 ; 0x01 32de2: c9 59 subi r28, 0x99 ; 153 32de4: d0 40 sbci r29, 0x00 ; 0 32de6: 6d 93 st X+, r22 32de8: 7d 93 st X+, r23 32dea: 8d 93 st X+, r24 32dec: 9d 93 st X+, r25 32dee: c7 56 subi r28, 0x67 ; 103 32df0: df 4f sbci r29, 0xFF ; 255 32df2: b9 83 std Y+1, r27 ; 0x01 32df4: a8 83 st Y, r26 32df6: c9 59 subi r28, 0x99 ; 153 32df8: 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) { 32dfa: 0f 5f subi r16, 0xFF ; 255 32dfc: ac 96 adiw r28, 0x2c ; 44 32dfe: ee ad ldd r30, Y+62 ; 0x3e 32e00: ff ad ldd r31, Y+63 ; 0x3f 32e02: ac 97 sbiw r28, 0x2c ; 44 32e04: 70 96 adiw r30, 0x10 ; 16 32e06: ac 96 adiw r28, 0x2c ; 44 32e08: ff af std Y+63, r31 ; 0x3f 32e0a: ee af std Y+62, r30 ; 0x3e 32e0c: ac 97 sbiw r28, 0x2c ; 44 32e0e: 04 30 cpi r16, 0x04 ; 4 32e10: 09 f0 breq .+2 ; 0x32e14 32e12: 21 ce rjmp .-958 ; 0x32a56 } // 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]; 32e14: 25 96 adiw r28, 0x05 ; 5 32e16: 2c ad ldd r18, Y+60 ; 0x3c 32e18: 3d ad ldd r19, Y+61 ; 0x3d 32e1a: 4e ad ldd r20, Y+62 ; 0x3e 32e1c: 5f ad ldd r21, Y+63 ; 0x3f 32e1e: 25 97 sbiw r28, 0x05 ; 5 32e20: ae 96 adiw r28, 0x2e ; 46 32e22: 2c af std Y+60, r18 ; 0x3c 32e24: 3d af std Y+61, r19 ; 0x3d 32e26: 4e af std Y+62, r20 ; 0x3e 32e28: 5f af std Y+63, r21 ; 0x3f 32e2a: ae 97 sbiw r28, 0x2e ; 46 32e2c: 8d 81 ldd r24, Y+5 ; 0x05 32e2e: 9e 81 ldd r25, Y+6 ; 0x06 32e30: af 81 ldd r26, Y+7 ; 0x07 32e32: b8 85 ldd r27, Y+8 ; 0x08 32e34: e4 96 adiw r28, 0x34 ; 52 32e36: 8c af std Y+60, r24 ; 0x3c 32e38: 9d af std Y+61, r25 ; 0x3d 32e3a: ae af std Y+62, r26 ; 0x3e 32e3c: bf af std Y+63, r27 ; 0x3f 32e3e: e4 97 sbiw r28, 0x34 ; 52 32e40: 29 85 ldd r18, Y+9 ; 0x09 32e42: 3a 85 ldd r19, Y+10 ; 0x0a 32e44: 4b 85 ldd r20, Y+11 ; 0x0b 32e46: 5c 85 ldd r21, Y+12 ; 0x0c 32e48: ed 96 adiw r28, 0x3d ; 61 32e4a: 2c af std Y+60, r18 ; 0x3c 32e4c: 3d af std Y+61, r19 ; 0x3d 32e4e: 4e af std Y+62, r20 ; 0x3e 32e50: 5f af std Y+63, r21 ; 0x3f 32e52: ed 97 sbiw r28, 0x3d ; 61 32e54: 8d 85 ldd r24, Y+13 ; 0x0d 32e56: 9e 85 ldd r25, Y+14 ; 0x0e 32e58: af 85 ldd r26, Y+15 ; 0x0f 32e5a: b8 89 ldd r27, Y+16 ; 0x10 32e5c: c3 58 subi r28, 0x83 ; 131 32e5e: df 4f sbci r29, 0xFF ; 255 32e60: 88 83 st Y, r24 32e62: 99 83 std Y+1, r25 ; 0x01 32e64: aa 83 std Y+2, r26 ; 0x02 32e66: bb 83 std Y+3, r27 ; 0x03 32e68: cd 57 subi r28, 0x7D ; 125 32e6a: d0 40 sbci r29, 0x00 ; 0 32e6c: 29 81 ldd r18, Y+1 ; 0x01 32e6e: 3a 81 ldd r19, Y+2 ; 0x02 32e70: 4b 81 ldd r20, Y+3 ; 0x03 32e72: 5c 81 ldd r21, Y+4 ; 0x04 32e74: cf 57 subi r28, 0x7F ; 127 32e76: df 4f sbci r29, 0xFF ; 255 32e78: 28 83 st Y, r18 32e7a: 39 83 std Y+1, r19 ; 0x01 32e7c: 4a 83 std Y+2, r20 ; 0x02 32e7e: 5b 83 std Y+3, r21 ; 0x03 32e80: c1 58 subi r28, 0x81 ; 129 32e82: 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]; 32e84: 29 96 adiw r28, 0x09 ; 9 32e86: 8c ad ldd r24, Y+60 ; 0x3c 32e88: 9d ad ldd r25, Y+61 ; 0x3d 32e8a: ae ad ldd r26, Y+62 ; 0x3e 32e8c: bf ad ldd r27, Y+63 ; 0x3f 32e8e: 29 97 sbiw r28, 0x09 ; 9 32e90: cb 57 subi r28, 0x7B ; 123 32e92: df 4f sbci r29, 0xFF ; 255 32e94: 88 83 st Y, r24 32e96: 99 83 std Y+1, r25 ; 0x01 32e98: aa 83 std Y+2, r26 ; 0x02 32e9a: bb 83 std Y+3, r27 ; 0x03 32e9c: c5 58 subi r28, 0x85 ; 133 32e9e: d0 40 sbci r29, 0x00 ; 0 32ea0: 29 89 ldd r18, Y+17 ; 0x11 32ea2: 3a 89 ldd r19, Y+18 ; 0x12 32ea4: 4b 89 ldd r20, Y+19 ; 0x13 32ea6: 5c 89 ldd r21, Y+20 ; 0x14 32ea8: c7 57 subi r28, 0x77 ; 119 32eaa: df 4f sbci r29, 0xFF ; 255 32eac: 28 83 st Y, r18 32eae: 39 83 std Y+1, r19 ; 0x01 32eb0: 4a 83 std Y+2, r20 ; 0x02 32eb2: 5b 83 std Y+3, r21 ; 0x03 32eb4: c9 58 subi r28, 0x89 ; 137 32eb6: d0 40 sbci r29, 0x00 ; 0 32eb8: 89 8d ldd r24, Y+25 ; 0x19 32eba: 9a 8d ldd r25, Y+26 ; 0x1a 32ebc: ab 8d ldd r26, Y+27 ; 0x1b 32ebe: bc 8d ldd r27, Y+28 ; 0x1c 32ec0: cb 56 subi r28, 0x6B ; 107 32ec2: df 4f sbci r29, 0xFF ; 255 32ec4: 88 83 st Y, r24 32ec6: 99 83 std Y+1, r25 ; 0x01 32ec8: aa 83 std Y+2, r26 ; 0x02 32eca: bb 83 std Y+3, r27 ; 0x03 32ecc: c5 59 subi r28, 0x95 ; 149 32ece: d0 40 sbci r29, 0x00 ; 0 32ed0: 2d 8d ldd r18, Y+29 ; 0x1d 32ed2: 3e 8d ldd r19, Y+30 ; 0x1e 32ed4: 4f 8d ldd r20, Y+31 ; 0x1f 32ed6: 58 a1 ldd r21, Y+32 ; 0x20 32ed8: c7 56 subi r28, 0x67 ; 103 32eda: df 4f sbci r29, 0xFF ; 255 32edc: 28 83 st Y, r18 32ede: 39 83 std Y+1, r19 ; 0x01 32ee0: 4a 83 std Y+2, r20 ; 0x02 32ee2: 5b 83 std Y+3, r21 ; 0x03 32ee4: c9 59 subi r28, 0x99 ; 153 32ee6: d0 40 sbci r29, 0x00 ; 0 32ee8: 8d 89 ldd r24, Y+21 ; 0x15 32eea: 9e 89 ldd r25, Y+22 ; 0x16 32eec: af 89 ldd r26, Y+23 ; 0x17 32eee: b8 8d ldd r27, Y+24 ; 0x18 32ef0: c3 57 subi r28, 0x73 ; 115 32ef2: df 4f sbci r29, 0xFF ; 255 32ef4: 88 83 st Y, r24 32ef6: 99 83 std Y+1, r25 ; 0x01 32ef8: aa 83 std Y+2, r26 ; 0x02 32efa: bb 83 std Y+3, r27 ; 0x03 32efc: cd 58 subi r28, 0x8D ; 141 32efe: 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]; 32f00: 2d 96 adiw r28, 0x0d ; 13 32f02: 2c ad ldd r18, Y+60 ; 0x3c 32f04: 3d ad ldd r19, Y+61 ; 0x3d 32f06: 4e ad ldd r20, Y+62 ; 0x3e 32f08: 5f ad ldd r21, Y+63 ; 0x3f 32f0a: 2d 97 sbiw r28, 0x0d ; 13 32f0c: c3 56 subi r28, 0x63 ; 99 32f0e: df 4f sbci r29, 0xFF ; 255 32f10: 28 83 st Y, r18 32f12: 39 83 std Y+1, r19 ; 0x01 32f14: 4a 83 std Y+2, r20 ; 0x02 32f16: 5b 83 std Y+3, r21 ; 0x03 32f18: cd 59 subi r28, 0x9D ; 157 32f1a: d0 40 sbci r29, 0x00 ; 0 32f1c: 89 a1 ldd r24, Y+33 ; 0x21 32f1e: 9a a1 ldd r25, Y+34 ; 0x22 32f20: ab a1 ldd r26, Y+35 ; 0x23 32f22: bc a1 ldd r27, Y+36 ; 0x24 32f24: cf 55 subi r28, 0x5F ; 95 32f26: df 4f sbci r29, 0xFF ; 255 32f28: 88 83 st Y, r24 32f2a: 99 83 std Y+1, r25 ; 0x01 32f2c: aa 83 std Y+2, r26 ; 0x02 32f2e: bb 83 std Y+3, r27 ; 0x03 32f30: c1 5a subi r28, 0xA1 ; 161 32f32: d0 40 sbci r29, 0x00 ; 0 32f34: 2d a1 ldd r18, Y+37 ; 0x25 32f36: 3e a1 ldd r19, Y+38 ; 0x26 32f38: 4f a1 ldd r20, Y+39 ; 0x27 32f3a: 58 a5 ldd r21, Y+40 ; 0x28 32f3c: cb 55 subi r28, 0x5B ; 91 32f3e: df 4f sbci r29, 0xFF ; 255 32f40: 28 83 st Y, r18 32f42: 39 83 std Y+1, r19 ; 0x01 32f44: 4a 83 std Y+2, r20 ; 0x02 32f46: 5b 83 std Y+3, r21 ; 0x03 32f48: c5 5a subi r28, 0xA5 ; 165 32f4a: d0 40 sbci r29, 0x00 ; 0 32f4c: 8d a5 ldd r24, Y+45 ; 0x2d 32f4e: 9e a5 ldd r25, Y+46 ; 0x2e 32f50: af a5 ldd r26, Y+47 ; 0x2f 32f52: b8 a9 ldd r27, Y+48 ; 0x30 32f54: cd 54 subi r28, 0x4D ; 77 32f56: df 4f sbci r29, 0xFF ; 255 32f58: 88 83 st Y, r24 32f5a: 99 83 std Y+1, r25 ; 0x01 32f5c: aa 83 std Y+2, r26 ; 0x02 32f5e: bb 83 std Y+3, r27 ; 0x03 32f60: c3 5b subi r28, 0xB3 ; 179 32f62: d0 40 sbci r29, 0x00 ; 0 32f64: 29 a5 ldd r18, Y+41 ; 0x29 32f66: 3a a5 ldd r19, Y+42 ; 0x2a 32f68: 4b a5 ldd r20, Y+43 ; 0x2b 32f6a: 5c a5 ldd r21, Y+44 ; 0x2c 32f6c: c9 54 subi r28, 0x49 ; 73 32f6e: df 4f sbci r29, 0xFF ; 255 32f70: 28 83 st Y, r18 32f72: 39 83 std Y+1, r19 ; 0x01 32f74: 4a 83 std Y+2, r20 ; 0x02 32f76: 5b 83 std Y+3, r21 ; 0x03 32f78: c7 5b subi r28, 0xB7 ; 183 32f7a: 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]; 32f7c: 61 96 adiw r28, 0x11 ; 17 32f7e: 8c ad ldd r24, Y+60 ; 0x3c 32f80: 9d ad ldd r25, Y+61 ; 0x3d 32f82: ae ad ldd r26, Y+62 ; 0x3e 32f84: bf ad ldd r27, Y+63 ; 0x3f 32f86: 61 97 sbiw r28, 0x11 ; 17 32f88: c5 54 subi r28, 0x45 ; 69 32f8a: df 4f sbci r29, 0xFF ; 255 32f8c: 88 83 st Y, r24 32f8e: 99 83 std Y+1, r25 ; 0x01 32f90: aa 83 std Y+2, r26 ; 0x02 32f92: bb 83 std Y+3, r27 ; 0x03 32f94: cb 5b subi r28, 0xBB ; 187 32f96: d0 40 sbci r29, 0x00 ; 0 32f98: 29 a9 ldd r18, Y+49 ; 0x31 32f9a: 3a a9 ldd r19, Y+50 ; 0x32 32f9c: 4b a9 ldd r20, Y+51 ; 0x33 32f9e: 5c a9 ldd r21, Y+52 ; 0x34 32fa0: c1 54 subi r28, 0x41 ; 65 32fa2: df 4f sbci r29, 0xFF ; 255 32fa4: 28 83 st Y, r18 32fa6: 39 83 std Y+1, r19 ; 0x01 32fa8: 4a 83 std Y+2, r20 ; 0x02 32faa: 5b 83 std Y+3, r21 ; 0x03 32fac: cf 5b subi r28, 0xBF ; 191 32fae: d0 40 sbci r29, 0x00 ; 0 32fb0: 8d a9 ldd r24, Y+53 ; 0x35 32fb2: 9e a9 ldd r25, Y+54 ; 0x36 32fb4: af a9 ldd r26, Y+55 ; 0x37 32fb6: b8 ad ldd r27, Y+56 ; 0x38 32fb8: cd 53 subi r28, 0x3D ; 61 32fba: df 4f sbci r29, 0xFF ; 255 32fbc: 88 83 st Y, r24 32fbe: 99 83 std Y+1, r25 ; 0x01 32fc0: aa 83 std Y+2, r26 ; 0x02 32fc2: bb 83 std Y+3, r27 ; 0x03 32fc4: c3 5c subi r28, 0xC3 ; 195 32fc6: d0 40 sbci r29, 0x00 ; 0 32fc8: 29 ad ldd r18, Y+57 ; 0x39 32fca: 3a ad ldd r19, Y+58 ; 0x3a 32fcc: 4b ad ldd r20, Y+59 ; 0x3b 32fce: 5c ad ldd r21, Y+60 ; 0x3c 32fd0: c9 53 subi r28, 0x39 ; 57 32fd2: df 4f sbci r29, 0xFF ; 255 32fd4: 28 83 st Y, r18 32fd6: 39 83 std Y+1, r19 ; 0x01 32fd8: 4a 83 std Y+2, r20 ; 0x02 32fda: 5b 83 std Y+3, r21 ; 0x03 32fdc: c7 5c subi r28, 0xC7 ; 199 32fde: d0 40 sbci r29, 0x00 ; 0 32fe0: 21 96 adiw r28, 0x01 ; 1 32fe2: 8c ad ldd r24, Y+60 ; 0x3c 32fe4: 9d ad ldd r25, Y+61 ; 0x3d 32fe6: ae ad ldd r26, Y+62 ; 0x3e 32fe8: bf ad ldd r27, Y+63 ; 0x3f 32fea: 21 97 sbiw r28, 0x01 ; 1 32fec: c5 53 subi r28, 0x35 ; 53 32fee: df 4f sbci r29, 0xFF ; 255 32ff0: 88 83 st Y, r24 32ff2: 99 83 std Y+1, r25 ; 0x01 32ff4: aa 83 std Y+2, r26 ; 0x02 32ff6: bb 83 std Y+3, r27 ; 0x03 32ff8: cb 5c subi r28, 0xCB ; 203 32ffa: d0 40 sbci r29, 0x00 ; 0 32ffc: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 32ffe: c1 2c mov r12, r1 33000: d1 2c mov r13, r1 33002: 76 01 movw r14, r12 33004: 46 01 movw r8, r12 33006: 57 01 movw r10, r14 33008: 26 01 movw r4, r12 3300a: 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]; 3300c: a3 01 movw r20, r6 3300e: 92 01 movw r18, r4 33010: e4 96 adiw r28, 0x34 ; 52 33012: 6c ad ldd r22, Y+60 ; 0x3c 33014: 7d ad ldd r23, Y+61 ; 0x3d 33016: 8e ad ldd r24, Y+62 ; 0x3e 33018: 9f ad ldd r25, Y+63 ; 0x3f 3301a: e4 97 sbiw r28, 0x34 ; 52 3301c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33020: 9b 01 movw r18, r22 33022: ac 01 movw r20, r24 33024: ae 96 adiw r28, 0x2e ; 46 33026: 6c ad ldd r22, Y+60 ; 0x3c 33028: 7d ad ldd r23, Y+61 ; 0x3d 3302a: 8e ad ldd r24, Y+62 ; 0x3e 3302c: 9f ad ldd r25, Y+63 ; 0x3f 3302e: ae 97 sbiw r28, 0x2e ; 46 33030: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33034: 2b 01 movw r4, r22 33036: 3c 01 movw r6, r24 33038: a5 01 movw r20, r10 3303a: 94 01 movw r18, r8 3303c: ed 96 adiw r28, 0x3d ; 61 3303e: 6c ad ldd r22, Y+60 ; 0x3c 33040: 7d ad ldd r23, Y+61 ; 0x3d 33042: 8e ad ldd r24, Y+62 ; 0x3e 33044: 9f ad ldd r25, Y+63 ; 0x3f 33046: ed 97 sbiw r28, 0x3d ; 61 33048: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3304c: 9b 01 movw r18, r22 3304e: ac 01 movw r20, r24 33050: c3 01 movw r24, r6 33052: b2 01 movw r22, r4 33054: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33058: 2b 01 movw r4, r22 3305a: 3c 01 movw r6, r24 3305c: a7 01 movw r20, r14 3305e: 96 01 movw r18, r12 33060: c3 58 subi r28, 0x83 ; 131 33062: df 4f sbci r29, 0xFF ; 255 33064: 68 81 ld r22, Y 33066: 79 81 ldd r23, Y+1 ; 0x01 33068: 8a 81 ldd r24, Y+2 ; 0x02 3306a: 9b 81 ldd r25, Y+3 ; 0x03 3306c: cd 57 subi r28, 0x7D ; 125 3306e: d0 40 sbci r29, 0x00 ; 0 33070: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33074: 9b 01 movw r18, r22 33076: ac 01 movw r20, r24 33078: c3 01 movw r24, r6 3307a: b2 01 movw r22, r4 3307c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33080: cf 57 subi r28, 0x7F ; 127 33082: df 4f sbci r29, 0xFF ; 255 33084: 28 81 ld r18, Y 33086: 39 81 ldd r19, Y+1 ; 0x01 33088: 4a 81 ldd r20, Y+2 ; 0x02 3308a: 5b 81 ldd r21, Y+3 ; 0x03 3308c: c1 58 subi r28, 0x81 ; 129 3308e: d0 40 sbci r29, 0x00 ; 0 33090: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33094: 6e 96 adiw r28, 0x1e ; 30 33096: 6c af std Y+60, r22 ; 0x3c 33098: 7d af std Y+61, r23 ; 0x3d 3309a: 8e af std Y+62, r24 ; 0x3e 3309c: 9f af std Y+63, r25 ; 0x3f 3309e: 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]; 330a0: c7 57 subi r28, 0x77 ; 119 330a2: df 4f sbci r29, 0xFF ; 255 330a4: 28 81 ld r18, Y 330a6: 39 81 ldd r19, Y+1 ; 0x01 330a8: 4a 81 ldd r20, Y+2 ; 0x02 330aa: 5b 81 ldd r21, Y+3 ; 0x03 330ac: c9 58 subi r28, 0x89 ; 137 330ae: d0 40 sbci r29, 0x00 ; 0 330b0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 330b4: 9b 01 movw r18, r22 330b6: ac 01 movw r20, r24 330b8: cb 57 subi r28, 0x7B ; 123 330ba: df 4f sbci r29, 0xFF ; 255 330bc: 68 81 ld r22, Y 330be: 79 81 ldd r23, Y+1 ; 0x01 330c0: 8a 81 ldd r24, Y+2 ; 0x02 330c2: 9b 81 ldd r25, Y+3 ; 0x03 330c4: c5 58 subi r28, 0x85 ; 133 330c6: d0 40 sbci r29, 0x00 ; 0 330c8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 330cc: 2b 01 movw r4, r22 330ce: 3c 01 movw r6, r24 330d0: a5 01 movw r20, r10 330d2: 94 01 movw r18, r8 330d4: cb 56 subi r28, 0x6B ; 107 330d6: df 4f sbci r29, 0xFF ; 255 330d8: 68 81 ld r22, Y 330da: 79 81 ldd r23, Y+1 ; 0x01 330dc: 8a 81 ldd r24, Y+2 ; 0x02 330de: 9b 81 ldd r25, Y+3 ; 0x03 330e0: c5 59 subi r28, 0x95 ; 149 330e2: d0 40 sbci r29, 0x00 ; 0 330e4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 330e8: 9b 01 movw r18, r22 330ea: ac 01 movw r20, r24 330ec: c3 01 movw r24, r6 330ee: b2 01 movw r22, r4 330f0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 330f4: 4b 01 movw r8, r22 330f6: 5c 01 movw r10, r24 330f8: a7 01 movw r20, r14 330fa: 96 01 movw r18, r12 330fc: c7 56 subi r28, 0x67 ; 103 330fe: df 4f sbci r29, 0xFF ; 255 33100: 68 81 ld r22, Y 33102: 79 81 ldd r23, Y+1 ; 0x01 33104: 8a 81 ldd r24, Y+2 ; 0x02 33106: 9b 81 ldd r25, Y+3 ; 0x03 33108: c9 59 subi r28, 0x99 ; 153 3310a: d0 40 sbci r29, 0x00 ; 0 3310c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33110: 9b 01 movw r18, r22 33112: ac 01 movw r20, r24 33114: c5 01 movw r24, r10 33116: b4 01 movw r22, r8 33118: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3311c: c3 57 subi r28, 0x73 ; 115 3311e: df 4f sbci r29, 0xFF ; 255 33120: 28 81 ld r18, Y 33122: 39 81 ldd r19, Y+1 ; 0x01 33124: 4a 81 ldd r20, Y+2 ; 0x02 33126: 5b 81 ldd r21, Y+3 ; 0x03 33128: cd 58 subi r28, 0x8D ; 141 3312a: d0 40 sbci r29, 0x00 ; 0 3312c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33130: 2b 01 movw r4, r22 33132: 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]; 33134: cf 55 subi r28, 0x5F ; 95 33136: df 4f sbci r29, 0xFF ; 255 33138: 28 81 ld r18, Y 3313a: 39 81 ldd r19, Y+1 ; 0x01 3313c: 4a 81 ldd r20, Y+2 ; 0x02 3313e: 5b 81 ldd r21, Y+3 ; 0x03 33140: c1 5a subi r28, 0xA1 ; 161 33142: d0 40 sbci r29, 0x00 ; 0 33144: 6e 96 adiw r28, 0x1e ; 30 33146: 6c ad ldd r22, Y+60 ; 0x3c 33148: 7d ad ldd r23, Y+61 ; 0x3d 3314a: 8e ad ldd r24, Y+62 ; 0x3e 3314c: 9f ad ldd r25, Y+63 ; 0x3f 3314e: 6e 97 sbiw r28, 0x1e ; 30 33150: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33154: 9b 01 movw r18, r22 33156: ac 01 movw r20, r24 33158: c3 56 subi r28, 0x63 ; 99 3315a: df 4f sbci r29, 0xFF ; 255 3315c: 68 81 ld r22, Y 3315e: 79 81 ldd r23, Y+1 ; 0x01 33160: 8a 81 ldd r24, Y+2 ; 0x02 33162: 9b 81 ldd r25, Y+3 ; 0x03 33164: cd 59 subi r28, 0x9D ; 157 33166: d0 40 sbci r29, 0x00 ; 0 33168: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3316c: 4b 01 movw r8, r22 3316e: 5c 01 movw r10, r24 33170: cb 55 subi r28, 0x5B ; 91 33172: df 4f sbci r29, 0xFF ; 255 33174: 28 81 ld r18, Y 33176: 39 81 ldd r19, Y+1 ; 0x01 33178: 4a 81 ldd r20, Y+2 ; 0x02 3317a: 5b 81 ldd r21, Y+3 ; 0x03 3317c: c5 5a subi r28, 0xA5 ; 165 3317e: d0 40 sbci r29, 0x00 ; 0 33180: c3 01 movw r24, r6 33182: b2 01 movw r22, r4 33184: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33188: 9b 01 movw r18, r22 3318a: ac 01 movw r20, r24 3318c: c5 01 movw r24, r10 3318e: b4 01 movw r22, r8 33190: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33194: 4b 01 movw r8, r22 33196: 5c 01 movw r10, r24 33198: a7 01 movw r20, r14 3319a: 96 01 movw r18, r12 3319c: cd 54 subi r28, 0x4D ; 77 3319e: df 4f sbci r29, 0xFF ; 255 331a0: 68 81 ld r22, Y 331a2: 79 81 ldd r23, Y+1 ; 0x01 331a4: 8a 81 ldd r24, Y+2 ; 0x02 331a6: 9b 81 ldd r25, Y+3 ; 0x03 331a8: c3 5b subi r28, 0xB3 ; 179 331aa: d0 40 sbci r29, 0x00 ; 0 331ac: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 331b0: 9b 01 movw r18, r22 331b2: ac 01 movw r20, r24 331b4: c5 01 movw r24, r10 331b6: b4 01 movw r22, r8 331b8: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 331bc: c9 54 subi r28, 0x49 ; 73 331be: df 4f sbci r29, 0xFF ; 255 331c0: 28 81 ld r18, Y 331c2: 39 81 ldd r19, Y+1 ; 0x01 331c4: 4a 81 ldd r20, Y+2 ; 0x02 331c6: 5b 81 ldd r21, Y+3 ; 0x03 331c8: c7 5b subi r28, 0xB7 ; 183 331ca: d0 40 sbci r29, 0x00 ; 0 331cc: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 331d0: 4b 01 movw r8, r22 331d2: 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]; 331d4: c1 54 subi r28, 0x41 ; 65 331d6: df 4f sbci r29, 0xFF ; 255 331d8: 28 81 ld r18, Y 331da: 39 81 ldd r19, Y+1 ; 0x01 331dc: 4a 81 ldd r20, Y+2 ; 0x02 331de: 5b 81 ldd r21, Y+3 ; 0x03 331e0: cf 5b subi r28, 0xBF ; 191 331e2: d0 40 sbci r29, 0x00 ; 0 331e4: 6e 96 adiw r28, 0x1e ; 30 331e6: 6c ad ldd r22, Y+60 ; 0x3c 331e8: 7d ad ldd r23, Y+61 ; 0x3d 331ea: 8e ad ldd r24, Y+62 ; 0x3e 331ec: 9f ad ldd r25, Y+63 ; 0x3f 331ee: 6e 97 sbiw r28, 0x1e ; 30 331f0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 331f4: 9b 01 movw r18, r22 331f6: ac 01 movw r20, r24 331f8: c5 54 subi r28, 0x45 ; 69 331fa: df 4f sbci r29, 0xFF ; 255 331fc: 68 81 ld r22, Y 331fe: 79 81 ldd r23, Y+1 ; 0x01 33200: 8a 81 ldd r24, Y+2 ; 0x02 33202: 9b 81 ldd r25, Y+3 ; 0x03 33204: cb 5b subi r28, 0xBB ; 187 33206: d0 40 sbci r29, 0x00 ; 0 33208: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3320c: 6b 01 movw r12, r22 3320e: 7c 01 movw r14, r24 33210: cd 53 subi r28, 0x3D ; 61 33212: df 4f sbci r29, 0xFF ; 255 33214: 28 81 ld r18, Y 33216: 39 81 ldd r19, Y+1 ; 0x01 33218: 4a 81 ldd r20, Y+2 ; 0x02 3321a: 5b 81 ldd r21, Y+3 ; 0x03 3321c: c3 5c subi r28, 0xC3 ; 195 3321e: d0 40 sbci r29, 0x00 ; 0 33220: c3 01 movw r24, r6 33222: b2 01 movw r22, r4 33224: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33228: 9b 01 movw r18, r22 3322a: ac 01 movw r20, r24 3322c: c7 01 movw r24, r14 3322e: b6 01 movw r22, r12 33230: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33234: 6b 01 movw r12, r22 33236: 7c 01 movw r14, r24 33238: c9 53 subi r28, 0x39 ; 57 3323a: df 4f sbci r29, 0xFF ; 255 3323c: 28 81 ld r18, Y 3323e: 39 81 ldd r19, Y+1 ; 0x01 33240: 4a 81 ldd r20, Y+2 ; 0x02 33242: 5b 81 ldd r21, Y+3 ; 0x03 33244: c7 5c subi r28, 0xC7 ; 199 33246: d0 40 sbci r29, 0x00 ; 0 33248: c5 01 movw r24, r10 3324a: b4 01 movw r22, r8 3324c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33250: 9b 01 movw r18, r22 33252: ac 01 movw r20, r24 33254: c7 01 movw r24, r14 33256: b6 01 movw r22, r12 33258: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3325c: c5 53 subi r28, 0x35 ; 53 3325e: df 4f sbci r29, 0xFF ; 255 33260: 28 81 ld r18, Y 33262: 39 81 ldd r19, Y+1 ; 0x01 33264: 4a 81 ldd r20, Y+2 ; 0x02 33266: 5b 81 ldd r21, Y+3 ; 0x03 33268: cb 5c subi r28, 0xCB ; 203 3326a: d0 40 sbci r29, 0x00 ; 0 3326c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33270: 6b 01 movw r12, r22 33272: 7c 01 movw r14, r24 33274: 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) { 33276: 09 f0 breq .+2 ; 0x3327a 33278: c9 ce rjmp .-622 ; 0x3300c // 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]; 3327a: 6e 96 adiw r28, 0x1e ; 30 3327c: 2c ad ldd r18, Y+60 ; 0x3c 3327e: 3d ad ldd r19, Y+61 ; 0x3d 33280: 4e ad ldd r20, Y+62 ; 0x3e 33282: 5f ad ldd r21, Y+63 ; 0x3f 33284: 6e 97 sbiw r28, 0x1e ; 30 33286: c5 55 subi r28, 0x55 ; 85 33288: df 4f sbci r29, 0xFF ; 255 3328a: 68 81 ld r22, Y 3328c: 79 81 ldd r23, Y+1 ; 0x01 3328e: 8a 81 ldd r24, Y+2 ; 0x02 33290: 9b 81 ldd r25, Y+3 ; 0x03 33292: cb 5a subi r28, 0xAB ; 171 33294: d0 40 sbci r29, 0x00 ; 0 33296: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3329a: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 3329e: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 332a2: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 332a6: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 cntr[1] += h[1]; 332aa: a3 01 movw r20, r6 332ac: 92 01 movw r18, r4 332ae: c1 55 subi r28, 0x51 ; 81 332b0: df 4f sbci r29, 0xFF ; 255 332b2: 68 81 ld r22, Y 332b4: 79 81 ldd r23, Y+1 ; 0x01 332b6: 8a 81 ldd r24, Y+2 ; 0x02 332b8: 9b 81 ldd r25, Y+3 ; 0x03 332ba: cf 5a subi r28, 0xAF ; 175 332bc: d0 40 sbci r29, 0x00 ; 0 332be: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 332c2: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 332c6: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 332ca: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 332ce: 90 93 fa 13 sts 0x13FA, r25 ; 0x8013fa a1 += h[2]; 332d2: a5 01 movw r20, r10 332d4: 94 01 movw r18, r8 332d6: a6 96 adiw r28, 0x26 ; 38 332d8: 6c ad ldd r22, Y+60 ; 0x3c 332da: 7d ad ldd r23, Y+61 ; 0x3d 332dc: 8e ad ldd r24, Y+62 ; 0x3e 332de: 9f ad ldd r25, Y+63 ; 0x3f 332e0: a6 97 sbiw r28, 0x26 ; 38 332e2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 332e6: a6 96 adiw r28, 0x26 ; 38 332e8: 6c af std Y+60, r22 ; 0x3c 332ea: 7d af std Y+61, r23 ; 0x3d 332ec: 8e af std Y+62, r24 ; 0x3e 332ee: 9f af std Y+63, r25 ; 0x3f 332f0: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 332f2: a7 01 movw r20, r14 332f4: 96 01 movw r18, r12 332f6: a2 96 adiw r28, 0x22 ; 34 332f8: 6c ad ldd r22, Y+60 ; 0x3c 332fa: 7d ad ldd r23, Y+61 ; 0x3d 332fc: 8e ad ldd r24, Y+62 ; 0x3e 332fe: 9f ad ldd r25, Y+63 ; 0x3f 33300: a2 97 sbiw r28, 0x22 ; 34 33302: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 33306: a2 96 adiw r28, 0x22 ; 34 33308: 6c af std Y+60, r22 ; 0x3c 3330a: 7d af std Y+61, r23 ; 0x3d 3330c: 8e af std Y+62, r24 ; 0x3e 3330e: 9f af std Y+63, r25 ; 0x3f 33310: a2 97 sbiw r28, 0x22 ; 34 33312: e6 96 adiw r28, 0x36 ; 54 33314: 9f ad ldd r25, Y+63 ; 0x3f 33316: e6 97 sbiw r28, 0x36 ; 54 33318: 91 50 subi r25, 0x01 ; 1 3331a: e6 96 adiw r28, 0x36 ; 54 3331c: 9f af std Y+63, r25 ; 0x3f 3331e: 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) { 33320: 91 11 cpse r25, r1 33322: e6 ca rjmp .-2612 ; 0x328f0 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 33324: a6 96 adiw r28, 0x26 ; 38 33326: 6c ad ldd r22, Y+60 ; 0x3c 33328: 7d ad ldd r23, Y+61 ; 0x3d 3332a: 8e ad ldd r24, Y+62 ; 0x3e 3332c: 9f ad ldd r25, Y+63 ; 0x3f 3332e: a6 97 sbiw r28, 0x26 ; 38 33330: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 33334: 60 93 e3 13 sts 0x13E3, r22 ; 0x8013e3 33338: 70 93 e4 13 sts 0x13E4, r23 ; 0x8013e4 3333c: 80 93 e5 13 sts 0x13E5, r24 ; 0x8013e5 33340: 90 93 e6 13 sts 0x13E6, r25 ; 0x8013e6 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 33344: a6 96 adiw r28, 0x26 ; 38 33346: 6c ad ldd r22, Y+60 ; 0x3c 33348: 7d ad ldd r23, Y+61 ; 0x3d 3334a: 8e ad ldd r24, Y+62 ; 0x3e 3334c: 9f ad ldd r25, Y+63 ; 0x3f 3334e: a6 97 sbiw r28, 0x26 ; 38 33350: 0f 94 0b e1 call 0x3c216 ; 0x3c216 33354: 60 93 e7 13 sts 0x13E7, r22 ; 0x8013e7 33358: 70 93 e8 13 sts 0x13E8, r23 ; 0x8013e8 3335c: 80 93 e9 13 sts 0x13E9, r24 ; 0x8013e9 33360: 90 93 ea 13 sts 0x13EA, r25 ; 0x8013ea vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 33364: a2 96 adiw r28, 0x22 ; 34 33366: 6c ad ldd r22, Y+60 ; 0x3c 33368: 7d ad ldd r23, Y+61 ; 0x3d 3336a: 8e ad ldd r24, Y+62 ; 0x3e 3336c: 9f ad ldd r25, Y+63 ; 0x3f 3336e: a2 97 sbiw r28, 0x22 ; 34 33370: 0f 94 0b e1 call 0x3c216 ; 0x3c216 33374: 90 58 subi r25, 0x80 ; 128 33376: 60 93 eb 13 sts 0x13EB, r22 ; 0x8013eb 3337a: 70 93 ec 13 sts 0x13EC, r23 ; 0x8013ec 3337e: 80 93 ed 13 sts 0x13ED, r24 ; 0x8013ed 33382: 90 93 ee 13 sts 0x13EE, r25 ; 0x8013ee vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 33386: a2 96 adiw r28, 0x22 ; 34 33388: 6c ad ldd r22, Y+60 ; 0x3c 3338a: 7d ad ldd r23, Y+61 ; 0x3d 3338c: 8e ad ldd r24, Y+62 ; 0x3e 3338e: 9f ad ldd r25, Y+63 ; 0x3f 33390: a2 97 sbiw r28, 0x22 ; 34 33392: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 33396: 60 93 ef 13 sts 0x13EF, r22 ; 0x8013ef 3339a: 70 93 f0 13 sts 0x13F0, r23 ; 0x8013f0 3339e: 80 93 f1 13 sts 0x13F1, r24 ; 0x8013f1 333a2: 90 93 f2 13 sts 0x13F2, r25 ; 0x8013f2 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 333a6: a6 96 adiw r28, 0x26 ; 38 333a8: 2c ad ldd r18, Y+60 ; 0x3c 333aa: 3d ad ldd r19, Y+61 ; 0x3d 333ac: 4e ad ldd r20, Y+62 ; 0x3e 333ae: 5f ad ldd r21, Y+63 ; 0x3f 333b0: a6 97 sbiw r28, 0x26 ; 38 333b2: a2 96 adiw r28, 0x22 ; 34 333b4: 6c ad ldd r22, Y+60 ; 0x3c 333b6: 7d ad ldd r23, Y+61 ; 0x3d 333b8: 8e ad ldd r24, Y+62 ; 0x3e 333ba: 9f ad ldd r25, Y+63 ; 0x3f 333bc: a2 97 sbiw r28, 0x22 ; 34 333be: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 333c2: 4b 01 movw r8, r22 333c4: 5c 01 movw r10, r24 333c6: 7c 01 movw r14, r24 333c8: 6b 01 movw r12, r22 333ca: e8 94 clt 333cc: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 333ce: 21 ee ldi r18, 0xE1 ; 225 333d0: 3e e2 ldi r19, 0x2E ; 46 333d2: 45 e6 ldi r20, 0x65 ; 101 333d4: 52 e4 ldi r21, 0x42 ; 66 333d6: a2 96 adiw r28, 0x22 ; 34 333d8: 6c ad ldd r22, Y+60 ; 0x3c 333da: 7d ad ldd r23, Y+61 ; 0x3d 333dc: 8e ad ldd r24, Y+62 ; 0x3e 333de: 9f ad ldd r25, Y+63 ; 0x3f 333e0: a2 97 sbiw r28, 0x22 ; 34 333e2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 333e6: 9f 93 push r25 333e8: 8f 93 push r24 333ea: 7f 93 push r23 333ec: 6f 93 push r22 333ee: 21 ee ldi r18, 0xE1 ; 225 333f0: 3e e2 ldi r19, 0x2E ; 46 333f2: 45 e6 ldi r20, 0x65 ; 101 333f4: 52 e4 ldi r21, 0x42 ; 66 333f6: c5 01 movw r24, r10 333f8: b4 01 movw r22, r8 333fa: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 333fe: 9f 93 push r25 33400: 8f 93 push r24 33402: 7f 93 push r23 33404: 6f 93 push r22 33406: 82 ef ldi r24, 0xF2 ; 242 33408: 9f e6 ldi r25, 0x6F ; 111 3340a: 9f 93 push r25 3340c: 8f 93 push r24 3340e: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 33412: b7 01 movw r22, r14 33414: a6 01 movw r20, r12 33416: 80 e6 ldi r24, 0x60 ; 96 33418: 9f e0 ldi r25, 0x0F ; 15 3341a: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 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) 3341e: 0f b6 in r0, 0x3f ; 63 33420: f8 94 cli 33422: de bf out 0x3e, r29 ; 62 33424: 0f be out 0x3f, r0 ; 63 33426: cd bf out 0x3d, r28 ; 61 33428: 2f e1 ldi r18, 0x1F ; 31 3342a: 32 e4 ldi r19, 0x42 ; 66 3342c: 49 e0 ldi r20, 0x09 ; 9 3342e: 5b e3 ldi r21, 0x3B ; 59 33430: c7 01 movw r24, r14 33432: b6 01 movw r22, r12 33434: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__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; 33438: 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) 3343a: 18 16 cp r1, r24 3343c: 64 f4 brge .+24 ; 0x33456 result = (angleDiff > bed_skew_angle_extreme) ? 3343e: 25 e3 ldi r18, 0x35 ; 53 33440: 3a ef ldi r19, 0xFA ; 250 33442: 4e e8 ldi r20, 0x8E ; 142 33444: 5b e3 ldi r21, 0x3B ; 59 33446: c7 01 movw r24, r14 33448: b6 01 movw r22, r12 3344a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 3344e: 12 e0 ldi r17, 0x02 ; 2 33450: 18 16 cp r1, r24 33452: 0c f0 brlt .+2 ; 0x33456 33454: 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 || 33456: 25 e3 ldi r18, 0x35 ; 53 33458: 3a ef ldi r19, 0xFA ; 250 3345a: 4e e8 ldi r20, 0x8E ; 142 3345c: 5b e3 ldi r21, 0x3B ; 59 3345e: a6 96 adiw r28, 0x26 ; 38 33460: 6c ad ldd r22, Y+60 ; 0x3c 33462: 7d ad ldd r23, Y+61 ; 0x3d 33464: 8e ad ldd r24, Y+62 ; 0x3e 33466: 9f ad ldd r25, Y+63 ; 0x3f 33468: a6 97 sbiw r28, 0x26 ; 38 3346a: 9f 77 andi r25, 0x7F ; 127 3346c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 33470: 18 16 cp r1, r24 33472: 0c f4 brge .+2 ; 0x33476 33474: 67 c4 rjmp .+2254 ; 0x33d44 33476: 25 e3 ldi r18, 0x35 ; 53 33478: 3a ef ldi r19, 0xFA ; 250 3347a: 4e e8 ldi r20, 0x8E ; 142 3347c: 5b e3 ldi r21, 0x3B ; 59 3347e: a2 96 adiw r28, 0x22 ; 34 33480: 6c ad ldd r22, Y+60 ; 0x3c 33482: 7d ad ldd r23, Y+61 ; 0x3d 33484: 8e ad ldd r24, Y+62 ; 0x3e 33486: 9f ad ldd r25, Y+63 ; 0x3f 33488: a2 97 sbiw r28, 0x22 ; 34 3348a: 9f 77 andi r25, 0x7F ; 127 3348c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 33490: 18 16 cp r1, r24 33492: 0c f4 brge .+2 ; 0x33496 33494: 57 c4 rjmp .+2222 ; 0x33d44 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]; 33496: 20 91 e3 13 lds r18, 0x13E3 ; 0x8013e3 3349a: 30 91 e4 13 lds r19, 0x13E4 ; 0x8013e4 3349e: 40 91 e5 13 lds r20, 0x13E5 ; 0x8013e5 334a2: 50 91 e6 13 lds r21, 0x13E6 ; 0x8013e6 334a6: ae 96 adiw r28, 0x2e ; 46 334a8: 2c af std Y+60, r18 ; 0x3c 334aa: 3d af std Y+61, r19 ; 0x3d 334ac: 4e af std Y+62, r20 ; 0x3e 334ae: 5f af std Y+63, r21 ; 0x3f 334b0: ae 97 sbiw r28, 0x2e ; 46 334b2: 80 91 eb 13 lds r24, 0x13EB ; 0x8013eb 334b6: 90 91 ec 13 lds r25, 0x13EC ; 0x8013ec 334ba: a0 91 ed 13 lds r26, 0x13ED ; 0x8013ed 334be: b0 91 ee 13 lds r27, 0x13EE ; 0x8013ee 334c2: e9 96 adiw r28, 0x39 ; 57 334c4: 8c af std Y+60, r24 ; 0x3c 334c6: 9d af std Y+61, r25 ; 0x3d 334c8: ae af std Y+62, r26 ; 0x3e 334ca: bf af std Y+63, r27 ; 0x3f 334cc: e9 97 sbiw r28, 0x39 ; 57 334ce: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 334d2: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 334d6: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 334da: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 334de: e4 96 adiw r28, 0x34 ; 52 334e0: 2c af std Y+60, r18 ; 0x3c 334e2: 3d af std Y+61, r19 ; 0x3d 334e4: 4e af std Y+62, r20 ; 0x3e 334e6: 5f af std Y+63, r21 ; 0x3f 334e8: 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]; 334ea: 80 91 e7 13 lds r24, 0x13E7 ; 0x8013e7 334ee: 90 91 e8 13 lds r25, 0x13E8 ; 0x8013e8 334f2: a0 91 e9 13 lds r26, 0x13E9 ; 0x8013e9 334f6: b0 91 ea 13 lds r27, 0x13EA ; 0x8013ea 334fa: ed 96 adiw r28, 0x3d ; 61 334fc: 8c af std Y+60, r24 ; 0x3c 334fe: 9d af std Y+61, r25 ; 0x3d 33500: ae af std Y+62, r26 ; 0x3e 33502: bf af std Y+63, r27 ; 0x3f 33504: ed 97 sbiw r28, 0x3d ; 61 33506: 20 91 ef 13 lds r18, 0x13EF ; 0x8013ef 3350a: 30 91 f0 13 lds r19, 0x13F0 ; 0x8013f0 3350e: 40 91 f1 13 lds r20, 0x13F1 ; 0x8013f1 33512: 50 91 f2 13 lds r21, 0x13F2 ; 0x8013f2 33516: c3 58 subi r28, 0x83 ; 131 33518: df 4f sbci r29, 0xFF ; 255 3351a: 28 83 st Y, r18 3351c: 39 83 std Y+1, r19 ; 0x01 3351e: 4a 83 std Y+2, r20 ; 0x02 33520: 5b 83 std Y+3, r21 ; 0x03 33522: cd 57 subi r28, 0x7D ; 125 33524: d0 40 sbci r29, 0x00 ; 0 33526: 80 91 f7 13 lds r24, 0x13F7 ; 0x8013f7 3352a: 90 91 f8 13 lds r25, 0x13F8 ; 0x8013f8 3352e: a0 91 f9 13 lds r26, 0x13F9 ; 0x8013f9 33532: b0 91 fa 13 lds r27, 0x13FA ; 0x8013fa 33536: cf 57 subi r28, 0x7F ; 127 33538: df 4f sbci r29, 0xFF ; 255 3353a: 88 83 st Y, r24 3353c: 99 83 std Y+1, r25 ; 0x01 3353e: aa 83 std Y+2, r26 ; 0x02 33540: bb 83 std Y+3, r27 ; 0x03 33542: c1 58 subi r28, 0x81 ; 129 33544: d0 40 sbci r29, 0x00 ; 0 33546: a8 ee ldi r26, 0xE8 ; 232 33548: b5 ea ldi r27, 0xA5 ; 165 3354a: 6c 96 adiw r28, 0x1c ; 28 3354c: bf af std Y+63, r27 ; 0x3f 3354e: ae af std Y+62, r26 ; 0x3e 33550: 6c 97 sbiw r28, 0x1c ; 28 33552: 82 ec ldi r24, 0xC2 ; 194 33554: 28 2e mov r2, r24 33556: 83 e1 ldi r24, 0x13 ; 19 33558: 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]; 3355a: f1 01 movw r30, r2 3355c: c1 80 ldd r12, Z+1 ; 0x01 3355e: d2 80 ldd r13, Z+2 ; 0x02 33560: e3 80 ldd r14, Z+3 ; 0x03 33562: f4 80 ldd r15, Z+4 ; 0x04 33564: 45 80 ldd r4, Z+5 ; 0x05 33566: 56 80 ldd r5, Z+6 ; 0x06 33568: 67 80 ldd r6, Z+7 ; 0x07 3356a: 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; 3356c: 6c 96 adiw r28, 0x1c ; 28 3356e: ee ad ldd r30, Y+62 ; 0x3e 33570: ff ad ldd r31, Y+63 ; 0x3f 33572: 6c 97 sbiw r28, 0x1c ; 28 33574: 25 91 lpm r18, Z+ 33576: 35 91 lpm r19, Z+ 33578: 45 91 lpm r20, Z+ 3357a: 54 91 lpm r21, Z 3357c: cb 57 subi r28, 0x7B ; 123 3357e: df 4f sbci r29, 0xFF ; 255 33580: 28 83 st Y, r18 33582: 39 83 std Y+1, r19 ; 0x01 33584: 4a 83 std Y+2, r20 ; 0x02 33586: 5b 83 std Y+3, r21 ; 0x03 33588: c5 58 subi r28, 0x85 ; 133 3358a: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 3358c: 6c 96 adiw r28, 0x1c ; 28 3358e: ee ad ldd r30, Y+62 ; 0x3e 33590: ff ad ldd r31, Y+63 ; 0x3f 33592: 6c 97 sbiw r28, 0x1c ; 28 33594: 34 96 adiw r30, 0x04 ; 4 33596: 85 90 lpm r8, Z+ 33598: 95 90 lpm r9, Z+ 3359a: a5 90 lpm r10, Z+ 3359c: 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]; 3359e: ed 96 adiw r28, 0x3d ; 61 335a0: 2c ad ldd r18, Y+60 ; 0x3c 335a2: 3d ad ldd r19, Y+61 ; 0x3d 335a4: 4e ad ldd r20, Y+62 ; 0x3e 335a6: 5f ad ldd r21, Y+63 ; 0x3f 335a8: ed 97 sbiw r28, 0x3d ; 61 335aa: c7 01 movw r24, r14 335ac: b6 01 movw r22, r12 335ae: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 335b2: c7 57 subi r28, 0x77 ; 119 335b4: df 4f sbci r29, 0xFF ; 255 335b6: 68 83 st Y, r22 335b8: 79 83 std Y+1, r23 ; 0x01 335ba: 8a 83 std Y+2, r24 ; 0x02 335bc: 9b 83 std Y+3, r25 ; 0x03 335be: c9 58 subi r28, 0x89 ; 137 335c0: d0 40 sbci r29, 0x00 ; 0 335c2: c3 58 subi r28, 0x83 ; 131 335c4: df 4f sbci r29, 0xFF ; 255 335c6: 28 81 ld r18, Y 335c8: 39 81 ldd r19, Y+1 ; 0x01 335ca: 4a 81 ldd r20, Y+2 ; 0x02 335cc: 5b 81 ldd r21, Y+3 ; 0x03 335ce: cd 57 subi r28, 0x7D ; 125 335d0: d0 40 sbci r29, 0x00 ; 0 335d2: c3 01 movw r24, r6 335d4: b2 01 movw r22, r4 335d6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 335da: 9b 01 movw r18, r22 335dc: ac 01 movw r20, r24 335de: c7 57 subi r28, 0x77 ; 119 335e0: df 4f sbci r29, 0xFF ; 255 335e2: 68 81 ld r22, Y 335e4: 79 81 ldd r23, Y+1 ; 0x01 335e6: 8a 81 ldd r24, Y+2 ; 0x02 335e8: 9b 81 ldd r25, Y+3 ; 0x03 335ea: c9 58 subi r28, 0x89 ; 137 335ec: d0 40 sbci r29, 0x00 ; 0 335ee: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 335f2: cf 57 subi r28, 0x7F ; 127 335f4: df 4f sbci r29, 0xFF ; 255 335f6: 28 81 ld r18, Y 335f8: 39 81 ldd r19, Y+1 ; 0x01 335fa: 4a 81 ldd r20, Y+2 ; 0x02 335fc: 5b 81 ldd r21, Y+3 ; 0x03 335fe: c1 58 subi r28, 0x81 ; 129 33600: d0 40 sbci r29, 0x00 ; 0 33602: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 33606: 9b 01 movw r18, r22 33608: 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; 3360a: c5 01 movw r24, r10 3360c: b4 01 movw r22, r8 3360e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33612: 4b 01 movw r8, r22 33614: 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]; 33616: a7 01 movw r20, r14 33618: 96 01 movw r18, r12 3361a: ae 96 adiw r28, 0x2e ; 46 3361c: 6c ad ldd r22, Y+60 ; 0x3c 3361e: 7d ad ldd r23, Y+61 ; 0x3d 33620: 8e ad ldd r24, Y+62 ; 0x3e 33622: 9f ad ldd r25, Y+63 ; 0x3f 33624: ae 97 sbiw r28, 0x2e ; 46 33626: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3362a: 6b 01 movw r12, r22 3362c: 7c 01 movw r14, r24 3362e: a3 01 movw r20, r6 33630: 92 01 movw r18, r4 33632: e9 96 adiw r28, 0x39 ; 57 33634: 6c ad ldd r22, Y+60 ; 0x3c 33636: 7d ad ldd r23, Y+61 ; 0x3d 33638: 8e ad ldd r24, Y+62 ; 0x3e 3363a: 9f ad ldd r25, Y+63 ; 0x3f 3363c: e9 97 sbiw r28, 0x39 ; 57 3363e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33642: 9b 01 movw r18, r22 33644: ac 01 movw r20, r24 33646: c7 01 movw r24, r14 33648: b6 01 movw r22, r12 3364a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3364e: e4 96 adiw r28, 0x34 ; 52 33650: 2c ad ldd r18, Y+60 ; 0x3c 33652: 3d ad ldd r19, Y+61 ; 0x3d 33654: 4e ad ldd r20, Y+62 ; 0x3e 33656: 5f ad ldd r21, Y+63 ; 0x3f 33658: e4 97 sbiw r28, 0x34 ; 52 3365a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3365e: 9b 01 movw r18, r22 33660: 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; 33662: cb 57 subi r28, 0x7B ; 123 33664: df 4f sbci r29, 0xFF ; 255 33666: 68 81 ld r22, Y 33668: 79 81 ldd r23, Y+1 ; 0x01 3366a: 8a 81 ldd r24, Y+2 ; 0x02 3366c: 9b 81 ldd r25, Y+3 ; 0x03 3366e: c5 58 subi r28, 0x85 ; 133 33670: d0 40 sbci r29, 0x00 ; 0 33672: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 33676: a5 01 movw r20, r10 33678: 94 01 movw r18, r8 3367a: 0f 94 e7 df call 0x3bfce ; 0x3bfce } 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) { 3367e: 2d ec ldi r18, 0xCD ; 205 33680: 3c ec ldi r19, 0xCC ; 204 33682: 4c e4 ldi r20, 0x4C ; 76 33684: 5f e3 ldi r21, 0x3F ; 63 33686: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 3368a: 18 16 cp r1, r24 3368c: 0c f4 brge .+2 ; 0x33690 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 3368e: 1e ef ldi r17, 0xFE ; 254 33690: 38 e0 ldi r19, 0x08 ; 8 33692: 23 0e add r2, r19 33694: 31 1c adc r3, r1 33696: 6c 96 adiw r28, 0x1c ; 28 33698: 4e ad ldd r20, Y+62 ; 0x3e 3369a: 5f ad ldd r21, Y+63 ; 0x3f 3369c: 6c 97 sbiw r28, 0x1c ; 28 3369e: 48 5f subi r20, 0xF8 ; 248 336a0: 5f 4f sbci r21, 0xFF ; 255 336a2: 6c 96 adiw r28, 0x1c ; 28 336a4: 5f af std Y+63, r21 ; 0x3f 336a6: 4e af std Y+62, r20 ; 0x3e 336a8: 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) { 336aa: a8 96 adiw r28, 0x28 ; 40 336ac: 8e ad ldd r24, Y+62 ; 0x3e 336ae: 9f ad ldd r25, Y+63 ; 0x3f 336b0: a8 97 sbiw r28, 0x28 ; 40 336b2: 82 15 cp r24, r2 336b4: 93 05 cpc r25, r3 336b6: 09 f0 breq .+2 ; 0x336ba 336b8: 50 cf rjmp .-352 ; 0x3355a MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 336ba: 11 11 cpse r17, r1 336bc: 62 c1 rjmp .+708 ; 0x33982 #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); 336be: a2 96 adiw r28, 0x22 ; 34 336c0: 2c ad ldd r18, Y+60 ; 0x3c 336c2: 3d ad ldd r19, Y+61 ; 0x3d 336c4: 4e ad ldd r20, Y+62 ; 0x3e 336c6: 5f ad ldd r21, Y+63 ; 0x3f 336c8: a2 97 sbiw r28, 0x22 ; 34 336ca: a6 96 adiw r28, 0x26 ; 38 336cc: 6c ad ldd r22, Y+60 ; 0x3c 336ce: 7d ad ldd r23, Y+61 ; 0x3d 336d0: 8e ad ldd r24, Y+62 ; 0x3e 336d2: 9f ad ldd r25, Y+63 ; 0x3f 336d4: a6 97 sbiw r28, 0x26 ; 38 336d6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 336da: 20 e0 ldi r18, 0x00 ; 0 336dc: 30 e0 ldi r19, 0x00 ; 0 336de: 40 e0 ldi r20, 0x00 ; 0 336e0: 5f e3 ldi r21, 0x3F ; 63 336e2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 336e6: 6b 01 movw r12, r22 336e8: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 336ea: 0f 94 45 de call 0x3bc8a ; 0x3bc8a 336ee: a2 96 adiw r28, 0x22 ; 34 336f0: 6c af std Y+60, r22 ; 0x3c 336f2: 7d af std Y+61, r23 ; 0x3d 336f4: 8e af std Y+62, r24 ; 0x3e 336f6: 9f af std Y+63, r25 ; 0x3f 336f8: a2 97 sbiw r28, 0x22 ; 34 336fa: 60 93 e3 13 sts 0x13E3, r22 ; 0x8013e3 336fe: 70 93 e4 13 sts 0x13E4, r23 ; 0x8013e4 33702: 80 93 e5 13 sts 0x13E5, r24 ; 0x8013e5 33706: 90 93 e6 13 sts 0x13E6, r25 ; 0x8013e6 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 3370a: c7 01 movw r24, r14 3370c: b6 01 movw r22, r12 3370e: 0f 94 0b e1 call 0x3c216 ; 0x3c216 33712: a6 96 adiw r28, 0x26 ; 38 33714: 6c af std Y+60, r22 ; 0x3c 33716: 7d af std Y+61, r23 ; 0x3d 33718: 8e af std Y+62, r24 ; 0x3e 3371a: 9f af std Y+63, r25 ; 0x3f 3371c: a6 97 sbiw r28, 0x26 ; 38 3371e: 60 93 e7 13 sts 0x13E7, r22 ; 0x8013e7 33722: 70 93 e8 13 sts 0x13E8, r23 ; 0x8013e8 33726: 80 93 e9 13 sts 0x13E9, r24 ; 0x8013e9 3372a: 90 93 ea 13 sts 0x13EA, r25 ; 0x8013ea vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 3372e: 9b 01 movw r18, r22 33730: ac 01 movw r20, r24 33732: 50 58 subi r21, 0x80 ; 128 33734: aa 96 adiw r28, 0x2a ; 42 33736: 2c af std Y+60, r18 ; 0x3c 33738: 3d af std Y+61, r19 ; 0x3d 3373a: 4e af std Y+62, r20 ; 0x3e 3373c: 5f af std Y+63, r21 ; 0x3f 3373e: aa 97 sbiw r28, 0x2a ; 42 33740: 20 93 eb 13 sts 0x13EB, r18 ; 0x8013eb 33744: 30 93 ec 13 sts 0x13EC, r19 ; 0x8013ec 33748: 40 93 ed 13 sts 0x13ED, r20 ; 0x8013ed 3374c: 50 93 ee 13 sts 0x13EE, r21 ; 0x8013ee vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 33750: a2 96 adiw r28, 0x22 ; 34 33752: 8c ad ldd r24, Y+60 ; 0x3c 33754: 9d ad ldd r25, Y+61 ; 0x3d 33756: ae ad ldd r26, Y+62 ; 0x3e 33758: bf ad ldd r27, Y+63 ; 0x3f 3375a: a2 97 sbiw r28, 0x22 ; 34 3375c: 80 93 ef 13 sts 0x13EF, r24 ; 0x8013ef 33760: 90 93 f0 13 sts 0x13F0, r25 ; 0x8013f0 33764: a0 93 f1 13 sts 0x13F1, r26 ; 0x8013f1 33768: b0 93 f2 13 sts 0x13F2, r27 ; 0x8013f2 // Refresh the offset. cntr[0] = 0.f; 3376c: 10 92 f3 13 sts 0x13F3, r1 ; 0x8013f3 33770: 10 92 f4 13 sts 0x13F4, r1 ; 0x8013f4 33774: 10 92 f5 13 sts 0x13F5, r1 ; 0x8013f5 33778: 10 92 f6 13 sts 0x13F6, r1 ; 0x8013f6 cntr[1] = 0.f; 3377c: 10 92 f7 13 sts 0x13F7, r1 ; 0x8013f7 33780: 10 92 f8 13 sts 0x13F8, r1 ; 0x8013f8 33784: 10 92 f9 13 sts 0x13F9, r1 ; 0x8013f9 33788: 10 92 fa 13 sts 0x13FA, r1 ; 0x8013fa float wx = 0.f; 3378c: 41 2c mov r4, r1 3378e: 51 2c mov r5, r1 33790: 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]; 33792: cf 56 subi r28, 0x6F ; 111 33794: df 4f sbci r29, 0xFF ; 255 33796: a8 81 ld r26, Y 33798: b9 81 ldd r27, Y+1 ; 0x01 3379a: c1 59 subi r28, 0x91 ; 145 3379c: d0 40 sbci r29, 0x00 ; 0 3379e: 11 96 adiw r26, 0x01 ; 1 337a0: 8d 90 ld r8, X+ 337a2: 9d 90 ld r9, X+ 337a4: ad 90 ld r10, X+ 337a6: bc 90 ld r11, X 337a8: 14 97 sbiw r26, 0x04 ; 4 337aa: 15 96 adiw r26, 0x05 ; 5 337ac: 2d 91 ld r18, X+ 337ae: 3d 91 ld r19, X+ 337b0: 4d 91 ld r20, X+ 337b2: 5c 91 ld r21, X 337b4: 18 97 sbiw r26, 0x08 ; 8 337b6: 6e 96 adiw r28, 0x1e ; 30 337b8: 2c af std Y+60, r18 ; 0x3c 337ba: 3d af std Y+61, r19 ; 0x3d 337bc: 4e af std Y+62, r20 ; 0x3e 337be: 5f af std Y+63, r21 ; 0x3f 337c0: 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); 337c2: cd 56 subi r28, 0x6D ; 109 337c4: df 4f sbci r29, 0xFF ; 255 337c6: e8 81 ld r30, Y 337c8: f9 81 ldd r31, Y+1 ; 0x01 337ca: c3 59 subi r28, 0x93 ; 147 337cc: d0 40 sbci r29, 0x00 ; 0 337ce: c5 90 lpm r12, Z+ 337d0: d5 90 lpm r13, Z+ 337d2: e5 90 lpm r14, Z+ 337d4: 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]; 337d6: a5 01 movw r20, r10 337d8: 94 01 movw r18, r8 337da: a2 96 adiw r28, 0x22 ; 34 337dc: 6c ad ldd r22, Y+60 ; 0x3c 337de: 7d ad ldd r23, Y+61 ; 0x3d 337e0: 8e ad ldd r24, Y+62 ; 0x3e 337e2: 9f ad ldd r25, Y+63 ; 0x3f 337e4: a2 97 sbiw r28, 0x22 ; 34 337e6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 337ea: ae 96 adiw r28, 0x2e ; 46 337ec: 6c af std Y+60, r22 ; 0x3c 337ee: 7d af std Y+61, r23 ; 0x3d 337f0: 8e af std Y+62, r24 ; 0x3e 337f2: 9f af std Y+63, r25 ; 0x3f 337f4: ae 97 sbiw r28, 0x2e ; 46 337f6: 6e 96 adiw r28, 0x1e ; 30 337f8: 2c ad ldd r18, Y+60 ; 0x3c 337fa: 3d ad ldd r19, Y+61 ; 0x3d 337fc: 4e ad ldd r20, Y+62 ; 0x3e 337fe: 5f ad ldd r21, Y+63 ; 0x3f 33800: 6e 97 sbiw r28, 0x1e ; 30 33802: aa 96 adiw r28, 0x2a ; 42 33804: 6c ad ldd r22, Y+60 ; 0x3c 33806: 7d ad ldd r23, Y+61 ; 0x3d 33808: 8e ad ldd r24, Y+62 ; 0x3e 3380a: 9f ad ldd r25, Y+63 ; 0x3f 3380c: aa 97 sbiw r28, 0x2a ; 42 3380e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33812: 9b 01 movw r18, r22 33814: ac 01 movw r20, r24 33816: ae 96 adiw r28, 0x2e ; 46 33818: 6c ad ldd r22, Y+60 ; 0x3c 3381a: 7d ad ldd r23, Y+61 ; 0x3d 3381c: 8e ad ldd r24, Y+62 ; 0x3e 3381e: 9f ad ldd r25, Y+63 ; 0x3f 33820: ae 97 sbiw r28, 0x2e ; 46 33822: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 33826: 9b 01 movw r18, r22 33828: 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); 3382a: c7 01 movw r24, r14 3382c: b6 01 movw r22, r12 3382e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33832: 20 91 f3 13 lds r18, 0x13F3 ; 0x8013f3 33836: 30 91 f4 13 lds r19, 0x13F4 ; 0x8013f4 3383a: 40 91 f5 13 lds r20, 0x13F5 ; 0x8013f5 3383e: 50 91 f6 13 lds r21, 0x13F6 ; 0x8013f6 33842: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 33846: 6b 01 movw r12, r22 33848: 7c 01 movw r14, r24 3384a: c0 92 f3 13 sts 0x13F3, r12 ; 0x8013f3 3384e: d0 92 f4 13 sts 0x13F4, r13 ; 0x8013f4 33852: e0 92 f5 13 sts 0x13F5, r14 ; 0x8013f5 33856: f0 92 f6 13 sts 0x13F6, r15 ; 0x8013f6 wx += w; 3385a: 20 e0 ldi r18, 0x00 ; 0 3385c: 30 e0 ldi r19, 0x00 ; 0 3385e: 40 e8 ldi r20, 0x80 ; 128 33860: 5f e3 ldi r21, 0x3F ; 63 33862: c3 01 movw r24, r6 33864: b2 01 movw r22, r4 33866: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3386a: 2b 01 movw r4, r22 3386c: 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); 3386e: cd 56 subi r28, 0x6D ; 109 33870: df 4f sbci r29, 0xFF ; 255 33872: e8 81 ld r30, Y 33874: f9 81 ldd r31, Y+1 ; 0x01 33876: c3 59 subi r28, 0x93 ; 147 33878: d0 40 sbci r29, 0x00 ; 0 3387a: 34 96 adiw r30, 0x04 ; 4 3387c: 25 91 lpm r18, Z+ 3387e: 35 91 lpm r19, Z+ 33880: 45 91 lpm r20, Z+ 33882: 54 91 lpm r21, Z 33884: ae 96 adiw r28, 0x2e ; 46 33886: 2c af std Y+60, r18 ; 0x3c 33888: 3d af std Y+61, r19 ; 0x3d 3388a: 4e af std Y+62, r20 ; 0x3e 3388c: 5f af std Y+63, r21 ; 0x3f 3388e: 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]; 33890: a5 01 movw r20, r10 33892: 94 01 movw r18, r8 33894: a6 96 adiw r28, 0x26 ; 38 33896: 6c ad ldd r22, Y+60 ; 0x3c 33898: 7d ad ldd r23, Y+61 ; 0x3d 3389a: 8e ad ldd r24, Y+62 ; 0x3e 3389c: 9f ad ldd r25, Y+63 ; 0x3f 3389e: a6 97 sbiw r28, 0x26 ; 38 338a0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 338a4: 4b 01 movw r8, r22 338a6: 5c 01 movw r10, r24 338a8: 6e 96 adiw r28, 0x1e ; 30 338aa: 2c ad ldd r18, Y+60 ; 0x3c 338ac: 3d ad ldd r19, Y+61 ; 0x3d 338ae: 4e ad ldd r20, Y+62 ; 0x3e 338b0: 5f ad ldd r21, Y+63 ; 0x3f 338b2: 6e 97 sbiw r28, 0x1e ; 30 338b4: a2 96 adiw r28, 0x22 ; 34 338b6: 6c ad ldd r22, Y+60 ; 0x3c 338b8: 7d ad ldd r23, Y+61 ; 0x3d 338ba: 8e ad ldd r24, Y+62 ; 0x3e 338bc: 9f ad ldd r25, Y+63 ; 0x3f 338be: a2 97 sbiw r28, 0x22 ; 34 338c0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 338c4: 9b 01 movw r18, r22 338c6: ac 01 movw r20, r24 338c8: c5 01 movw r24, r10 338ca: b4 01 movw r22, r8 338cc: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 338d0: 9b 01 movw r18, r22 338d2: 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); 338d4: ae 96 adiw r28, 0x2e ; 46 338d6: 6c ad ldd r22, Y+60 ; 0x3c 338d8: 7d ad ldd r23, Y+61 ; 0x3d 338da: 8e ad ldd r24, Y+62 ; 0x3e 338dc: 9f ad ldd r25, Y+63 ; 0x3f 338de: ae 97 sbiw r28, 0x2e ; 46 338e0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 338e4: 20 91 f7 13 lds r18, 0x13F7 ; 0x8013f7 338e8: 30 91 f8 13 lds r19, 0x13F8 ; 0x8013f8 338ec: 40 91 f9 13 lds r20, 0x13F9 ; 0x8013f9 338f0: 50 91 fa 13 lds r21, 0x13FA ; 0x8013fa 338f4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 338f8: 4b 01 movw r8, r22 338fa: 5c 01 movw r10, r24 338fc: 80 92 f7 13 sts 0x13F7, r8 ; 0x8013f7 33900: 90 92 f8 13 sts 0x13F8, r9 ; 0x8013f8 33904: a0 92 f9 13 sts 0x13F9, r10 ; 0x8013f9 33908: b0 92 fa 13 sts 0x13FA, r11 ; 0x8013fa 3390c: cf 56 subi r28, 0x6F ; 111 3390e: df 4f sbci r29, 0xFF ; 255 33910: 48 81 ld r20, Y 33912: 59 81 ldd r21, Y+1 ; 0x01 33914: c1 59 subi r28, 0x91 ; 145 33916: d0 40 sbci r29, 0x00 ; 0 33918: 48 5f subi r20, 0xF8 ; 248 3391a: 5f 4f sbci r21, 0xFF ; 255 3391c: cf 56 subi r28, 0x6F ; 111 3391e: df 4f sbci r29, 0xFF ; 255 33920: 59 83 std Y+1, r21 ; 0x01 33922: 48 83 st Y, r20 33924: c1 59 subi r28, 0x91 ; 145 33926: d0 40 sbci r29, 0x00 ; 0 33928: cd 56 subi r28, 0x6D ; 109 3392a: df 4f sbci r29, 0xFF ; 255 3392c: 88 81 ld r24, Y 3392e: 99 81 ldd r25, Y+1 ; 0x01 33930: c3 59 subi r28, 0x93 ; 147 33932: d0 40 sbci r29, 0x00 ; 0 33934: 08 96 adiw r24, 0x08 ; 8 33936: cd 56 subi r28, 0x6D ; 109 33938: df 4f sbci r29, 0xFF ; 255 3393a: 99 83 std Y+1, r25 ; 0x01 3393c: 88 83 st Y, r24 3393e: c3 59 subi r28, 0x93 ; 147 33940: 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) { 33942: 24 16 cp r2, r20 33944: 35 06 cpc r3, r21 33946: 09 f0 breq .+2 ; 0x3394a 33948: 24 cf rjmp .-440 ; 0x33792 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 3394a: a3 01 movw r20, r6 3394c: 92 01 movw r18, r4 3394e: c7 01 movw r24, r14 33950: b6 01 movw r22, r12 33952: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33956: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 3395a: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 3395e: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33962: 90 93 f6 13 sts 0x13F6, r25 ; 0x8013f6 cntr[1] /= wy; 33966: a3 01 movw r20, r6 33968: 92 01 movw r18, r4 3396a: c5 01 movw r24, r10 3396c: b4 01 movw r22, r8 3396e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33972: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 33976: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 3397a: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 3397e: 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]; 33982: 40 90 e3 13 lds r4, 0x13E3 ; 0x8013e3 33986: 50 90 e4 13 lds r5, 0x13E4 ; 0x8013e4 3398a: 60 90 e5 13 lds r6, 0x13E5 ; 0x8013e5 3398e: 70 90 e6 13 lds r7, 0x13E6 ; 0x8013e6 33992: c0 90 ef 13 lds r12, 0x13EF ; 0x8013ef 33996: d0 90 f0 13 lds r13, 0x13F0 ; 0x8013f0 3399a: e0 90 f1 13 lds r14, 0x13F1 ; 0x8013f1 3399e: f0 90 f2 13 lds r15, 0x13F2 ; 0x8013f2 339a2: 20 91 e7 13 lds r18, 0x13E7 ; 0x8013e7 339a6: 30 91 e8 13 lds r19, 0x13E8 ; 0x8013e8 339aa: 40 91 e9 13 lds r20, 0x13E9 ; 0x8013e9 339ae: 50 91 ea 13 lds r21, 0x13EA ; 0x8013ea 339b2: a2 96 adiw r28, 0x22 ; 34 339b4: 2c af std Y+60, r18 ; 0x3c 339b6: 3d af std Y+61, r19 ; 0x3d 339b8: 4e af std Y+62, r20 ; 0x3e 339ba: 5f af std Y+63, r21 ; 0x3f 339bc: a2 97 sbiw r28, 0x22 ; 34 339be: 80 91 eb 13 lds r24, 0x13EB ; 0x8013eb 339c2: 90 91 ec 13 lds r25, 0x13EC ; 0x8013ec 339c6: a0 91 ed 13 lds r26, 0x13ED ; 0x8013ed 339ca: b0 91 ee 13 lds r27, 0x13EE ; 0x8013ee 339ce: a6 96 adiw r28, 0x26 ; 38 339d0: 8c af std Y+60, r24 ; 0x3c 339d2: 9d af std Y+61, r25 ; 0x3d 339d4: ae af std Y+62, r26 ; 0x3e 339d6: bf af std Y+63, r27 ; 0x3f 339d8: a6 97 sbiw r28, 0x26 ; 38 339da: a7 01 movw r20, r14 339dc: 96 01 movw r18, r12 339de: c3 01 movw r24, r6 339e0: b2 01 movw r22, r4 339e2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 339e6: 4b 01 movw r8, r22 339e8: 5c 01 movw r10, r24 339ea: a6 96 adiw r28, 0x26 ; 38 339ec: 2c ad ldd r18, Y+60 ; 0x3c 339ee: 3d ad ldd r19, Y+61 ; 0x3d 339f0: 4e ad ldd r20, Y+62 ; 0x3e 339f2: 5f ad ldd r21, Y+63 ; 0x3f 339f4: a6 97 sbiw r28, 0x26 ; 38 339f6: a2 96 adiw r28, 0x22 ; 34 339f8: 6c ad ldd r22, Y+60 ; 0x3c 339fa: 7d ad ldd r23, Y+61 ; 0x3d 339fc: 8e ad ldd r24, Y+62 ; 0x3e 339fe: 9f ad ldd r25, Y+63 ; 0x3f 33a00: a2 97 sbiw r28, 0x22 ; 34 33a02: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33a06: 9b 01 movw r18, r22 33a08: ac 01 movw r20, r24 33a0a: c5 01 movw r24, r10 33a0c: b4 01 movw r22, r8 33a0e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 33a12: 4b 01 movw r8, r22 33a14: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 33a16: ac 01 movw r20, r24 33a18: 9b 01 movw r18, r22 33a1a: c7 01 movw r24, r14 33a1c: b6 01 movw r22, r12 33a1e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33a22: 6b 01 movw r12, r22 33a24: 7c 01 movw r14, r24 33a26: a6 96 adiw r28, 0x26 ; 38 33a28: 6c ad ldd r22, Y+60 ; 0x3c 33a2a: 7d ad ldd r23, Y+61 ; 0x3d 33a2c: 8e ad ldd r24, Y+62 ; 0x3e 33a2e: 9f ad ldd r25, Y+63 ; 0x3f 33a30: a6 97 sbiw r28, 0x26 ; 38 33a32: 90 58 subi r25, 0x80 ; 128 33a34: a5 01 movw r20, r10 33a36: 94 01 movw r18, r8 33a38: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33a3c: a6 96 adiw r28, 0x26 ; 38 33a3e: 6c af std Y+60, r22 ; 0x3c 33a40: 7d af std Y+61, r23 ; 0x3d 33a42: 8e af std Y+62, r24 ; 0x3e 33a44: 9f af std Y+63, r25 ; 0x3f 33a46: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 33a48: a2 96 adiw r28, 0x22 ; 34 33a4a: 6c ad ldd r22, Y+60 ; 0x3c 33a4c: 7d ad ldd r23, Y+61 ; 0x3d 33a4e: 8e ad ldd r24, Y+62 ; 0x3e 33a50: 9f ad ldd r25, Y+63 ; 0x3f 33a52: a2 97 sbiw r28, 0x22 ; 34 33a54: 90 58 subi r25, 0x80 ; 128 33a56: a5 01 movw r20, r10 33a58: 94 01 movw r18, r8 33a5a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33a5e: aa 96 adiw r28, 0x2a ; 42 33a60: 6c af std Y+60, r22 ; 0x3c 33a62: 7d af std Y+61, r23 ; 0x3d 33a64: 8e af std Y+62, r24 ; 0x3e 33a66: 9f af std Y+63, r25 ; 0x3f 33a68: aa 97 sbiw r28, 0x2a ; 42 33a6a: a5 01 movw r20, r10 33a6c: 94 01 movw r18, r8 33a6e: c3 01 movw r24, r6 33a70: b2 01 movw r22, r4 33a72: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 33a76: 4b 01 movw r8, r22 33a78: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 33a7a: 40 90 f3 13 lds r4, 0x13F3 ; 0x8013f3 33a7e: 50 90 f4 13 lds r5, 0x13F4 ; 0x8013f4 33a82: 60 90 f5 13 lds r6, 0x13F5 ; 0x8013f5 33a86: 70 90 f6 13 lds r7, 0x13F6 ; 0x8013f6 33a8a: 20 91 f7 13 lds r18, 0x13F7 ; 0x8013f7 33a8e: 30 91 f8 13 lds r19, 0x13F8 ; 0x8013f8 33a92: 40 91 f9 13 lds r20, 0x13F9 ; 0x8013f9 33a96: 50 91 fa 13 lds r21, 0x13FA ; 0x8013fa 33a9a: a2 96 adiw r28, 0x22 ; 34 33a9c: 2c af std Y+60, r18 ; 0x3c 33a9e: 3d af std Y+61, r19 ; 0x3d 33aa0: 4e af std Y+62, r20 ; 0x3e 33aa2: 5f af std Y+63, r21 ; 0x3f 33aa4: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 33aa6: c0 92 e3 13 sts 0x13E3, r12 ; 0x8013e3 33aaa: d0 92 e4 13 sts 0x13E4, r13 ; 0x8013e4 33aae: e0 92 e5 13 sts 0x13E5, r14 ; 0x8013e5 33ab2: f0 92 e6 13 sts 0x13E6, r15 ; 0x8013e6 vec_x[1] = Ainv[1][0]; 33ab6: aa 96 adiw r28, 0x2a ; 42 33ab8: 8c ad ldd r24, Y+60 ; 0x3c 33aba: 9d ad ldd r25, Y+61 ; 0x3d 33abc: ae ad ldd r26, Y+62 ; 0x3e 33abe: bf ad ldd r27, Y+63 ; 0x3f 33ac0: aa 97 sbiw r28, 0x2a ; 42 33ac2: 80 93 e7 13 sts 0x13E7, r24 ; 0x8013e7 33ac6: 90 93 e8 13 sts 0x13E8, r25 ; 0x8013e8 33aca: a0 93 e9 13 sts 0x13E9, r26 ; 0x8013e9 33ace: b0 93 ea 13 sts 0x13EA, r27 ; 0x8013ea vec_y[0] = Ainv[0][1]; 33ad2: a6 96 adiw r28, 0x26 ; 38 33ad4: 2c ad ldd r18, Y+60 ; 0x3c 33ad6: 3d ad ldd r19, Y+61 ; 0x3d 33ad8: 4e ad ldd r20, Y+62 ; 0x3e 33ada: 5f ad ldd r21, Y+63 ; 0x3f 33adc: a6 97 sbiw r28, 0x26 ; 38 33ade: 20 93 eb 13 sts 0x13EB, r18 ; 0x8013eb 33ae2: 30 93 ec 13 sts 0x13EC, r19 ; 0x8013ec 33ae6: 40 93 ed 13 sts 0x13ED, r20 ; 0x8013ed 33aea: 50 93 ee 13 sts 0x13EE, r21 ; 0x8013ee vec_y[1] = Ainv[1][1]; 33aee: 80 92 ef 13 sts 0x13EF, r8 ; 0x8013ef 33af2: 90 92 f0 13 sts 0x13F0, r9 ; 0x8013f0 33af6: a0 92 f1 13 sts 0x13F1, r10 ; 0x8013f1 33afa: 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], 33afe: c7 01 movw r24, r14 33b00: b6 01 movw r22, r12 33b02: 90 58 subi r25, 0x80 ; 128 33b04: a3 01 movw r20, r6 33b06: 92 01 movw r18, r4 33b08: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33b0c: 6b 01 movw r12, r22 33b0e: 7c 01 movw r14, r24 33b10: a2 96 adiw r28, 0x22 ; 34 33b12: 2c ad ldd r18, Y+60 ; 0x3c 33b14: 3d ad ldd r19, Y+61 ; 0x3d 33b16: 4e ad ldd r20, Y+62 ; 0x3e 33b18: 5f ad ldd r21, Y+63 ; 0x3f 33b1a: a2 97 sbiw r28, 0x22 ; 34 33b1c: a6 96 adiw r28, 0x26 ; 38 33b1e: 6c ad ldd r22, Y+60 ; 0x3c 33b20: 7d ad ldd r23, Y+61 ; 0x3d 33b22: 8e ad ldd r24, Y+62 ; 0x3e 33b24: 9f ad ldd r25, Y+63 ; 0x3f 33b26: a6 97 sbiw r28, 0x26 ; 38 33b28: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33b2c: 9b 01 movw r18, r22 33b2e: ac 01 movw r20, r24 33b30: c7 01 movw r24, r14 33b32: b6 01 movw r22, r12 33b34: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__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]; 33b38: 60 93 f3 13 sts 0x13F3, r22 ; 0x8013f3 33b3c: 70 93 f4 13 sts 0x13F4, r23 ; 0x8013f4 33b40: 80 93 f5 13 sts 0x13F5, r24 ; 0x8013f5 33b44: 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] 33b48: aa 96 adiw r28, 0x2a ; 42 33b4a: 6c ad ldd r22, Y+60 ; 0x3c 33b4c: 7d ad ldd r23, Y+61 ; 0x3d 33b4e: 8e ad ldd r24, Y+62 ; 0x3e 33b50: 9f ad ldd r25, Y+63 ; 0x3f 33b52: aa 97 sbiw r28, 0x2a ; 42 33b54: 90 58 subi r25, 0x80 ; 128 33b56: a3 01 movw r20, r6 33b58: 92 01 movw r18, r4 33b5a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33b5e: 6b 01 movw r12, r22 33b60: 7c 01 movw r14, r24 33b62: a2 96 adiw r28, 0x22 ; 34 33b64: 2c ad ldd r18, Y+60 ; 0x3c 33b66: 3d ad ldd r19, Y+61 ; 0x3d 33b68: 4e ad ldd r20, Y+62 ; 0x3e 33b6a: 5f ad ldd r21, Y+63 ; 0x3f 33b6c: a2 97 sbiw r28, 0x22 ; 34 33b6e: c5 01 movw r24, r10 33b70: b4 01 movw r22, r8 33b72: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33b76: 9b 01 movw r18, r22 33b78: ac 01 movw r20, r24 33b7a: c7 01 movw r24, r14 33b7c: b6 01 movw r22, r12 33b7e: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__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]; 33b82: 60 93 f7 13 sts 0x13F7, r22 ; 0x8013f7 33b86: 70 93 f8 13 sts 0x13F8, r23 ; 0x8013f8 33b8a: 80 93 f9 13 sts 0x13F9, r24 ; 0x8013f9 33b8e: 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 33b92: 90 e0 ldi r25, 0x00 ; 0 33b94: 80 e0 ldi r24, 0x00 ; 0 33b96: 0e 94 eb 8c call 0x119d6 ; 0x119d6 if (result >= 0) { 33b9a: 17 fd sbrc r17, 7 33b9c: d5 c0 rjmp .+426 ; 0x33d48 DBG(_n("Calibration success.\n")); 33b9e: 80 e3 ldi r24, 0x30 ; 48 33ba0: 90 e7 ldi r25, 0x70 ; 112 33ba2: 9f 93 push r25 33ba4: 8f 93 push r24 33ba6: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca world2machine_update(vec_x, vec_y, cntr); 33baa: 43 ef ldi r20, 0xF3 ; 243 33bac: 53 e1 ldi r21, 0x13 ; 19 33bae: 6b ee ldi r22, 0xEB ; 235 33bb0: 73 e1 ldi r23, 0x13 ; 19 33bb2: 83 ee ldi r24, 0xE3 ; 227 33bb4: 93 e1 ldi r25, 0x13 ; 19 33bb6: 0f 94 bb cc call 0x39976 ; 0x39976 #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); 33bba: 48 e0 ldi r20, 0x08 ; 8 33bbc: 50 e0 ldi r21, 0x00 ; 0 33bbe: 65 ee ldi r22, 0xE5 ; 229 33bc0: 7f e0 ldi r23, 0x0F ; 15 33bc2: 83 ef ldi r24, 0xF3 ; 243 33bc4: 93 e1 ldi r25, 0x13 ; 19 33bc6: 0f 94 37 dc call 0x3b86e ; 0x3b86e 33bca: 48 e0 ldi r20, 0x08 ; 8 33bcc: 50 e0 ldi r21, 0x00 ; 0 33bce: 6d ed ldi r22, 0xDD ; 221 33bd0: 7f e0 ldi r23, 0x0F ; 15 33bd2: 83 ee ldi r24, 0xE3 ; 227 33bd4: 93 e1 ldi r25, 0x13 ; 19 33bd6: 0f 94 37 dc call 0x3b86e ; 0x3b86e 33bda: 48 e0 ldi r20, 0x08 ; 8 33bdc: 50 e0 ldi r21, 0x00 ; 0 33bde: 65 ed ldi r22, 0xD5 ; 213 33be0: 7f e0 ldi r23, 0x0F ; 15 33be2: 8b ee ldi r24, 0xEB ; 235 33be4: 93 e1 ldi r25, 0x13 ; 19 33be6: 0f 94 37 dc call 0x3b86e ; 0x3b86e 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(); 33bea: 0f 94 40 cc call 0x39880 ; 0x39880 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 33bee: 0f 90 pop r0 33bf0: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 33bf2: c7 55 subi r28, 0x57 ; 87 33bf4: df 4f sbci r29, 0xFF ; 255 33bf6: 88 81 ld r24, Y 33bf8: 99 81 ldd r25, Y+1 ; 0x01 33bfa: c9 5a subi r28, 0xA9 ; 169 33bfc: d0 40 sbci r29, 0x00 ; 0 33bfe: 0e 94 d5 66 call 0xcdaa ; 0xcdaa // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 33c02: 80 e0 ldi r24, 0x00 ; 0 33c04: 90 e0 ldi r25, 0x00 ; 0 33c06: a0 ea ldi r26, 0xA0 ; 160 33c08: b0 e4 ldi r27, 0x40 ; 64 33c0a: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 33c0e: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 33c12: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 33c16: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 33c1a: 60 e0 ldi r22, 0x00 ; 0 33c1c: 70 e0 ldi r23, 0x00 ; 0 33c1e: 80 ea ldi r24, 0xA0 ; 160 33c20: 91 e4 ldi r25, 0x41 ; 65 33c22: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 33c26: 0f 94 ef 42 call 0x285de ; 0x285de //#ifndef NEW_XYZCAL if (result >= 0) 33c2a: 17 fd sbrc r17, 7 33c2c: 22 c0 rjmp .+68 ; 0x33c72 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; 33c2e: 10 92 9a 06 sts 0x069A, r1 ; 0x80069a 33c32: 10 92 9b 06 sts 0x069B, r1 ; 0x80069b 33c36: 10 92 9c 06 sts 0x069C, r1 ; 0x80069c 33c3a: 10 92 9d 06 sts 0x069D, r1 ; 0x80069d destination[Z_AXIS] = 150.F; 33c3e: 80 e0 ldi r24, 0x00 ; 0 33c40: 90 e0 ldi r25, 0x00 ; 0 33c42: a6 e1 ldi r26, 0x16 ; 22 33c44: b3 e4 ldi r27, 0x43 ; 67 33c46: 80 93 7c 06 sts 0x067C, r24 ; 0x80067c 33c4a: 90 93 7d 06 sts 0x067D, r25 ; 0x80067d 33c4e: a0 93 7e 06 sts 0x067E, r26 ; 0x80067e 33c52: b0 93 7f 06 sts 0x067F, r27 ; 0x80067f plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 33c56: 65 e5 ldi r22, 0x55 ; 85 33c58: 75 e5 ldi r23, 0x55 ; 85 33c5a: 85 e5 ldi r24, 0x55 ; 85 33c5c: 91 e4 ldi r25, 0x41 ; 65 33c5e: 0f 94 1d c0 call 0x3803a ; 0x3803a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 33c62: 8d e1 ldi r24, 0x1D ; 29 33c64: 9a e5 ldi r25, 0x5A ; 90 33c66: 0e 94 b3 72 call 0xe566 ; 0xe566 33c6a: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 // 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()) 33c6e: 0f 94 4f ca call 0x3949e ; 0x3949e st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 33c72: 81 e0 ldi r24, 0x01 ; 1 33c74: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_update(2); 33c78: 82 e0 ldi r24, 0x02 ; 2 33c7a: 0e 94 ae 6e call 0xdd5c ; 0xdd5c 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)); 33c7e: 8e ed ldi r24, 0xDE ; 222 33c80: 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) { 33c82: 1f 3f cpi r17, 0xFF ; 255 33c84: 99 f0 breq .+38 ; 0x33cac 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) { 33c86: 1e 3f cpi r17, 0xFE ; 254 33c88: 09 f0 breq .+2 ; 0x33c8c 33c8a: 73 c0 rjmp .+230 ; 0x33d72 if (point_too_far_mask == 0) 33c8c: af 96 adiw r28, 0x2f ; 47 33c8e: 4f ad ldd r20, Y+63 ; 0x3f 33c90: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33c92: 89 ea ldi r24, 0xA9 ; 169 33c94: 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) 33c96: 44 23 and r20, r20 33c98: 49 f0 breq .+18 ; 0x33cac msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 33c9a: af 96 adiw r28, 0x2f ; 47 33c9c: 5f ad ldd r21, Y+63 ; 0x3f 33c9e: 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); 33ca0: 87 e6 ldi r24, 0x67 ; 103 33ca2: 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) 33ca4: 52 30 cpi r21, 0x02 ; 2 33ca6: 11 f0 breq .+4 ; 0x33cac // 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); 33ca8: 80 e2 ldi r24, 0x20 ; 32 33caa: 99 e5 ldi r25, 0x59 ; 89 33cac: 0e 94 b3 72 call 0xe566 ; 0xe566 33cb0: 0d 94 a8 92 jmp 0x32550 ; 0x32550 (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]) : 33cb4: f2 01 movw r30, r4 33cb6: 25 81 ldd r18, Z+5 ; 0x05 33cb8: 36 81 ldd r19, Z+6 ; 0x06 33cba: 47 81 ldd r20, Z+7 ; 0x07 33cbc: 50 85 ldd r21, Z+8 ; 0x08 33cbe: c3 58 subi r28, 0x83 ; 131 33cc0: df 4f sbci r29, 0xFF ; 255 33cc2: 68 81 ld r22, Y 33cc4: 79 81 ldd r23, Y+1 ; 0x01 33cc6: 8a 81 ldd r24, Y+2 ; 0x02 33cc8: 9b 81 ldd r25, Y+3 ; 0x03 33cca: cd 57 subi r28, 0x7D ; 125 33ccc: d0 40 sbci r29, 0x00 ; 0 33cce: 0d 94 94 95 jmp 0x32b28 ; 0x32b28 // 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]) : 33cd2: f2 01 movw r30, r4 33cd4: 25 81 ldd r18, Z+5 ; 0x05 33cd6: 36 81 ldd r19, Z+6 ; 0x06 33cd8: 47 81 ldd r20, Z+7 ; 0x07 33cda: 50 85 ldd r21, Z+8 ; 0x08 33cdc: ed 96 adiw r28, 0x3d ; 61 33cde: 6c ad ldd r22, Y+60 ; 0x3c 33ce0: 7d ad ldd r23, Y+61 ; 0x3d 33ce2: 8e ad ldd r24, Y+62 ; 0x3e 33ce4: 9f ad ldd r25, Y+63 ; 0x3f 33ce6: ed 97 sbiw r28, 0x3d ; 61 33ce8: b8 c0 rjmp .+368 ; 0x33e5a (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33cea: f2 01 movw r30, r4 33cec: 25 81 ldd r18, Z+5 ; 0x05 33cee: 36 81 ldd r19, Z+6 ; 0x06 33cf0: 47 81 ldd r20, Z+7 ; 0x07 33cf2: 50 85 ldd r21, Z+8 ; 0x08 33cf4: ed 96 adiw r28, 0x3d ; 61 33cf6: 6c ad ldd r22, Y+60 ; 0x3c 33cf8: 7d ad ldd r23, Y+61 ; 0x3d 33cfa: 8e ad ldd r24, Y+62 ; 0x3e 33cfc: 9f ad ldd r25, Y+63 ; 0x3f 33cfe: ed 97 sbiw r28, 0x3d ; 61 33d00: c6 c0 rjmp .+396 ; 0x33e8e 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]) : 33d02: a3 01 movw r20, r6 33d04: 92 01 movw r18, r4 33d06: c3 58 subi r28, 0x83 ; 131 33d08: df 4f sbci r29, 0xFF ; 255 33d0a: 68 81 ld r22, Y 33d0c: 79 81 ldd r23, Y+1 ; 0x01 33d0e: 8a 81 ldd r24, Y+2 ; 0x02 33d10: 9b 81 ldd r25, Y+3 ; 0x03 33d12: cd 57 subi r28, 0x7D ; 125 33d14: d0 40 sbci r29, 0x00 ; 0 33d16: 0d 94 fc 95 jmp 0x32bf8 ; 0x32bf8 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 33d1a: 81 2c mov r8, r1 33d1c: 91 2c mov r9, r1 33d1e: 20 e8 ldi r18, 0x80 ; 128 33d20: a2 2e mov r10, r18 33d22: 2f e3 ldi r18, 0x3F ; 63 33d24: b2 2e mov r11, r18 33d26: 0d 94 00 96 jmp 0x32c00 ; 0x32c00 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 33d2a: c1 2c mov r12, r1 33d2c: d1 2c mov r13, r1 33d2e: 76 01 movw r14, r12 33d30: 0d 94 77 96 jmp 0x32cee ; 0x32cee ((r == 1) ? 1.f : 33d34: c1 2c mov r12, r1 33d36: d1 2c mov r13, r1 33d38: 90 e8 ldi r25, 0x80 ; 128 33d3a: e9 2e mov r14, r25 33d3c: 9f e3 ldi r25, 0x3F ; 63 33d3e: f9 2e mov r15, r25 33d40: 0d 94 77 96 jmp 0x32cee ; 0x32cee 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; 33d44: 12 e0 ldi r17, 0x02 ; 2 33d46: a7 cb rjmp .-2226 ; 0x33496 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33d48: 1e 3f cpi r17, 0xFE ; 254 33d4a: 89 f4 brne .+34 ; 0x33d6e 33d4c: af 96 adiw r28, 0x2f ; 47 33d4e: 3f ad ldd r19, Y+63 ; 0x3f 33d50: af 97 sbiw r28, 0x2f ; 47 33d52: 32 30 cpi r19, 0x02 ; 2 33d54: 09 f0 breq .+2 ; 0x33d58 33d56: 4d cf rjmp .-358 ; 0x33bf2 DBG(_n("Fitting failed => calibration failed.\n")); 33d58: 89 e0 ldi r24, 0x09 ; 9 33d5a: 90 e7 ldi r25, 0x70 ; 112 33d5c: 9f 93 push r25 33d5e: 8f 93 push r24 33d60: 0f 94 e5 da call 0x3b5ca ; 0x3b5ca 33d64: 44 cf rjmp .-376 ; 0x33bee // 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; 33d66: af 96 adiw r28, 0x2f ; 47 33d68: 1f ae std Y+63, r1 ; 0x3f 33d6a: af 97 sbiw r28, 0x2f ; 47 33d6c: 42 cf rjmp .-380 ; 0x33bf2 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 33d6e: 1f ef ldi r17, 0xFF ; 255 33d70: 40 cf rjmp .-384 ; 0x33bf2 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) { 33d72: af 96 adiw r28, 0x2f ; 47 33d74: 6f ad ldd r22, Y+63 ; 0x3f 33d76: af 97 sbiw r28, 0x2f ; 47 33d78: 61 11 cpse r22, r1 33d7a: 13 c0 rjmp .+38 ; 0x33da2 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); 33d7c: 85 e0 ldi r24, 0x05 ; 5 33d7e: 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) { 33d80: 11 30 cpi r17, 0x01 ; 1 33d82: 51 f0 breq .+20 ; 0x33d98 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); 33d84: 82 ec ldi r24, 0xC2 ; 194 33d86: 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) { 33d88: 12 30 cpi r17, 0x02 ; 2 33d8a: 31 f0 breq .+12 ; 0x33d98 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 33d8c: 89 ea ldi r24, 0xA9 ; 169 33d8e: 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) { 33d90: 11 11 cpse r17, r1 33d92: 02 c0 rjmp .+4 ; 0x33d98 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); 33d94: 8a e4 ldi r24, 0x4A ; 74 33d96: 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); 33d98: 0e 94 b3 72 call 0xe566 ; 0xe566 break; } lcd_show_fullscreen_message_and_wait_P(msg); 33d9c: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 33da0: 0d c0 rjmp .+26 ; 0x33dbc // 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) 33da2: af 96 adiw r28, 0x2f ; 47 33da4: 8f ad ldd r24, Y+63 ; 0x3f 33da6: af 97 sbiw r28, 0x2f ; 47 33da8: 82 30 cpi r24, 0x02 ; 2 33daa: f1 f4 brne .+60 ; 0x33de8 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 33dac: 89 ed ldi r24, 0xD9 ; 217 33dae: 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); 33db0: 0e 94 b3 72 call 0xe566 ; 0xe566 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); 33db4: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 } if (point_too_far_mask == 0 || result > 0) { 33db8: 11 16 cp r1, r17 33dba: 04 f3 brlt .-64 ; 0x33d7c //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 33dbc: 1f 3f cpi r17, 0xFF ; 255 33dbe: 11 f4 brne .+4 ; 0x33dc4 33dc0: 0d 94 4a 8e jmp 0x31c94 ; 0x31c94 { // 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); 33dc4: 86 e0 ldi r24, 0x06 ; 6 33dc6: 0e 94 99 ee call 0x1dd32 ; 0x1dd32 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 33dca: 8f e5 ldi r24, 0x5F ; 95 33dcc: 9f e0 ldi r25, 0x0F ; 15 33dce: 0f 94 23 dc call 0x3b846 ; 0x3b846 33dd2: 81 11 cpse r24, r1 33dd4: 0d 94 c2 92 jmp 0x32584 ; 0x32584 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 33dd8: 84 e4 ldi r24, 0x44 ; 68 33dda: 9a e5 ldi r25, 0x5A ; 90 33ddc: 0e 94 b3 72 call 0xe566 ; 0xe566 33de0: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 33de4: 0d 94 c2 92 jmp 0x32584 ; 0x32584 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); 33de8: 8d e8 ldi r24, 0x8D ; 141 33dea: 98 e5 ldi r25, 0x58 ; 88 33dec: e1 cf rjmp .-62 ; 0x33db0 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)) 33dee: 89 81 ldd r24, Y+1 ; 0x01 33df0: 9a 81 ldd r25, Y+2 ; 0x02 33df2: 80 37 cpi r24, 0x70 ; 112 33df4: 98 40 sbci r25, 0x08 ; 8 33df6: 10 f0 brcs .+4 ; 0x33dfc 33df8: 0d 94 01 93 jmp 0x32602 ; 0x32602 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 33dfc: ae 01 movw r20, r28 33dfe: 4f 5f subi r20, 0xFF ; 255 33e00: 5f 4f sbci r21, 0xFF ; 255 33e02: 7a 01 movw r14, r20 33e04: 04 eb ldi r16, 0xB4 ; 180 33e06: 10 e0 ldi r17, 0x00 ; 0 33e08: 24 e8 ldi r18, 0x84 ; 132 33e0a: 33 e0 ldi r19, 0x03 ; 3 33e0c: a6 01 movw r20, r12 33e0e: 48 5c subi r20, 0xC8 ; 200 33e10: 51 09 sbc r21, r1 33e12: 69 2d mov r22, r9 33e14: 78 2d mov r23, r8 33e16: 8b 2d mov r24, r11 33e18: 9a 2d mov r25, r10 33e1a: 0f 94 82 6e call 0x2dd04 ; 0x2dd04 33e1e: 88 23 and r24, r24 33e20: 11 f4 brne .+4 ; 0x33e26 33e22: 0d 94 01 93 jmp 0x32602 ; 0x32602 ad += 1440; 33e26: 89 81 ldd r24, Y+1 ; 0x01 33e28: 9a 81 ldd r25, Y+2 ; 0x02 33e2a: 80 56 subi r24, 0x60 ; 96 33e2c: 9a 4f sbci r25, 0xFA ; 250 33e2e: 0d 94 24 90 jmp 0x32048 ; 0x32048 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) { 33e32: 00 23 and r16, r16 33e34: 11 f4 brne .+4 ; 0x33e3a 33e36: 0d 94 a7 95 jmp 0x32b4e ; 0x32b4e float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 33e3a: 02 30 cpi r16, 0x02 ; 2 33e3c: 09 f0 breq .+2 ; 0x33e40 33e3e: 49 cf rjmp .-366 ; 0x33cd2 33e40: d2 01 movw r26, r4 33e42: 11 96 adiw r26, 0x01 ; 1 33e44: 2d 91 ld r18, X+ 33e46: 3d 91 ld r19, X+ 33e48: 4d 91 ld r20, X+ 33e4a: 5c 91 ld r21, X 33e4c: 14 97 sbiw r26, 0x04 ; 4 33e4e: 6e 96 adiw r28, 0x1e ; 30 33e50: 6c ad ldd r22, Y+60 ; 0x3c 33e52: 7d ad ldd r23, Y+61 ; 0x3d 33e54: 8e ad ldd r24, Y+62 ; 0x3e 33e56: 9f ad ldd r25, Y+63 ; 0x3f 33e58: 6e 97 sbiw r28, 0x1e ; 30 33e5a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33e5e: 4b 01 movw r8, r22 33e60: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 33e62: 60 e0 ldi r22, 0x00 ; 0 33e64: 70 e0 ldi r23, 0x00 ; 0 33e66: 80 e8 ldi r24, 0x80 ; 128 33e68: 9f e3 ldi r25, 0x3F ; 63 33e6a: 11 30 cpi r17, 0x01 ; 1 33e6c: 91 f0 breq .+36 ; 0x33e92 ((c == 2) ? ( c1 * measured_pts[2 * i]) : 33e6e: 12 30 cpi r17, 0x02 ; 2 33e70: 09 f0 breq .+2 ; 0x33e74 33e72: 3b cf rjmp .-394 ; 0x33cea 33e74: d2 01 movw r26, r4 33e76: 11 96 adiw r26, 0x01 ; 1 33e78: 2d 91 ld r18, X+ 33e7a: 3d 91 ld r19, X+ 33e7c: 4d 91 ld r20, X+ 33e7e: 5c 91 ld r21, X 33e80: 14 97 sbiw r26, 0x04 ; 4 33e82: 6e 96 adiw r28, 0x1e ; 30 33e84: 6c ad ldd r22, Y+60 ; 0x3c 33e86: 7d ad ldd r23, Y+61 ; 0x3d 33e88: 8e ad ldd r24, Y+62 ; 0x3e 33e8a: 9f ad ldd r25, Y+63 ; 0x3f 33e8c: 6e 97 sbiw r28, 0x1e ; 30 33e8e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 33e92: 9b 01 movw r18, r22 33e94: ac 01 movw r20, r24 33e96: c5 01 movw r24, r10 33e98: b4 01 movw r22, r8 33e9a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 33e9e: 9b 01 movw r18, r22 33ea0: ac 01 movw r20, r24 33ea2: c7 01 movw r24, r14 33ea4: b6 01 movw r22, r12 33ea6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 33eaa: 6b 01 movw r12, r22 33eac: 7c 01 movw r14, r24 33eae: 0d 94 a7 95 jmp 0x32b4e ; 0x32b4e // 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 : 33eb2: 81 2c mov r8, r1 33eb4: 91 2c mov r9, r1 33eb6: 50 e8 ldi r21, 0x80 ; 128 33eb8: a5 2e mov r10, r21 33eba: 5f e3 ldi r21, 0x3F ; 63 33ebc: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 33ebe: 11 11 cpse r17, r1 33ec0: 0d 94 81 95 jmp 0x32b02 ; 0x32b02 ((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; 33ec4: 20 e0 ldi r18, 0x00 ; 0 33ec6: 30 e0 ldi r19, 0x00 ; 0 33ec8: 40 e8 ldi r20, 0x80 ; 128 33eca: 5f e3 ldi r21, 0x3F ; 63 33ecc: ea cf rjmp .-44 ; 0x33ea2 // 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 : 33ece: 81 2c mov r8, r1 33ed0: 91 2c mov r9, r1 33ed2: 40 e8 ldi r20, 0x80 ; 128 33ed4: a4 2e mov r10, r20 33ed6: 4f e3 ldi r20, 0x3F ; 63 33ed8: 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) { 33eda: 11 11 cpse r17, r1 33edc: c2 cf rjmp .-124 ; 0x33e62 33ede: 0d 94 a7 95 jmp 0x32b4e ; 0x32b4e 33ee2: 11 11 cpse r17, r1 33ee4: aa cf rjmp .-172 ; 0x33e3a 33ee6: 0d 94 a7 95 jmp 0x32b4e ; 0x32b4e 00033eea : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 33eea: 1f 93 push r17 33eec: cf 93 push r28 33eee: df 93 push r29 33ef0: 18 2f mov r17, r24 33ef2: eb 01 movw r28, r22 33ef4: 80 e0 ldi r24, 0x00 ; 0 33ef6: 0f 94 0e 4e call 0x29c1c ; 0x29c1c { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 33efa: 80 e0 ldi r24, 0x00 ; 0 33efc: 0e 94 50 8a call 0x114a0 ; 0x114a0 target_temperature[0] = 0; 33f00: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 33f04: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 target_temperature_bed = 0; 33f08: 10 92 73 06 sts 0x0673, r1 ; 0x800673 33f0c: 10 92 72 06 sts 0x0672, r1 ; 0x800672 manage_heater(); 33f10: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(); 33f14: 80 e0 ldi r24, 0x00 ; 0 33f16: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_clear(); 33f1a: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 33f1e: 80 eb ldi r24, 0xB0 ; 176 33f20: 97 e5 ldi r25, 0x57 ; 87 33f22: 0e 94 b3 72 call 0xe566 ; 0xe566 33f26: ac 01 movw r20, r24 33f28: 60 e0 ldi r22, 0x00 ; 0 33f2a: 80 e0 ldi r24, 0x00 ; 0 33f2c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 33f30: 80 ea ldi r24, 0xA0 ; 160 33f32: 97 e5 ldi r25, 0x57 ; 87 33f34: 0e 94 b3 72 call 0xe566 ; 0xe566 33f38: ac 01 movw r20, r24 33f3a: 61 e0 ldi r22, 0x01 ; 1 33f3c: 80 e0 ldi r24, 0x00 ; 0 33f3e: 0e 94 fb 6e call 0xddf6 ; 0xddf6 switch (testError) 33f42: 11 50 subi r17, 0x01 ; 1 33f44: 1a 30 cpi r17, 0x0A ; 10 33f46: 90 f4 brcc .+36 ; 0x33f6c 33f48: e1 2f mov r30, r17 33f4a: f0 e0 ldi r31, 0x00 ; 0 33f4c: 88 27 eor r24, r24 33f4e: e4 55 subi r30, 0x54 ; 84 33f50: f0 46 sbci r31, 0x60 ; 96 33f52: 8e 4f sbci r24, 0xFE ; 254 33f54: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 33f58: 74 3a cpi r23, 0xA4 ; 164 33f5a: 44 3a cpi r20, 0xA4 ; 164 33f5c: 58 3a cpi r21, 0xA8 ; 168 33f5e: d8 3a cpi r29, 0xA8 ; 168 33f60: 3c 3a cpi r19, 0xAC ; 172 33f62: 6c 39 cpi r22, 0x9C ; 156 33f64: 34 39 cpi r19, 0x94 ; 148 33f66: 84 3a cpi r24, 0xA4 ; 164 33f68: ba 39 cpi r27, 0x9A ; 154 33f6a: b8 39 cpi r27, 0x98 ; 152 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 33f6c: 8c e8 ldi r24, 0x8C ; 140 33f6e: 97 e5 ldi r25, 0x57 ; 87 33f70: 0e 94 b3 72 call 0xe566 ; 0xe566 33f74: ac 01 movw r20, r24 33f76: 62 e0 ldi r22, 0x02 ; 2 33f78: 80 e0 ldi r24, 0x00 ; 0 33f7a: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 33f7e: 8c e7 ldi r24, 0x7C ; 124 33f80: 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)); 33f82: 0e 94 b3 72 call 0xe566 ; 0xe566 33f86: ac 01 movw r20, r24 33f88: 63 e0 ldi r22, 0x03 ; 3 33f8a: 80 e0 ldi r24, 0x00 ; 0 33f8c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 33f90: 45 c0 rjmp .+138 ; 0x3401c 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)); 33f92: 8f e6 ldi r24, 0x6F ; 111 33f94: 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)); 33f96: 0e 94 b3 72 call 0xe566 ; 0xe566 33f9a: ac 01 movw r20, r24 33f9c: 62 e0 ldi r22, 0x02 ; 2 33f9e: 80 e0 ldi r24, 0x00 ; 0 33fa0: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33fa4: 80 e6 ldi r24, 0x60 ; 96 33fa6: 97 e5 ldi r25, 0x57 ; 87 33fa8: ec cf rjmp .-40 ; 0x33f82 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)); 33faa: 85 e5 ldi r24, 0x55 ; 85 33fac: 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)); 33fae: 0e 94 b3 72 call 0xe566 ; 0xe566 33fb2: ac 01 movw r20, r24 33fb4: 62 e0 ldi r22, 0x02 ; 2 33fb6: 80 e0 ldi r24, 0x00 ; 0 33fb8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 33fbc: 80 e6 ldi r24, 0x60 ; 96 33fbe: 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)); 33fc0: 0e 94 b3 72 call 0xe566 ; 0xe566 33fc4: ac 01 movw r20, r24 33fc6: 63 e0 ldi r22, 0x03 ; 3 33fc8: 80 e0 ldi r24, 0x00 ; 0 33fca: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(18, 3); 33fce: 63 e0 ldi r22, 0x03 ; 3 33fd0: 82 e1 ldi r24, 0x12 ; 18 33fd2: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print(_error_1); 33fd6: ce 01 movw r24, r28 33fd8: 1f c0 rjmp .+62 ; 0x34018 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)); 33fda: 8d e4 ldi r24, 0x4D ; 77 33fdc: 97 e5 ldi r25, 0x57 ; 87 33fde: 0e 94 b3 72 call 0xe566 ; 0xe566 33fe2: ac 01 movw r20, r24 33fe4: 62 e0 ldi r22, 0x02 ; 2 33fe6: 80 e0 ldi r24, 0x00 ; 0 33fe8: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(18, 2); 33fec: 62 e0 ldi r22, 0x02 ; 2 33fee: 82 e1 ldi r24, 0x12 ; 18 33ff0: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print(_error_1); 33ff4: ce 01 movw r24, r28 33ff6: 0e 94 ee 70 call 0xe1dc ; 0xe1dc lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 33ffa: 83 e4 ldi r24, 0x43 ; 67 33ffc: 97 e5 ldi r25, 0x57 ; 87 33ffe: 0e 94 b3 72 call 0xe566 ; 0xe566 34002: ac 01 movw r20, r24 34004: 63 e0 ldi r22, 0x03 ; 3 34006: 80 e0 ldi r24, 0x00 ; 0 34008: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_set_cursor(18, 3); 3400c: 63 e0 ldi r22, 0x03 ; 3 3400e: 82 e1 ldi r24, 0x12 ; 18 34010: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print(_error_2); 34014: 89 ef ldi r24, 0xF9 ; 249 34016: 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); 34018: 0e 94 ee 70 call 0xe1dc ; 0xe1dc lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 3401c: 68 ee ldi r22, 0xE8 ; 232 3401e: 73 e0 ldi r23, 0x03 ; 3 34020: 80 e0 ldi r24, 0x00 ; 0 34022: 90 e0 ldi r25, 0x00 ; 0 34024: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 34028: 80 e0 ldi r24, 0x00 ; 0 3402a: 0f 94 0e 4e call 0x29c1c ; 0x29c1c lcd_beeper_quick_feedback(); do { _delay(100); 3402e: 64 e6 ldi r22, 0x64 ; 100 34030: 70 e0 ldi r23, 0x00 ; 0 34032: 80 e0 ldi r24, 0x00 ; 0 34034: 90 e0 ldi r25, 0x00 ; 0 34036: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 manage_heater(); 3403a: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(); 3403e: 80 e0 ldi r24, 0x00 ; 0 34040: 0e 94 b6 8a call 0x1156c ; 0x1156c } while (!lcd_clicked()); 34044: 0e 94 04 71 call 0xe208 ; 0xe208 34048: 88 23 and r24, r24 3404a: 89 f3 breq .-30 ; 0x3402e LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 3404c: 87 ea ldi r24, 0xA7 ; 167 3404e: 96 e5 ldi r25, 0x56 ; 86 34050: 0e 94 b3 72 call 0xe566 ; 0xe566 34054: 62 e0 ldi r22, 0x02 ; 2 34056: 0e 94 24 f1 call 0x1e248 ; 0x1e248 lcd_return_to_status(); } 3405a: df 91 pop r29 3405c: cf 91 pop r28 3405e: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 34060: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a 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)); 34064: 81 e3 ldi r24, 0x31 ; 49 34066: 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)); 34068: 0e 94 b3 72 call 0xe566 ; 0xe566 3406c: ac 01 movw r20, r24 3406e: 62 e0 ldi r22, 0x02 ; 2 34070: 80 e0 ldi r24, 0x00 ; 0 34072: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 34076: 8d e4 ldi r24, 0x4D ; 77 34078: 97 e5 ldi r25, 0x57 ; 87 3407a: a2 cf rjmp .-188 ; 0x33fc0 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)); 3407c: 8e e1 ldi r24, 0x1E ; 30 3407e: 97 e5 ldi r25, 0x57 ; 87 34080: 96 cf rjmp .-212 ; 0x33fae 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)); 34082: 8b e0 ldi r24, 0x0B ; 11 34084: 97 e5 ldi r25, 0x57 ; 87 34086: 93 cf rjmp .-218 ; 0x33fae 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)); 34088: 8c ef ldi r24, 0xFC ; 252 3408a: 96 e5 ldi r25, 0x56 ; 86 3408c: ed cf rjmp .-38 ; 0x34068 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)); 3408e: 8e ee ldi r24, 0xEE ; 238 34090: 96 e5 ldi r25, 0x56 ; 86 34092: 0e 94 b3 72 call 0xe566 ; 0xe566 34096: ac 01 movw r20, r24 34098: 62 e0 ldi r22, 0x02 ; 2 3409a: 80 e0 ldi r24, 0x00 ; 0 3409c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 340a0: 87 ee ldi r24, 0xE7 ; 231 340a2: 96 e5 ldi r25, 0x56 ; 86 340a4: 8d cf rjmp .-230 ; 0x33fc0 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 340a6: 85 ed ldi r24, 0xD5 ; 213 340a8: 96 e5 ldi r25, 0x56 ; 86 340aa: 0e 94 b3 72 call 0xe566 ; 0xe566 340ae: ac 01 movw r20, r24 340b0: 62 e0 ldi r22, 0x02 ; 2 340b2: 80 e0 ldi r24, 0x00 ; 0 340b4: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 340b8: 8b ec ldi r24, 0xCB ; 203 340ba: 96 e5 ldi r25, 0x56 ; 86 340bc: 81 cf rjmp .-254 ; 0x33fc0 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 340be: 89 eb ldi r24, 0xB9 ; 185 340c0: 96 e5 ldi r25, 0x56 ; 86 340c2: 69 cf rjmp .-302 ; 0x33f96 000340c4 : 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, 340c4: 1f 93 push r17 340c6: cf 93 push r28 340c8: df 93 push r29 340ca: c8 2f mov r28, r24 340cc: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 340ce: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 340d2: 8c e9 ldi r24, 0x9C ; 156 340d4: 96 e5 ldi r25, 0x56 ; 86 340d6: 0e 94 b3 72 call 0xe566 ; 0xe566 340da: ac 01 movw r20, r24 340dc: 60 e0 ldi r22, 0x00 ; 0 340de: 80 e0 ldi r24, 0x00 ; 0 340e0: 0e 94 fb 6e call 0xddf6 ; 0xddf6 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)); 340e4: 8b e0 ldi r24, 0x0B ; 11 340e6: 97 e5 ldi r25, 0x57 ; 87 340e8: c1 11 cpse r28, r1 340ea: 02 c0 rjmp .+4 ; 0x340f0 340ec: 8e e1 ldi r24, 0x1E ; 30 340ee: 97 e5 ldi r25, 0x57 ; 87 340f0: 0e 94 b3 72 call 0xe566 ; 0xe566 340f4: ac 01 movw r20, r24 340f6: 61 e0 ldi r22, 0x01 ; 1 340f8: 80 e0 ldi r24, 0x00 ; 0 340fa: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_selftest_setfan(255); 340fe: 8f ef ldi r24, 0xFF ; 255 34100: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 break; } _delay(500); 34104: 64 ef ldi r22, 0xF4 ; 244 34106: 71 e0 ldi r23, 0x01 ; 1 34108: 80 e0 ldi r24, 0x00 ; 0 3410a: 90 e0 ldi r25, 0x00 ; 0 3410c: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 34110: 81 e9 ldi r24, 0x91 ; 145 34112: 96 e5 ldi r25, 0x56 ; 86 34114: 0e 94 b3 72 call 0xe566 ; 0xe566 34118: ac 01 movw r20, r24 3411a: 62 e0 ldi r22, 0x02 ; 2 3411c: 81 e0 ldi r24, 0x01 ; 1 3411e: 0e 94 fb 6e call 0xddf6 ; 0xddf6 lcd_putc_at(0, 3, '>'); 34122: 4e e3 ldi r20, 0x3E ; 62 34124: 63 e0 ldi r22, 0x03 ; 3 34126: 80 e0 ldi r24, 0x00 ; 0 34128: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 3412c: 82 e8 ldi r24, 0x82 ; 130 3412e: 96 e5 ldi r25, 0x56 ; 86 34130: 0e 94 b3 72 call 0xe566 ; 0xe566 34134: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_encoder = _default; 34138: 6d 2f mov r22, r29 3413a: 70 e0 ldi r23, 0x00 ; 0 3413c: 70 93 71 06 sts 0x0671, r23 ; 0x800671 34140: 60 93 70 06 sts 0x0670, r22 ; 0x800670 KEEPALIVE_STATE(PAUSED_FOR_USER); 34144: 84 e0 ldi r24, 0x04 ; 4 34146: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be lcd_consume_click(); 3414a: 0e 94 ff 70 call 0xe1fe ; 0xe1fe 3414e: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 34150: 11 e0 ldi r17, 0x01 ; 1 34152: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 34154: 80 91 70 06 lds r24, 0x0670 ; 0x800670 34158: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3415c: 00 97 sbiw r24, 0x00 ; 0 3415e: 19 f1 breq .+70 ; 0x341a6 if (lcd_encoder < 0) { 34160: 97 ff sbrs r25, 7 34162: 0b c0 rjmp .+22 ; 0x3417a _result = !check_opposite; 34164: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 34166: 4e e3 ldi r20, 0x3E ; 62 34168: 62 e0 ldi r22, 0x02 ; 2 3416a: 80 e0 ldi r24, 0x00 ; 0 3416c: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_putc_at(0, 3, ' '); 34170: 40 e2 ldi r20, 0x20 ; 32 34172: 63 e0 ldi r22, 0x03 ; 3 34174: 80 e0 ldi r24, 0x00 ; 0 34176: 0e 94 07 6f call 0xde0e ; 0xde0e } if (lcd_encoder > 0) { 3417a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3417e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 34182: 18 16 cp r1, r24 34184: 19 06 cpc r1, r25 34186: 5c f4 brge .+22 ; 0x3419e _result = check_opposite; lcd_putc_at(0, 2, ' '); 34188: 40 e2 ldi r20, 0x20 ; 32 3418a: 62 e0 ldi r22, 0x02 ; 2 3418c: 80 e0 ldi r24, 0x00 ; 0 3418e: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_putc_at(0, 3, '>'); 34192: 4e e3 ldi r20, 0x3E ; 62 34194: 63 e0 ldi r22, 0x03 ; 3 34196: 80 e0 ldi r24, 0x00 ; 0 34198: 0e 94 07 6f call 0xde0e ; 0xde0e 3419c: dc 2f mov r29, r28 } lcd_encoder = 0; 3419e: 10 92 71 06 sts 0x0671, r1 ; 0x800671 341a2: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } manage_heater(); 341a6: 0f 94 63 38 call 0x270c6 ; 0x270c6 manage_inactivity(true); 341aa: 81 e0 ldi r24, 0x01 ; 1 341ac: 0e 94 b6 8a call 0x1156c ; 0x1156c _delay(100); 341b0: 64 e6 ldi r22, 0x64 ; 100 341b2: 70 e0 ldi r23, 0x00 ; 0 341b4: 80 e0 ldi r24, 0x00 ; 0 341b6: 90 e0 ldi r25, 0x00 ; 0 341b8: 0f 94 5a 27 call 0x24eb4 ; 0x24eb4 } while (!lcd_clicked()); 341bc: 0e 94 04 71 call 0xe208 ; 0xe208 341c0: 88 23 and r24, r24 341c2: 41 f2 breq .-112 ; 0x34154 KEEPALIVE_STATE(IN_HANDLER); 341c4: 82 e0 ldi r24, 0x02 ; 2 341c6: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be setExtruderAutoFanState(0); // Turn off hotend fan 341ca: 80 e0 ldi r24, 0x00 ; 0 341cc: 0e 94 62 75 call 0xeac4 ; 0xeac4 lcd_selftest_setfan(0); // Turn off print fan 341d0: 80 e0 ldi r24, 0x00 ; 0 341d2: 0e 94 61 f5 call 0x1eac2 ; 0x1eac2 return _result; } 341d6: 8d 2f mov r24, r29 341d8: df 91 pop r29 341da: cf 91 pop r28 341dc: 1f 91 pop r17 341de: 08 95 ret 000341e0 : #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) { 341e0: cf 93 push r28 341e2: df 93 push r29 341e4: c8 2f mov r28, r24 341e6: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 341e8: c1 50 subi r28, 0x01 ; 1 341ea: 98 f0 brcs .+38 ; 0x34212 for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 341ec: 4d e2 ldi r20, 0x2D ; 45 341ee: 6d 2f mov r22, r29 341f0: 82 e1 ldi r24, 0x12 ; 18 341f2: 0e 94 07 6f call 0xde0e ; 0xde0e delay_keep_alive(1000 / sizeof(symbols)); 341f6: 84 ef ldi r24, 0xF4 ; 244 341f8: 91 e0 ldi r25, 0x01 ; 1 341fa: 0e 94 eb 8c call 0x119d6 ; 0x119d6 // 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]); 341fe: 4c e7 ldi r20, 0x7C ; 124 34200: 6d 2f mov r22, r29 34202: 82 e1 ldi r24, 0x12 ; 18 34204: 0e 94 07 6f call 0xde0e ; 0xde0e delay_keep_alive(1000 / sizeof(symbols)); 34208: 84 ef ldi r24, 0xF4 ; 244 3420a: 91 e0 ldi r25, 0x01 ; 1 3420c: 0e 94 eb 8c call 0x119d6 ; 0x119d6 34210: eb cf rjmp .-42 ; 0x341e8 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 34212: 0f 94 53 29 call 0x252a6 ; 0x252a6 34216: 60 93 c0 17 sts 0x17C0, r22 ; 0x8017c0 3421a: 70 93 c1 17 sts 0x17C1, r23 ; 0x8017c1 3421e: 80 93 c2 17 sts 0x17C2, r24 ; 0x8017c2 34222: 90 93 c3 17 sts 0x17C3, r25 ; 0x8017c3 #endif fan_measuring = true; 34226: 81 e0 ldi r24, 0x01 ; 1 34228: 80 93 6f 06 sts 0x066F, r24 ; 0x80066f while(fan_measuring) { 3422c: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 34230: 88 23 and r24, r24 34232: 29 f0 breq .+10 ; 0x3423e delay_keep_alive(100); 34234: 84 e6 ldi r24, 0x64 ; 100 34236: 90 e0 ldi r25, 0x00 ; 0 34238: 0e 94 eb 8c call 0x119d6 ; 0x119d6 3423c: f7 cf rjmp .-18 ; 0x3422c } gcode_M123(); } 3423e: df 91 pop r29 34240: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 34242: 0c 94 8b 66 jmp 0xcd16 ; 0xcd16 00034246 : } #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) { 34246: 4f 92 push r4 34248: 5f 92 push r5 3424a: 6f 92 push r6 3424c: 7f 92 push r7 3424e: af 92 push r10 34250: bf 92 push r11 34252: cf 92 push r12 34254: df 92 push r13 34256: ef 92 push r14 34258: ff 92 push r15 3425a: 0f 93 push r16 3425c: 1f 93 push r17 3425e: cf 93 push r28 34260: df 93 push r29 34262: 24 e0 ldi r18, 0x04 ; 4 34264: 30 e0 ldi r19, 0x00 ; 0 34266: 41 e0 ldi r20, 0x01 ; 1 34268: 50 e0 ldi r21, 0x00 ; 0 3426a: d9 01 movw r26, r18 3426c: a4 52 subi r26, 0x24 ; 36 3426e: bc 45 sbci r27, 0x5C ; 92 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 34270: fd 01 movw r30, r26 34272: 65 91 lpm r22, Z+ 34274: 74 91 lpm r23, Z 34276: 86 17 cp r24, r22 34278: 97 07 cpc r25, r23 3427a: 0c f0 brlt .+2 ; 0x3427e 3427c: 66 c0 rjmp .+204 ; 0x3434a { celsius = PGM_RD_W((*tt)[i-1][1]) + 3427e: 41 50 subi r20, 0x01 ; 1 34280: 51 09 sbc r21, r1 34282: 44 0f add r20, r20 34284: 55 1f adc r21, r21 34286: 44 0f add r20, r20 34288: 55 1f adc r21, r21 3428a: ea 01 movw r28, r20 3428c: c2 52 subi r28, 0x22 ; 34 3428e: dc 45 sbci r29, 0x5C ; 92 34290: fe 01 movw r30, r28 34292: 05 91 lpm r16, Z+ 34294: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 34296: 44 52 subi r20, 0x24 ; 36 34298: 5c 45 sbci r21, 0x5C ; 92 3429a: fa 01 movw r30, r20 3429c: 65 91 lpm r22, Z+ 3429e: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 342a0: f9 01 movw r30, r18 342a2: e2 52 subi r30, 0x22 ; 34 342a4: fc 45 sbci r31, 0x5C ; 92 342a6: e5 90 lpm r14, Z+ 342a8: f4 90 lpm r15, Z 342aa: fe 01 movw r30, r28 342ac: c5 90 lpm r12, Z+ 342ae: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 342b0: fd 01 movw r30, r26 342b2: c5 91 lpm r28, Z+ 342b4: d4 91 lpm r29, Z 342b6: fa 01 movw r30, r20 342b8: a5 90 lpm r10, Z+ 342ba: 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])) * 342bc: 86 1b sub r24, r22 342be: 97 0b sbc r25, r23 342c0: bc 01 movw r22, r24 342c2: 99 0f add r25, r25 342c4: 88 0b sbc r24, r24 342c6: 99 0b sbc r25, r25 342c8: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 342cc: 2b 01 movw r4, r22 342ce: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 342d0: b7 01 movw r22, r14 342d2: 6c 19 sub r22, r12 342d4: 7d 09 sbc r23, r13 342d6: 07 2e mov r0, r23 342d8: 00 0c add r0, r0 342da: 88 0b sbc r24, r24 342dc: 99 0b sbc r25, r25 342de: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 342e2: 9b 01 movw r18, r22 342e4: 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])) * 342e6: c3 01 movw r24, r6 342e8: b2 01 movw r22, r4 342ea: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 342ee: 6b 01 movw r12, r22 342f0: 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])); 342f2: be 01 movw r22, r28 342f4: 6a 19 sub r22, r10 342f6: 7b 09 sbc r23, r11 342f8: 07 2e mov r0, r23 342fa: 00 0c add r0, r0 342fc: 88 0b sbc r24, r24 342fe: 99 0b sbc r25, r25 34300: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 34304: 9b 01 movw r18, r22 34306: 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])) / 34308: c7 01 movw r24, r14 3430a: b6 01 movw r22, r12 3430c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 34310: 6b 01 movw r12, r22 34312: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 34314: b8 01 movw r22, r16 34316: 11 0f add r17, r17 34318: 88 0b sbc r24, r24 3431a: 99 0b sbc r25, r25 3431c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 34320: 9b 01 movw r18, r22 34322: ac 01 movw r20, r24 34324: c7 01 movw r24, r14 34326: b6 01 movw r22, r12 34328: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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; } 3432c: df 91 pop r29 3432e: cf 91 pop r28 34330: 1f 91 pop r17 34332: 0f 91 pop r16 34334: ff 90 pop r15 34336: ef 90 pop r14 34338: df 90 pop r13 3433a: cf 90 pop r12 3433c: bf 90 pop r11 3433e: af 90 pop r10 34340: 7f 90 pop r7 34342: 6f 90 pop r6 34344: 5f 90 pop r5 34346: 4f 90 pop r4 34348: 08 95 ret 3434a: 4f 5f subi r20, 0xFF ; 255 3434c: 5f 4f sbci r21, 0xFF ; 255 3434e: 2c 5f subi r18, 0xFC ; 252 34350: 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 34358: 88 cf rjmp .-240 ; 0x3426a break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 3435a: ea e5 ldi r30, 0x5A ; 90 3435c: f4 ea ldi r31, 0xA4 ; 164 3435e: 65 91 lpm r22, Z+ 34360: 74 91 lpm r23, Z 34362: 07 2e mov r0, r23 34364: 00 0c add r0, r0 34366: 88 0b sbc r24, r24 34368: 99 0b sbc r25, r25 3436a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3436e: de cf rjmp .-68 ; 0x3432c 00034370 : float mesh_bed_leveling::get_z(float x, float y) { 34370: 2f 92 push r2 34372: 3f 92 push r3 34374: 4f 92 push r4 34376: 5f 92 push r5 34378: 6f 92 push r6 3437a: 7f 92 push r7 3437c: 8f 92 push r8 3437e: 9f 92 push r9 34380: af 92 push r10 34382: bf 92 push r11 34384: cf 92 push r12 34386: df 92 push r13 34388: ef 92 push r14 3438a: ff 92 push r15 3438c: 0f 93 push r16 3438e: 1f 93 push r17 34390: cf 93 push r28 34392: df 93 push r29 34394: 00 d0 rcall .+0 ; 0x34396 34396: 00 d0 rcall .+0 ; 0x34398 34398: 00 d0 rcall .+0 ; 0x3439a 3439a: 1f 92 push r1 3439c: cd b7 in r28, 0x3d ; 61 3439e: de b7 in r29, 0x3e ; 62 343a0: 2b 01 movw r4, r22 343a2: 3c 01 movw r6, r24 343a4: 49 01 movw r8, r18 343a6: 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)); 343a8: 20 e0 ldi r18, 0x00 ; 0 343aa: 30 e0 ldi r19, 0x00 ; 0 343ac: 40 ec ldi r20, 0xC0 ; 192 343ae: 51 e4 ldi r21, 0x41 ; 65 343b0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 343b4: 20 e0 ldi r18, 0x00 ; 0 343b6: 30 e0 ldi r19, 0x00 ; 0 343b8: 48 e0 ldi r20, 0x08 ; 8 343ba: 52 e4 ldi r21, 0x42 ; 66 343bc: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 343c0: 6b 01 movw r12, r22 343c2: 7c 01 movw r14, r24 343c4: 0f 94 f2 de call 0x3bde4 ; 0x3bde4 343c8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> if (i < 0) { i = 0; 343cc: 31 2c mov r3, r1 343ce: 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) { 343d0: 77 fd sbrc r23, 7 343d2: 1e c0 rjmp .+60 ; 0x34410 343d4: 1b 01 movw r2, r22 343d6: 66 30 cpi r22, 0x06 ; 6 343d8: 71 05 cpc r23, r1 343da: 1c f0 brlt .+6 ; 0x343e2 343dc: 45 e0 ldi r20, 0x05 ; 5 343de: 24 2e mov r2, r20 343e0: 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; } 343e2: 82 2d mov r24, r2 343e4: 0f 94 3c ca call 0x39478 ; 0x39478 343e8: 20 e0 ldi r18, 0x00 ; 0 343ea: 30 e0 ldi r19, 0x00 ; 0 343ec: 48 eb ldi r20, 0xB8 ; 184 343ee: 51 e4 ldi r21, 0x41 ; 65 343f0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 343f4: 9b 01 movw r18, r22 343f6: 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; 343f8: c3 01 movw r24, r6 343fa: b2 01 movw r22, r4 343fc: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34400: 20 e0 ldi r18, 0x00 ; 0 34402: 30 e0 ldi r19, 0x00 ; 0 34404: 48 e0 ldi r20, 0x08 ; 8 34406: 52 e4 ldi r21, 0x42 ; 66 34408: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3440c: 6b 01 movw r12, r22 3440e: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 34410: 20 e0 ldi r18, 0x00 ; 0 34412: 30 e0 ldi r19, 0x00 ; 0 34414: 40 ec ldi r20, 0xC0 ; 192 34416: 50 e4 ldi r21, 0x40 ; 64 34418: c5 01 movw r24, r10 3441a: b4 01 movw r22, r8 3441c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34420: 20 e0 ldi r18, 0x00 ; 0 34422: 30 e0 ldi r19, 0x00 ; 0 34424: 48 e0 ldi r20, 0x08 ; 8 34426: 52 e4 ldi r21, 0x42 ; 66 34428: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3442c: 69 83 std Y+1, r22 ; 0x01 3442e: 7a 83 std Y+2, r23 ; 0x02 34430: 8b 83 std Y+3, r24 ; 0x03 34432: 9c 83 std Y+4, r25 ; 0x04 34434: 0f 94 f2 de call 0x3bde4 ; 0x3bde4 34438: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> if (j < 0) { 3443c: 77 fd sbrc r23, 7 3443e: da c0 rjmp .+436 ; 0x345f4 34440: 7a 87 std Y+10, r23 ; 0x0a 34442: 69 87 std Y+9, r22 ; 0x09 34444: 66 30 cpi r22, 0x06 ; 6 34446: 71 05 cpc r23, r1 34448: 24 f0 brlt .+8 ; 0x34452 3444a: e5 e0 ldi r30, 0x05 ; 5 3444c: f0 e0 ldi r31, 0x00 ; 0 3444e: fa 87 std Y+10, r31 ; 0x0a 34450: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 34452: 89 85 ldd r24, Y+9 ; 0x09 34454: 0f 94 3c ca call 0x39478 ; 0x39478 34458: 20 e0 ldi r18, 0x00 ; 0 3445a: 30 e0 ldi r19, 0x00 ; 0 3445c: 40 ea ldi r20, 0xA0 ; 160 3445e: 50 e4 ldi r21, 0x40 ; 64 34460: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 34464: 9b 01 movw r18, r22 34466: 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; 34468: c5 01 movw r24, r10 3446a: b4 01 movw r22, r8 3446c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34470: 20 e0 ldi r18, 0x00 ; 0 34472: 30 e0 ldi r19, 0x00 ; 0 34474: 48 e0 ldi r20, 0x08 ; 8 34476: 52 e4 ldi r21, 0x42 ; 66 34478: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3447c: 69 83 std Y+1, r22 ; 0x01 3447e: 7a 83 std Y+2, r23 ; 0x02 34480: 8b 83 std Y+3, r24 ; 0x03 34482: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 34484: a7 01 movw r20, r14 34486: 96 01 movw r18, r12 34488: 60 e0 ldi r22, 0x00 ; 0 3448a: 70 e0 ldi r23, 0x00 ; 0 3448c: 80 e8 ldi r24, 0x80 ; 128 3448e: 9f e3 ldi r25, 0x3F ; 63 34490: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34494: 2b 01 movw r4, r22 34496: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 34498: 91 01 movw r18, r2 3449a: 2f 5f subi r18, 0xFF ; 255 3449c: 3f 4f sbci r19, 0xFF ; 255 3449e: 3e 83 std Y+6, r19 ; 0x06 344a0: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 344a2: 89 85 ldd r24, Y+9 ; 0x09 344a4: 9a 85 ldd r25, Y+10 ; 0x0a 344a6: 01 96 adiw r24, 0x01 ; 1 344a8: 98 87 std Y+8, r25 ; 0x08 344aa: 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]; 344ac: 27 e0 ldi r18, 0x07 ; 7 344ae: e9 85 ldd r30, Y+9 ; 0x09 344b0: fa 85 ldd r31, Y+10 ; 0x0a 344b2: 2e 9f mul r18, r30 344b4: 80 01 movw r16, r0 344b6: 2f 9f mul r18, r31 344b8: 10 0d add r17, r0 344ba: 11 24 eor r1, r1 344bc: f8 01 movw r30, r16 344be: e2 0d add r30, r2 344c0: f3 1d adc r31, r3 344c2: ee 0f add r30, r30 344c4: ff 1f adc r31, r31 344c6: ee 0f add r30, r30 344c8: ff 1f adc r31, r31 344ca: ee 53 subi r30, 0x3E ; 62 344cc: fc 4e sbci r31, 0xEC ; 236 344ce: 21 81 ldd r18, Z+1 ; 0x01 344d0: 32 81 ldd r19, Z+2 ; 0x02 344d2: 43 81 ldd r20, Z+3 ; 0x03 344d4: 54 81 ldd r21, Z+4 ; 0x04 344d6: c3 01 movw r24, r6 344d8: b2 01 movw r22, r4 344da: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 344de: 4b 01 movw r8, r22 344e0: 5c 01 movw r10, r24 344e2: ed 81 ldd r30, Y+5 ; 0x05 344e4: fe 81 ldd r31, Y+6 ; 0x06 344e6: e0 0f add r30, r16 344e8: f1 1f adc r31, r17 344ea: ee 0f add r30, r30 344ec: ff 1f adc r31, r31 344ee: ee 0f add r30, r30 344f0: ff 1f adc r31, r31 344f2: ee 53 subi r30, 0x3E ; 62 344f4: fc 4e sbci r31, 0xEC ; 236 344f6: 21 81 ldd r18, Z+1 ; 0x01 344f8: 32 81 ldd r19, Z+2 ; 0x02 344fa: 43 81 ldd r20, Z+3 ; 0x03 344fc: 54 81 ldd r21, Z+4 ; 0x04 344fe: c7 01 movw r24, r14 34500: b6 01 movw r22, r12 34502: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34506: 9b 01 movw r18, r22 34508: ac 01 movw r20, r24 3450a: c5 01 movw r24, r10 3450c: b4 01 movw r22, r8 3450e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 34512: 4b 01 movw r8, r22 34514: 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; 34516: 29 81 ldd r18, Y+1 ; 0x01 34518: 3a 81 ldd r19, Y+2 ; 0x02 3451a: 4b 81 ldd r20, Y+3 ; 0x03 3451c: 5c 81 ldd r21, Y+4 ; 0x04 3451e: 60 e0 ldi r22, 0x00 ; 0 34520: 70 e0 ldi r23, 0x00 ; 0 34522: 80 e8 ldi r24, 0x80 ; 128 34524: 9f e3 ldi r25, 0x3F ; 63 34526: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3452a: 9b 01 movw r18, r22 3452c: ac 01 movw r20, r24 3452e: c5 01 movw r24, r10 34530: b4 01 movw r22, r8 34532: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34536: 4b 01 movw r8, r22 34538: 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]; 3453a: 27 e0 ldi r18, 0x07 ; 7 3453c: ef 81 ldd r30, Y+7 ; 0x07 3453e: f8 85 ldd r31, Y+8 ; 0x08 34540: 2e 9f mul r18, r30 34542: c0 01 movw r24, r0 34544: 2f 9f mul r18, r31 34546: 90 0d add r25, r0 34548: 11 24 eor r1, r1 3454a: 9a 87 std Y+10, r25 ; 0x0a 3454c: 89 87 std Y+9, r24 ; 0x09 3454e: fc 01 movw r30, r24 34550: e2 0d add r30, r2 34552: f3 1d adc r31, r3 34554: ee 0f add r30, r30 34556: ff 1f adc r31, r31 34558: ee 0f add r30, r30 3455a: ff 1f adc r31, r31 3455c: ee 53 subi r30, 0x3E ; 62 3455e: fc 4e sbci r31, 0xEC ; 236 34560: 21 81 ldd r18, Z+1 ; 0x01 34562: 32 81 ldd r19, Z+2 ; 0x02 34564: 43 81 ldd r20, Z+3 ; 0x03 34566: 54 81 ldd r21, Z+4 ; 0x04 34568: c3 01 movw r24, r6 3456a: b2 01 movw r22, r4 3456c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34570: 2b 01 movw r4, r22 34572: 3c 01 movw r6, r24 34574: 89 85 ldd r24, Y+9 ; 0x09 34576: 9a 85 ldd r25, Y+10 ; 0x0a 34578: ed 81 ldd r30, Y+5 ; 0x05 3457a: fe 81 ldd r31, Y+6 ; 0x06 3457c: 8e 0f add r24, r30 3457e: 9f 1f adc r25, r31 34580: 88 0f add r24, r24 34582: 99 1f adc r25, r25 34584: 88 0f add r24, r24 34586: 99 1f adc r25, r25 34588: 8e 53 subi r24, 0x3E ; 62 3458a: 9c 4e sbci r25, 0xEC ; 236 3458c: fc 01 movw r30, r24 3458e: 21 81 ldd r18, Z+1 ; 0x01 34590: 32 81 ldd r19, Z+2 ; 0x02 34592: 43 81 ldd r20, Z+3 ; 0x03 34594: 54 81 ldd r21, Z+4 ; 0x04 34596: c7 01 movw r24, r14 34598: b6 01 movw r22, r12 3459a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3459e: 9b 01 movw r18, r22 345a0: ac 01 movw r20, r24 345a2: c3 01 movw r24, r6 345a4: b2 01 movw r22, r4 345a6: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> return (1.f-t) * z0 + t * z1; 345aa: 29 81 ldd r18, Y+1 ; 0x01 345ac: 3a 81 ldd r19, Y+2 ; 0x02 345ae: 4b 81 ldd r20, Y+3 ; 0x03 345b0: 5c 81 ldd r21, Y+4 ; 0x04 345b2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 345b6: 9b 01 movw r18, r22 345b8: ac 01 movw r20, r24 345ba: c5 01 movw r24, r10 345bc: b4 01 movw r22, r8 345be: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> } 345c2: 2a 96 adiw r28, 0x0a ; 10 345c4: 0f b6 in r0, 0x3f ; 63 345c6: f8 94 cli 345c8: de bf out 0x3e, r29 ; 62 345ca: 0f be out 0x3f, r0 ; 63 345cc: cd bf out 0x3d, r28 ; 61 345ce: df 91 pop r29 345d0: cf 91 pop r28 345d2: 1f 91 pop r17 345d4: 0f 91 pop r16 345d6: ff 90 pop r15 345d8: ef 90 pop r14 345da: df 90 pop r13 345dc: cf 90 pop r12 345de: bf 90 pop r11 345e0: af 90 pop r10 345e2: 9f 90 pop r9 345e4: 8f 90 pop r8 345e6: 7f 90 pop r7 345e8: 6f 90 pop r6 345ea: 5f 90 pop r5 345ec: 4f 90 pop r4 345ee: 3f 90 pop r3 345f0: 2f 90 pop r2 345f2: 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; 345f4: 1a 86 std Y+10, r1 ; 0x0a 345f6: 19 86 std Y+9, r1 ; 0x09 345f8: 45 cf rjmp .-374 ; 0x34484 000345fa : 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() 345fa: 2f 92 push r2 345fc: 3f 92 push r3 345fe: 4f 92 push r4 34600: 5f 92 push r5 34602: 6f 92 push r6 34604: 7f 92 push r7 34606: 8f 92 push r8 34608: 9f 92 push r9 3460a: af 92 push r10 3460c: bf 92 push r11 3460e: cf 92 push r12 34610: df 92 push r13 34612: ef 92 push r14 34614: ff 92 push r15 34616: 0f 93 push r16 34618: 1f 93 push r17 3461a: cf 93 push r28 3461c: df 93 push r29 3461e: 00 d0 rcall .+0 ; 0x34620 34620: 00 d0 rcall .+0 ; 0x34622 34622: 00 d0 rcall .+0 ; 0x34624 34624: cd b7 in r28, 0x3d ; 61 34626: de b7 in r29, 0x3e ; 62 34628: 02 ec ldi r16, 0xC2 ; 194 3462a: 13 e1 ldi r17, 0x13 ; 19 3462c: 1f 83 std Y+7, r17 ; 0x07 3462e: 0e 83 std Y+6, r16 ; 0x06 34630: 2e 80 ldd r2, Y+6 ; 0x06 34632: 3f 80 ldd r3, Y+7 ; 0x07 34634: 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])) 34636: f1 01 movw r30, r2 34638: 61 81 ldd r22, Z+1 ; 0x01 3463a: 72 81 ldd r23, Z+2 ; 0x02 3463c: 83 81 ldd r24, Z+3 ; 0x03 3463e: 94 81 ldd r25, Z+4 ; 0x04 34640: 9b 01 movw r18, r22 34642: ac 01 movw r20, r24 34644: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 34648: 88 23 and r24, r24 3464a: 09 f4 brne .+2 ; 0x3464e 3464c: 7c c0 rjmp .+248 ; 0x34746 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 3464e: 89 81 ldd r24, Y+1 ; 0x01 34650: 0f 94 3c ca call 0x39478 ; 0x39478 34654: 20 e0 ldi r18, 0x00 ; 0 34656: 30 e0 ldi r19, 0x00 ; 0 34658: 48 eb ldi r20, 0xB8 ; 184 3465a: 51 e4 ldi r21, 0x41 ; 65 3465c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 34660: 6b 01 movw r12, r22 34662: 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)) + 34664: 20 e0 ldi r18, 0x00 ; 0 34666: 30 e0 ldi r19, 0x00 ; 0 34668: 4c ef ldi r20, 0xFC ; 252 3466a: 52 e4 ldi r21, 0x42 ; 66 3466c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34670: 2b 01 movw r4, r22 34672: 3c 01 movw r6, r24 34674: 20 e0 ldi r18, 0x00 ; 0 34676: 30 e0 ldi r19, 0x00 ; 0 34678: 44 e6 ldi r20, 0x64 ; 100 3467a: 53 e4 ldi r21, 0x43 ; 67 3467c: c7 01 movw r24, r14 3467e: b6 01 movw r22, r12 34680: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34684: 4b 01 movw r8, r22 34686: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 34688: 20 e0 ldi r18, 0x00 ; 0 3468a: 30 e0 ldi r19, 0x00 ; 0 3468c: 40 ec ldi r20, 0xC0 ; 192 3468e: 51 e4 ldi r21, 0x41 ; 65 34690: c7 01 movw r24, r14 34692: b6 01 movw r22, r12 34694: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 34698: 6b 01 movw r12, r22 3469a: 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)) + 3469c: ee 81 ldd r30, Y+6 ; 0x06 3469e: ff 81 ldd r31, Y+7 ; 0x07 346a0: 21 81 ldd r18, Z+1 ; 0x01 346a2: 32 81 ldd r19, Z+2 ; 0x02 346a4: 43 81 ldd r20, Z+3 ; 0x03 346a6: 54 81 ldd r21, Z+4 ; 0x04 346a8: c3 01 movw r24, r6 346aa: b2 01 movw r22, r4 346ac: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 346b0: a5 01 movw r20, r10 346b2: 94 01 movw r18, r8 346b4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 346b8: 20 e0 ldi r18, 0x00 ; 0 346ba: 30 e9 ldi r19, 0x90 ; 144 346bc: 42 ea ldi r20, 0xA2 ; 162 346be: 56 e4 ldi r21, 0x46 ; 70 346c0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 346c4: 6a 83 std Y+2, r22 ; 0x02 346c6: 7b 83 std Y+3, r23 ; 0x03 346c8: 8c 83 std Y+4, r24 ; 0x04 346ca: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 346cc: ee 81 ldd r30, Y+6 ; 0x06 346ce: ff 81 ldd r31, Y+7 ; 0x07 346d0: 25 85 ldd r18, Z+13 ; 0x0d 346d2: 36 85 ldd r19, Z+14 ; 0x0e 346d4: 47 85 ldd r20, Z+15 ; 0x0f 346d6: 50 89 ldd r21, Z+16 ; 0x10 346d8: c7 01 movw r24, r14 346da: b6 01 movw r22, r12 346dc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 346e0: a5 01 movw r20, r10 346e2: 94 01 movw r18, r8 346e4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 346e8: 20 e0 ldi r18, 0x00 ; 0 346ea: 30 e9 ldi r19, 0x90 ; 144 346ec: 42 e2 ldi r20, 0x22 ; 34 346ee: 56 ec ldi r21, 0xC6 ; 198 346f0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 346f4: 9b 01 movw r18, r22 346f6: 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)) + 346f8: 6a 81 ldd r22, Y+2 ; 0x02 346fa: 7b 81 ldd r23, Y+3 ; 0x03 346fc: 8c 81 ldd r24, Y+4 ; 0x04 346fe: 9d 81 ldd r25, Y+5 ; 0x05 34700: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 34704: 4b 01 movw r8, r22 34706: 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)); 34708: ee 81 ldd r30, Y+6 ; 0x06 3470a: ff 81 ldd r31, Y+7 ; 0x07 3470c: 21 8d ldd r18, Z+25 ; 0x19 3470e: 32 8d ldd r19, Z+26 ; 0x1a 34710: 43 8d ldd r20, Z+27 ; 0x1b 34712: 54 8d ldd r21, Z+28 ; 0x1c 34714: c7 01 movw r24, r14 34716: b6 01 movw r22, r12 34718: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3471c: a3 01 movw r20, r6 3471e: 92 01 movw r18, r4 34720: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34724: 20 e0 ldi r18, 0x00 ; 0 34726: 30 e9 ldi r19, 0x90 ; 144 34728: 42 ea ldi r20, 0xA2 ; 162 3472a: 56 e4 ldi r21, 0x46 ; 70 3472c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 34730: 9b 01 movw r18, r22 34732: 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)) + 34734: c5 01 movw r24, r10 34736: b4 01 movw r22, r8 34738: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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] = 3473c: f1 01 movw r30, r2 3473e: 61 83 std Z+1, r22 ; 0x01 34740: 72 83 std Z+2, r23 ; 0x02 34742: 83 83 std Z+3, r24 ; 0x03 34744: 94 83 std Z+4, r25 ; 0x04 34746: f4 e0 ldi r31, 0x04 ; 4 34748: 2f 0e add r2, r31 3474a: 31 1c adc r3, r1 3474c: 29 81 ldd r18, Y+1 ; 0x01 3474e: 2f 5f subi r18, 0xFF ; 255 34750: 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) { 34752: 27 30 cpi r18, 0x07 ; 7 34754: 09 f0 breq .+2 ; 0x34758 34756: 6f cf rjmp .-290 ; 0x34636 34758: 8e 81 ldd r24, Y+6 ; 0x06 3475a: 9f 81 ldd r25, Y+7 ; 0x07 3475c: 4c 96 adiw r24, 0x1c ; 28 3475e: 9f 83 std Y+7, r25 ; 0x07 34760: 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) { 34762: 86 58 subi r24, 0x86 ; 134 34764: 94 41 sbci r25, 0x14 ; 20 34766: 09 f0 breq .+2 ; 0x3476a 34768: 63 cf rjmp .-314 ; 0x34630 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() 3476a: 19 87 std Y+9, r17 ; 0x09 3476c: 08 87 std Y+8, r16 ; 0x08 3476e: f1 e0 ldi r31, 0x01 ; 1 34770: 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)) + 34772: c8 01 movw r24, r16 34774: 8b 5a subi r24, 0xAB ; 171 34776: 9f 4f sbci r25, 0xFF ; 255 34778: 9f 83 std Y+7, r25 ; 0x07 3477a: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 3477c: 18 01 movw r2, r16 3477e: 99 ea ldi r25, 0xA9 ; 169 34780: 29 0e add r2, r25 34782: 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])) 34784: e8 85 ldd r30, Y+8 ; 0x08 34786: f9 85 ldd r31, Y+9 ; 0x09 34788: 65 8d ldd r22, Z+29 ; 0x1d 3478a: 76 8d ldd r23, Z+30 ; 0x1e 3478c: 87 8d ldd r24, Z+31 ; 0x1f 3478e: 90 a1 ldd r25, Z+32 ; 0x20 34790: 9b 01 movw r18, r22 34792: ac 01 movw r20, r24 34794: 0f 94 59 e1 call 0x3c2b2 ; 0x3c2b2 <__unordsf2> 34798: 88 23 and r24, r24 3479a: 09 f4 brne .+2 ; 0x3479e 3479c: 79 c0 rjmp .+242 ; 0x34890 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 3479e: 89 81 ldd r24, Y+1 ; 0x01 347a0: 0f 94 3c ca call 0x39478 ; 0x39478 347a4: 20 e0 ldi r18, 0x00 ; 0 347a6: 30 e0 ldi r19, 0x00 ; 0 347a8: 40 ea ldi r20, 0xA0 ; 160 347aa: 50 e4 ldi r21, 0x40 ; 64 347ac: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 347b0: 6b 01 movw r12, r22 347b2: 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)) + 347b4: 20 e0 ldi r18, 0x00 ; 0 347b6: 30 e0 ldi r19, 0x00 ; 0 347b8: 48 ed ldi r20, 0xD8 ; 216 347ba: 52 e4 ldi r21, 0x42 ; 66 347bc: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 347c0: 2b 01 movw r4, r22 347c2: 3c 01 movw r6, r24 347c4: 20 e0 ldi r18, 0x00 ; 0 347c6: 30 e0 ldi r19, 0x00 ; 0 347c8: 42 e5 ldi r20, 0x52 ; 82 347ca: 53 e4 ldi r21, 0x43 ; 67 347cc: c7 01 movw r24, r14 347ce: b6 01 movw r22, r12 347d0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 347d4: 4b 01 movw r8, r22 347d6: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 347d8: 20 e0 ldi r18, 0x00 ; 0 347da: 30 e0 ldi r19, 0x00 ; 0 347dc: 40 ec ldi r20, 0xC0 ; 192 347de: 50 e4 ldi r21, 0x40 ; 64 347e0: c7 01 movw r24, r14 347e2: b6 01 movw r22, r12 347e4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 347e8: 6b 01 movw r12, r22 347ea: 7c 01 movw r14, r24 347ec: ee 81 ldd r30, Y+6 ; 0x06 347ee: ff 81 ldd r31, Y+7 ; 0x07 347f0: 20 81 ld r18, Z 347f2: 31 81 ldd r19, Z+1 ; 0x01 347f4: 42 81 ldd r20, Z+2 ; 0x02 347f6: 53 81 ldd r21, Z+3 ; 0x03 347f8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 347fc: a5 01 movw r20, r10 347fe: 94 01 movw r18, r8 34800: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34804: 20 e0 ldi r18, 0x00 ; 0 34806: 30 e9 ldi r19, 0x90 ; 144 34808: 42 e2 ldi r20, 0x22 ; 34 3480a: 56 ec ldi r21, 0xC6 ; 198 3480c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 34810: 6a 83 std Y+2, r22 ; 0x02 34812: 7b 83 std Y+3, r23 ; 0x03 34814: 8c 83 std Y+4, r24 ; 0x04 34816: 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)) + 34818: f8 01 movw r30, r16 3481a: 21 81 ldd r18, Z+1 ; 0x01 3481c: 32 81 ldd r19, Z+2 ; 0x02 3481e: 43 81 ldd r20, Z+3 ; 0x03 34820: 54 81 ldd r21, Z+4 ; 0x04 34822: c3 01 movw r24, r6 34824: b2 01 movw r22, r4 34826: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3482a: a5 01 movw r20, r10 3482c: 94 01 movw r18, r8 3482e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34832: 20 e0 ldi r18, 0x00 ; 0 34834: 30 e9 ldi r19, 0x90 ; 144 34836: 42 ea ldi r20, 0xA2 ; 162 34838: 56 e4 ldi r21, 0x46 ; 70 3483a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3483e: 9b 01 movw r18, r22 34840: ac 01 movw r20, r24 34842: 6a 81 ldd r22, Y+2 ; 0x02 34844: 7b 81 ldd r23, Y+3 ; 0x03 34846: 8c 81 ldd r24, Y+4 ; 0x04 34848: 9d 81 ldd r25, Y+5 ; 0x05 3484a: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3484e: 4b 01 movw r8, r22 34850: 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)); 34852: f1 01 movw r30, r2 34854: 20 81 ld r18, Z 34856: 31 81 ldd r19, Z+1 ; 0x01 34858: 42 81 ldd r20, Z+2 ; 0x02 3485a: 53 81 ldd r21, Z+3 ; 0x03 3485c: c7 01 movw r24, r14 3485e: b6 01 movw r22, r12 34860: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 34864: a3 01 movw r20, r6 34866: 92 01 movw r18, r4 34868: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3486c: 20 e0 ldi r18, 0x00 ; 0 3486e: 30 e9 ldi r19, 0x90 ; 144 34870: 42 ea ldi r20, 0xA2 ; 162 34872: 56 e4 ldi r21, 0x46 ; 70 34874: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 34878: 9b 01 movw r18, r22 3487a: 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)) + 3487c: c5 01 movw r24, r10 3487e: b4 01 movw r22, r8 34880: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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] = 34884: e8 85 ldd r30, Y+8 ; 0x08 34886: f9 85 ldd r31, Y+9 ; 0x09 34888: 65 8f std Z+29, r22 ; 0x1d 3488a: 76 8f std Z+30, r23 ; 0x1e 3488c: 87 8f std Z+31, r24 ; 0x1f 3488e: 90 a3 std Z+32, r25 ; 0x20 34890: 88 85 ldd r24, Y+8 ; 0x08 34892: 99 85 ldd r25, Y+9 ; 0x09 34894: 4c 96 adiw r24, 0x1c ; 28 34896: 99 87 std Y+9, r25 ; 0x09 34898: 88 87 std Y+8, r24 ; 0x08 3489a: 99 81 ldd r25, Y+1 ; 0x01 3489c: 9f 5f subi r25, 0xFF ; 255 3489e: 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) { 348a0: 96 30 cpi r25, 0x06 ; 6 348a2: 09 f0 breq .+2 ; 0x348a6 348a4: 6f cf rjmp .-290 ; 0x34784 348a6: 0c 5f subi r16, 0xFC ; 252 348a8: 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) { 348aa: e3 e1 ldi r30, 0x13 ; 19 348ac: 0e 3d cpi r16, 0xDE ; 222 348ae: 1e 07 cpc r17, r30 348b0: 09 f0 breq .+2 ; 0x348b4 348b2: 5b cf rjmp .-330 ; 0x3476a z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 348b4: 29 96 adiw r28, 0x09 ; 9 348b6: 0f b6 in r0, 0x3f ; 63 348b8: f8 94 cli 348ba: de bf out 0x3e, r29 ; 62 348bc: 0f be out 0x3f, r0 ; 63 348be: cd bf out 0x3d, r28 ; 61 348c0: df 91 pop r29 348c2: cf 91 pop r28 348c4: 1f 91 pop r17 348c6: 0f 91 pop r16 348c8: ff 90 pop r15 348ca: ef 90 pop r14 348cc: df 90 pop r13 348ce: cf 90 pop r12 348d0: bf 90 pop r11 348d2: af 90 pop r10 348d4: 9f 90 pop r9 348d6: 8f 90 pop r8 348d8: 7f 90 pop r7 348da: 6f 90 pop r6 348dc: 5f 90 pop r5 348de: 4f 90 pop r4 348e0: 3f 90 pop r3 348e2: 2f 90 pop r2 348e4: 08 95 ret 000348e6 : 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) { 348e6: 1f 93 push r17 348e8: cf 93 push r28 348ea: df 93 push r29 348ec: 00 d0 rcall .+0 ; 0x348ee 348ee: 1f 92 push r1 348f0: 1f 92 push r1 348f2: cd b7 in r28, 0x3d ; 61 348f4: de b7 in r29, 0x3e ; 62 348f6: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 348f8: 48 2f mov r20, r24 348fa: 62 e5 ldi r22, 0x52 ; 82 348fc: ce 01 movw r24, r28 348fe: 01 96 adiw r24, 0x01 ; 1 34900: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34904: 49 81 ldd r20, Y+1 ; 0x01 34906: 5a 81 ldd r21, Y+2 ; 0x02 34908: 6b 81 ldd r22, Y+3 ; 0x03 3490a: 7c 81 ldd r23, Y+4 ; 0x04 3490c: 8d 81 ldd r24, Y+5 ; 0x05 3490e: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 scopeState = nextState; 34912: 10 93 4e 13 sts 0x134E, r17 ; 0x80134e } 34916: 0f 90 pop r0 34918: 0f 90 pop r0 3491a: 0f 90 pop r0 3491c: 0f 90 pop r0 3491e: 0f 90 pop r0 34920: df 91 pop r29 34922: cf 91 pop r28 34924: 1f 91 pop r17 34926: 08 95 ret 00034928 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 34928: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 3492c: ee e6 ldi r30, 0x6E ; 110 3492e: fb ea ldi r31, 0xAB ; 171 34930: 84 91 lpm r24, Z 34932: 67 e0 ldi r22, 0x07 ; 7 34934: 0d 94 73 a4 jmp 0x348e6 ; 0x348e6 00034938 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 34938: e0 91 99 13 lds r30, 0x1399 ; 0x801399 3493c: ae 2f mov r26, r30 3493e: b0 e0 ldi r27, 0x00 ; 0 34940: aa 0f add r26, r26 34942: bb 1f adc r27, r27 34944: ad 56 subi r26, 0x6D ; 109 34946: bc 4e sbci r27, 0xEC ; 236 34948: 20 91 66 13 lds r18, 0x1366 ; 0x801366 3494c: 30 91 67 13 lds r19, 0x1367 ; 0x801367 34950: 2d 93 st X+, r18 34952: 3c 93 st X, r19 ++regIndex; 34954: ef 5f subi r30, 0xFF ; 255 34956: e0 93 99 13 sts 0x1399, r30 ; 0x801399 if (regIndex >= regs16Count) { 3495a: e2 30 cpi r30, 0x02 ; 2 3495c: 40 f4 brcc .+16 ; 0x3496e return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 3495e: f0 e0 ldi r31, 0x00 ; 0 34960: eb 5a subi r30, 0xAB ; 171 34962: f4 45 sbci r31, 0x54 ; 84 34964: 84 91 lpm r24, Z 34966: 68 e0 ldi r22, 0x08 ; 8 34968: 0f 94 73 a4 call 0x348e6 ; 0x348e6 } return ScopeState::Reading16bitRegisters; 3496c: 88 e0 ldi r24, 0x08 ; 8 } 3496e: 08 95 ret 00034970 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 34970: e0 91 99 13 lds r30, 0x1399 ; 0x801399 34974: ae 2f mov r26, r30 34976: b0 e0 ldi r27, 0x00 ; 0 34978: a0 57 subi r26, 0x70 ; 112 3497a: bc 4e sbci r27, 0xEC ; 236 3497c: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34980: 8c 93 st X, r24 ++regIndex; 34982: ef 5f subi r30, 0xFF ; 255 34984: e0 93 99 13 sts 0x1399, r30 ; 0x801399 if (regIndex >= regs8Count) { 34988: e3 30 cpi r30, 0x03 ; 3 3498a: 40 f0 brcs .+16 ; 0x3499c SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 3498c: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 34990: e5 e5 ldi r30, 0x55 ; 85 34992: fb ea ldi r31, 0xAB ; 171 34994: 84 91 lpm r24, Z 34996: 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); 34998: 0d 94 73 a4 jmp 0x348e6 ; 0x348e6 3499c: f0 e0 ldi r31, 0x00 ; 0 3499e: e2 59 subi r30, 0x92 ; 146 349a0: f4 45 sbci r31, 0x54 ; 84 349a2: 84 91 lpm r24, Z 349a4: 67 e0 ldi r22, 0x07 ; 7 349a6: f8 cf rjmp .-16 ; 0x34998 000349a8 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 349a8: cf 93 push r28 349aa: df 93 push r29 349ac: 00 d0 rcall .+0 ; 0x349ae 349ae: 00 d0 rcall .+0 ; 0x349b0 349b0: 00 d0 rcall .+0 ; 0x349b2 349b2: 1f 92 push r1 349b4: cd b7 in r28, 0x3d ; 61 349b6: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 349b8: 80 91 55 13 lds r24, 0x1355 ; 0x801355 349bc: 82 34 cpi r24, 0x42 ; 66 349be: 09 f4 brne .+2 ; 0x349c2 349c0: 46 c0 rjmp .+140 ; 0x34a4e 349c2: b8 f5 brcc .+110 ; 0x34a32 349c4: 88 23 and r24, r24 349c6: 09 f4 brne .+2 ; 0x349ca 349c8: 72 c0 rjmp .+228 ; 0x34aae plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 349ca: 84 e0 ldi r24, 0x04 ; 4 349cc: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 349d0: 85 e0 ldi r24, 0x05 ; 5 349d2: e5 e5 ldi r30, 0x55 ; 85 349d4: f3 e1 ldi r31, 0x13 ; 19 349d6: de 01 movw r26, r28 349d8: 16 96 adiw r26, 0x06 ; 6 349da: 01 90 ld r0, Z+ 349dc: 0d 92 st X+, r0 349de: 8a 95 dec r24 349e0: e1 f7 brne .-8 ; 0x349da StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 349e2: 85 e0 ldi r24, 0x05 ; 5 349e4: fe 01 movw r30, r28 349e6: 36 96 adiw r30, 0x06 ; 6 349e8: a0 e5 ldi r26, 0x50 ; 80 349ea: b3 e1 ldi r27, 0x13 ; 19 349ec: 01 90 ld r0, Z+ 349ee: 0d 92 st X+, r0 349f0: 8a 95 dec r24 349f2: e1 f7 brne .-8 ; 0x349ec SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 349f4: 40 e0 ldi r20, 0x00 ; 0 349f6: 60 e0 ldi r22, 0x00 ; 0 349f8: ce 01 movw r24, r28 349fa: 01 96 adiw r24, 0x01 ; 1 349fc: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34a00: 85 e0 ldi r24, 0x05 ; 5 34a02: fe 01 movw r30, r28 34a04: 31 96 adiw r30, 0x01 ; 1 34a06: a5 e5 ldi r26, 0x55 ; 85 34a08: b3 e1 ldi r27, 0x13 ; 19 34a0a: 01 90 ld r0, Z+ 34a0c: 0d 92 st X+, r0 34a0e: 8a 95 dec r24 34a10: e1 f7 brne .-8 ; 0x34a0a void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 34a12: 85 e0 ldi r24, 0x05 ; 5 34a14: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendMsg(rq); 34a18: 40 91 50 13 lds r20, 0x1350 ; 0x801350 34a1c: 50 91 51 13 lds r21, 0x1351 ; 0x801351 34a20: 60 91 52 13 lds r22, 0x1352 ; 0x801352 34a24: 70 91 53 13 lds r23, 0x1353 ; 0x801353 34a28: 80 91 54 13 lds r24, 0x1354 ; 0x801354 34a2c: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 34a30: 2e c0 rjmp .+92 ; 0x34a8e ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 34a32: 82 35 cpi r24, 0x52 ; 82 34a34: b1 f1 breq .+108 ; 0x34aa2 34a36: 87 35 cpi r24, 0x57 ; 87 34a38: 41 f6 brne .-112 ; 0x349ca 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); 34a3a: 60 91 57 13 lds r22, 0x1357 ; 0x801357 34a3e: 70 91 58 13 lds r23, 0x1358 ; 0x801358 34a42: 4c e0 ldi r20, 0x0C ; 12 34a44: 80 91 56 13 lds r24, 0x1356 ; 0x801356 34a48: 0f 94 0e 67 call 0x2ce1c ; 0x2ce1c 34a4c: 11 c0 rjmp .+34 ; 0x34a70 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 34a4e: 40 91 56 13 lds r20, 0x1356 ; 0x801356 34a52: 62 e4 ldi r22, 0x42 ; 66 34a54: ce 01 movw r24, r28 34a56: 01 96 adiw r24, 0x01 ; 1 34a58: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34a5c: 49 81 ldd r20, Y+1 ; 0x01 34a5e: 5a 81 ldd r21, Y+2 ; 0x02 34a60: 6b 81 ldd r22, Y+3 ; 0x03 34a62: 7c 81 ldd r23, Y+4 ; 0x04 34a64: 8d 81 ldd r24, Y+5 ; 0x05 34a66: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 scopeState = ScopeState::ButtonSent; 34a6a: 8a e0 ldi r24, 0x0A ; 10 34a6c: 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); 34a70: 40 e0 ldi r20, 0x00 ; 0 34a72: 60 e0 ldi r22, 0x00 ; 0 34a74: ce 01 movw r24, r28 34a76: 01 96 adiw r24, 0x01 ; 1 34a78: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34a7c: 85 e0 ldi r24, 0x05 ; 5 34a7e: fe 01 movw r30, r28 34a80: 31 96 adiw r30, 0x01 ; 1 34a82: a5 e5 ldi r26, 0x55 ; 85 34a84: b3 e1 ldi r27, 0x13 ; 19 34a86: 01 90 ld r0, Z+ 34a88: 0d 92 st X+, r0 34a8a: 8a 95 dec r24 34a8c: e1 f7 brne .-8 ; 0x34a86 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 34a8e: 81 e0 ldi r24, 0x01 ; 1 } } 34a90: 2a 96 adiw r28, 0x0a ; 10 34a92: 0f b6 in r0, 0x3f ; 63 34a94: f8 94 cli 34a96: de bf out 0x3e, r29 ; 62 34a98: 0f be out 0x3f, r0 ; 63 34a9a: cd bf out 0x3d, r28 ; 61 34a9c: df 91 pop r29 34a9e: cf 91 pop r28 34aa0: 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); 34aa2: 6b e0 ldi r22, 0x0B ; 11 34aa4: 80 91 56 13 lds r24, 0x1356 ; 0x801356 34aa8: 0f 94 73 a4 call 0x348e6 ; 0x348e6 34aac: e1 cf rjmp .-62 ; 0x34a70 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 34aae: 80 e0 ldi r24, 0x00 ; 0 34ab0: ef cf rjmp .-34 ; 0x34a90 00034ab2 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 34ab2: cf 93 push r28 34ab4: df 93 push r29 34ab6: 00 d0 rcall .+0 ; 0x34ab8 34ab8: 1f 92 push r1 34aba: 1f 92 push r1 34abc: cd b7 in r28, 0x3d ; 61 34abe: de b7 in r29, 0x3e ; 62 34ac0: 49 83 std Y+1, r20 ; 0x01 34ac2: 5a 83 std Y+2, r21 ; 0x02 34ac4: 6b 83 std Y+3, r22 ; 0x03 34ac6: 7c 83 std Y+4, r23 ; 0x04 34ac8: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 34aca: 85 e0 ldi r24, 0x05 ; 5 34acc: fe 01 movw r30, r28 34ace: 31 96 adiw r30, 0x01 ; 1 34ad0: a5 e5 ldi r26, 0x55 ; 85 34ad2: b3 e1 ldi r27, 0x13 ; 19 34ad4: 01 90 ld r0, Z+ 34ad6: 0d 92 st X+, r0 34ad8: 8a 95 dec r24 34ada: e1 f7 brne .-8 ; 0x34ad4 if (!ExpectsResponse()) { 34adc: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 34ae0: 87 ff sbrs r24, 7 34ae2: 09 c0 rjmp .+18 ; 0x34af6 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 34ae4: 0f 90 pop r0 34ae6: 0f 90 pop r0 34ae8: 0f 90 pop r0 34aea: 0f 90 pop r0 34aec: 0f 90 pop r0 34aee: df 91 pop r29 34af0: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 34af2: 0d 94 d4 a4 jmp 0x349a8 ; 0x349a8 } // otherwise wait for an empty window to activate the request } 34af6: 0f 90 pop r0 34af8: 0f 90 pop r0 34afa: 0f 90 pop r0 34afc: 0f 90 pop r0 34afe: 0f 90 pop r0 34b00: df 91 pop r29 34b02: cf 91 pop r28 34b04: 08 95 ret 00034b06 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 34b06: 1f 93 push r17 34b08: cf 93 push r28 34b0a: df 93 push r29 34b0c: 00 d0 rcall .+0 ; 0x34b0e 34b0e: 1f 92 push r1 34b10: 1f 92 push r1 34b12: cd b7 in r28, 0x3d ; 61 34b14: de b7 in r29, 0x3e ; 62 34b16: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 34b18: 48 2f mov r20, r24 34b1a: 63 e5 ldi r22, 0x53 ; 83 34b1c: ce 01 movw r24, r28 34b1e: 01 96 adiw r24, 0x01 ; 1 34b20: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34b24: 49 81 ldd r20, Y+1 ; 0x01 34b26: 5a 81 ldd r21, Y+2 ; 0x02 34b28: 6b 81 ldd r22, Y+3 ; 0x03 34b2a: 7c 81 ldd r23, Y+4 ; 0x04 34b2c: 8d 81 ldd r24, Y+5 ; 0x05 34b2e: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 34b32: 10 93 4e 13 sts 0x134E, r17 ; 0x80134e } 34b36: 0f 90 pop r0 34b38: 0f 90 pop r0 34b3a: 0f 90 pop r0 34b3c: 0f 90 pop r0 34b3e: 0f 90 pop r0 34b40: df 91 pop r29 34b42: cf 91 pop r28 34b44: 1f 91 pop r17 34b46: 08 95 ret 00034b48 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 34b48: cf 93 push r28 34b4a: df 93 push r29 34b4c: 00 d0 rcall .+0 ; 0x34b4e 34b4e: 1f 92 push r1 34b50: 1f 92 push r1 34b52: cd b7 in r28, 0x3d ; 61 34b54: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 34b56: 40 e0 ldi r20, 0x00 ; 0 34b58: 61 e5 ldi r22, 0x51 ; 81 34b5a: ce 01 movw r24, r28 34b5c: 01 96 adiw r24, 0x01 ; 1 34b5e: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34b62: 49 81 ldd r20, Y+1 ; 0x01 34b64: 5a 81 ldd r21, Y+2 ; 0x02 34b66: 6b 81 ldd r22, Y+3 ; 0x03 34b68: 7c 81 ldd r23, Y+4 ; 0x04 34b6a: 8d 81 ldd r24, Y+5 ; 0x05 34b6c: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 scopeState = ScopeState::QuerySent; 34b70: 84 e0 ldi r24, 0x04 ; 4 34b72: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e } 34b76: 0f 90 pop r0 34b78: 0f 90 pop r0 34b7a: 0f 90 pop r0 34b7c: 0f 90 pop r0 34b7e: 0f 90 pop r0 34b80: df 91 pop r29 34b82: cf 91 pop r28 34b84: 08 95 ret 00034b86 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 34b86: cf 93 push r28 34b88: df 93 push r29 34b8a: 00 d0 rcall .+0 ; 0x34b8c 34b8c: 1f 92 push r1 34b8e: 1f 92 push r1 34b90: cd b7 in r28, 0x3d ; 61 34b92: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 34b94: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 34b98: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f 34b9c: 48 2f mov r20, r24 34b9e: 66 e6 ldi r22, 0x66 ; 102 34ba0: ce 01 movw r24, r28 34ba2: 01 96 adiw r24, 0x01 ; 1 34ba4: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34ba8: 49 81 ldd r20, Y+1 ; 0x01 34baa: 5a 81 ldd r21, Y+2 ; 0x02 34bac: 6b 81 ldd r22, Y+3 ; 0x03 34bae: 7c 81 ldd r23, Y+4 ; 0x04 34bb0: 8d 81 ldd r24, Y+5 ; 0x05 34bb2: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 scopeState = ScopeState::FilamentSensorStateSent; 34bb6: 86 e0 ldi r24, 0x06 ; 6 34bb8: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e } 34bbc: 0f 90 pop r0 34bbe: 0f 90 pop r0 34bc0: 0f 90 pop r0 34bc2: 0f 90 pop r0 34bc4: 0f 90 pop r0 34bc6: df 91 pop r29 34bc8: cf 91 pop r28 34bca: 08 95 ret 00034bcc : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 34bcc: cf 93 push r28 34bce: df 93 push r29 34bd0: 00 d0 rcall .+0 ; 0x34bd2 34bd2: 1f 92 push r1 34bd4: 1f 92 push r1 34bd6: cd b7 in r28, 0x3d ; 61 34bd8: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 34bda: 80 91 65 13 lds r24, 0x1365 ; 0x801365 34bde: 85 34 cpi r24, 0x45 ; 69 34be0: f1 f0 breq .+60 ; 0x34c1e 34be2: 20 f4 brcc .+8 ; 0x34bec 34be4: 82 34 cpi r24, 0x42 ; 66 34be6: 51 f1 breq .+84 ; 0x34c3c } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 34be8: 85 e0 ldi r24, 0x05 ; 5 34bea: 11 c0 rjmp .+34 ; 0x34c0e } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 34bec: 86 34 cpi r24, 0x46 ; 70 34bee: 71 f1 breq .+92 ; 0x34c4c 34bf0: 80 35 cpi r24, 0x50 ; 80 34bf2: d1 f7 brne .-12 ; 0x34be8 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 34bf4: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34bf8: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = ErrorCode::OK; 34bfc: 81 e0 ldi r24, 0x01 ; 1 34bfe: 90 e0 ldi r25, 0x00 ; 0 34c00: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c04: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 34c08: 0f 94 c3 a5 call 0x34b86 ; 0x34b86 return Processing; 34c0c: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 34c0e: 0f 90 pop r0 34c10: 0f 90 pop r0 34c12: 0f 90 pop r0 34c14: 0f 90 pop r0 34c16: 0f 90 pop r0 34c18: df 91 pop r29 34c1a: cf 91 pop r28 34c1c: 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; 34c1e: 8c e0 ldi r24, 0x0C ; 12 34c20: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = static_cast(rsp.paramValue); 34c24: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34c28: 90 91 67 13 lds r25, 0x1367 ; 0x801367 34c2c: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c30: 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(); 34c34: 0f 94 c3 a5 call 0x34b86 ; 0x34b86 return CommandError; 34c38: 87 e0 ldi r24, 0x07 ; 7 34c3a: e9 cf rjmp .-46 ; 0x34c0e 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); 34c3c: 80 91 66 13 lds r24, 0x1366 ; 0x801366 34c40: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e SendAndUpdateFilamentSensor(); 34c44: 0f 94 c3 a5 call 0x34b86 ; 0x34b86 return ButtonPushed; 34c48: 8b e0 ldi r24, 0x0B ; 11 34c4a: e1 cf rjmp .-62 ; 0x34c0e 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) { 34c4c: 90 91 50 13 lds r25, 0x1350 ; 0x801350 34c50: 80 91 60 13 lds r24, 0x1360 ; 0x801360 34c54: 98 13 cpse r25, r24 34c56: 22 c0 rjmp .+68 ; 0x34c9c 34c58: 90 91 51 13 lds r25, 0x1351 ; 0x801351 34c5c: 80 91 61 13 lds r24, 0x1361 ; 0x801361 34c60: 98 13 cpse r25, r24 34c62: 1c c0 rjmp .+56 ; 0x34c9c progressCode = ProgressCode::OK; 34c64: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::OK; 34c68: 81 e0 ldi r24, 0x01 ; 1 34c6a: 90 e0 ldi r25, 0x00 ; 0 34c6c: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 34c70: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b scopeState = ScopeState::Ready; 34c74: 82 e8 ldi r24, 0x82 ; 130 34c76: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 34c7a: 40 e0 ldi r20, 0x00 ; 0 34c7c: 60 e0 ldi r22, 0x00 ; 0 34c7e: ce 01 movw r24, r28 34c80: 01 96 adiw r24, 0x01 ; 1 34c82: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34c86: 85 e0 ldi r24, 0x05 ; 5 34c88: fe 01 movw r30, r28 34c8a: 31 96 adiw r30, 0x01 ; 1 34c8c: a0 e5 ldi r26, 0x50 ; 80 34c8e: b3 e1 ldi r27, 0x13 ; 19 34c90: 01 90 ld r0, Z+ 34c92: 0d 92 st X+, r0 34c94: 8a 95 dec r24 34c96: e1 f7 brne .-8 ; 0x34c90 34c98: 82 e0 ldi r24, 0x02 ; 2 34c9a: b9 cf rjmp .-142 ; 0x34c0e return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 34c9c: 83 e0 ldi r24, 0x03 ; 3 34c9e: b7 cf rjmp .-146 ; 0x34c0e 00034ca0 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 34ca0: 1f 93 push r17 34ca2: cf 93 push r28 34ca4: df 93 push r29 34ca6: 00 d0 rcall .+0 ; 0x34ca8 34ca8: 1f 92 push r1 34caa: 1f 92 push r1 34cac: cd b7 in r28, 0x3d ; 61 34cae: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 34cb0: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 34cb4: 81 11 cpse r24, r1 34cb6: 2a c0 rjmp .+84 ; 0x34d0c auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 34cb8: 10 91 b5 13 lds r17, 0x13B5 ; 0x8013b5 34cbc: 1f 3f cpi r17, 0xFF ; 255 34cbe: 91 f5 brne .+100 ; 0x34d24 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 34cc0: 80 91 b4 13 lds r24, 0x13B4 ; 0x8013b4 34cc4: 81 11 cpse r24, r1 34cc6: 60 c0 rjmp .+192 ; 0x34d88 34cc8: 1f 3f cpi r17, 0xFF ; 255 34cca: b9 f0 breq .+46 ; 0x34cfa inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 34ccc: 81 e0 ldi r24, 0x01 ; 1 34cce: 90 e0 ldi r25, 0x00 ; 0 34cd0: 90 93 4c 13 sts 0x134C, r25 ; 0x80134c 34cd4: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 34cd8: 90 93 b3 13 sts 0x13B3, r25 ; 0x8013b3 34cdc: 80 93 b2 13 sts 0x13B2, r24 ; 0x8013b2 lastErrorSource = ErrorSource::ErrorSourceNone; 34ce0: 8f ef ldi r24, 0xFF ; 255 34ce2: 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) { 34ce6: 13 30 cpi r17, 0x03 ; 3 34ce8: 09 f4 brne .+2 ; 0x34cec 34cea: 82 c0 rjmp .+260 ; 0x34df0 34cec: f8 f0 brcs .+62 ; 0x34d2c 34cee: 16 30 cpi r17, 0x06 ; 6 34cf0: 08 f4 brcc .+2 ; 0x34cf4 34cf2: 7b c0 rjmp .+246 ; 0x34dea 34cf4: 17 30 cpi r17, 0x07 ; 7 34cf6: 09 f4 brne .+2 ; 0x34cfa 34cf8: 7e c0 rjmp .+252 ; 0x34df6 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 34cfa: 0f 90 pop r0 34cfc: 0f 90 pop r0 34cfe: 0f 90 pop r0 34d00: 0f 90 pop r0 34d02: 0f 90 pop r0 34d04: df 91 pop r29 34d06: cf 91 pop r28 34d08: 1f 91 pop r17 34d0a: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 34d0c: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34d10: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34d14: 0f 94 7e c8 call 0x390fc ; 0x390fc 34d18: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 34d1a: 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) { 34d1e: 8f 3f cpi r24, 0xFF ; 255 34d20: 79 f6 brne .-98 ; 0x34cc0 34d22: ca cf rjmp .-108 ; 0x34cb8 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 34d24: 8f ef ldi r24, 0xFF ; 255 34d26: 80 93 b5 13 sts 0x13B5, r24 ; 0x8013b5 34d2a: ca cf rjmp .-108 ; 0x34cc0 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 34d2c: 86 ea ldi r24, 0xA6 ; 166 34d2e: 99 ea ldi r25, 0xA9 ; 169 34d30: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 34d34: 81 2f mov r24, r17 34d36: 90 e0 ldi r25, 0x00 ; 0 34d38: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 34d3c: 0f 94 1b ac call 0x35836 ; 0x35836 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 34d40: 80 91 b4 13 lds r24, 0x13B4 ; 0x8013b4 34d44: 81 30 cpi r24, 0x01 ; 1 34d46: 89 f4 brne .+34 ; 0x34d6a ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 34d48: 8f e9 ldi r24, 0x9F ; 159 34d4a: 99 ea ldi r25, 0xA9 ; 169 34d4c: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 34d50: 41 2f mov r20, r17 34d52: 62 e4 ldi r22, 0x42 ; 66 34d54: ce 01 movw r24, r28 34d56: 01 96 adiw r24, 0x01 ; 1 34d58: 0f 94 94 c5 call 0x38b28 ; 0x38b28 34d5c: 49 81 ldd r20, Y+1 ; 0x01 34d5e: 5a 81 ldd r21, Y+2 ; 0x02 34d60: 6b 81 ldd r22, Y+3 ; 0x03 34d62: 7c 81 ldd r23, Y+4 ; 0x04 34d64: 8d 81 ldd r24, Y+5 ; 0x05 34d66: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 } // 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) { 34d6a: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34d6e: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34d72: 84 30 cpi r24, 0x04 ; 4 34d74: 20 e8 ldi r18, 0x80 ; 128 34d76: 92 07 cpc r25, r18 34d78: 21 f0 breq .+8 ; 0x34d82 34d7a: 89 30 cpi r24, 0x09 ; 9 34d7c: 90 48 sbci r25, 0x80 ; 128 34d7e: 09 f0 breq .+2 ; 0x34d82 34d80: bc cf rjmp .-136 ; 0x34cfa case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 34d82: 0f 94 13 6a call 0x2d426 ; 0x2d426 34d86: b9 cf rjmp .-142 ; 0x34cfa // 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) { 34d88: 19 30 cpi r17, 0x09 ; 9 34d8a: 08 f0 brcs .+2 ; 0x34d8e 34d8c: b6 cf rjmp .-148 ; 0x34cfa 34d8e: e1 2f mov r30, r17 34d90: f0 e0 ldi r31, 0x00 ; 0 34d92: 88 27 eor r24, r24 34d94: e1 53 subi r30, 0x31 ; 49 34d96: f9 45 sbci r31, 0x59 ; 89 34d98: 8e 4f sbci r24, 0xFE ; 254 34d9a: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 34d9e: c8 3a cpi r28, 0xA8 ; 168 34da0: c8 3a cpi r28, 0xA8 ; 168 34da2: c8 3a cpi r28, 0xA8 ; 168 34da4: 9a 3a cpi r25, 0xAA ; 170 34da6: 7e 39 cpi r23, 0x9E ; 158 34da8: 7e 39 cpi r23, 0x9E ; 158 34daa: da 3a cpi r29, 0xAA ; 170 34dac: 68 39 cpi r22, 0x98 ; 152 34dae: b4 3a cpi r27, 0xA4 ; 164 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 34db0: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 34db4: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 34db8: 87 38 cpi r24, 0x87 ; 135 34dba: 20 e8 ldi r18, 0x80 ; 128 34dbc: 92 07 cpc r25, r18 34dbe: 21 f0 breq .+8 ; 0x34dc8 34dc0: 87 30 cpi r24, 0x07 ; 7 34dc2: 91 48 sbci r25, 0x81 ; 129 34dc4: 09 f0 breq .+2 ; 0x34dc8 34dc6: 99 cf rjmp .-206 ; 0x34cfa // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 34dc8: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34dcc: 84 30 cpi r24, 0x04 ; 4 34dce: 21 f4 brne .+8 ; 0x34dd8 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 34dd0: 80 91 50 13 lds r24, 0x1350 ; 0x801350 34dd4: 81 11 cpse r24, r1 34dd6: 91 cf rjmp .-222 ; 0x34cfa // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 34dd8: 81 e0 ldi r24, 0x01 ; 1 34dda: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> menu_submenu(tuneIdlerStallguardThresholdMenu); 34dde: 60 e0 ldi r22, 0x00 ; 0 34de0: 86 e1 ldi r24, 0x16 ; 22 34de2: 9a e3 ldi r25, 0x3A ; 58 34de4: 0f 94 0a d3 call 0x3a614 ; 0x3a614 34de8: 88 cf rjmp .-240 ; 0x34cfa } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 34dea: 10 93 b8 13 sts 0x13B8, r17 ; 0x8013b8 34dee: 85 cf rjmp .-246 ; 0x34cfa void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 34df0: 0f 94 a1 c5 call 0x38b42 ; 0x38b42 34df4: 82 cf rjmp .-252 ; 0x34cfa StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 34df6: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 34dfa: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 34dfe: 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); 34e02: 60 e0 ldi r22, 0x00 ; 0 34e04: 8c ea ldi r24, 0xAC ; 172 34e06: 9c e0 ldi r25, 0x0C ; 12 34e08: 0f 94 47 dc call 0x3b88e ; 0x3b88e } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 34e0c: 0f 94 ea 74 call 0x2e9d4 ; 0x2e9d4 34e10: 74 cf rjmp .-280 ; 0x34cfa 00034e12 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 34e12: 4f 92 push r4 34e14: 5f 92 push r5 34e16: 6f 92 push r6 34e18: 7f 92 push r7 34e1a: 8f 92 push r8 34e1c: 9f 92 push r9 34e1e: af 92 push r10 34e20: bf 92 push r11 34e22: cf 92 push r12 34e24: df 92 push r13 34e26: ef 92 push r14 34e28: ff 92 push r15 34e2a: 0f 93 push r16 34e2c: 1f 93 push r17 34e2e: cf 93 push r28 34e30: df 93 push r29 34e32: cd b7 in r28, 0x3d ; 61 34e34: de b7 in r29, 0x3e ; 62 34e36: a0 97 sbiw r28, 0x20 ; 32 34e38: 0f b6 in r0, 0x3f ; 63 34e3a: f8 94 cli 34e3c: de bf out 0x3e, r29 ; 62 34e3e: 0f be out 0x3f, r0 ; 63 34e40: cd bf out 0x3d, r28 ; 61 34e42: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 34e44: 0f 94 50 a6 call 0x34ca0 ; 0x34ca0 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 34e48: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 34e4c: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 34e4e: 0f 94 d4 a4 call 0x349a8 ; 0x349a8 34e52: 90 91 4e 13 lds r25, 0x134E ; 0x80134e } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 34e56: 97 ff sbrs r25, 7 34e58: 7d c0 rjmp .+250 ; 0x34f54 // we are waiting for something switch (currentScope) { 34e5a: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 34e5e: 82 30 cpi r24, 0x02 ; 2 34e60: b1 f0 breq .+44 ; 0x34e8e 34e62: 08 f4 brcc .+2 ; 0x34e66 34e64: 75 c0 rjmp .+234 ; 0x34f50 34e66: 83 30 cpi r24, 0x03 ; 3 34e68: e1 f1 breq .+120 ; 0x34ee2 34e6a: 84 30 cpi r24, 0x04 ; 4 34e6c: 09 f4 brne .+2 ; 0x34e70 34e6e: 54 c0 rjmp .+168 ; 0x34f18 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 34e70: 0f 94 d4 a4 call 0x349a8 ; 0x349a8 34e74: 81 11 cpse r24, r1 34e76: 6b c3 rjmp .+1750 ; 0x3554e // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 34e78: 82 e0 ldi r24, 0x02 ; 2 34e7a: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::Idle; 34e7e: 83 e0 ldi r24, 0x03 ; 3 34e80: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 34e84: 82 e8 ldi r24, 0x82 ; 130 34e86: 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()) { 34e8a: 12 e0 ldi r17, 0x02 ; 2 34e8c: db c2 rjmp .+1462 ; 0x35444 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34e8e: 0f 94 53 29 call 0x252a6 ; 0x252a6 34e92: ab 01 movw r20, r22 34e94: bc 01 movw r22, r24 34e96: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34e9a: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34e9e: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34ea2: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34ea6: 88 51 subi r24, 0x18 ; 24 34ea8: 9c 4f sbci r25, 0xFC ; 252 34eaa: af 4f sbci r26, 0xFF ; 255 34eac: 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 34eae: 48 17 cp r20, r24 34eb0: 59 07 cpc r21, r25 34eb2: 6a 07 cpc r22, r26 34eb4: 7b 07 cpc r23, r27 34eb6: 08 f4 brcc .+2 ; 0x34eba 34eb8: 4b c0 rjmp .+150 ; 0x34f50 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 34eba: 84 e9 ldi r24, 0x94 ; 148 34ebc: 92 e1 ldi r25, 0x12 ; 18 34ebe: 0f 94 4f da call 0x3b49e ; 0x3b49e while (uart->read() != -1) 34ec2: 01 96 adiw r24, 0x01 ; 1 34ec4: d1 f7 brne .-12 ; 0x34eba initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 34ec6: 81 e0 ldi r24, 0x01 ; 1 34ec8: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::StartSeq; 34ecc: 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; 34ed0: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 34ed4: 86 e0 ldi r24, 0x06 ; 6 34ed6: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f SendVersion(0); 34eda: 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); 34edc: 0f 94 83 a5 call 0x34b06 ; 0x34b06 34ee0: 37 c0 rjmp .+110 ; 0x34f50 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 34ee2: 92 38 cpi r25, 0x82 ; 130 34ee4: 29 f6 brne .-118 ; 0x34e70 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34ee6: 0f 94 53 29 call 0x252a6 ; 0x252a6 34eea: ab 01 movw r20, r22 34eec: bc 01 movw r22, r24 34eee: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34ef2: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34ef6: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34efa: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34efe: 88 51 subi r24, 0x18 ; 24 34f00: 9c 4f sbci r25, 0xFC ; 252 34f02: af 4f sbci r26, 0xFF ; 255 34f04: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 34f06: 48 17 cp r20, r24 34f08: 59 07 cpc r21, r25 34f0a: 6a 07 cpc r22, r26 34f0c: 7b 07 cpc r23, r27 34f0e: 08 f4 brcc .+2 ; 0x34f12 34f10: af cf rjmp .-162 ; 0x34e70 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 34f12: 0f 94 a4 a5 call 0x34b48 ; 0x34b48 34f16: 1c c0 rjmp .+56 ; 0x34f50 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 34f18: 0f 94 53 29 call 0x252a6 ; 0x252a6 34f1c: ab 01 movw r20, r22 34f1e: bc 01 movw r22, r24 34f20: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 34f24: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 34f28: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 34f2c: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 34f30: 88 51 subi r24, 0x18 ; 24 34f32: 9c 4f sbci r25, 0xFC ; 252 34f34: af 4f sbci r26, 0xFF ; 255 34f36: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 34f38: 48 17 cp r20, r24 34f3a: 59 07 cpc r21, r25 34f3c: 6a 07 cpc r22, r26 34f3e: 7b 07 cpc r23, r27 34f40: 40 f7 brcc .-48 ; 0x34f12 }; 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(); 34f42: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 if (fs != lastFSensor) { 34f46: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 34f4a: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 34f4c: 0f 94 c3 a5 call 0x34b86 ; 0x34b86 // 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; 34f50: 10 e0 ldi r17, 0x00 ; 0 34f52: 78 c2 rjmp .+1264 ; 0x35444 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 34f54: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 34f56: d1 2c mov r13, r1 34f58: 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; 34f5a: 99 24 eor r9, r9 34f5c: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 34f5e: 55 e0 ldi r21, 0x05 ; 5 34f60: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 34f62: 63 e0 ldi r22, 0x03 ; 3 34f64: 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; 34f66: 74 e0 ldi r23, 0x04 ; 4 34f68: 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; 34f6a: e2 e0 ldi r30, 0x02 ; 2 34f6c: 6e 2e mov r6, r30 34f6e: 66 c0 rjmp .+204 ; 0x3503c ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 34f70: 23 30 cpi r18, 0x03 ; 3 34f72: 09 f4 brne .+2 ; 0x34f76 34f74: e0 c0 rjmp .+448 ; 0x35136 34f76: 24 30 cpi r18, 0x04 ; 4 34f78: 09 f0 breq .+2 ; 0x34f7c 34f7a: 83 c0 rjmp .+262 ; 0x35082 } 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'); 34f7c: 20 ed ldi r18, 0xD0 ; 208 34f7e: 28 0f add r18, r24 34f80: 2a 30 cpi r18, 0x0A ; 10 34f82: 08 f4 brcc .+2 ; 0x34f86 34f84: f8 c0 rjmp .+496 ; 0x35176 34f86: 2f e9 ldi r18, 0x9F ; 159 34f88: 28 0f add r18, r24 34f8a: 26 30 cpi r18, 0x06 ; 6 34f8c: 08 f4 brcc .+2 ; 0x34f90 34f8e: f3 c0 rjmp .+486 ; 0x35176 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 34f90: 8a 30 cpi r24, 0x0A ; 10 34f92: 09 f0 breq .+2 ; 0x34f96 34f94: fa c0 rjmp .+500 ; 0x3518a 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()) { 34f96: 40 90 74 13 lds r4, 0x1374 ; 0x801374 34f9a: 80 e7 ldi r24, 0x70 ; 112 34f9c: 93 e1 ldi r25, 0x13 ; 19 34f9e: 0f 94 83 c5 call 0x38b06 ; 0x38b06 34fa2: 48 12 cpse r4, r24 34fa4: b8 c0 rjmp .+368 ; 0x35116 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 34fa6: 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; } 34faa: 88 e0 ldi r24, 0x08 ; 8 34fac: e0 e7 ldi r30, 0x70 ; 112 34fae: f3 e1 ldi r31, 0x13 ; 19 34fb0: de 01 movw r26, r28 34fb2: 51 96 adiw r26, 0x11 ; 17 34fb4: 01 90 ld r0, Z+ 34fb6: 0d 92 st X+, r0 34fb8: 8a 95 dec r24 34fba: e1 f7 brne .-8 ; 0x34fb4 34fbc: 88 e0 ldi r24, 0x08 ; 8 34fbe: fe 01 movw r30, r28 34fc0: 71 96 adiw r30, 0x11 ; 17 34fc2: de 01 movw r26, r28 34fc4: 59 96 adiw r26, 0x19 ; 25 34fc6: 01 90 ld r0, Z+ 34fc8: 0d 92 st X+, r0 34fca: 8a 95 dec r24 34fcc: e1 f7 brne .-8 ; 0x34fc6 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 34fce: 88 e0 ldi r24, 0x08 ; 8 34fd0: fe 01 movw r30, r28 34fd2: 79 96 adiw r30, 0x19 ; 25 34fd4: a0 e6 ldi r26, 0x60 ; 96 34fd6: b3 e1 ldi r27, 0x13 ; 19 34fd8: 01 90 ld r0, Z+ 34fda: 0d 92 st X+, r0 34fdc: 8a 95 dec r24 34fde: e1 f7 brne .-8 ; 0x34fd8 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 34fe0: 8c e3 ldi r24, 0x3C ; 60 34fe2: 89 83 std Y+1, r24 ; 0x01 34fe4: fe 01 movw r30, r28 34fe6: 32 96 adiw r30, 0x02 ; 2 34fe8: a8 e7 ldi r26, 0x78 ; 120 34fea: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 34fec: 20 e0 ldi r18, 0x00 ; 0 34fee: cf 01 movw r24, r30 34ff0: 52 16 cp r5, r18 34ff2: 09 f4 brne .+2 ; 0x34ff6 34ff4: cd c0 rjmp .+410 ; 0x35190 uint8_t b = lastReceivedBytes[i]; 34ff6: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 34ff8: 40 ee ldi r20, 0xE0 ; 224 34ffa: 43 0f add r20, r19 34ffc: 40 36 cpi r20, 0x60 ; 96 34ffe: 08 f0 brcs .+2 ; 0x35002 b = '.'; 35000: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 35002: 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) { 35004: 2f 5f subi r18, 0xFF ; 255 35006: f4 cf rjmp .-24 ; 0x34ff0 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 35008: 8e 34 cpi r24, 0x4E ; 78 3500a: 08 f0 brcs .+2 ; 0x3500e 3500c: 56 c0 rjmp .+172 ; 0x350ba 3500e: 8b 34 cpi r24, 0x4B ; 75 35010: 08 f0 brcs .+2 ; 0x35014 35012: 46 c0 rjmp .+140 ; 0x350a0 35014: 82 34 cpi r24, 0x42 ; 66 35016: 09 f4 brne .+2 ; 0x3501a 35018: 43 c0 rjmp .+134 ; 0x350a0 3501a: e0 f5 brcc .+120 ; 0x35094 3501c: 8a 30 cpi r24, 0x0A ; 10 3501e: 59 f0 breq .+22 ; 0x35036 35020: 8d 30 cpi r24, 0x0D ; 13 35022: 49 f0 breq .+18 ; 0x35036 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 35024: 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') { 35028: a1 10 cpse r10, r1 3502a: 05 c1 rjmp .+522 ; 0x35236 3502c: 1f 36 cpi r17, 0x6F ; 111 3502e: 09 f0 breq .+2 ; 0x35032 35030: fc c3 rjmp .+2040 ; 0x3582a ++ok; 35032: aa 24 eor r10, r10 35034: 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; 35036: 4f ef ldi r20, 0xFF ; 255 35038: c4 1a sub r12, r20 3503a: d4 0a sbc r13, r20 3503c: 84 e9 ldi r24, 0x94 ; 148 3503e: 92 e1 ldi r25, 0x12 ; 18 35040: 0f 94 4f da call 0x3b49e ; 0x3b49e 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) { 35044: 97 fd sbrc r25, 7 35046: 00 c1 rjmp .+512 ; 0x35248 ++bytesConsumed; RecordReceivedByte(c); 35048: 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]; 3504a: 20 91 88 13 lds r18, 0x1388 ; 0x801388 3504e: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 35050: f9 01 movw r30, r18 35052: e5 5b subi r30, 0xB5 ; 181 35054: fc 4e sbci r31, 0xEC ; 236 35056: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 35058: 79 01 movw r14, r18 3505a: ef ef ldi r30, 0xFF ; 255 3505c: ee 1a sub r14, r30 3505e: fe 0a sbc r15, r30 35060: ff e0 ldi r31, 0x0F ; 15 35062: ef 22 and r14, r31 35064: ff 24 eor r15, r15 35066: 5e 2c mov r5, r14 35068: e0 92 88 13 sts 0x1388, r14 ; 0x801388 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 3506c: 20 91 6f 13 lds r18, 0x136F ; 0x80136f 35070: 22 30 cpi r18, 0x02 ; 2 35072: 09 f4 brne .+2 ; 0x35076 35074: 48 c0 rjmp .+144 ; 0x35106 35076: 08 f0 brcs .+2 ; 0x3507a 35078: 7b cf rjmp .-266 ; 0x34f70 3507a: 22 23 and r18, r18 3507c: 29 f2 breq .-118 ; 0x35008 3507e: 21 30 cpi r18, 0x01 ; 1 35080: 51 f1 breq .+84 ; 0x350d6 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 35082: 1a 30 cpi r17, 0x0A ; 10 35084: 09 f4 brne .+2 ; 0x35088 35086: 8f cf rjmp .-226 ; 0x34fa6 35088: 1d 30 cpi r17, 0x0D ; 13 3508a: 09 f4 brne .+2 ; 0x3508e 3508c: 8c cf rjmp .-232 ; 0x34fa6 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 3508e: 10 92 75 13 sts 0x1375, r1 ; 0x801375 35092: ca cf rjmp .-108 ; 0x35028 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 35094: 85 34 cpi r24, 0x45 ; 69 35096: 30 f2 brcs .-116 ; 0x35024 35098: 87 34 cpi r24, 0x47 ; 71 3509a: 10 f0 brcs .+4 ; 0x350a0 3509c: 88 34 cpi r24, 0x48 ; 72 3509e: 11 f6 brne .-124 ; 0x35024 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 350a0: 80 93 70 13 sts 0x1370, r24 ; 0x801370 responseMsg.request.value = 0; 350a4: 10 92 71 13 sts 0x1371, r1 ; 0x801371 responseMsg.request.value2 = 0; 350a8: 10 92 73 13 sts 0x1373, r1 ; 0x801373 350ac: 10 92 72 13 sts 0x1372, r1 ; 0x801372 responseMsg.request.crc8 = 0; 350b0: 10 92 74 13 sts 0x1374, r1 ; 0x801374 rspState = ResponseStates::RequestValue; 350b4: 90 92 6f 13 sts 0x136F, r9 ; 0x80136f 350b8: be cf rjmp .-132 ; 0x35036 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 350ba: 89 35 cpi r24, 0x59 ; 89 350bc: 40 f4 brcc .+16 ; 0x350ce 350be: 87 35 cpi r24, 0x57 ; 87 350c0: 78 f7 brcc .-34 ; 0x350a0 350c2: 20 eb ldi r18, 0xB0 ; 176 350c4: 28 0f add r18, r24 350c6: 26 30 cpi r18, 0x06 ; 6 350c8: 08 f0 brcs .+2 ; 0x350cc 350ca: ac cf rjmp .-168 ; 0x35024 350cc: e9 cf rjmp .-46 ; 0x350a0 350ce: 86 36 cpi r24, 0x66 ; 102 350d0: 09 f0 breq .+2 ; 0x350d4 350d2: a8 cf rjmp .-176 ; 0x35024 350d4: e5 cf rjmp .-54 ; 0x350a0 } 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'); 350d6: 20 ed ldi r18, 0xD0 ; 208 350d8: 28 0f add r18, r24 350da: 2a 30 cpi r18, 0x0A ; 10 350dc: 50 f0 brcs .+20 ; 0x350f2 350de: 2f e9 ldi r18, 0x9F ; 159 350e0: 28 0f add r18, r24 350e2: 26 30 cpi r18, 0x06 ; 6 350e4: 30 f0 brcs .+12 ; 0x350f2 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 350e6: 80 32 cpi r24, 0x20 ; 32 350e8: 09 f0 breq .+2 ; 0x350ec 350ea: 9c cf rjmp .-200 ; 0x35024 rspState = ResponseStates::ParamCode; 350ec: 60 92 6f 13 sts 0x136F, r6 ; 0x80136f 350f0: a2 cf rjmp .-188 ; 0x35036 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 350f2: 0f 94 62 c5 call 0x38ac4 ; 0x38ac4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 350f6: 90 91 71 13 lds r25, 0x1371 ; 0x801371 350fa: 92 95 swap r25 350fc: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 350fe: 89 0f add r24, r25 35100: 80 93 71 13 sts 0x1371, r24 ; 0x801371 35104: 98 cf rjmp .-208 ; 0x35036 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 35106: 87 34 cpi r24, 0x47 ; 71 35108: 48 f4 brcc .+18 ; 0x3511c 3510a: 85 34 cpi r24, 0x45 ; 69 3510c: 58 f4 brcc .+22 ; 0x35124 3510e: 2f eb ldi r18, 0xBF ; 191 35110: 28 0f add r18, r24 35112: 22 30 cpi r18, 0x02 ; 2 35114: 38 f0 brcs .+14 ; 0x35124 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 35116: 10 92 75 13 sts 0x1375, r1 ; 0x801375 3511a: 84 cf rjmp .-248 ; 0x35024 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 3511c: 80 35 cpi r24, 0x50 ; 80 3511e: 11 f0 breq .+4 ; 0x35124 35120: 82 35 cpi r24, 0x52 ; 82 35122: c9 f7 brne .-14 ; 0x35116 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 35124: 80 92 6f 13 sts 0x136F, r8 ; 0x80136f responseMsg.paramCode = (ResponseMsgParamCodes)c; 35128: 80 93 75 13 sts 0x1375, r24 ; 0x801375 responseMsg.paramValue = 0; 3512c: 10 92 77 13 sts 0x1377, r1 ; 0x801377 35130: 10 92 76 13 sts 0x1376, r1 ; 0x801376 35134: 80 cf rjmp .-256 ; 0x35036 35136: 20 ed ldi r18, 0xD0 ; 208 35138: 28 0f add r18, r24 3513a: 2a 30 cpi r18, 0x0A ; 10 3513c: 48 f0 brcs .+18 ; 0x35150 3513e: 2f e9 ldi r18, 0x9F ; 159 35140: 28 0f add r18, r24 35142: 26 30 cpi r18, 0x06 ; 6 35144: 28 f0 brcs .+10 ; 0x35150 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 35146: 8a 32 cpi r24, 0x2A ; 42 35148: 31 f7 brne .-52 ; 0x35116 rspState = ResponseStates::CRC; 3514a: 70 92 6f 13 sts 0x136F, r7 ; 0x80136f 3514e: 73 cf rjmp .-282 ; 0x35036 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 35150: 0f 94 62 c5 call 0x38ac4 ; 0x38ac4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 35154: 20 91 76 13 lds r18, 0x1376 ; 0x801376 35158: 30 91 77 13 lds r19, 0x1377 ; 0x801377 3515c: 44 e0 ldi r20, 0x04 ; 4 3515e: 22 0f add r18, r18 35160: 33 1f adc r19, r19 35162: 4a 95 dec r20 35164: e1 f7 brne .-8 ; 0x3515e responseMsg.paramValue += Char2Nibble(c); 35166: 82 0f add r24, r18 35168: 93 2f mov r25, r19 3516a: 91 1d adc r25, r1 3516c: 90 93 77 13 sts 0x1377, r25 ; 0x801377 35170: 80 93 76 13 sts 0x1376, r24 ; 0x801376 35174: 60 cf rjmp .-320 ; 0x35036 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 35176: 0f 94 62 c5 call 0x38ac4 ; 0x38ac4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 3517a: 90 91 74 13 lds r25, 0x1374 ; 0x801374 3517e: 92 95 swap r25 35180: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 35182: 89 0f add r24, r25 35184: 80 93 74 13 sts 0x1374, r24 ; 0x801374 35188: 56 cf rjmp .-340 ; 0x35036 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3518a: 8d 30 cpi r24, 0x0D ; 13 3518c: 21 f6 brne .-120 ; 0x35116 3518e: 03 cf rjmp .-506 ; 0x34f96 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 35190: e8 0e add r14, r24 35192: f9 1e adc r15, r25 35194: f7 01 movw r30, r14 35196: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 35198: 10 92 88 13 sts 0x1388, r1 ; 0x801388 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 3519c: 80 ed ldi r24, 0xD0 ; 208 3519e: 9b ea ldi r25, 0xAB ; 171 351a0: 0e 94 57 77 call 0xeeae ; 0xeeae 351a4: 8a ec ldi r24, 0xCA ; 202 351a6: 9b ea ldi r25, 0xAB ; 171 351a8: 0e 94 57 77 call 0xeeae ; 0xeeae 351ac: ce 01 movw r24, r28 351ae: 01 96 adiw r24, 0x01 ; 1 351b0: 0f 94 07 d6 call 0x3ac0e ; 0x3ac0e 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 351b4: 0f 94 9d 65 call 0x2cb3a ; 0x2cb3a if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 351b8: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 351bc: 81 30 cpi r24, 0x01 ; 1 351be: 09 f4 brne .+2 ; 0x351c2 351c0: 74 c0 rjmp .+232 ; 0x352aa 351c2: 08 f4 brcc .+2 ; 0x351c6 351c4: c5 ce rjmp .-630 ; 0x34f50 351c6: 83 30 cpi r24, 0x03 ; 3 351c8: 09 f4 brne .+2 ; 0x351cc 351ca: d1 c0 rjmp .+418 ; 0x3536e 351cc: 84 30 cpi r24, 0x04 ; 4 351ce: 09 f0 breq .+2 ; 0x351d2 351d0: 4f ce rjmp .-866 ; 0x34e70 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 351d2: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 351d6: 86 30 cpi r24, 0x06 ; 6 351d8: 09 f4 brne .+2 ; 0x351dc 351da: 6c c1 rjmp .+728 ; 0x354b4 351dc: 08 f0 brcs .+2 ; 0x351e0 351de: 93 c1 rjmp .+806 ; 0x35506 351e0: 84 30 cpi r24, 0x04 ; 4 351e2: 09 f4 brne .+2 ; 0x351e6 351e4: 09 c1 rjmp .+530 ; 0x353f8 351e6: 85 30 cpi r24, 0x05 ; 5 351e8: 09 f0 breq .+2 ; 0x351ec 351ea: cc c0 rjmp .+408 ; 0x35384 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 351ec: 80 91 65 13 lds r24, 0x1365 ; 0x801365 351f0: 81 34 cpi r24, 0x41 ; 65 351f2: 09 f4 brne .+2 ; 0x351f6 351f4: 96 c1 rjmp .+812 ; 0x35522 351f6: 82 35 cpi r24, 0x52 ; 82 351f8: 09 f0 breq .+2 ; 0x351fc 351fa: c4 c0 rjmp .+392 ; 0x35384 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 351fc: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::PROTOCOL_ERROR; 35200: 8d e2 ldi r24, 0x2D ; 45 35202: 90 e8 ldi r25, 0x80 ; 128 35204: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 35208: 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")); 3520c: 8f e0 ldi r24, 0x0F ; 15 3520e: 99 ea ldi r25, 0xA9 ; 169 35210: 0f 94 ba 65 call 0x2cb74 ; 0x2cb74 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 35214: 85 e0 ldi r24, 0x05 ; 5 35216: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e SendMsg(rq); 3521a: 40 91 50 13 lds r20, 0x1350 ; 0x801350 3521e: 50 91 51 13 lds r21, 0x1351 ; 0x801351 35222: 60 91 52 13 lds r22, 0x1352 ; 0x801352 35226: 70 91 53 13 lds r23, 0x1353 ; 0x801353 3522a: 80 91 54 13 lds r24, 0x1354 ; 0x801354 3522e: 0f 94 a3 66 call 0x2cd46 ; 0x2cd46 35232: 16 e0 ldi r17, 0x06 ; 6 35234: 07 c1 rjmp .+526 ; 0x35444 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') { 35236: 1b 36 cpi r17, 0x6B ; 107 35238: 09 f0 breq .+2 ; 0x3523c 3523a: f7 c2 rjmp .+1518 ; 0x3582a 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")); 3523c: 80 ef ldi r24, 0xF0 ; 240 3523e: 98 ea ldi r25, 0xA8 ; 168 35240: 0f 94 ba 65 call 0x2cb74 ; 0x2cb74 35244: 18 e0 ldi r17, 0x08 ; 8 35246: fe c0 rjmp .+508 ; 0x35444 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 35248: cd 28 or r12, r13 3524a: 19 f0 breq .+6 ; 0x35252 RecordUARTActivity(); // something has happened on the UART, update the timeout record 3524c: 0f 94 9d 65 call 0x2cb3a ; 0x2cb3a 35250: 7f ce rjmp .-770 ; 0x34f50 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 35252: 0f 94 53 29 call 0x252a6 ; 0x252a6 35256: ab 01 movw r20, r22 35258: bc 01 movw r22, r24 3525a: 80 91 5a 13 lds r24, 0x135A ; 0x80135a 3525e: 90 91 5b 13 lds r25, 0x135B ; 0x80135b 35262: a0 91 5c 13 lds r26, 0x135C ; 0x80135c 35266: b0 91 5d 13 lds r27, 0x135D ; 0x80135d 3526a: 80 53 subi r24, 0x30 ; 48 3526c: 98 4f sbci r25, 0xF8 ; 248 3526e: af 4f sbci r26, 0xFF ; 255 35270: 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) { 35272: 48 17 cp r20, r24 35274: 59 07 cpc r21, r25 35276: 6a 07 cpc r22, r26 35278: 7b 07 cpc r23, r27 3527a: 08 f4 brcc .+2 ; 0x3527e 3527c: 69 ce rjmp .-814 ; 0x34f50 3527e: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35282: 88 23 and r24, r24 35284: 09 f4 brne .+2 ; 0x35288 35286: 64 ce rjmp .-824 ; 0x34f50 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 35288: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 3528c: 81 e0 ldi r24, 0x01 ; 1 3528e: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::StartSeq; 35292: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 35296: 86 e0 ldi r24, 0x06 ; 6 35298: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f SendVersion(0); 3529c: 80 e0 ldi r24, 0x00 ; 0 3529e: 0f 94 83 a5 call 0x34b06 ; 0x34b06 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 352a2: 64 e0 ldi r22, 0x04 ; 4 352a4: 88 ec ldi r24, 0xC8 ; 200 352a6: 98 ea ldi r25, 0xA8 ; 168 352a8: 79 c0 rjmp .+242 ; 0x3539c return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 352aa: 10 91 4e 13 lds r17, 0x134E ; 0x80134e 352ae: 13 30 cpi r17, 0x03 ; 3 352b0: b1 f1 breq .+108 ; 0x3531e 352b2: 60 f0 brcs .+24 ; 0x352cc 352b4: 16 30 cpi r17, 0x06 ; 6 352b6: 09 f4 brne .+2 ; 0x352ba 352b8: 50 c0 rjmp .+160 ; 0x3535a 352ba: 19 30 cpi r17, 0x09 ; 9 352bc: 09 f0 breq .+2 ; 0x352c0 352be: be cf rjmp .-132 ; 0x3523c // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 352c0: 0f 94 cd 67 call 0x2cf9a ; 0x2cf9a 352c4: 88 23 and r24, r24 352c6: 09 f4 brne .+2 ; 0x352ca 352c8: 43 ce rjmp .-890 ; 0x34f50 352ca: 40 ce rjmp .-896 ; 0x34f4c void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 352cc: 80 91 60 13 lds r24, 0x1360 ; 0x801360 352d0: 83 35 cpi r24, 0x53 ; 83 352d2: 21 f4 brne .+8 ; 0x352dc 352d4: 80 91 61 13 lds r24, 0x1361 ; 0x801361 352d8: 18 17 cp r17, r24 352da: 11 f0 breq .+4 ; 0x352e0 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 352dc: 81 2f mov r24, r17 352de: fe cd rjmp .-1028 ; 0x34edc 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; 352e0: 80 91 66 13 lds r24, 0x1366 ; 0x801366 352e4: e1 2f mov r30, r17 352e6: f0 e0 ldi r31, 0x00 ; 0 352e8: df 01 movw r26, r30 352ea: a6 56 subi r26, 0x66 ; 102 352ec: bc 4e sbci r27, 0xEC ; 236 352ee: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 352f0: e3 51 subi r30, 0x13 ; 19 352f2: f7 45 sbci r31, 0x57 ; 87 352f4: e4 91 lpm r30, Z 352f6: 8e 17 cp r24, r30 352f8: 41 f0 breq .+16 ; 0x3530a if (--retries == 0) { 352fa: 80 91 4f 13 lds r24, 0x134F ; 0x80134f 352fe: 81 50 subi r24, 0x01 ; 1 35300: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 35304: 81 11 cpse r24, r1 35306: ea cf rjmp .-44 ; 0x352dc 35308: 99 cf rjmp .-206 ; 0x3523c SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 3530a: 83 e7 ldi r24, 0x73 ; 115 3530c: 9b ea ldi r25, 0xAB ; 171 3530e: 0e 94 82 79 call 0xf304 ; 0xf304 /// @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; } 35312: 8a e0 ldi r24, 0x0A ; 10 35314: 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); 35318: 81 e0 ldi r24, 0x01 ; 1 3531a: 81 0f add r24, r17 3531c: df cd rjmp .-1090 ; 0x34edc 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) { 3531e: 80 91 60 13 lds r24, 0x1360 ; 0x801360 35322: 83 35 cpi r24, 0x53 ; 83 35324: 21 f4 brne .+8 ; 0x3532e 35326: 80 91 61 13 lds r24, 0x1361 ; 0x801361 3532a: 83 30 cpi r24, 0x03 ; 3 3532c: 11 f0 breq .+4 ; 0x35332 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 3532e: 83 e0 ldi r24, 0x03 ; 3 35330: d5 cd rjmp .-1110 ; 0x34edc } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 35332: 80 91 66 13 lds r24, 0x1366 ; 0x801366 35336: 90 91 67 13 lds r25, 0x1367 ; 0x801367 3533a: 90 93 9e 13 sts 0x139E, r25 ; 0x80139e 3533e: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 35342: 10 92 99 13 sts 0x1399, r1 ; 0x801399 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 35346: e1 e7 ldi r30, 0x71 ; 113 35348: fb ea ldi r31, 0xAB ; 171 3534a: 84 91 lpm r24, Z 3534c: 60 91 97 13 lds r22, 0x1397 ; 0x801397 35350: 70 e0 ldi r23, 0x00 ; 0 35352: 49 e0 ldi r20, 0x09 ; 9 35354: 0f 94 0e 67 call 0x2ce1c ; 0x2ce1c 35358: fb cd rjmp .-1034 ; 0x34f50 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 3535a: 82 e0 ldi r24, 0x02 ; 2 3535c: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::Idle; 35360: 83 e0 ldi r24, 0x03 ; 3 35362: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 35366: 82 e8 ldi r24, 0x82 ; 130 35368: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 3536c: d2 cd rjmp .-1116 ; 0x34f12 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 3536e: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 35372: 88 30 cpi r24, 0x08 ; 8 35374: 09 f4 brne .+2 ; 0x35378 35376: b7 c0 rjmp .+366 ; 0x354e6 35378: a8 f4 brcc .+42 ; 0x353a4 3537a: 84 30 cpi r24, 0x04 ; 4 3537c: d9 f0 breq .+54 ; 0x353b4 3537e: 87 30 cpi r24, 0x07 ; 7 35380: 09 f4 brne .+2 ; 0x35384 35382: ae c0 rjmp .+348 ; 0x354e0 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 35384: 81 e0 ldi r24, 0x01 ; 1 35386: 80 93 68 13 sts 0x1368, r24 ; 0x801368 currentScope = Scope::DelayedRestart; 3538a: 82 e0 ldi r24, 0x02 ; 2 3538c: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 35390: 83 e8 ldi r24, 0x83 ; 131 35392: 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); 35396: 65 e0 ldi r22, 0x05 ; 5 35398: 8e ed ldi r24, 0xDE ; 222 3539a: 98 ea ldi r25, 0xA8 ; 168 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 3539c: 0f 94 2b 66 call 0x2cc56 ; 0x2cc56 353a0: 18 2f mov r17, r24 353a2: 50 c0 rjmp .+160 ; 0x35444 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 353a4: 8a 30 cpi r24, 0x0A ; 10 353a6: 09 f4 brne .+2 ; 0x353aa 353a8: a7 c0 rjmp .+334 ; 0x354f8 353aa: 60 f3 brcs .-40 ; 0x35384 353ac: 8d 30 cpi r24, 0x0D ; 13 353ae: 08 f4 brcc .+2 ; 0x353b2 353b0: 5f cd rjmp .-1346 ; 0x34e70 353b2: e8 cf rjmp .-48 ; 0x35384 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) { 353b4: 80 91 60 13 lds r24, 0x1360 ; 0x801360 353b8: 8e 34 cpi r24, 0x4E ; 78 353ba: 60 f5 brcc .+88 ; 0x35414 353bc: 8b 34 cpi r24, 0x4B ; 75 353be: 10 f4 brcc .+4 ; 0x353c4 353c0: 85 34 cpi r24, 0x45 ; 69 353c2: 01 f7 brne .-64 ; 0x35384 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 353c4: 80 91 65 13 lds r24, 0x1365 ; 0x801365 353c8: 86 34 cpi r24, 0x46 ; 70 353ca: 09 f4 brne .+2 ; 0x353ce 353cc: 73 c0 rjmp .+230 ; 0x354b4 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 353ce: 84 e0 ldi r24, 0x04 ; 4 353d0: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 353d4: 85 e0 ldi r24, 0x05 ; 5 353d6: e0 e6 ldi r30, 0x60 ; 96 353d8: f3 e1 ldi r31, 0x13 ; 19 353da: de 01 movw r26, r28 353dc: 11 96 adiw r26, 0x01 ; 1 353de: 01 90 ld r0, Z+ 353e0: 0d 92 st X+, r0 353e2: 8a 95 dec r24 353e4: e1 f7 brne .-8 ; 0x353de StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 353e6: 85 e0 ldi r24, 0x05 ; 5 353e8: fe 01 movw r30, r28 353ea: 31 96 adiw r30, 0x01 ; 1 353ec: a0 e5 ldi r26, 0x50 ; 80 353ee: b3 e1 ldi r27, 0x13 ; 19 353f0: 01 90 ld r0, Z+ 353f2: 0d 92 st X+, r0 353f4: 8a 95 dec r24 353f6: e1 f7 brne .-8 ; 0x353f0 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 353f8: 0f 94 e6 a5 call 0x34bcc ; 0x34bcc 353fc: 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) { 353fe: 85 30 cpi r24, 0x05 ; 5 35400: 09 f2 breq .-126 ; 0x35384 35402: 08 f0 brcs .+2 ; 0x35406 35404: 9c c0 rjmp .+312 ; 0x3553e 35406: 82 30 cpi r24, 0x02 ; 2 35408: 09 f4 brne .+2 ; 0x3540c 3540a: 32 cd rjmp .-1436 ; 0x34e70 3540c: 84 30 cpi r24, 0x04 ; 4 3540e: 09 f4 brne .+2 ; 0x35412 35410: 3b cf rjmp .-394 ; 0x35288 35412: 18 c0 rjmp .+48 ; 0x35444 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) { 35414: 84 35 cpi r24, 0x54 ; 84 35416: 08 f4 brcc .+2 ; 0x3541a 35418: b5 cf rjmp .-150 ; 0x35384 3541a: 86 35 cpi r24, 0x56 ; 86 3541c: 98 f2 brcs .-90 ; 0x353c4 3541e: 88 35 cpi r24, 0x58 ; 88 35420: 09 f0 breq .+2 ; 0x35424 35422: b0 cf rjmp .-160 ; 0x35384 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) { 35424: 80 91 65 13 lds r24, 0x1365 ; 0x801365 35428: 86 34 cpi r24, 0x46 ; 70 3542a: 89 f1 breq .+98 ; 0x3548e 3542c: 80 35 cpi r24, 0x50 ; 80 3542e: c1 f1 breq .+112 ; 0x354a0 35430: 82 34 cpi r24, 0x42 ; 66 35432: 09 f0 breq .+2 ; 0x35436 35434: 42 c0 rjmp .+132 ; 0x354ba 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); 35436: 80 91 66 13 lds r24, 0x1366 ; 0x801366 3543a: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e StartReading8bitRegisters(); 3543e: 0f 94 94 a4 call 0x34928 ; 0x34928 return ButtonPushed; 35442: 1b e0 ldi r17, 0x0B ; 11 35444: 80 91 4b 13 lds r24, 0x134B ; 0x80134b 35448: 90 91 4c 13 lds r25, 0x134C ; 0x80134c break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 3544c: 81 30 cpi r24, 0x01 ; 1 3544e: 91 05 cpc r25, r1 35450: 09 f0 breq .+2 ; 0x35454 35452: ee c1 rjmp .+988 ; 0x35830 const StepStatus ss = logic.Step(); switch (ss) { 35454: 12 30 cpi r17, 0x02 ; 2 35456: 09 f4 brne .+2 ; 0x3545a 35458: 90 c0 rjmp .+288 ; 0x3557a 3545a: 08 f0 brcs .+2 ; 0x3545e 3545c: 7d c0 rjmp .+250 ; 0x35558 3545e: 11 23 and r17, r17 35460: 09 f4 brne .+2 ; 0x35464 35462: 18 c1 rjmp .+560 ; 0x35694 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 35464: 00 23 and r16, r16 35466: 09 f4 brne .+2 ; 0x3546a 35468: e4 c0 rjmp .+456 ; 0x35632 switch (ss) { 3546a: 17 30 cpi r17, 0x07 ; 7 3546c: 09 f4 brne .+2 ; 0x35470 3546e: c4 c1 rjmp .+904 ; 0x357f8 35470: 08 f0 brcs .+2 ; 0x35474 35472: b8 c1 rjmp .+880 ; 0x357e4 35474: 14 30 cpi r17, 0x04 ; 4 35476: 09 f4 brne .+2 ; 0x3547a 35478: c7 c1 rjmp .+910 ; 0x35808 3547a: 15 30 cpi r17, 0x05 ; 5 3547c: 09 f0 breq .+2 ; 0x35480 3547e: d9 c0 rjmp .+434 ; 0x35632 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 35480: 82 e0 ldi r24, 0x02 ; 2 35482: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 35486: 60 e0 ldi r22, 0x00 ; 0 35488: 8d e2 ldi r24, 0x2D ; 45 3548a: 90 e8 ldi r25, 0x80 ; 128 3548c: ba c1 rjmp .+884 ; 0x35802 // 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) { 3548e: 80 91 50 13 lds r24, 0x1350 ; 0x801350 35492: 88 23 and r24, r24 35494: 29 f0 breq .+10 ; 0x354a0 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 35496: 82 e8 ldi r24, 0x82 ; 130 35498: 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; 3549c: 13 e0 ldi r17, 0x03 ; 3 3549e: d2 cf rjmp .-92 ; 0x35444 } [[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); 354a0: 80 91 66 13 lds r24, 0x1366 ; 0x801366 354a4: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = ErrorCode::OK; 354a8: 81 e0 ldi r24, 0x01 ; 1 354aa: 90 e0 ldi r25, 0x00 ; 0 354ac: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 354b0: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 354b4: 0f 94 94 a4 call 0x34928 ; 0x34928 354b8: 4b cd rjmp .-1386 ; 0x34f50 // 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; 354ba: 8c e0 ldi r24, 0x0C ; 12 354bc: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d errorCode = static_cast(rsp.paramValue); 354c0: 80 91 66 13 lds r24, 0x1366 ; 0x801366 354c4: 90 91 67 13 lds r25, 0x1367 ; 0x801367 354c8: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 354cc: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b StartReading8bitRegisters(); // continue Idle state without restarting the communication 354d0: 0f 94 94 a4 call 0x34928 ; 0x34928 // @@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")); 354d4: 81 e0 ldi r24, 0x01 ; 1 354d6: 99 ea ldi r25, 0xA9 ; 169 354d8: 0f 94 ba 65 call 0x2cb74 ; 0x2cb74 354dc: 17 e0 ldi r17, 0x07 ; 7 354de: b2 cf rjmp .-156 ; 0x35444 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 354e0: 0f 94 b8 a4 call 0x34970 ; 0x34970 354e4: 35 cd rjmp .-1430 ; 0x34f50 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 354e6: 82 e8 ldi r24, 0x82 ; 130 354e8: 0f 94 9c a4 call 0x34938 ; 0x34938 354ec: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e return scopeState == ScopeState::Ready ? Finished : Processing; 354f0: 82 38 cpi r24, 0x82 ; 130 354f2: 09 f0 breq .+2 ; 0x354f6 354f4: 2d cd rjmp .-1446 ; 0x34f50 354f6: bc cc rjmp .-1672 ; 0x34e70 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 354f8: 80 91 65 13 lds r24, 0x1365 ; 0x801365 354fc: 81 34 cpi r24, 0x41 ; 65 354fe: d1 f6 brne .-76 ; 0x354b4 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 35500: 0f 94 a8 65 call 0x2cb50 ; 0x2cb50 35504: d7 cf rjmp .-82 ; 0x354b4 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 35506: 88 30 cpi r24, 0x08 ; 8 35508: b1 f0 breq .+44 ; 0x35536 3550a: 50 f3 brcs .-44 ; 0x354e0 3550c: 8a 30 cpi r24, 0x0A ; 10 3550e: 09 f0 breq .+2 ; 0x35512 35510: 39 cf rjmp .-398 ; 0x35384 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 35512: 80 91 65 13 lds r24, 0x1365 ; 0x801365 35516: 81 34 cpi r24, 0x41 ; 65 35518: 09 f0 breq .+2 ; 0x3551c 3551a: 18 cd rjmp .-1488 ; 0x34f4c // Button was accepted, decrement the retry. DecrementRetryAttempts(); 3551c: 0f 94 a8 65 call 0x2cb50 ; 0x2cb50 35520: 15 cd rjmp .-1494 ; 0x34f4c 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; 35522: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d errorCode = ErrorCode::RUNNING; 35526: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 3552a: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b scopeState = ScopeState::Wait; 3552e: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 35530: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e 35534: 0d cd rjmp .-1510 ; 0x34f50 35536: 81 e8 ldi r24, 0x81 ; 129 35538: 0f 94 9c a4 call 0x34938 ; 0x34938 3553c: f9 cf rjmp .-14 ; 0x35530 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 3553e: 87 30 cpi r24, 0x07 ; 7 35540: 49 f2 breq .-110 ; 0x354d4 35542: 08 f4 brcc .+2 ; 0x35546 35544: 63 ce rjmp .-826 ; 0x3520c 35546: 88 30 cpi r24, 0x08 ; 8 35548: 09 f4 brne .+2 ; 0x3554c 3554a: 78 ce rjmp .-784 ; 0x3523c 3554c: 7b cf rjmp .-266 ; 0x35444 // 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()) { 3554e: 80 91 4e 13 lds r24, 0x134E ; 0x80134e 35552: 87 fd sbrc r24, 7 35554: 9a cc rjmp .-1740 ; 0x34e8a 35556: fc cc rjmp .-1544 ; 0x34f50 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 35558: 13 30 cpi r17, 0x03 ; 3 3555a: 09 f4 brne .+2 ; 0x3555e 3555c: 6a c0 rjmp .+212 ; 0x35632 3555e: 1b 30 cpi r17, 0x0B ; 11 35560: 09 f0 breq .+2 ; 0x35564 35562: 80 cf rjmp .-256 ; 0x35464 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 35564: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 35568: 80 93 b5 13 sts 0x13B5, r24 ; 0x8013b5 LogEchoEvent_P(PSTR("MMU Button pushed")); 3556c: 80 e2 ldi r24, 0x20 ; 32 3556e: 99 ea ldi r25, 0xA9 ; 169 35570: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 CheckUserInput(); // Process the button immediately 35574: 0f 94 50 a6 call 0x34ca0 ; 0x34ca0 35578: 5c c0 rjmp .+184 ; 0x35632 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 3557a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 3557e: 81 11 cpse r24, r1 35580: 58 c0 rjmp .+176 ; 0x35632 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() 35582: 0e 94 97 67 call 0xcf2e ; 0xcf2e && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 35586: 88 23 and r24, r24 35588: 09 f4 brne .+2 ; 0x3558c 3558a: 53 c0 rjmp .+166 ; 0x35632 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 3558c: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa <_ZL17mcode_in_progress.lto_priv.530> 35590: 90 91 ab 0d lds r25, 0x0DAB ; 0x800dab <_ZL17mcode_in_progress.lto_priv.530+0x1> 35594: 88 35 cpi r24, 0x58 ; 88 35596: 92 40 sbci r25, 0x02 ; 2 35598: 09 f4 brne .+2 ; 0x3559c 3559a: 4b c0 rjmp .+150 ; 0x35632 && !saved_printing 3559c: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 355a0: 81 11 cpse r24, r1 355a2: 47 c0 rjmp .+142 ; 0x35632 && !mesh_bed_leveling_flag 355a4: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 355a8: 81 11 cpse r24, r1 355aa: 43 c0 rjmp .+134 ; 0x35632 && !homing_flag 355ac: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 355b0: 81 11 cpse r24, r1 355b2: 3f c0 rjmp .+126 ; 0x35632 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 355b4: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 355b8: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 355bc: 98 17 cp r25, r24 355be: c9 f1 breq .+114 ; 0x35632 { uint8_t block_index = block_buffer_tail; 355c0: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 } #endif bool e_active() { unsigned char e_active = 0; 355c4: 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++; 355c6: 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) 355c8: 30 91 a5 0d lds r19, 0x0DA5 ; 0x800da5 355cc: 38 17 cp r19, r24 355ce: 89 f0 breq .+34 ; 0x355f2 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 355d0: 28 9f mul r18, r24 355d2: f0 01 movw r30, r0 355d4: 11 24 eor r1, r1 355d6: eb 53 subi r30, 0x3B ; 59 355d8: f9 4f sbci r31, 0xF9 ; 249 355da: 44 85 ldd r20, Z+12 ; 0x0c 355dc: 55 85 ldd r21, Z+13 ; 0x0d 355de: 66 85 ldd r22, Z+14 ; 0x0e 355e0: 77 85 ldd r23, Z+15 ; 0x0f 355e2: 45 2b or r20, r21 355e4: 46 2b or r20, r22 355e6: 47 2b or r20, r23 355e8: 09 f0 breq .+2 ; 0x355ec 355ea: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 355ec: 8f 5f subi r24, 0xFF ; 255 355ee: 8f 70 andi r24, 0x0F ; 15 355f0: eb cf rjmp .-42 ; 0x355c8 && e_active(); 355f2: 99 23 and r25, r25 355f4: f1 f0 breq .+60 ; 0x35632 SERIAL_ECHOLNPGM("FINDA filament runout!"); 355f6: 81 eb ldi r24, 0xB1 ; 177 355f8: 98 ea ldi r25, 0xA8 ; 168 355fa: 0e 94 82 79 call 0xf304 ; 0xf304 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); 355fe: 20 e0 ldi r18, 0x00 ; 0 35600: 30 e0 ldi r19, 0x00 ; 0 35602: a9 01 movw r20, r18 35604: ca 01 movw r24, r20 35606: b9 01 movw r22, r18 35608: 0e 94 3e 89 call 0x1127c ; 0x1127c marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 3560c: 60 e0 ldi r22, 0x00 ; 0 3560e: 70 e0 ldi r23, 0x00 ; 0 35610: cb 01 movw r24, r22 35612: 0e 94 4b 68 call 0xd096 ; 0xd096 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 35616: 86 ed ldi r24, 0xD6 ; 214 35618: 9e e0 ldi r25, 0x0E ; 14 3561a: 0f 94 23 dc call 0x3b846 ; 0x3b846 3561e: 81 30 cpi r24, 0x01 ; 1 35620: 21 f4 brne .+8 ; 0x3562a if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 35622: 0f 94 c0 74 call 0x2e980 ; 0x2e980 35626: 8f 3f cpi r24, 0xFF ; 255 35628: 91 f5 brne .+100 ; 0x3568e enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 3562a: 8c ee ldi r24, 0xEC ; 236 3562c: 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 3562e: 0f 94 04 75 call 0x2ea08 ; 0x2ea08 break; } } } if (logic.Running()) { 35632: 80 91 68 13 lds r24, 0x1368 ; 0x801368 35636: 82 30 cpi r24, 0x02 ; 2 35638: 19 f4 brne .+6 ; 0x35640 state = xState::Active; 3563a: 81 e0 ldi r24, 0x01 ; 1 3563c: 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 35640: 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) { 35644: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> 35648: 88 23 and r24, r24 3564a: 51 f0 breq .+20 ; 0x35660 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 3564c: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 35650: 81 11 cpse r24, r1 35652: 06 c0 rjmp .+12 ; 0x35660 35654: 80 91 b2 13 lds r24, 0x13B2 ; 0x8013b2 35658: 90 91 b3 13 lds r25, 0x13B3 ; 0x8013b3 3565c: 0f 94 44 c7 call 0x38e88 ; 0x38e88 CheckErrorScreenUserInput(); } 35660: a0 96 adiw r28, 0x20 ; 32 35662: 0f b6 in r0, 0x3f ; 63 35664: f8 94 cli 35666: de bf out 0x3e, r29 ; 62 35668: 0f be out 0x3f, r0 ; 63 3566a: cd bf out 0x3d, r28 ; 61 3566c: df 91 pop r29 3566e: cf 91 pop r28 35670: 1f 91 pop r17 35672: 0f 91 pop r16 35674: ff 90 pop r15 35676: ef 90 pop r14 35678: df 90 pop r13 3567a: cf 90 pop r12 3567c: bf 90 pop r11 3567e: af 90 pop r10 35680: 9f 90 pop r9 35682: 8f 90 pop r8 35684: 7f 90 pop r7 35686: 6f 90 pop r6 35688: 5f 90 pop r5 3568a: 4f 90 pop r4 3568c: 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 3568e: 87 ea ldi r24, 0xA7 ; 167 35690: 98 ea ldi r25, 0xA8 ; 168 35692: cd cf rjmp .-102 ; 0x3562e 35694: 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) { 35698: 80 91 b1 13 lds r24, 0x13B1 ; 0x8013b1 3569c: 08 17 cp r16, r24 3569e: 09 f4 brne .+2 ; 0x356a2 356a0: 49 c0 rjmp .+146 ; 0x35734 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 356a2: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 356a6: 84 30 cpi r24, 0x04 ; 4 356a8: b9 f4 brne .+46 ; 0x356d8 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 356aa: 80 91 50 13 lds r24, 0x1350 ; 0x801350 356ae: 88 23 and r24, r24 356b0: 99 f0 breq .+38 ; 0x356d8 custom_message_type = CustomMsg::MMUProgress; 356b2: 89 e0 ldi r24, 0x09 ; 9 356b4: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 : static_cast(pgm_read_ptr(&progressTexts[0])); 356b8: ed e6 ldi r30, 0x6D ; 109 356ba: 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])) 356bc: 0e 31 cpi r16, 0x1E ; 30 356be: 30 f4 brcc .+12 ; 0x356cc 356c0: e0 2f mov r30, r16 356c2: f0 e0 ldi r31, 0x00 ; 0 356c4: ee 0f add r30, r30 356c6: ff 1f adc r31, r31 356c8: e3 59 subi r30, 0x93 ; 147 356ca: f7 45 sbci r31, 0x57 ; 87 : static_cast(pgm_read_ptr(&progressTexts[0])); 356cc: 85 91 lpm r24, Z+ 356ce: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 356d0: 0e 94 b3 72 call 0xe566 ; 0xe566 356d4: 0e 94 64 f1 call 0x1e2c8 ; 0x1e2c8 356d8: ed e6 ldi r30, 0x6D ; 109 356da: 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])) 356dc: 0e 31 cpi r16, 0x1E ; 30 356de: 30 f4 brcc .+12 ; 0x356ec 356e0: e0 2f mov r30, r16 356e2: f0 e0 ldi r31, 0x00 ; 0 356e4: ee 0f add r30, r30 356e6: ff 1f adc r31, r31 356e8: e3 59 subi r30, 0x93 ; 147 356ea: f7 45 sbci r31, 0x57 ; 87 : static_cast(pgm_read_ptr(&progressTexts[0])); 356ec: 85 91 lpm r24, Z+ 356ee: 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))); 356f0: 02 96 adiw r24, 0x02 ; 2 356f2: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 356f6: 00 93 b1 13 sts 0x13B1, r16 ; 0x8013b1 switch (pc) { 356fa: 03 30 cpi r16, 0x03 ; 3 356fc: 49 f0 breq .+18 ; 0x35710 356fe: 0c 31 cpi r16, 0x1C ; 28 35700: 09 f0 breq .+2 ; 0x35704 35702: 97 cf rjmp .-210 ; 0x35632 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 35704: 0f 94 ef 42 call 0x285de ; 0x285de } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 35708: 81 e0 ldi r24, 0x01 ; 1 3570a: 80 93 bc 13 sts 0x13BC, r24 ; 0x8013bc 3570e: 91 cf rjmp .-222 ; 0x35632 35710: 80 91 4d 13 lds r24, 0x134D ; 0x80134d 35714: 84 30 cpi r24, 0x04 ; 4 35716: 31 f4 brne .+12 ; 0x35724 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 35718: 80 91 50 13 lds r24, 0x1350 ; 0x801350 3571c: 84 55 subi r24, 0x54 ; 84 3571e: 82 30 cpi r24, 0x02 ; 2 35720: 08 f4 brcc .+2 ; 0x35724 35722: 87 cf rjmp .-242 ; 0x35632 35724: 0f 94 ef 42 call 0x285de ; 0x285de // 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; 35728: 81 e0 ldi r24, 0x01 ; 1 3572a: 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(); 3572e: 0f 94 13 6a call 0x2d426 ; 0x2d426 35732: 7f cf rjmp .-258 ; 0x35632 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) { 35734: 03 30 cpi r16, 0x03 ; 3 35736: 71 f1 breq .+92 ; 0x35794 35738: 0c 31 cpi r16, 0x1C ; 28 3573a: 09 f0 breq .+2 ; 0x3573e 3573c: 7a cf rjmp .-268 ; 0x35632 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 3573e: 80 91 bc 13 lds r24, 0x13BC ; 0x8013bc 35742: 88 23 and r24, r24 35744: 09 f4 brne .+2 ; 0x35748 35746: 75 cf rjmp .-278 ; 0x35632 switch (WhereIsFilament()) { 35748: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 3574c: 88 23 and r24, r24 3574e: b1 f1 breq .+108 ; 0x357bc 35750: 81 30 cpi r24, 0x01 ; 1 35752: 09 f0 breq .+2 ; 0x35756 35754: 6e cf rjmp .-292 ; 0x35632 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 35756: 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(); 3575a: 0f 94 ca c1 call 0x38394 ; 0x38394 // 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; 3575e: 10 92 ac 0d sts 0x0DAC, r1 ; 0x800dac planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 35762: 60 91 98 13 lds r22, 0x1398 ; 0x801398 35766: 70 e0 ldi r23, 0x00 ; 0 35768: 90 e0 ldi r25, 0x00 ; 0 3576a: 80 e0 ldi r24, 0x00 ; 0 3576c: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 35770: 6b 01 movw r12, r22 35772: 7c 01 movw r14, r24 35774: 60 91 97 13 lds r22, 0x1397 ; 0x801397 35778: 70 e0 ldi r23, 0x00 ; 0 3577a: 6e 5f subi r22, 0xFE ; 254 3577c: 7f 4f sbci r23, 0xFF ; 255 3577e: 07 2e mov r0, r23 35780: 00 0c add r0, r0 35782: 88 0b sbc r24, r24 35784: 99 0b sbc r25, r25 35786: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3578a: a7 01 movw r20, r14 3578c: 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()); 3578e: 0f 94 b8 c5 call 0x38b70 ; 0x38b70 35792: 4f cf rjmp .-354 ; 0x35632 } 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 35794: 80 91 bd 13 lds r24, 0x13BD ; 0x8013bd 35798: 88 23 and r24, r24 3579a: 09 f4 brne .+2 ; 0x3579e 3579c: 4a cf rjmp .-364 ; 0x35632 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); 3579e: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 357a2: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 357a6: 98 13 cpse r25, r24 357a8: 44 cf rjmp .-376 ; 0x35632 switch (WhereIsFilament()) { 357aa: 0f 94 ec c5 call 0x38bd8 ; 0x38bd8 357ae: 81 50 subi r24, 0x01 ; 1 357b0: 83 30 cpi r24, 0x03 ; 3 357b2: 08 f4 brcc .+2 ; 0x357b6 357b4: bc cf rjmp .-136 ; 0x3572e 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; 357b6: 10 92 bd 13 sts 0x13BD, r1 ; 0x8013bd 357ba: 3b cf rjmp .-394 ; 0x35632 357bc: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 357c0: 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 357c4: 98 13 cpse r25, r24 357c6: 35 cf rjmp .-406 ; 0x35632 // 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()); 357c8: 60 91 98 13 lds r22, 0x1398 ; 0x801398 357cc: 70 e0 ldi r23, 0x00 ; 0 357ce: 90 e0 ldi r25, 0x00 ; 0 357d0: 80 e0 ldi r24, 0x00 ; 0 357d2: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 357d6: 9b 01 movw r18, r22 357d8: ac 01 movw r20, r24 357da: 60 e0 ldi r22, 0x00 ; 0 357dc: 70 e0 ldi r23, 0x00 ; 0 357de: 8f ea ldi r24, 0xAF ; 175 357e0: 93 e4 ldi r25, 0x43 ; 67 357e2: d5 cf rjmp .-86 ; 0x3578e // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 357e4: 18 30 cpi r17, 0x08 ; 8 357e6: b9 f0 breq .+46 ; 0x35816 357e8: 19 30 cpi r17, 0x09 ; 9 357ea: 09 f0 breq .+2 ; 0x357ee 357ec: 22 cf rjmp .-444 ; 0x35632 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 357ee: 60 e0 ldi r22, 0x00 ; 0 357f0: 0f 94 f5 82 call 0x305ea ; 0x305ea 357f4: 19 e0 ldi r17, 0x09 ; 9 357f6: 1d cf rjmp .-454 ; 0x35632 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 357f8: 61 e0 ldi r22, 0x01 ; 1 357fa: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 357fe: 90 91 8c 13 lds r25, 0x138C ; 0x80138c ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 35802: 0f 94 f5 82 call 0x305ea ; 0x305ea 35806: 15 cf rjmp .-470 ; 0x35632 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 35808: 82 e0 ldi r24, 0x02 ; 2 3580a: 80 93 ba 13 sts 0x13BA, r24 ; 0x8013ba ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 3580e: 60 e0 ldi r22, 0x00 ; 0 35810: 8e e2 ldi r24, 0x2E ; 46 35812: 90 e8 ldi r25, 0x80 ; 128 35814: f6 cf rjmp .-20 ; 0x35802 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 35816: 10 92 ba 13 sts 0x13BA, r1 ; 0x8013ba protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 3581a: 10 92 68 13 sts 0x1368, r1 ; 0x801368 currentScope = Scope::Stopped; 3581e: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 35822: 60 e0 ldi r22, 0x00 ; 0 35824: 8c e2 ldi r24, 0x2C ; 44 35826: 90 e8 ldi r25, 0x80 ; 128 35828: ec cf rjmp .-40 ; 0x35802 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 3582a: 0f 94 9d 65 call 0x2cb3a ; 0x2cb3a 3582e: aa cd rjmp .-1196 ; 0x35384 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 35830: 00 23 and r16, r16 35832: 01 f3 breq .-64 ; 0x357f4 35834: dc cf rjmp .-72 ; 0x357ee 00035836 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 35836: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 3583a: 82 ff sbrs r24, 2 3583c: 07 c0 rjmp .+14 ; 0x3584c // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 3583e: 8b 7f andi r24, 0xFB ; 251 35840: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb LogEchoEvent_P(PSTR("Cooldown flag cleared")); 35844: 8b ef ldi r24, 0xFB ; 251 35846: 99 ea ldi r25, 0xA9 ; 169 35848: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 3584c: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 35850: 81 ff sbrs r24, 1 35852: 52 c0 rjmp .+164 ; 0x358f8 35854: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 35858: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 3585c: 89 2b or r24, r25 3585e: 09 f4 brne .+2 ; 0x35862 35860: 4b c0 rjmp .+150 ; 0x358f8 LogEchoEvent_P(PSTR("Resuming Temp")); 35862: 8d ee ldi r24, 0xED ; 237 35864: 99 ea ldi r25, 0xA9 ; 169 35866: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 3586a: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 3586e: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 35872: 0f 94 fc 74 call 0x2e9f8 ; 0x2e9f8 mmu_print_saved &= ~(SavedState::Cooldown); 35876: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 3587a: 8d 7f andi r24, 0xFD ; 253 3587c: 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; 35880: 80 91 af 13 lds r24, 0x13AF ; 0x8013af 35884: 90 91 b0 13 lds r25, 0x13B0 ; 0x8013b0 35888: 90 93 b7 0d sts 0x0DB7, r25 ; 0x800db7 3588c: 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)); 35890: 8a e4 ldi r24, 0x4A ; 74 35892: 9c e5 ldi r25, 0x5C ; 92 35894: 0e 94 b3 72 call 0xe566 ; 0xe566 35898: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 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)); 3589c: 4d eb ldi r20, 0xBD ; 189 3589e: 59 ea ldi r21, 0xA9 ; 169 358a0: 62 e0 ldi r22, 0x02 ; 2 358a2: 80 e0 ldi r24, 0x00 ; 0 358a4: 0e 94 fb 6e call 0xddf6 ; 0xddf6 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 358a8: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 358ac: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 358b0: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 358b4: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 358b8: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 358bc: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 358c0: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 358c4: c9 01 movw r24, r18 358c6: 86 1b sub r24, r22 358c8: 97 0b sbc r25, r23 358ca: 06 97 sbiw r24, 0x06 ; 6 358cc: 6c f0 brlt .+26 ; 0x358e8 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 358ce: 81 e0 ldi r24, 0x01 ; 1 358d0: 0e 94 b6 8a call 0x1156c ; 0x1156c 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); 358d4: 80 e0 ldi r24, 0x00 ; 0 358d6: 0f 94 09 a7 call 0x34e12 ; 0x34e12 ReportErrorHookDynamicRender(); 358da: 0f 94 fd c4 call 0x389fa ; 0x389fa void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 358de: 84 e6 ldi r24, 0x64 ; 100 358e0: 90 e0 ldi r25, 0x00 ; 0 358e2: 0e 94 eb 8c call 0x119d6 ; 0x119d6 358e6: e0 cf rjmp .-64 ; 0x358a8 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 358e8: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 LogEchoEvent_P(PSTR("Hotend temperature reached")); 358ec: 82 ed ldi r24, 0xD2 ; 210 358ee: 99 ea ldi r25, 0xA9 ; 169 358f0: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 358f4: 0c 94 1a 6f jmp 0xde34 ; 0xde34 ScreenClear(); } } 358f8: 08 95 ret 000358fa : /// 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) { 358fa: 0f 93 push r16 358fc: 1f 93 push r17 358fe: cf 93 push r28 35900: df 93 push r29 35902: 00 d0 rcall .+0 ; 0x35904 35904: 1f 92 push r1 35906: 1f 92 push r1 35908: cd b7 in r28, 0x3d ; 61 3590a: de b7 in r29, 0x3e ; 62 3590c: 18 2f mov r17, r24 3590e: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 35910: 10 92 bb 13 sts 0x13BB, r1 ; 0x8013bb MARLIN_KEEPALIVE_STATE_IN_PROCESS; 35914: 83 e0 ldi r24, 0x03 ; 3 35916: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be LongTimer nozzleTimeout; 3591a: 19 82 std Y+1, r1 ; 0x01 3591c: 1a 82 std Y+2, r1 ; 0x02 3591e: 1b 82 std Y+3, r1 ; 0x03 35920: 1c 82 std Y+4, r1 ; 0x04 35922: 1d 82 std Y+5, r1 ; 0x05 35924: 90 e0 ldi r25, 0x00 ; 0 35926: 80 e0 ldi r24, 0x00 ; 0 35928: 0e 94 eb 8c call 0x119d6 ; 0x119d6 // - 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) { 3592c: 90 91 bb 13 lds r25, 0x13BB ; 0x8013bb 35930: 89 81 ldd r24, Y+1 ; 0x01 35932: 92 ff sbrs r25, 2 35934: 37 c0 rjmp .+110 ; 0x359a4 if (!nozzleTimeout.running()) { 35936: 81 11 cpse r24, r1 35938: 1e c0 rjmp .+60 ; 0x35976 nozzleTimeout.start(); 3593a: ce 01 movw r24, r28 3593c: 01 96 adiw r24, 0x01 ; 1 3593e: 0f 94 f6 2b call 0x257ec ; 0x257ec ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 35942: 82 ed ldi r24, 0xD2 ; 210 35944: 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")); 35946: 0f 94 dc c5 call 0x38bb8 ; 0x38bb8 } switch (logicStepLastStatus) { 3594a: e0 91 b9 13 lds r30, 0x13B9 ; 0x8013b9 3594e: e2 50 subi r30, 0x02 ; 2 35950: ea 30 cpi r30, 0x0A ; 10 35952: 40 f7 brcc .-48 ; 0x35924 35954: f0 e0 ldi r31, 0x00 ; 0 35956: 88 27 eor r24, r24 35958: ef 54 subi r30, 0x4F ; 79 3595a: f3 45 sbci r31, 0x53 ; 83 3595c: 8e 4f sbci r24, 0xFE ; 254 3595e: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 <__tablejump2__> 35962: 42 3a cpi r20, 0xA2 ; 162 35964: 66 39 cpi r22, 0x96 ; 150 35966: 88 39 cpi r24, 0x98 ; 152 35968: 88 39 cpi r24, 0x98 ; 152 3596a: a2 3a cpi r26, 0xA2 ; 162 3596c: 88 39 cpi r24, 0x98 ; 152 3596e: 00 3a cpi r16, 0xA0 ; 160 35970: 52 3a cpi r21, 0xA2 ; 162 35972: 80 39 cpi r24, 0x90 ; 144 35974: 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. 35976: 40 e4 ldi r20, 0x40 ; 64 35978: 57 e7 ldi r21, 0x77 ; 119 3597a: 6b e1 ldi r22, 0x1B ; 27 3597c: 70 e0 ldi r23, 0x00 ; 0 3597e: ce 01 movw r24, r28 35980: 01 96 adiw r24, 0x01 ; 1 35982: 0f 94 37 2a call 0x2546e ; 0x2546e ::expired(unsigned long)> 35986: 88 23 and r24, r24 35988: 01 f3 breq .-64 ; 0x3594a mmu_print_saved &= ~(SavedState::CooldownPending); 3598a: 80 91 bb 13 lds r24, 0x13BB ; 0x8013bb 3598e: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 35990: 82 60 ori r24, 0x02 ; 2 35992: 80 93 bb 13 sts 0x13BB, r24 ; 0x8013bb 35996: 10 92 b7 0d sts 0x0DB7, r1 ; 0x800db7 3599a: 10 92 b6 0d sts 0x0DB6, r1 ; 0x800db6 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 3599e: 82 ec ldi r24, 0xC2 ; 194 359a0: 97 ea ldi r25, 0xA7 ; 167 359a2: d1 cf rjmp .-94 ; 0x35946 } } else if (nozzleTimeout.running()) { 359a4: 88 23 and r24, r24 359a6: 89 f2 breq .-94 ; 0x3594a 359a8: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 359aa: 8c ea ldi r24, 0xAC ; 172 359ac: 97 ea ldi r25, 0xA7 ; 167 359ae: cb cf rjmp .-106 ; 0x35946 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(); 359b0: 0f 94 1b ac call 0x35836 ; 0x35836 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 359b4: 0f 94 39 6a call 0x2d472 ; 0x2d472 if (!TuneMenuEntered()) { 359b8: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> 359bc: 81 11 cpse r24, r1 359be: 07 c0 rjmp .+14 ; 0x359ce retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 359c0: 89 e9 ldi r24, 0x99 ; 153 359c2: 97 ea ldi r25, 0xA7 ; 167 359c4: 0e 94 82 79 call 0xf304 ; 0xf304 retryAttempts = MAX_RETRIES; 359c8: 83 e0 ldi r24, 0x03 ; 3 359ca: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 359ce: 0f 94 ef 42 call 0x285de ; 0x285de 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; 359d2: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 359d4: 0f 90 pop r0 359d6: 0f 90 pop r0 359d8: 0f 90 pop r0 359da: 0f 90 pop r0 359dc: 0f 90 pop r0 359de: df 91 pop r29 359e0: cf 91 pop r28 359e2: 1f 91 pop r17 359e4: 0f 91 pop r16 359e6: 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(); 359e8: 0f 94 50 a6 call 0x34ca0 ; 0x34ca0 359ec: f2 cf rjmp .-28 ; 0x359d2 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 359ee: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 359f2: 81 11 cpse r24, r1 359f4: 97 cf rjmp .-210 ; 0x35924 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 359f6: 81 2f mov r24, r17 359f8: 0f 94 85 6a call 0x2d50a ; 0x2d50a SaveHotendTemp(turn_off_nozzle); 359fc: 80 2f mov r24, r16 359fe: 0f 94 1d 6a call 0x2d43a ; 0x2d43a CheckUserInput(); 35a02: 0f 94 50 a6 call 0x34ca0 ; 0x34ca0 35a06: 8e cf rjmp .-228 ; 0x35924 } 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(); 35a08: 0f 94 1b ac call 0x35836 ; 0x35836 ResumeUnpark(); 35a0c: 0f 94 39 6a call 0x2d472 ; 0x2d472 35a10: 89 cf rjmp .-238 ; 0x35924 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 35a12: 80 e0 ldi r24, 0x00 ; 0 35a14: df cf rjmp .-66 ; 0x359d4 00035a16 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 35a16: cf 93 push r28 35a18: df 93 push r29 35a1a: 00 d0 rcall .+0 ; 0x35a1c 35a1c: 1f 92 push r1 35a1e: 1f 92 push r1 35a20: cd b7 in r28, 0x3d ; 61 35a22: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 35a24: 0f 94 b5 86 call 0x30d6a ; 0x30d6a return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 35a28: 62 e1 ldi r22, 0x12 ; 18 35a2a: 89 e0 ldi r24, 0x09 ; 9 35a2c: 97 ea ldi r25, 0xA7 ; 167 35a2e: 0f 94 62 88 call 0x310c4 ; 0x310c4 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(); 35a32: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 35a36: 40 e0 ldi r20, 0x00 ; 0 35a38: 65 e5 ldi r22, 0x55 ; 85 35a3a: ce 01 movw r24, r28 35a3c: 01 96 adiw r24, 0x01 ; 1 35a3e: 0f 94 94 c5 call 0x38b28 ; 0x38b28 35a42: 49 81 ldd r20, Y+1 ; 0x01 35a44: 5a 81 ldd r21, Y+2 ; 0x02 35a46: 6b 81 ldd r22, Y+3 ; 0x03 35a48: 7c 81 ldd r23, Y+4 ; 0x04 35a4a: 8d 81 ldd r24, Y+5 ; 0x05 35a4c: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 logic.UnloadFilament(); if (manage_response(false, true)) { 35a50: 61 e0 ldi r22, 0x01 ; 1 35a52: 80 e0 ldi r24, 0x00 ; 0 35a54: 0f 94 7d ac call 0x358fa ; 0x358fa 35a58: 81 11 cpse r24, r1 35a5a: 03 c0 rjmp .+6 ; 0x35a62 break; } IncrementMMUFails(); 35a5c: 0f 94 f5 c4 call 0x389ea ; 0x389ea 35a60: e8 cf rjmp .-48 ; 0x35a32 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); 35a62: 83 e0 ldi r24, 0x03 ; 3 35a64: 0f 94 0e 4e call 0x29c1c ; 0x29c1c } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 35a68: 83 e6 ldi r24, 0x63 ; 99 35a6a: 0f 94 0a 88 call 0x31014 ; 0x31014 tool_change_extruder = MMU2_NO_TOOL; 35a6e: 83 e6 ldi r24, 0x63 ; 99 35a70: 80 93 a2 13 sts 0x13A2, r24 ; 0x8013a2 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 35a74: 0f 94 f9 7a call 0x2f5f2 ; 0x2f5f2 } 35a78: 0f 90 pop r0 35a7a: 0f 90 pop r0 35a7c: 0f 90 pop r0 35a7e: 0f 90 pop r0 35a80: 0f 90 pop r0 35a82: df 91 pop r29 35a84: cf 91 pop r28 35a86: 08 95 ret 00035a88 : bool MMU2::unload() { 35a88: cf 93 push r28 if (!WaitForMMUReady()) { 35a8a: 0f 94 8b 88 call 0x31116 ; 0x31116 35a8e: c8 2f mov r28, r24 35a90: 88 23 and r24, r24 35a92: 79 f0 breq .+30 ; 0x35ab2 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 35a94: 88 ec ldi r24, 0xC8 ; 200 35a96: 90 e0 ldi r25, 0x00 ; 0 35a98: 0f 94 3a c9 call 0x39274 ; 0x39274 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]> 35a9c: 82 e0 ldi r24, 0x02 ; 2 35a9e: 0f 94 0e 4e call 0x29c1c ; 0x29c1c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35aa2: 0f 94 ff 87 call 0x30ffe ; 0x30ffe WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 35aa6: 0f 94 0b ad call 0x35a16 ; 0x35a16 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35aaa: 0f 94 80 88 call 0x31100 ; 0x31100 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 35aae: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 return true; } 35ab2: 8c 2f mov r24, r28 35ab4: cf 91 pop r28 35ab6: 08 95 ret 00035ab8 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 35ab8: 0f 93 push r16 35aba: 1f 93 push r17 35abc: cf 93 push r28 35abe: df 93 push r29 35ac0: 00 d0 rcall .+0 ; 0x35ac2 35ac2: 1f 92 push r1 35ac4: 1f 92 push r1 35ac6: cd b7 in r28, 0x3d ; 61 35ac8: de b7 in r29, 0x3e ; 62 35aca: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 35acc: 0f 94 8b 88 call 0x31116 ; 0x31116 35ad0: 18 2f mov r17, r24 35ad2: 88 23 and r24, r24 35ad4: 49 f1 breq .+82 ; 0x35b28 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 35ad6: 87 e3 ldi r24, 0x37 ; 55 35ad8: 9c e5 ldi r25, 0x5C ; 92 35ada: 0e 94 b3 72 call 0xe566 ; 0xe566 35ade: 60 2f mov r22, r16 35ae0: 0f 94 d6 c4 call 0x389ac ; 0x389ac struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35ae4: 0f 94 ff 87 call 0x30ffe ; 0x30ffe FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 35ae8: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 35aec: 40 2f mov r20, r16 35aee: 6c e4 ldi r22, 0x4C ; 76 35af0: ce 01 movw r24, r28 35af2: 01 96 adiw r24, 0x01 ; 1 35af4: 0f 94 94 c5 call 0x38b28 ; 0x38b28 35af8: 49 81 ldd r20, Y+1 ; 0x01 35afa: 5a 81 ldd r21, Y+2 ; 0x02 35afc: 6b 81 ldd r22, Y+3 ; 0x03 35afe: 7c 81 ldd r23, Y+4 ; 0x04 35b00: 8d 81 ldd r24, Y+5 ; 0x05 35b02: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 logic.LoadFilament(slot); if (manage_response(false, false)) { 35b06: 60 e0 ldi r22, 0x00 ; 0 35b08: 80 e0 ldi r24, 0x00 ; 0 35b0a: 0f 94 7d ac call 0x358fa ; 0x358fa 35b0e: 18 2f mov r17, r24 35b10: 81 11 cpse r24, r1 35b12: 03 c0 rjmp .+6 ; 0x35b1a break; } IncrementMMUFails(); 35b14: 0f 94 f5 c4 call 0x389ea ; 0x389ea 35b18: e7 cf rjmp .-50 ; 0x35ae8 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); 35b1a: 83 e0 ldi r24, 0x03 ; 3 35b1c: 0f 94 0e 4e call 0x29c1c ; 0x29c1c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35b20: 0f 94 80 88 call 0x31100 ; 0x31100 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35b24: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 return true; } 35b28: 81 2f mov r24, r17 35b2a: 0f 90 pop r0 35b2c: 0f 90 pop r0 35b2e: 0f 90 pop r0 35b30: 0f 90 pop r0 35b32: 0f 90 pop r0 35b34: df 91 pop r29 35b36: cf 91 pop r28 35b38: 1f 91 pop r17 35b3a: 0f 91 pop r16 35b3c: 08 95 ret 00035b3e : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 35b3e: ff 92 push r15 35b40: 0f 93 push r16 35b42: 1f 93 push r17 35b44: cf 93 push r28 35b46: df 93 push r29 35b48: 00 d0 rcall .+0 ; 0x35b4a 35b4a: 1f 92 push r1 35b4c: 1f 92 push r1 35b4e: cd b7 in r28, 0x3d ; 61 35b50: de b7 in r29, 0x3e ; 62 35b52: 08 2f mov r16, r24 35b54: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 35b56: 0f 94 8b 88 call 0x31116 ; 0x31116 35b5a: 18 2f mov r17, r24 35b5c: 88 23 and r24, r24 35b5e: b1 f1 breq .+108 ; 0x35bcc return false; } if (enableFullScreenMsg) { 35b60: ff 20 and r15, r15 35b62: 39 f0 breq .+14 ; 0x35b72 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 35b64: 86 e2 ldi r24, 0x26 ; 38 35b66: 9c e5 ldi r25, 0x5C ; 92 35b68: 0e 94 b3 72 call 0xe566 ; 0xe566 35b6c: 60 2f mov r22, r16 35b6e: 0f 94 d6 c4 call 0x389ac ; 0x389ac FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 35b72: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35b76: 81 11 cpse r24, r1 unload(); 35b78: 0f 94 44 ad call 0x35a88 ; 0x35a88 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35b7c: 0f 94 ff 87 call 0x30ffe ; 0x30ffe unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 35b80: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 35b84: 40 2f mov r20, r16 35b86: 65 e4 ldi r22, 0x45 ; 69 35b88: ce 01 movw r24, r28 35b8a: 01 96 adiw r24, 0x01 ; 1 35b8c: 0f 94 94 c5 call 0x38b28 ; 0x38b28 35b90: 49 81 ldd r20, Y+1 ; 0x01 35b92: 5a 81 ldd r21, Y+2 ; 0x02 35b94: 6b 81 ldd r22, Y+3 ; 0x03 35b96: 7c 81 ldd r23, Y+4 ; 0x04 35b98: 8d 81 ldd r24, Y+5 ; 0x05 35b9a: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 logic.EjectFilament(slot); if (manage_response(false, true)) { 35b9e: 61 e0 ldi r22, 0x01 ; 1 35ba0: 80 e0 ldi r24, 0x00 ; 0 35ba2: 0f 94 7d ac call 0x358fa ; 0x358fa 35ba6: 18 2f mov r17, r24 35ba8: 81 11 cpse r24, r1 35baa: 03 c0 rjmp .+6 ; 0x35bb2 break; } IncrementMMUFails(); 35bac: 0f 94 f5 c4 call 0x389ea ; 0x389ea 35bb0: e7 cf rjmp .-50 ; 0x35b80 } SetCurrentTool(MMU2_NO_TOOL); 35bb2: 83 e6 ldi r24, 0x63 ; 99 35bb4: 0f 94 0a 88 call 0x31014 ; 0x31014 tool_change_extruder = MMU2_NO_TOOL; 35bb8: 83 e6 ldi r24, 0x63 ; 99 35bba: 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); 35bbe: 83 e0 ldi r24, 0x03 ; 3 35bc0: 0f 94 0e 4e call 0x29c1c ; 0x29c1c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35bc4: 0f 94 80 88 call 0x31100 ; 0x31100 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 35bc8: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 return true; } 35bcc: 81 2f mov r24, r17 35bce: 0f 90 pop r0 35bd0: 0f 90 pop r0 35bd2: 0f 90 pop r0 35bd4: 0f 90 pop r0 35bd6: 0f 90 pop r0 35bd8: df 91 pop r29 35bda: cf 91 pop r28 35bdc: 1f 91 pop r17 35bde: 0f 91 pop r16 35be0: ff 90 pop r15 35be2: 08 95 ret 00035be4 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 35be4: 1f 93 push r17 35be6: cf 93 push r28 35be8: df 93 push r29 35bea: 00 d0 rcall .+0 ; 0x35bec 35bec: 1f 92 push r1 35bee: 1f 92 push r1 35bf0: cd b7 in r28, 0x3d ; 61 35bf2: de b7 in r29, 0x3e ; 62 35bf4: 18 2f mov r17, r24 for (;;) { Disable_E0(); 35bf6: 0f 94 b6 c5 call 0x38b6c ; 0x38b6c } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 35bfa: 41 2f mov r20, r17 35bfc: 6b e4 ldi r22, 0x4B ; 75 35bfe: ce 01 movw r24, r28 35c00: 01 96 adiw r24, 0x01 ; 1 35c02: 0f 94 94 c5 call 0x38b28 ; 0x38b28 35c06: 49 81 ldd r20, Y+1 ; 0x01 35c08: 5a 81 ldd r21, Y+2 ; 0x02 35c0a: 6b 81 ldd r22, Y+3 ; 0x03 35c0c: 7c 81 ldd r23, Y+4 ; 0x04 35c0e: 8d 81 ldd r24, Y+5 ; 0x05 35c10: 0f 94 59 a5 call 0x34ab2 ; 0x34ab2 logic.CutFilament(slot); if (manage_response(false, true)) { 35c14: 61 e0 ldi r22, 0x01 ; 1 35c16: 80 e0 ldi r24, 0x00 ; 0 35c18: 0f 94 7d ac call 0x358fa ; 0x358fa 35c1c: 81 11 cpse r24, r1 35c1e: 03 c0 rjmp .+6 ; 0x35c26 break; } IncrementMMUFails(); 35c20: 0f 94 f5 c4 call 0x389ea ; 0x389ea 35c24: e8 cf rjmp .-48 ; 0x35bf6 } } 35c26: 0f 90 pop r0 35c28: 0f 90 pop r0 35c2a: 0f 90 pop r0 35c2c: 0f 90 pop r0 35c2e: 0f 90 pop r0 35c30: df 91 pop r29 35c32: cf 91 pop r28 35c34: 1f 91 pop r17 35c36: 08 95 ret 00035c38 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 35c38: cf 93 push r28 35c3a: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 35c3c: 87 e1 ldi r24, 0x17 ; 23 35c3e: 9c e5 ldi r25, 0x5C ; 92 35c40: 0e 94 b3 72 call 0xe566 ; 0xe566 35c44: 6c 2f mov r22, r28 35c46: 0f 94 d6 c4 call 0x389ac ; 0x389ac if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 35c4a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 35c4e: 81 11 cpse r24, r1 unload(); 35c50: 0f 94 44 ad call 0x35a88 ; 0x35a88 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 35c54: 0f 94 ff 87 call 0x30ffe ; 0x30ffe if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 35c58: 8c 2f mov r24, r28 35c5a: 0f 94 f2 ad call 0x35be4 ; 0x35be4 SetCurrentTool(MMU2_NO_TOOL); 35c5e: 83 e6 ldi r24, 0x63 ; 99 35c60: 0f 94 0a 88 call 0x31014 ; 0x31014 tool_change_extruder = MMU2_NO_TOOL; 35c64: 83 e6 ldi r24, 0x63 ; 99 35c66: 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); 35c6a: 83 e0 ldi r24, 0x03 ; 3 35c6c: 0f 94 0e 4e call 0x29c1c ; 0x29c1c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 35c70: 0f 94 80 88 call 0x31100 ; 0x31100 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 35c74: 0f 94 d3 c4 call 0x389a6 ; 0x389a6 return true; } 35c78: 81 e0 ldi r24, 0x01 ; 1 35c7a: cf 91 pop r28 35c7c: 08 95 ret 00035c7e : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 35c7e: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c82: 95 ff sbrs r25, 5 35c84: fc cf rjmp .-8 ; 0x35c7e UDR0 = ch; 35c86: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 35c8a: 08 95 ret 00035c8c : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 35c8c: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c90: 87 ff sbrs r24, 7 35c92: fc cf rjmp .-8 ; 0x35c8c if (!(UCSR0A & _BV(FE0))) { 35c94: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 35c98: 84 fd sbrc r24, 4 35c9a: 01 c0 rjmp .+2 ; 0x35c9e * 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(); 35c9c: a8 95 wdr } ch = UDR0; 35c9e: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 35ca2: 08 95 ret 00035ca4 : /// 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; 35ca4: 86 27 eor r24, r22 35ca6: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 35ca8: 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) { 35caa: 38 2f mov r19, r24 35cac: 88 0f add r24, r24 35cae: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 35cb0: 82 27 eor r24, r18 35cb2: 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++) { 35cb4: d1 f7 brne .-12 ; 0x35caa } else { data <<= 1U; } } return data; } 35cb6: 08 95 ret 00035cb8 : // 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) { 35cb8: 2f 92 push r2 35cba: 3f 92 push r3 35cbc: 4f 92 push r4 35cbe: 5f 92 push r5 35cc0: 6f 92 push r6 35cc2: 7f 92 push r7 35cc4: 8f 92 push r8 35cc6: 9f 92 push r9 35cc8: af 92 push r10 35cca: bf 92 push r11 35ccc: cf 92 push r12 35cce: df 92 push r13 35cd0: ef 92 push r14 35cd2: ff 92 push r15 35cd4: 0f 93 push r16 35cd6: 1f 93 push r17 35cd8: cf 93 push r28 35cda: df 93 push r29 35cdc: cd b7 in r28, 0x3d ; 61 35cde: de b7 in r29, 0x3e ; 62 35ce0: a1 97 sbiw r28, 0x21 ; 33 35ce2: 0f b6 in r0, 0x3f ; 63 35ce4: f8 94 cli 35ce6: de bf out 0x3e, r29 ; 62 35ce8: 0f be out 0x3f, r0 ; 63 35cea: cd bf out 0x3d, r28 ; 61 35cec: 1c 01 movw r2, r24 35cee: 48 01 movw r8, r16 35cf0: 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) 35cf2: fc 01 movw r30, r24 35cf4: e8 5b subi r30, 0xB8 ; 184 35cf6: ff 4f sbci r31, 0xFF ; 255 35cf8: c0 80 ld r12, Z 35cfa: d1 80 ldd r13, Z+1 ; 0x01 35cfc: e2 80 ldd r14, Z+2 ; 0x02 35cfe: f3 80 ldd r15, Z+3 ; 0x03 35d00: 9a 01 movw r18, r20 35d02: ab 01 movw r20, r22 35d04: c7 01 movw r24, r14 35d06: b6 01 movw r22, r12 35d08: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 35d0c: 0f 94 29 de call 0x3bc52 ; 0x3bc52 35d10: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 35d14: 8b 01 movw r16, r22 35d16: 8d 83 std Y+5, r24 ; 0x05 35d18: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 35d1a: a5 01 movw r20, r10 35d1c: 94 01 movw r18, r8 35d1e: c7 01 movw r24, r14 35d20: b6 01 movw r22, r12 35d22: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 35d26: 0f 94 29 de call 0x3bc52 ; 0x3bc52 35d2a: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 35d2e: 36 2f mov r19, r22 35d30: 27 2f mov r18, r23 35d32: a8 01 movw r20, r16 35d34: 6d 81 ldd r22, Y+5 ; 0x05 35d36: 79 81 ldd r23, Y+1 ; 0x01 35d38: 48 37 cpi r20, 0x78 ; 120 35d3a: 51 05 cpc r21, r1 35d3c: 61 05 cpc r22, r1 35d3e: 71 05 cpc r23, r1 35d40: 20 f4 brcc .+8 ; 0x35d4a 35d42: 48 e7 ldi r20, 0x78 ; 120 35d44: 50 e0 ldi r21, 0x00 ; 0 35d46: 60 e0 ldi r22, 0x00 ; 0 35d48: 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) 35d4a: d1 01 movw r26, r2 35d4c: d6 96 adiw r26, 0x36 ; 54 35d4e: 8d 90 ld r8, X+ 35d50: 9d 90 ld r9, X+ 35d52: ad 90 ld r10, X+ 35d54: bc 90 ld r11, X 35d56: d9 97 sbiw r26, 0x39 ; 57 35d58: 8f 8a std Y+23, r8 ; 0x17 35d5a: 98 8e std Y+24, r9 ; 0x18 35d5c: a9 8e std Y+25, r10 ; 0x19 35d5e: ba 8e std Y+26, r11 ; 0x1a 35d60: 48 15 cp r20, r8 35d62: 59 05 cpc r21, r9 35d64: 6a 05 cpc r22, r10 35d66: 7b 05 cpc r23, r11 35d68: 20 f4 brcc .+8 ; 0x35d72 35d6a: 4f 8b std Y+23, r20 ; 0x17 35d6c: 58 8f std Y+24, r21 ; 0x18 35d6e: 69 8f std Y+25, r22 ; 0x19 35d70: 7a 8f std Y+26, r23 ; 0x1a 35d72: 43 2f mov r20, r19 35d74: 52 2f mov r21, r18 35d76: bc 01 movw r22, r24 35d78: 48 37 cpi r20, 0x78 ; 120 35d7a: 51 05 cpc r21, r1 35d7c: 61 05 cpc r22, r1 35d7e: 71 05 cpc r23, r1 35d80: 20 f4 brcc .+8 ; 0x35d8a 35d82: 48 e7 ldi r20, 0x78 ; 120 35d84: 50 e0 ldi r21, 0x00 ; 0 35d86: 60 e0 ldi r22, 0x00 ; 0 35d88: 70 e0 ldi r23, 0x00 ; 0 35d8a: 18 2d mov r17, r8 35d8c: 09 2d mov r16, r9 35d8e: a9 a2 std Y+33, r10 ; 0x21 35d90: b8 a2 std Y+32, r11 ; 0x20 35d92: 48 15 cp r20, r8 35d94: 59 05 cpc r21, r9 35d96: 6a 05 cpc r22, r10 35d98: 7b 05 cpc r23, r11 35d9a: 20 f4 brcc .+8 ; 0x35da4 35d9c: 14 2f mov r17, r20 35d9e: 05 2f mov r16, r21 35da0: 69 a3 std Y+33, r22 ; 0x21 35da2: 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; 35da4: f1 01 movw r30, r2 35da6: ee 5b subi r30, 0xBE ; 190 35da8: ff 4f sbci r31, 0xFF ; 255 35daa: c0 80 ld r12, Z 35dac: d1 80 ldd r13, Z+1 ; 0x01 35dae: e2 80 ldd r14, Z+2 ; 0x02 35db0: f3 80 ldd r15, Z+3 ; 0x03 35db2: cd 82 std Y+5, r12 ; 0x05 35db4: de 82 std Y+6, r13 ; 0x06 35db6: ef 82 std Y+7, r14 ; 0x07 35db8: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 35dba: cd 28 or r12, r13 35dbc: ce 28 or r12, r14 35dbe: cf 28 or r12, r15 35dc0: 41 f4 brne .+16 ; 0x35dd2 // Don't allow zero acceleration. acceleration = 1; 35dc2: c1 2c mov r12, r1 35dc4: d1 2c mov r13, r1 35dc6: 76 01 movw r14, r12 35dc8: c3 94 inc r12 35dca: cd 82 std Y+5, r12 ; 0x05 35dcc: de 82 std Y+6, r13 ; 0x06 35dce: ef 82 std Y+7, r14 ; 0x07 35dd0: 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; 35dd2: 2f 89 ldd r18, Y+23 ; 0x17 35dd4: 38 8d ldd r19, Y+24 ; 0x18 35dd6: 49 8d ldd r20, Y+25 ; 0x19 35dd8: 5a 8d ldd r21, Y+26 ; 0x1a 35dda: b9 01 movw r22, r18 35ddc: ca 01 movw r24, r20 35dde: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 35de2: 6d 87 std Y+13, r22 ; 0x0d 35de4: 7e 87 std Y+14, r23 ; 0x0e 35de6: 8f 87 std Y+15, r24 ; 0x0f 35de8: 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; 35dea: a5 01 movw r20, r10 35dec: 94 01 movw r18, r8 35dee: c5 01 movw r24, r10 35df0: b4 01 movw r22, r8 35df2: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 35df6: 2b 01 movw r4, r22 35df8: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 35dfa: 21 2f mov r18, r17 35dfc: 30 2f mov r19, r16 35dfe: 49 a1 ldd r20, Y+33 ; 0x21 35e00: 58 a1 ldd r21, Y+32 ; 0x20 35e02: 61 2f mov r22, r17 35e04: 70 2f mov r23, r16 35e06: ca 01 movw r24, r20 35e08: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 35e0c: 69 8b std Y+17, r22 ; 0x11 35e0e: 7a 8b std Y+18, r23 ; 0x12 35e10: 8b 8b std Y+19, r24 ; 0x13 35e12: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 35e14: cd 80 ldd r12, Y+5 ; 0x05 35e16: de 80 ldd r13, Y+6 ; 0x06 35e18: ef 80 ldd r14, Y+7 ; 0x07 35e1a: f8 84 ldd r15, Y+8 ; 0x08 35e1c: cc 0c add r12, r12 35e1e: dd 1c adc r13, r13 35e20: ee 1c adc r14, r14 35e22: ff 1c adc r15, r15 35e24: c9 86 std Y+9, r12 ; 0x09 35e26: da 86 std Y+10, r13 ; 0x0a 35e28: eb 86 std Y+11, r14 ; 0x0b 35e2a: 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; 35e2c: c3 01 movw r24, r6 35e2e: b2 01 movw r22, r4 35e30: 61 50 subi r22, 0x01 ; 1 35e32: 71 09 sbc r23, r1 35e34: 81 09 sbc r24, r1 35e36: 91 09 sbc r25, r1 35e38: cd 84 ldd r12, Y+13 ; 0x0d 35e3a: de 84 ldd r13, Y+14 ; 0x0e 35e3c: ef 84 ldd r14, Y+15 ; 0x0f 35e3e: f8 88 ldd r15, Y+16 ; 0x10 35e40: 6c 19 sub r22, r12 35e42: 7d 09 sbc r23, r13 35e44: 8e 09 sbc r24, r14 35e46: 9f 09 sbc r25, r15 35e48: c9 84 ldd r12, Y+9 ; 0x09 35e4a: da 84 ldd r13, Y+10 ; 0x0a 35e4c: eb 84 ldd r14, Y+11 ; 0x0b 35e4e: fc 84 ldd r15, Y+12 ; 0x0c 35e50: 6c 0d add r22, r12 35e52: 7d 1d adc r23, r13 35e54: 8e 1d adc r24, r14 35e56: 9f 1d adc r25, r15 35e58: a7 01 movw r20, r14 35e5a: 96 01 movw r18, r12 35e5c: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 35e60: 69 01 movw r12, r18 35e62: 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; 35e64: c3 01 movw r24, r6 35e66: b2 01 movw r22, r4 35e68: 29 89 ldd r18, Y+17 ; 0x11 35e6a: 3a 89 ldd r19, Y+18 ; 0x12 35e6c: 4b 89 ldd r20, Y+19 ; 0x13 35e6e: 5c 89 ldd r21, Y+20 ; 0x14 35e70: 62 1b sub r22, r18 35e72: 73 0b sbc r23, r19 35e74: 84 0b sbc r24, r20 35e76: 95 0b sbc r25, r21 35e78: 29 85 ldd r18, Y+9 ; 0x09 35e7a: 3a 85 ldd r19, Y+10 ; 0x0a 35e7c: 4b 85 ldd r20, Y+11 ; 0x0b 35e7e: 5c 85 ldd r21, Y+12 ; 0x0c 35e80: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 35e84: 29 01 movw r4, r18 35e86: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 35e88: d7 01 movw r26, r14 35e8a: c6 01 movw r24, r12 35e8c: 84 0d add r24, r4 35e8e: 95 1d adc r25, r5 35e90: a6 1d adc r26, r6 35e92: b7 1d adc r27, r7 35e94: 8c 8f std Y+28, r24 ; 0x1c 35e96: 9d 8f std Y+29, r25 ; 0x1d 35e98: ae 8f std Y+30, r26 ; 0x1e 35e9a: 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) { 35e9c: f1 01 movw r30, r2 35e9e: e4 5b subi r30, 0xB4 ; 180 35ea0: ff 4f sbci r31, 0xFF ; 255 35ea2: 90 81 ld r25, Z 35ea4: 9b 8f std Y+27, r25 ; 0x1b 35ea6: 99 23 and r25, r25 35ea8: 09 f4 brne .+2 ; 0x35eac 35eaa: 8d c0 rjmp .+282 ; 0x35fc6 final_adv_steps = final_rate * block->adv_comp; 35eac: 61 2f mov r22, r17 35eae: 70 2f mov r23, r16 35eb0: 89 a1 ldd r24, Y+33 ; 0x21 35eb2: 98 a1 ldd r25, Y+32 ; 0x20 35eb4: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 35eb8: f1 01 movw r30, r2 35eba: ec 5a subi r30, 0xAC ; 172 35ebc: ff 4f sbci r31, 0xFF ; 255 35ebe: 20 81 ld r18, Z 35ec0: 31 81 ldd r19, Z+1 ; 0x01 35ec2: 42 81 ldd r20, Z+2 ; 0x02 35ec4: 53 81 ldd r21, Z+3 ; 0x03 35ec6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 35eca: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 35ece: 6d 8b std Y+21, r22 ; 0x15 35ed0: 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) { 35ed2: d1 01 movw r26, r2 35ed4: 50 96 adiw r26, 0x10 ; 16 35ed6: 2d 91 ld r18, X+ 35ed8: 3d 91 ld r19, X+ 35eda: 4d 91 ld r20, X+ 35edc: 5c 91 ld r21, X 35ede: 53 97 sbiw r26, 0x13 ; 19 35ee0: 29 83 std Y+1, r18 ; 0x01 35ee2: 3a 83 std Y+2, r19 ; 0x02 35ee4: 4b 83 std Y+3, r20 ; 0x03 35ee6: 5c 83 std Y+4, r21 ; 0x04 35ee8: 8c 8d ldd r24, Y+28 ; 0x1c 35eea: 9d 8d ldd r25, Y+29 ; 0x1d 35eec: ae 8d ldd r26, Y+30 ; 0x1e 35eee: bf 8d ldd r27, Y+31 ; 0x1f 35ef0: 82 17 cp r24, r18 35ef2: 93 07 cpc r25, r19 35ef4: a4 07 cpc r26, r20 35ef6: b5 07 cpc r27, r21 35ef8: 08 f0 brcs .+2 ; 0x35efc 35efa: 68 c0 rjmp .+208 ; 0x35fcc plateau_steps = block->step_event_count.wide - accel_decel_steps; 35efc: 29 01 movw r4, r18 35efe: 3a 01 movw r6, r20 35f00: 48 1a sub r4, r24 35f02: 59 0a sbc r5, r25 35f04: 6a 0a sbc r6, r26 35f06: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 35f08: 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; 35f0a: 40 e0 ldi r20, 0x00 ; 0 35f0c: 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) 35f0e: 99 23 and r25, r25 35f10: 89 f0 breq .+34 ; 0x35f34 max_adv_steps = block->nominal_rate * block->adv_comp; 35f12: c5 01 movw r24, r10 35f14: b4 01 movw r22, r8 35f16: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 35f1a: f1 01 movw r30, r2 35f1c: ec 5a subi r30, 0xAC ; 172 35f1e: ff 4f sbci r31, 0xFF ; 255 35f20: 20 81 ld r18, Z 35f22: 31 81 ldd r19, Z+1 ; 0x01 35f24: 42 81 ldd r20, Z+2 ; 0x02 35f26: 53 81 ldd r21, Z+3 ; 0x03 35f28: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 35f2c: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 35f30: 46 2f mov r20, r22 35f32: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 35f34: 3f b7 in r19, 0x3f ; 63 35f36: 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. 35f38: f1 01 movw r30, r2 35f3a: e9 5b subi r30, 0xB9 ; 185 35f3c: ff 4f sbci r31, 0xFF ; 255 35f3e: 20 81 ld r18, Z 35f40: 21 11 cpse r18, r1 35f42: 27 c0 rjmp .+78 ; 0x35f92 block->accelerate_until = accelerate_steps; 35f44: d1 01 movw r26, r2 35f46: 59 96 adiw r26, 0x19 ; 25 35f48: cd 92 st X+, r12 35f4a: dd 92 st X+, r13 35f4c: ed 92 st X+, r14 35f4e: fc 92 st X, r15 35f50: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 35f52: c4 0c add r12, r4 35f54: d5 1c adc r13, r5 35f56: e6 1c adc r14, r6 35f58: f7 1c adc r15, r7 35f5a: f1 01 movw r30, r2 35f5c: c5 8e std Z+29, r12 ; 0x1d 35f5e: d6 8e std Z+30, r13 ; 0x1e 35f60: e7 8e std Z+31, r14 ; 0x1f 35f62: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 35f64: cf 88 ldd r12, Y+23 ; 0x17 35f66: c2 ae std Z+58, r12 ; 0x3a 35f68: d8 8c ldd r13, Y+24 ; 0x18 35f6a: d3 ae std Z+59, r13 ; 0x3b 35f6c: e9 8c ldd r14, Y+25 ; 0x19 35f6e: e4 ae std Z+60, r14 ; 0x3c 35f70: fa 8c ldd r15, Y+26 ; 0x1a 35f72: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 35f74: fe 96 adiw r30, 0x3e ; 62 35f76: 10 83 st Z, r17 35f78: 01 83 std Z+1, r16 ; 0x01 35f7a: c9 a0 ldd r12, Y+33 ; 0x21 35f7c: c2 82 std Z+2, r12 ; 0x02 35f7e: d8 a0 ldd r13, Y+32 ; 0x20 35f80: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 35f82: 73 96 adiw r30, 0x13 ; 19 35f84: ed 88 ldd r14, Y+21 ; 0x15 35f86: e0 82 st Z, r14 35f88: fe 88 ldd r15, Y+22 ; 0x16 35f8a: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 35f8c: 32 97 sbiw r30, 0x02 ; 2 35f8e: 40 83 st Z, r20 35f90: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 35f92: 3f bf out 0x3f, r19 ; 63 } 35f94: a1 96 adiw r28, 0x21 ; 33 35f96: 0f b6 in r0, 0x3f ; 63 35f98: f8 94 cli 35f9a: de bf out 0x3e, r29 ; 62 35f9c: 0f be out 0x3f, r0 ; 63 35f9e: cd bf out 0x3d, r28 ; 61 35fa0: df 91 pop r29 35fa2: cf 91 pop r28 35fa4: 1f 91 pop r17 35fa6: 0f 91 pop r16 35fa8: ff 90 pop r15 35faa: ef 90 pop r14 35fac: df 90 pop r13 35fae: cf 90 pop r12 35fb0: bf 90 pop r11 35fb2: af 90 pop r10 35fb4: 9f 90 pop r9 35fb6: 8f 90 pop r8 35fb8: 7f 90 pop r7 35fba: 6f 90 pop r6 35fbc: 5f 90 pop r5 35fbe: 4f 90 pop r4 35fc0: 3f 90 pop r3 35fc2: 2f 90 pop r2 35fc4: 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; 35fc6: 1d 8a std Y+21, r1 ; 0x15 35fc8: 1e 8a std Y+22, r1 ; 0x16 35fca: 83 cf rjmp .-250 ; 0x35ed2 #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; 35fcc: 2d 81 ldd r18, Y+5 ; 0x05 35fce: 3e 81 ldd r19, Y+6 ; 0x06 35fd0: 4f 81 ldd r20, Y+7 ; 0x07 35fd2: 58 85 ldd r21, Y+8 ; 0x08 35fd4: 82 e0 ldi r24, 0x02 ; 2 35fd6: 22 0f add r18, r18 35fd8: 33 1f adc r19, r19 35fda: 44 1f adc r20, r20 35fdc: 55 1f adc r21, r21 35fde: 8a 95 dec r24 35fe0: d1 f7 brne .-12 ; 0x35fd6 35fe2: 89 81 ldd r24, Y+1 ; 0x01 35fe4: 9a 81 ldd r25, Y+2 ; 0x02 35fe6: ab 81 ldd r26, Y+3 ; 0x03 35fe8: bc 81 ldd r27, Y+4 ; 0x04 35fea: 81 70 andi r24, 0x01 ; 1 35fec: 99 27 eor r25, r25 35fee: aa 27 eor r26, r26 35ff0: bb 27 eor r27, r27 35ff2: 8d 83 std Y+5, r24 ; 0x05 35ff4: 9e 83 std Y+6, r25 ; 0x06 35ff6: af 83 std Y+7, r26 ; 0x07 35ff8: b8 87 std Y+8, r27 ; 0x08 35ffa: 89 80 ldd r8, Y+1 ; 0x01 35ffc: 9a 80 ldd r9, Y+2 ; 0x02 35ffe: ab 80 ldd r10, Y+3 ; 0x03 36000: bc 80 ldd r11, Y+4 ; 0x04 36002: b6 94 lsr r11 36004: a7 94 ror r10 36006: 97 94 ror r9 36008: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 3600a: cd 84 ldd r12, Y+13 ; 0x0d 3600c: de 84 ldd r13, Y+14 ; 0x0e 3600e: ef 84 ldd r14, Y+15 ; 0x0f 36010: f8 88 ldd r15, Y+16 ; 0x10 36012: 89 89 ldd r24, Y+17 ; 0x11 36014: 9a 89 ldd r25, Y+18 ; 0x12 36016: ab 89 ldd r26, Y+19 ; 0x13 36018: bc 89 ldd r27, Y+20 ; 0x14 3601a: 8c 15 cp r24, r12 3601c: 9d 05 cpc r25, r13 3601e: ae 05 cpc r26, r14 36020: bf 05 cpc r27, r15 36022: 08 f4 brcc .+2 ; 0x36026 36024: 6f c0 rjmp .+222 ; 0x36104 // 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; 36026: 6c 01 movw r12, r24 36028: 7d 01 movw r14, r26 3602a: 91 e0 ldi r25, 0x01 ; 1 3602c: c9 1a sub r12, r25 3602e: d1 08 sbc r13, r1 36030: e1 08 sbc r14, r1 36032: f1 08 sbc r15, r1 36034: 8d 85 ldd r24, Y+13 ; 0x0d 36036: 9e 85 ldd r25, Y+14 ; 0x0e 36038: af 85 ldd r26, Y+15 ; 0x0f 3603a: b8 89 ldd r27, Y+16 ; 0x10 3603c: c8 1a sub r12, r24 3603e: d9 0a sbc r13, r25 36040: ea 0a sbc r14, r26 36042: fb 0a sbc r15, r27 36044: c7 01 movw r24, r14 36046: b6 01 movw r22, r12 36048: 62 0f add r22, r18 3604a: 73 1f adc r23, r19 3604c: 84 1f adc r24, r20 3604e: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 36050: cd 80 ldd r12, Y+5 ; 0x05 36052: de 80 ldd r13, Y+6 ; 0x06 36054: ef 80 ldd r14, Y+7 ; 0x07 36056: f8 84 ldd r15, Y+8 ; 0x08 36058: cd 28 or r12, r13 3605a: ce 28 or r12, r14 3605c: cf 28 or r12, r15 3605e: 41 f0 breq .+16 ; 0x36070 accelerate_steps += acceleration_x2; 36060: c9 84 ldd r12, Y+9 ; 0x09 36062: da 84 ldd r13, Y+10 ; 0x0a 36064: eb 84 ldd r14, Y+11 ; 0x0b 36066: fc 84 ldd r15, Y+12 ; 0x0c 36068: 6c 0d add r22, r12 3606a: 7d 1d adc r23, r13 3606c: 8e 1d adc r24, r14 3606e: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 36070: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 36074: 75 01 movw r14, r10 36076: 64 01 movw r12, r8 36078: c2 0e add r12, r18 3607a: d3 1e adc r13, r19 3607c: e4 1e adc r14, r20 3607e: f5 1e adc r15, r21 36080: 29 81 ldd r18, Y+1 ; 0x01 36082: 3a 81 ldd r19, Y+2 ; 0x02 36084: 4b 81 ldd r20, Y+3 ; 0x03 36086: 5c 81 ldd r21, Y+4 ; 0x04 36088: 2c 15 cp r18, r12 3608a: 3d 05 cpc r19, r13 3608c: 4e 05 cpc r20, r14 3608e: 5f 05 cpc r21, r15 36090: 10 f4 brcc .+4 ; 0x36096 36092: 69 01 movw r12, r18 36094: 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) { 36096: 2b 8d ldd r18, Y+27 ; 0x1b 36098: 22 23 and r18, r18 3609a: 09 f4 brne .+2 ; 0x3609e 3609c: 69 c0 rjmp .+210 ; 0x36170 if(!accelerate_steps || !decelerate_steps) { 3609e: c1 14 cp r12, r1 360a0: d1 04 cpc r13, r1 360a2: e1 04 cpc r14, r1 360a4: f1 04 cpc r15, r1 360a6: 09 f4 brne .+2 ; 0x360aa 360a8: 66 c0 rjmp .+204 ; 0x36176 // 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; 360aa: 4d 89 ldd r20, Y+21 ; 0x15 360ac: 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) { 360ae: 41 14 cp r4, r1 360b0: 51 04 cpc r5, r1 360b2: 61 04 cpc r6, r1 360b4: 71 04 cpc r7, r1 360b6: 09 f4 brne .+2 ; 0x360ba 360b8: 3d cf rjmp .-390 ; 0x35f34 // 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); 360ba: a7 01 movw r20, r14 360bc: 96 01 movw r18, r12 360be: 69 85 ldd r22, Y+9 ; 0x09 360c0: 7a 85 ldd r23, Y+10 ; 0x0a 360c2: 8b 85 ldd r24, Y+11 ; 0x0b 360c4: 9c 85 ldd r25, Y+12 ; 0x0c 360c6: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 360ca: 2d 85 ldd r18, Y+13 ; 0x0d 360cc: 3e 85 ldd r19, Y+14 ; 0x0e 360ce: 4f 85 ldd r20, Y+15 ; 0x0f 360d0: 58 89 ldd r21, Y+16 ; 0x10 360d2: 62 0f add r22, r18 360d4: 73 1f adc r23, r19 360d6: 84 1f adc r24, r20 360d8: 95 1f adc r25, r21 360da: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 360de: 0f 94 19 e1 call 0x3c232 ; 0x3c232 max_adv_steps = max_rate * block->adv_comp; 360e2: f1 01 movw r30, r2 360e4: ec 5a subi r30, 0xAC ; 172 360e6: ff 4f sbci r31, 0xFF ; 255 360e8: 20 81 ld r18, Z 360ea: 31 81 ldd r19, Z+1 ; 0x01 360ec: 42 81 ldd r20, Z+2 ; 0x02 360ee: 53 81 ldd r21, Z+3 ; 0x03 360f0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 360f4: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 360f8: 46 2f mov r20, r22 360fa: 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; 360fc: 41 2c mov r4, r1 360fe: 51 2c mov r5, r1 36100: 32 01 movw r6, r4 36102: 18 cf rjmp .-464 ; 0x35f34 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; 36104: 6d 85 ldd r22, Y+13 ; 0x0d 36106: 7e 85 ldd r23, Y+14 ; 0x0e 36108: 8f 85 ldd r24, Y+15 ; 0x0f 3610a: 98 89 ldd r25, Y+16 ; 0x10 3610c: c9 88 ldd r12, Y+17 ; 0x11 3610e: da 88 ldd r13, Y+18 ; 0x12 36110: eb 88 ldd r14, Y+19 ; 0x13 36112: fc 88 ldd r15, Y+20 ; 0x14 36114: 6c 19 sub r22, r12 36116: 7d 09 sbc r23, r13 36118: 8e 09 sbc r24, r14 3611a: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 3611c: cd 80 ldd r12, Y+5 ; 0x05 3611e: de 80 ldd r13, Y+6 ; 0x06 36120: ef 80 ldd r14, Y+7 ; 0x07 36122: f8 84 ldd r15, Y+8 ; 0x08 36124: cd 28 or r12, r13 36126: ce 28 or r12, r14 36128: cf 28 or r12, r15 3612a: 41 f0 breq .+16 ; 0x3613c decelerate_steps += acceleration_x2; 3612c: c9 84 ldd r12, Y+9 ; 0x09 3612e: da 84 ldd r13, Y+10 ; 0x0a 36130: eb 84 ldd r14, Y+11 ; 0x0b 36132: fc 84 ldd r15, Y+12 ; 0x0c 36134: 6c 0d add r22, r12 36136: 7d 1d adc r23, r13 36138: 8e 1d adc r24, r14 3613a: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 3613c: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 36140: 82 0e add r8, r18 36142: 93 1e adc r9, r19 36144: a4 1e adc r10, r20 36146: b5 1e adc r11, r21 36148: 49 80 ldd r4, Y+1 ; 0x01 3614a: 5a 80 ldd r5, Y+2 ; 0x02 3614c: 6b 80 ldd r6, Y+3 ; 0x03 3614e: 7c 80 ldd r7, Y+4 ; 0x04 36150: 84 14 cp r8, r4 36152: 95 04 cpc r9, r5 36154: a6 04 cpc r10, r6 36156: b7 04 cpc r11, r7 36158: 10 f4 brcc .+4 ; 0x3615e 3615a: 24 01 movw r4, r8 3615c: 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; 3615e: c9 80 ldd r12, Y+1 ; 0x01 36160: da 80 ldd r13, Y+2 ; 0x02 36162: eb 80 ldd r14, Y+3 ; 0x03 36164: fc 80 ldd r15, Y+4 ; 0x04 36166: c4 18 sub r12, r4 36168: d5 08 sbc r13, r5 3616a: e6 08 sbc r14, r6 3616c: f7 08 sbc r15, r7 3616e: 93 cf rjmp .-218 ; 0x36096 // 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; 36170: 40 e0 ldi r20, 0x00 ; 0 36172: 80 e0 ldi r24, 0x00 ; 0 36174: c3 cf rjmp .-122 ; 0x360fc #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; 36176: 4d 89 ldd r20, Y+21 ; 0x15 36178: 8e 89 ldd r24, Y+22 ; 0x16 3617a: c0 cf rjmp .-128 ; 0x360fc 0003617c : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 3617c: 0f 94 46 ae call 0x35c8c ; 0x35c8c 36180: 80 32 cpi r24, 0x20 ; 32 36182: 29 f0 breq .+10 ; 0x3618e putch(STK_FAILED); 36184: 81 e1 ldi r24, 0x11 ; 17 36186: 0f 94 3f ae call 0x35c7e ; 0x35c7e softReset(); 3618a: 0e 94 53 67 call 0xcea6 ; 0xcea6 } putch(STK_INSYNC); 3618e: 84 e1 ldi r24, 0x14 ; 20 36190: 0d 94 3f ae jmp 0x35c7e ; 0x35c7e 00036194 : } static void getNch(uint8_t count) { 36194: cf 93 push r28 36196: c8 2f mov r28, r24 do getch(); while (--count); 36198: 0f 94 46 ae call 0x35c8c ; 0x35c8c 3619c: c1 50 subi r28, 0x01 ; 1 3619e: e1 f7 brne .-8 ; 0x36198 verifySpace(); } 361a0: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 361a2: 0d 94 be b0 jmp 0x3617c ; 0x3617c 000361a6 : /// @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) { 361a6: 0f 93 push r16 361a8: 1f 93 push r17 361aa: cf 93 push r28 361ac: df 93 push r29 361ae: eb 01 movw r28, r22 361b0: 14 2f mov r17, r20 361b2: 05 2f mov r16, r21 lcd_putc(chr); 361b4: 0e 94 d6 6e call 0xddac ; 0xddac lcd_puts_P(str); 361b8: ce 01 movw r24, r28 361ba: 0e 94 d2 6e call 0xdda4 ; 0xdda4 lcd_putc(':'); 361be: 8a e3 ldi r24, 0x3A ; 58 361c0: 0e 94 d6 6e call 0xddac ; 0xddac 361c4: ce 01 movw r24, r28 361c6: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 361ca: 9e e0 ldi r25, 0x0E ; 14 361cc: 98 1b sub r25, r24 361ce: 89 2f mov r24, r25 361d0: 0e 94 dd 6e call 0xddba ; 0xddba // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 361d4: 0f 93 push r16 361d6: 1f 93 push r17 361d8: 8d ee ldi r24, 0xED ; 237 361da: 9b ea ldi r25, 0xAB ; 171 361dc: 9f 93 push r25 361de: 8f 93 push r24 361e0: 0e 94 c0 6e call 0xdd80 ; 0xdd80 361e4: 0f 90 pop r0 361e6: 0f 90 pop r0 361e8: 0f 90 pop r0 361ea: 0f 90 pop r0 } 361ec: df 91 pop r29 361ee: cf 91 pop r28 361f0: 1f 91 pop r17 361f2: 0f 91 pop r16 361f4: 08 95 ret 000361f6 : // 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) { 361f6: 2f 92 push r2 361f8: 3f 92 push r3 361fa: 4f 92 push r4 361fc: 5f 92 push r5 361fe: 6f 92 push r6 36200: 7f 92 push r7 36202: 8f 92 push r8 36204: 9f 92 push r9 36206: af 92 push r10 36208: bf 92 push r11 3620a: cf 92 push r12 3620c: df 92 push r13 3620e: ef 92 push r14 36210: ff 92 push r15 36212: 0f 93 push r16 36214: 1f 93 push r17 36216: cf 93 push r28 36218: df 93 push r29 3621a: cd b7 in r28, 0x3d ; 61 3621c: de b7 in r29, 0x3e ; 62 3621e: c5 58 subi r28, 0x85 ; 133 36220: d1 09 sbc r29, r1 36222: 0f b6 in r0, 0x3f ; 63 36224: f8 94 cli 36226: de bf out 0x3e, r29 ; 62 36228: 0f be out 0x3f, r0 ; 63 3622a: cd bf out 0x3d, r28 ; 61 3622c: 69 a3 std Y+33, r22 ; 0x21 3622e: 7a a3 std Y+34, r23 ; 0x22 36230: 8b a3 std Y+35, r24 ; 0x23 36232: 9c a3 std Y+36, r25 ; 0x24 36234: 2d a3 std Y+37, r18 ; 0x25 36236: 3e a3 std Y+38, r19 ; 0x26 36238: 4f a3 std Y+39, r20 ; 0x27 3623a: 58 a7 std Y+40, r21 ; 0x28 3623c: a8 96 adiw r28, 0x28 ; 40 3623e: ec ae std Y+60, r14 ; 0x3c 36240: fd ae std Y+61, r15 ; 0x3d 36242: 0e af std Y+62, r16 ; 0x3e 36244: 1f af std Y+63, r17 ; 0x3f 36246: a8 97 sbiw r28, 0x28 ; 40 36248: aa 96 adiw r28, 0x2a ; 42 3624a: df ae std Y+63, r13 ; 0x3f 3624c: ce ae std Y+62, r12 ; 0x3e 3624e: aa 97 sbiw r28, 0x2a ; 42 36250: 89 aa std Y+49, r8 ; 0x31 36252: 99 ae std Y+57, r9 ; 0x39 36254: ad ae std Y+61, r10 ; 0x3d 36256: bd aa std Y+53, r11 ; 0x35 36258: c5 56 subi r28, 0x65 ; 101 3625a: df 4f sbci r29, 0xFF ; 255 3625c: 08 81 ld r16, Y 3625e: 19 81 ldd r17, Y+1 ; 0x01 36260: cb 59 subi r28, 0x9B ; 155 36262: 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); 36264: 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) 36268: 8f 5f subi r24, 0xFF ; 255 3626a: a1 96 adiw r28, 0x21 ; 33 3626c: 8f af std Y+63, r24 ; 0x3f 3626e: a1 97 sbiw r28, 0x21 ; 33 36270: 80 31 cpi r24, 0x10 ; 16 36272: 19 f4 brne .+6 ; 0x3627a block_index = 0; 36274: a1 96 adiw r28, 0x21 ; 33 36276: 1f ae std Y+63, r1 ; 0x3f 36278: 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) { 3627a: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 3627e: a1 96 adiw r28, 0x21 ; 33 36280: 2f ad ldd r18, Y+63 ; 0x3f 36282: a1 97 sbiw r28, 0x21 ; 33 36284: 82 13 cpse r24, r18 36286: 0f c0 rjmp .+30 ; 0x362a6 do { manage_heater(); 36288: 0f 94 63 38 call 0x270c6 ; 0x270c6 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 3628c: 80 e0 ldi r24, 0x00 ; 0 3628e: 0e 94 b6 8a call 0x1156c ; 0x1156c lcd_update(0); 36292: 80 e0 ldi r24, 0x00 ; 0 36294: 0e 94 ae 6e call 0xdd5c ; 0xdd5c } while (block_buffer_tail == next_buffer_head); 36298: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 3629c: a1 96 adiw r28, 0x21 ; 33 3629e: 3f ad ldd r19, Y+63 ; 0x3f 362a0: a1 97 sbiw r28, 0x21 ; 33 362a2: 83 17 cp r24, r19 362a4: 89 f3 breq .-30 ; 0x36288 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 362a6: 40 91 ac 0d lds r20, 0x0DAC ; 0x800dac 362aa: a2 96 adiw r28, 0x22 ; 34 362ac: 4f af std Y+63, r20 ; 0x3f 362ae: a2 97 sbiw r28, 0x22 ; 34 362b0: 44 23 and r20, r20 362b2: 11 f1 breq .+68 ; 0x362f8 // avoid planning the block early if aborted SERIAL_ECHO_START; 362b4: 80 ed ldi r24, 0xD0 ; 208 362b6: 9b ea ldi r25, 0xAB ; 171 362b8: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n("Move aborted")); 362bc: 8a e3 ldi r24, 0x3A ; 58 362be: 91 e7 ldi r25, 0x71 ; 113 362c0: 0e 94 82 79 call 0xf304 ; 0xf304 // 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(); } 362c4: cb 57 subi r28, 0x7B ; 123 362c6: df 4f sbci r29, 0xFF ; 255 362c8: 0f b6 in r0, 0x3f ; 63 362ca: f8 94 cli 362cc: de bf out 0x3e, r29 ; 62 362ce: 0f be out 0x3f, r0 ; 63 362d0: cd bf out 0x3d, r28 ; 61 362d2: df 91 pop r29 362d4: cf 91 pop r28 362d6: 1f 91 pop r17 362d8: 0f 91 pop r16 362da: ff 90 pop r15 362dc: ef 90 pop r14 362de: df 90 pop r13 362e0: cf 90 pop r12 362e2: bf 90 pop r11 362e4: af 90 pop r10 362e6: 9f 90 pop r9 362e8: 8f 90 pop r8 362ea: 7f 90 pop r7 362ec: 6f 90 pop r6 362ee: 5f 90 pop r5 362f0: 4f 90 pop r4 362f2: 3f 90 pop r3 362f4: 2f 90 pop r2 362f6: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 362f8: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 362fc: 29 2e mov r2, r25 362fe: 31 2c mov r3, r1 36300: 8e e6 ldi r24, 0x6E ; 110 36302: 98 9f mul r25, r24 36304: d0 01 movw r26, r0 36306: 11 24 eor r1, r1 36308: a4 96 adiw r28, 0x24 ; 36 3630a: bf af std Y+63, r27 ; 0x3f 3630c: ae af std Y+62, r26 ; 0x3e 3630e: 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; 36310: cd 01 movw r24, r26 36312: 8b 53 subi r24, 0x3B ; 59 36314: 99 4f sbci r25, 0xF9 ; 249 36316: fc 01 movw r30, r24 36318: e9 5b subi r30, 0xB9 ; 185 3631a: ff 4f sbci r31, 0xFF ; 255 3631c: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 3631e: 84 59 subi r24, 0x94 ; 148 36320: 9f 4f sbci r25, 0xFF ; 255 36322: fc 01 movw r30, r24 36324: 11 82 std Z+1, r1 ; 0x01 36326: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 36328: 01 15 cp r16, r1 3632a: 11 05 cpc r17, r1 3632c: 11 f4 brne .+4 ; 0x36332 3632e: 0d 94 ef bb jmp 0x377de ; 0x377de memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 36332: 80 e1 ldi r24, 0x10 ; 16 36334: f8 01 movw r30, r16 36336: a3 5e subi r26, 0xE3 ; 227 36338: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 3633a: 01 90 ld r0, Z+ 3633c: 0d 92 st X+, r0 3633e: 8a 95 dec r24 36340: e1 f7 brne .-8 ; 0x3633a // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 36342: 8e e6 ldi r24, 0x6E ; 110 36344: 82 9d mul r24, r2 36346: 80 01 movw r16, r0 36348: 83 9d mul r24, r3 3634a: 10 0d add r17, r0 3634c: 11 24 eor r1, r1 3634e: 0b 53 subi r16, 0x3B ; 59 36350: 19 4f sbci r17, 0xF9 ; 249 36352: f8 01 movw r30, r16 36354: e8 59 subi r30, 0x98 ; 152 36356: ff 4f sbci r31, 0xFF ; 255 36358: c3 56 subi r28, 0x63 ; 99 3635a: df 4f sbci r29, 0xFF ; 255 3635c: 88 81 ld r24, Y 3635e: 99 81 ldd r25, Y+1 ; 0x01 36360: cd 59 subi r28, 0x9D ; 157 36362: d0 40 sbci r29, 0x00 ; 0 36364: 91 83 std Z+1, r25 ; 0x01 36366: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 36368: 06 59 subi r16, 0x96 ; 150 3636a: 1f 4f sbci r17, 0xFF ; 255 3636c: 60 91 b8 02 lds r22, 0x02B8 ; 0x8002b8 36370: 70 91 b9 02 lds r23, 0x02B9 ; 0x8002b9 36374: 80 91 ba 02 lds r24, 0x02BA ; 0x8002ba 36378: 90 91 bb 02 lds r25, 0x02BB ; 0x8002bb 3637c: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 36380: d8 01 movw r26, r16 36382: 6d 93 st X+, r22 36384: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 36386: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> 3638a: 88 23 and r24, r24 3638c: a9 f0 breq .+42 ; 0x363b8 { position[E_AXIS] = 0; 3638e: 10 92 af 06 sts 0x06AF, r1 ; 0x8006af 36392: 10 92 b0 06 sts 0x06B0, r1 ; 0x8006b0 36396: 10 92 b1 06 sts 0x06B1, r1 ; 0x8006b1 3639a: 10 92 b2 06 sts 0x06B2, r1 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 3639e: 10 92 d9 04 sts 0x04D9, r1 ; 0x8004d9 363a2: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 363a6: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db 363aa: 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; 363ae: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = true; 363b2: 81 e0 ldi r24, 0x01 ; 1 363b4: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> } // Apply the machine correction matrix. world2machine(x, y); 363b8: be 01 movw r22, r28 363ba: 6b 5d subi r22, 0xDB ; 219 363bc: 7f 4f sbci r23, 0xFF ; 255 363be: ce 01 movw r24, r28 363c0: 81 96 adiw r24, 0x21 ; 33 363c2: 0e 94 09 6a call 0xd412 ; 0xd412 // 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]); 363c6: c9 a0 ldd r12, Y+33 ; 0x21 363c8: da a0 ldd r13, Y+34 ; 0x22 363ca: eb a0 ldd r14, Y+35 ; 0x23 363cc: fc a0 ldd r15, Y+36 ; 0x24 363ce: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 363d2: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 363d6: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 363da: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 363de: c7 01 movw r24, r14 363e0: b6 01 movw r22, r12 363e2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 363e6: 0f 94 88 e0 call 0x3c110 ; 0x3c110 363ea: c2 58 subi r28, 0x82 ; 130 363ec: df 4f sbci r29, 0xFF ; 255 363ee: 68 83 st Y, r22 363f0: 79 83 std Y+1, r23 ; 0x01 363f2: 8a 83 std Y+2, r24 ; 0x02 363f4: 9b 83 std Y+3, r25 ; 0x03 363f6: ce 57 subi r28, 0x7E ; 126 363f8: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 363fa: 8d a0 ldd r8, Y+37 ; 0x25 363fc: 9e a0 ldd r9, Y+38 ; 0x26 363fe: af a0 ldd r10, Y+39 ; 0x27 36400: b8 a4 ldd r11, Y+40 ; 0x28 36402: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 36406: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 3640a: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 3640e: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 36412: c5 01 movw r24, r10 36414: b4 01 movw r22, r8 36416: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3641a: 0f 94 88 e0 call 0x3c110 ; 0x3c110 3641e: ce 57 subi r28, 0x7E ; 126 36420: df 4f sbci r29, 0xFF ; 255 36422: 68 83 st Y, r22 36424: 79 83 std Y+1, r23 ; 0x01 36426: 8a 83 std Y+2, r24 ; 0x02 36428: 9b 83 std Y+3, r25 ; 0x03 3642a: c2 58 subi r28, 0x82 ; 130 3642c: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 3642e: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 36432: 88 23 and r24, r24 36434: 11 f4 brne .+4 ; 0x3643a 36436: 0d 94 f6 bb jmp 0x377ec ; 0x377ec target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 3643a: a5 01 movw r20, r10 3643c: 94 01 movw r18, r8 3643e: c7 01 movw r24, r14 36440: b6 01 movw r22, r12 36442: 0f 94 b8 a1 call 0x34370 ; 0x34370 36446: a8 96 adiw r28, 0x28 ; 40 36448: 2c ad ldd r18, Y+60 ; 0x3c 3644a: 3d ad ldd r19, Y+61 ; 0x3d 3644c: 4e ad ldd r20, Y+62 ; 0x3e 3644e: 5f ad ldd r21, Y+63 ; 0x3f 36450: a8 97 sbiw r28, 0x28 ; 40 36452: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 36456: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 3645a: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 3645e: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 36462: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 36466: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3646a: 0f 94 88 e0 call 0x3c110 ; 0x3c110 3646e: e6 96 adiw r28, 0x36 ; 54 36470: 6c af std Y+60, r22 ; 0x3c 36472: 7d af std Y+61, r23 ; 0x3d 36474: 8e af std Y+62, r24 ; 0x3e 36476: 9f af std Y+63, r25 ; 0x3f 36478: 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]); 3647a: aa 96 adiw r28, 0x2a ; 42 3647c: ee ad ldd r30, Y+62 ; 0x3e 3647e: ff ad ldd r31, Y+63 ; 0x3f 36480: aa 97 sbiw r28, 0x2a ; 42 36482: 80 80 ld r8, Z 36484: 91 80 ldd r9, Z+1 ; 0x01 36486: a2 80 ldd r10, Z+2 ; 0x02 36488: b3 80 ldd r11, Z+3 ; 0x03 3648a: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 3648e: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 36492: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 36496: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 3649a: c5 01 movw r24, r10 3649c: b4 01 movw r22, r8 3649e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 364a2: 0f 94 88 e0 call 0x3c110 ; 0x3c110 364a6: ae 96 adiw r28, 0x2e ; 46 364a8: 6c af std Y+60, r22 ; 0x3c 364aa: 7d af std Y+61, r23 ; 0x3d 364ac: 8e af std Y+62, r24 ; 0x3e 364ae: 9f af std Y+63, r25 ; 0x3f 364b0: 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]; 364b2: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 364b6: 90 91 b0 06 lds r25, 0x06B0 ; 0x8006b0 364ba: a0 91 b1 06 lds r26, 0x06B1 ; 0x8006b1 364be: b0 91 b2 06 lds r27, 0x06B2 ; 0x8006b2 364c2: ae 96 adiw r28, 0x2e ; 46 364c4: 4c ac ldd r4, Y+60 ; 0x3c 364c6: 5d ac ldd r5, Y+61 ; 0x3d 364c8: 6e ac ldd r6, Y+62 ; 0x3e 364ca: 7f ac ldd r7, Y+63 ; 0x3f 364cc: ae 97 sbiw r28, 0x2e ; 46 364ce: 48 1a sub r4, r24 364d0: 59 0a sbc r5, r25 364d2: 6a 0a sbc r6, r26 364d4: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 364d6: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 364da: 90 91 a4 06 lds r25, 0x06A4 ; 0x8006a4 364de: a0 91 a5 06 lds r26, 0x06A5 ; 0x8006a5 364e2: b0 91 a6 06 lds r27, 0x06A6 ; 0x8006a6 364e6: c2 58 subi r28, 0x82 ; 130 364e8: df 4f sbci r29, 0xFF ; 255 364ea: c8 80 ld r12, Y 364ec: d9 80 ldd r13, Y+1 ; 0x01 364ee: ea 80 ldd r14, Y+2 ; 0x02 364f0: fb 80 ldd r15, Y+3 ; 0x03 364f2: ce 57 subi r28, 0x7E ; 126 364f4: d0 40 sbci r29, 0x00 ; 0 364f6: c8 1a sub r12, r24 364f8: d9 0a sbc r13, r25 364fa: ea 0a sbc r14, r26 364fc: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 364fe: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 36502: 90 91 a8 06 lds r25, 0x06A8 ; 0x8006a8 36506: a0 91 a9 06 lds r26, 0x06A9 ; 0x8006a9 3650a: b0 91 aa 06 lds r27, 0x06AA ; 0x8006aa 3650e: ce 57 subi r28, 0x7E ; 126 36510: df 4f sbci r29, 0xFF ; 255 36512: 28 81 ld r18, Y 36514: 39 81 ldd r19, Y+1 ; 0x01 36516: 4a 81 ldd r20, Y+2 ; 0x02 36518: 5b 81 ldd r21, Y+3 ; 0x03 3651a: c2 58 subi r28, 0x82 ; 130 3651c: d0 40 sbci r29, 0x00 ; 0 3651e: 28 1b sub r18, r24 36520: 39 0b sbc r19, r25 36522: 4a 0b sbc r20, r26 36524: 5b 0b sbc r21, r27 36526: 29 a7 std Y+41, r18 ; 0x29 36528: 3a a7 std Y+42, r19 ; 0x2a 3652a: 4b a7 std Y+43, r20 ; 0x2b 3652c: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 3652e: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 36532: 90 91 ac 06 lds r25, 0x06AC ; 0x8006ac 36536: a0 91 ad 06 lds r26, 0x06AD ; 0x8006ad 3653a: b0 91 ae 06 lds r27, 0x06AE ; 0x8006ae 3653e: e6 96 adiw r28, 0x36 ; 54 36540: 2c ad ldd r18, Y+60 ; 0x3c 36542: 3d ad ldd r19, Y+61 ; 0x3d 36544: 4e ad ldd r20, Y+62 ; 0x3e 36546: 5f ad ldd r21, Y+63 ; 0x3f 36548: e6 97 sbiw r28, 0x36 ; 54 3654a: 28 1b sub r18, r24 3654c: 39 0b sbc r19, r25 3654e: 4a 0b sbc r20, r26 36550: 5b 0b sbc r21, r27 36552: 2d a7 std Y+45, r18 ; 0x2d 36554: 3e a7 std Y+46, r19 ; 0x2e 36556: 4f a7 std Y+47, r20 ; 0x2f 36558: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 3655a: 41 14 cp r4, r1 3655c: 51 04 cpc r5, r1 3655e: 61 04 cpc r6, r1 36560: 71 04 cpc r7, r1 36562: 09 f4 brne .+2 ; 0x36566 36564: 80 c0 rjmp .+256 ; 0x36666 { if((int)degHotend(active_extruder) 3656a: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 3656e: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 36572: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 36576: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 3657a: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 3657e: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 36582: 62 17 cp r22, r18 36584: 73 07 cpc r23, r19 36586: 0c f5 brge .+66 ; 0x365ca { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 36588: ae 96 adiw r28, 0x2e ; 46 3658a: 8c ad ldd r24, Y+60 ; 0x3c 3658c: 9d ad ldd r25, Y+61 ; 0x3d 3658e: ae ad ldd r26, Y+62 ; 0x3e 36590: bf ad ldd r27, Y+63 ; 0x3f 36592: ae 97 sbiw r28, 0x2e ; 46 36594: 80 93 af 06 sts 0x06AF, r24 ; 0x8006af 36598: 90 93 b0 06 sts 0x06B0, r25 ; 0x8006b0 3659c: a0 93 b1 06 sts 0x06B1, r26 ; 0x8006b1 365a0: b0 93 b2 06 sts 0x06B2, r27 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 365a4: 80 92 d9 04 sts 0x04D9, r8 ; 0x8004d9 365a8: 90 92 da 04 sts 0x04DA, r9 ; 0x8004da 365ac: a0 92 db 04 sts 0x04DB, r10 ; 0x8004db 365b0: b0 92 dc 04 sts 0x04DC, r11 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 365b4: 80 ed ldi r24, 0xD0 ; 208 365b6: 9b ea ldi r25, 0xAB ; 171 365b8: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 365bc: 80 e2 ldi r24, 0x20 ; 32 365be: 91 e7 ldi r25, 0x71 ; 113 365c0: 0e 94 82 79 call 0xf304 ; 0xf304 { 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 365c4: 41 2c mov r4, r1 365c6: 51 2c mov r5, r1 365c8: 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) 365ca: c3 01 movw r24, r6 365cc: b2 01 movw r22, r4 365ce: 77 fe sbrs r7, 7 365d0: 07 c0 rjmp .+14 ; 0x365e0 365d2: 66 27 eor r22, r22 365d4: 77 27 eor r23, r23 365d6: cb 01 movw r24, r22 365d8: 64 19 sub r22, r4 365da: 75 09 sbc r23, r5 365dc: 86 09 sbc r24, r6 365de: 97 09 sbc r25, r7 365e0: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 365e4: 4b 01 movw r8, r22 365e6: 5c 01 movw r10, r24 365e8: 20 e0 ldi r18, 0x00 ; 0 365ea: 30 ec ldi r19, 0xC0 ; 192 365ec: 4b ee ldi r20, 0xEB ; 235 365ee: 53 e4 ldi r21, 0x43 ; 67 365f0: 60 91 ce 0d lds r22, 0x0DCE ; 0x800dce 365f4: 70 91 cf 0d lds r23, 0x0DCF ; 0x800dcf 365f8: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 365fc: 90 91 d1 0d lds r25, 0x0DD1 ; 0x800dd1 36600: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36604: 9b 01 movw r18, r22 36606: ac 01 movw r20, r24 36608: c5 01 movw r24, r10 3660a: b4 01 movw r22, r8 3660c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 36610: 18 16 cp r1, r24 36612: 4c f5 brge .+82 ; 0x36666 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 36614: ae 96 adiw r28, 0x2e ; 46 36616: 2c ad ldd r18, Y+60 ; 0x3c 36618: 3d ad ldd r19, Y+61 ; 0x3d 3661a: 4e ad ldd r20, Y+62 ; 0x3e 3661c: 5f ad ldd r21, Y+63 ; 0x3f 3661e: ae 97 sbiw r28, 0x2e ; 46 36620: 20 93 af 06 sts 0x06AF, r18 ; 0x8006af 36624: 30 93 b0 06 sts 0x06B0, r19 ; 0x8006b0 36628: 40 93 b1 06 sts 0x06B1, r20 ; 0x8006b1 3662c: 50 93 b2 06 sts 0x06B2, r21 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 36630: aa 96 adiw r28, 0x2a ; 42 36632: ee ad ldd r30, Y+62 ; 0x3e 36634: ff ad ldd r31, Y+63 ; 0x3f 36636: aa 97 sbiw r28, 0x2a ; 42 36638: 80 81 ld r24, Z 3663a: 91 81 ldd r25, Z+1 ; 0x01 3663c: a2 81 ldd r26, Z+2 ; 0x02 3663e: b3 81 ldd r27, Z+3 ; 0x03 36640: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 36644: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 36648: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 3664c: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 36650: 80 ed ldi r24, 0xD0 ; 208 36652: 9b ea ldi r25, 0xAB ; 171 36654: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 36658: 82 e0 ldi r24, 0x02 ; 2 3665a: 91 e7 ldi r25, 0x71 ; 113 3665c: 0e 94 82 79 call 0xf304 ; 0xf304 { 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 36660: 41 2c mov r4, r1 36662: 51 2c mov r5, r1 36664: 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); 36666: 8e e6 ldi r24, 0x6E ; 110 36668: 82 9d mul r24, r2 3666a: f0 01 movw r30, r0 3666c: 83 9d mul r24, r3 3666e: f0 0d add r31, r0 36670: 11 24 eor r1, r1 36672: eb 53 subi r30, 0x3B ; 59 36674: f9 4f sbci r31, 0xF9 ; 249 36676: d7 01 movw r26, r14 36678: c6 01 movw r24, r12 3667a: f7 fe sbrs r15, 7 3667c: 07 c0 rjmp .+14 ; 0x3668c 3667e: 88 27 eor r24, r24 36680: 99 27 eor r25, r25 36682: dc 01 movw r26, r24 36684: 8c 19 sub r24, r12 36686: 9d 09 sbc r25, r13 36688: ae 09 sbc r26, r14 3668a: bf 09 sbc r27, r15 3668c: 80 83 st Z, r24 3668e: 91 83 std Z+1, r25 ; 0x01 36690: a2 83 std Z+2, r26 ; 0x02 36692: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 36694: 8e e6 ldi r24, 0x6E ; 110 36696: 82 9d mul r24, r2 36698: f0 01 movw r30, r0 3669a: 83 9d mul r24, r3 3669c: f0 0d add r31, r0 3669e: 11 24 eor r1, r1 366a0: eb 53 subi r30, 0x3B ; 59 366a2: f9 4f sbci r31, 0xF9 ; 249 366a4: 89 a5 ldd r24, Y+41 ; 0x29 366a6: 9a a5 ldd r25, Y+42 ; 0x2a 366a8: ab a5 ldd r26, Y+43 ; 0x2b 366aa: bc a5 ldd r27, Y+44 ; 0x2c 366ac: b7 ff sbrs r27, 7 366ae: 07 c0 rjmp .+14 ; 0x366be 366b0: b0 95 com r27 366b2: a0 95 com r26 366b4: 90 95 com r25 366b6: 81 95 neg r24 366b8: 9f 4f sbci r25, 0xFF ; 255 366ba: af 4f sbci r26, 0xFF ; 255 366bc: bf 4f sbci r27, 0xFF ; 255 366be: 84 83 std Z+4, r24 ; 0x04 366c0: 95 83 std Z+5, r25 ; 0x05 366c2: a6 83 std Z+6, r26 ; 0x06 366c4: 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); 366c6: 8e e6 ldi r24, 0x6E ; 110 366c8: 82 9d mul r24, r2 366ca: f0 01 movw r30, r0 366cc: 83 9d mul r24, r3 366ce: f0 0d add r31, r0 366d0: 11 24 eor r1, r1 366d2: eb 53 subi r30, 0x3B ; 59 366d4: f9 4f sbci r31, 0xF9 ; 249 366d6: 8d a5 ldd r24, Y+45 ; 0x2d 366d8: 9e a5 ldd r25, Y+46 ; 0x2e 366da: af a5 ldd r26, Y+47 ; 0x2f 366dc: b8 a9 ldd r27, Y+48 ; 0x30 366de: b7 ff sbrs r27, 7 366e0: 07 c0 rjmp .+14 ; 0x366f0 366e2: b0 95 com r27 366e4: a0 95 com r26 366e6: 90 95 com r25 366e8: 81 95 neg r24 366ea: 9f 4f sbci r25, 0xFF ; 255 366ec: af 4f sbci r26, 0xFF ; 255 366ee: bf 4f sbci r27, 0xFF ; 255 366f0: 80 87 std Z+8, r24 ; 0x08 366f2: 91 87 std Z+9, r25 ; 0x09 366f4: a2 87 std Z+10, r26 ; 0x0a 366f6: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 366f8: b3 01 movw r22, r6 366fa: a2 01 movw r20, r4 366fc: 77 fe sbrs r7, 7 366fe: 07 c0 rjmp .+14 ; 0x3670e 36700: 44 27 eor r20, r20 36702: 55 27 eor r21, r21 36704: ba 01 movw r22, r20 36706: 44 19 sub r20, r4 36708: 55 09 sbc r21, r5 3670a: 66 09 sbc r22, r6 3670c: 77 09 sbc r23, r7 3670e: 8e e6 ldi r24, 0x6E ; 110 36710: 82 9d mul r24, r2 36712: f0 01 movw r30, r0 36714: 83 9d mul r24, r3 36716: f0 0d add r31, r0 36718: 11 24 eor r1, r1 3671a: eb 53 subi r30, 0x3B ; 59 3671c: f9 4f sbci r31, 0xF9 ; 249 3671e: 44 87 std Z+12, r20 ; 0x0c 36720: 55 87 std Z+13, r21 ; 0x0d 36722: 66 87 std Z+14, r22 ; 0x0e 36724: 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))); 36726: 00 81 ld r16, Z 36728: 11 81 ldd r17, Z+1 ; 0x01 3672a: 22 81 ldd r18, Z+2 ; 0x02 3672c: 33 81 ldd r19, Z+3 ; 0x03 3672e: 84 81 ldd r24, Z+4 ; 0x04 36730: 95 81 ldd r25, Z+5 ; 0x05 36732: a6 81 ldd r26, Z+6 ; 0x06 36734: b7 81 ldd r27, Z+7 ; 0x07 36736: 80 17 cp r24, r16 36738: 91 07 cpc r25, r17 3673a: a2 07 cpc r26, r18 3673c: b3 07 cpc r27, r19 3673e: 14 f4 brge .+4 ; 0x36744 36740: d9 01 movw r26, r18 36742: c8 01 movw r24, r16 36744: ee e6 ldi r30, 0x6E ; 110 36746: be 2e mov r11, r30 36748: b2 9c mul r11, r2 3674a: f0 01 movw r30, r0 3674c: b3 9c mul r11, r3 3674e: f0 0d add r31, r0 36750: 11 24 eor r1, r1 36752: eb 53 subi r30, 0x3B ; 59 36754: f9 4f sbci r31, 0xF9 ; 249 36756: 80 84 ldd r8, Z+8 ; 0x08 36758: 91 84 ldd r9, Z+9 ; 0x09 3675a: a2 84 ldd r10, Z+10 ; 0x0a 3675c: b3 84 ldd r11, Z+11 ; 0x0b 3675e: 88 15 cp r24, r8 36760: 99 05 cpc r25, r9 36762: aa 05 cpc r26, r10 36764: bb 05 cpc r27, r11 36766: 14 f4 brge .+4 ; 0x3676c 36768: d5 01 movw r26, r10 3676a: c4 01 movw r24, r8 3676c: 84 17 cp r24, r20 3676e: 95 07 cpc r25, r21 36770: a6 07 cpc r26, r22 36772: b7 07 cpc r27, r23 36774: 14 f4 brge .+4 ; 0x3677a 36776: db 01 movw r26, r22 36778: ca 01 movw r24, r20 3677a: 4e e6 ldi r20, 0x6E ; 110 3677c: 42 9d mul r20, r2 3677e: f0 01 movw r30, r0 36780: 43 9d mul r20, r3 36782: f0 0d add r31, r0 36784: 11 24 eor r1, r1 36786: eb 53 subi r30, 0x3B ; 59 36788: f9 4f sbci r31, 0xF9 ; 249 3678a: 80 8b std Z+16, r24 ; 0x10 3678c: 91 8b std Z+17, r25 ; 0x11 3678e: a2 8b std Z+18, r26 ; 0x12 36790: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 36792: 06 97 sbiw r24, 0x06 ; 6 36794: a1 05 cpc r26, r1 36796: b1 05 cpc r27, r1 36798: 0c f4 brge .+2 ; 0x3679c 3679a: 94 cd rjmp .-1240 ; 0x362c4 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 3679c: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 367a0: df 01 movw r26, r30 367a2: aa 5b subi r26, 0xBA ; 186 367a4: bf 4f sbci r27, 0xFF ; 255 367a6: 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); 367a8: f7 fe sbrs r15, 7 367aa: 02 c0 rjmp .+4 ; 0x367b0 367ac: 0d 94 06 bc jmp 0x3780c ; 0x3780c } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 367b0: 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); 367b2: 89 a5 ldd r24, Y+41 ; 0x29 367b4: 9a a5 ldd r25, Y+42 ; 0x2a 367b6: ab a5 ldd r26, Y+43 ; 0x2b 367b8: bc a5 ldd r27, Y+44 ; 0x2c 367ba: b7 ff sbrs r27, 7 367bc: 0b c0 rjmp .+22 ; 0x367d4 367be: 8e e6 ldi r24, 0x6E ; 110 367c0: 82 9d mul r24, r2 367c2: f0 01 movw r30, r0 367c4: 83 9d mul r24, r3 367c6: f0 0d add r31, r0 367c8: 11 24 eor r1, r1 367ca: eb 53 subi r30, 0x3B ; 59 367cc: f9 4f sbci r31, 0xF9 ; 249 367ce: 80 8d ldd r24, Z+24 ; 0x18 367d0: 82 60 ori r24, 0x02 ; 2 367d2: 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); 367d4: 8d a5 ldd r24, Y+45 ; 0x2d 367d6: 9e a5 ldd r25, Y+46 ; 0x2e 367d8: af a5 ldd r26, Y+47 ; 0x2f 367da: b8 a9 ldd r27, Y+48 ; 0x30 367dc: b7 ff sbrs r27, 7 367de: 0b c0 rjmp .+22 ; 0x367f6 367e0: 8e e6 ldi r24, 0x6E ; 110 367e2: 82 9d mul r24, r2 367e4: f0 01 movw r30, r0 367e6: 83 9d mul r24, r3 367e8: f0 0d add r31, r0 367ea: 11 24 eor r1, r1 367ec: eb 53 subi r30, 0x3B ; 59 367ee: f9 4f sbci r31, 0xF9 ; 249 367f0: 80 8d ldd r24, Z+24 ; 0x18 367f2: 84 60 ori r24, 0x04 ; 4 367f4: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 367f6: 77 fe sbrs r7, 7 367f8: 0b c0 rjmp .+22 ; 0x36810 367fa: 8e e6 ldi r24, 0x6E ; 110 367fc: 82 9d mul r24, r2 367fe: f0 01 movw r30, r0 36800: 83 9d mul r24, r3 36802: f0 0d add r31, r0 36804: 11 24 eor r1, r1 36806: eb 53 subi r30, 0x3B ; 59 36808: f9 4f sbci r31, 0xF9 ; 249 3680a: 80 8d ldd r24, Z+24 ; 0x18 3680c: 88 60 ori r24, 0x08 ; 8 3680e: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 36810: 01 2b or r16, r17 36812: 02 2b or r16, r18 36814: 03 2b or r16, r19 36816: 09 f0 breq .+2 ; 0x3681a 36818: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 3681a: 8e e6 ldi r24, 0x6E ; 110 3681c: 82 9d mul r24, r2 3681e: f0 01 movw r30, r0 36820: 83 9d mul r24, r3 36822: f0 0d add r31, r0 36824: 11 24 eor r1, r1 36826: eb 53 subi r30, 0x3B ; 59 36828: f9 4f sbci r31, 0xF9 ; 249 3682a: 84 81 ldd r24, Z+4 ; 0x04 3682c: 95 81 ldd r25, Z+5 ; 0x05 3682e: a6 81 ldd r26, Z+6 ; 0x06 36830: b7 81 ldd r27, Z+7 ; 0x07 36832: 89 2b or r24, r25 36834: 8a 2b or r24, r26 36836: 8b 2b or r24, r27 36838: 09 f0 breq .+2 ; 0x3683c 3683a: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 3683c: 8e e6 ldi r24, 0x6E ; 110 3683e: 82 9d mul r24, r2 36840: f0 01 movw r30, r0 36842: 83 9d mul r24, r3 36844: f0 0d add r31, r0 36846: 11 24 eor r1, r1 36848: eb 53 subi r30, 0x3B ; 59 3684a: f9 4f sbci r31, 0xF9 ; 249 3684c: 80 85 ldd r24, Z+8 ; 0x08 3684e: 91 85 ldd r25, Z+9 ; 0x09 36850: a2 85 ldd r26, Z+10 ; 0x0a 36852: b3 85 ldd r27, Z+11 ; 0x0b 36854: 89 2b or r24, r25 36856: 8a 2b or r24, r26 36858: 8b 2b or r24, r27 3685a: 09 f0 breq .+2 ; 0x3685e 3685c: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 3685e: 8e e6 ldi r24, 0x6E ; 110 36860: 82 9d mul r24, r2 36862: f0 01 movw r30, r0 36864: 83 9d mul r24, r3 36866: f0 0d add r31, r0 36868: 11 24 eor r1, r1 3686a: eb 53 subi r30, 0x3B ; 59 3686c: f9 4f sbci r31, 0xF9 ; 249 3686e: 84 85 ldd r24, Z+12 ; 0x0c 36870: 95 85 ldd r25, Z+13 ; 0x0d 36872: a6 85 ldd r26, Z+14 ; 0x0e 36874: b7 85 ldd r27, Z+15 ; 0x0f 36876: 89 2b or r24, r25 36878: 8a 2b or r24, r26 3687a: 8b 2b or r24, r27 3687c: 09 f0 breq .+2 ; 0x36880 3687e: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 36880: 8e e6 ldi r24, 0x6E ; 110 36882: 82 9d mul r24, r2 36884: f0 01 movw r30, r0 36886: 83 9d mul r24, r3 36888: f0 0d add r31, r0 3688a: 11 24 eor r1, r1 3688c: eb 53 subi r30, 0x3B ; 59 3688e: f9 4f sbci r31, 0xF9 ; 249 36890: 24 85 ldd r18, Z+12 ; 0x0c 36892: 35 85 ldd r19, Z+13 ; 0x0d 36894: 46 85 ldd r20, Z+14 ; 0x0e 36896: 57 85 ldd r21, Z+15 ; 0x0f 36898: 2a 96 adiw r28, 0x0a ; 10 3689a: 2c af std Y+60, r18 ; 0x3c 3689c: 3d af std Y+61, r19 ; 0x3d 3689e: 4e af std Y+62, r20 ; 0x3e 368a0: 5f af std Y+63, r21 ; 0x3f 368a2: 2a 97 sbiw r28, 0x0a ; 10 368a4: 23 2b or r18, r19 368a6: 24 2b or r18, r20 368a8: 25 2b or r18, r21 368aa: 09 f0 breq .+2 ; 0x368ae 368ac: b3 c7 rjmp .+3942 ; 0x37814 { if(feed_rate 368b2: b0 90 ff 0d lds r11, 0x0DFF ; 0x800dff 368b6: 00 91 00 0e lds r16, 0x0E00 ; 0x800e00 368ba: 10 91 01 0e lds r17, 0x0E01 ; 0x800e01 } else { if(feed_rate 368ce: 18 16 cp r1, r24 368d0: 24 f4 brge .+8 ; 0x368da 368d2: a9 aa std Y+49, r10 ; 0x31 368d4: b9 ae std Y+57, r11 ; 0x39 368d6: 0d af std Y+61, r16 ; 0x3d 368d8: 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]; 368da: c7 01 movw r24, r14 368dc: b6 01 movw r22, r12 368de: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 368e2: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 368e6: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 368ea: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 368ee: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 368f2: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 368f6: 4b 01 movw r8, r22 368f8: 5c 01 movw r10, r24 368fa: 89 82 std Y+1, r8 ; 0x01 368fc: 9a 82 std Y+2, r9 ; 0x02 368fe: ab 82 std Y+3, r10 ; 0x03 36900: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 36902: 69 a5 ldd r22, Y+41 ; 0x29 36904: 7a a5 ldd r23, Y+42 ; 0x2a 36906: 8b a5 ldd r24, Y+43 ; 0x2b 36908: 9c a5 ldd r25, Y+44 ; 0x2c 3690a: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3690e: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 36912: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 36916: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 3691a: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 3691e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36922: 6b 01 movw r12, r22 36924: 7c 01 movw r14, r24 36926: cd 82 std Y+5, r12 ; 0x05 36928: de 82 std Y+6, r13 ; 0x06 3692a: ef 82 std Y+7, r14 ; 0x07 3692c: 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]; 3692e: 6d a5 ldd r22, Y+45 ; 0x2d 36930: 7e a5 ldd r23, Y+46 ; 0x2e 36932: 8f a5 ldd r24, Y+47 ; 0x2f 36934: 98 a9 ldd r25, Y+48 ; 0x30 36936: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3693a: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 3693e: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 36942: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 36946: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 3694a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3694e: 22 96 adiw r28, 0x02 ; 2 36950: 6c af std Y+60, r22 ; 0x3c 36952: 7d af std Y+61, r23 ; 0x3d 36954: 8e af std Y+62, r24 ; 0x3e 36956: 9f af std Y+63, r25 ; 0x3f 36958: 22 97 sbiw r28, 0x02 ; 2 3695a: 69 87 std Y+9, r22 ; 0x09 3695c: 7a 87 std Y+10, r23 ; 0x0a 3695e: 8b 87 std Y+11, r24 ; 0x0b 36960: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 36962: c3 01 movw r24, r6 36964: b2 01 movw r22, r4 36966: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3696a: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 3696e: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 36972: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 36976: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 3697a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3697e: 26 96 adiw r28, 0x06 ; 6 36980: 6c af std Y+60, r22 ; 0x3c 36982: 7d af std Y+61, r23 ; 0x3d 36984: 8e af std Y+62, r24 ; 0x3e 36986: 9f af std Y+63, r25 ; 0x3f 36988: 26 97 sbiw r28, 0x06 ; 6 3698a: 6d 87 std Y+13, r22 ; 0x0d 3698c: 7e 87 std Y+14, r23 ; 0x0e 3698e: 8f 87 std Y+15, r24 ; 0x0f 36990: 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 ) 36992: 8e e6 ldi r24, 0x6E ; 110 36994: 82 9d mul r24, r2 36996: f0 01 movw r30, r0 36998: 83 9d mul r24, r3 3699a: f0 0d add r31, r0 3699c: 11 24 eor r1, r1 3699e: eb 53 subi r30, 0x3B ; 59 369a0: f9 4f sbci r31, 0xF9 ; 249 369a2: 80 81 ld r24, Z 369a4: 91 81 ldd r25, Z+1 ; 0x01 369a6: a2 81 ldd r26, Z+2 ; 0x02 369a8: b3 81 ldd r27, Z+3 ; 0x03 369aa: 2e 96 adiw r28, 0x0e ; 14 369ac: 8c af std Y+60, r24 ; 0x3c 369ae: 9d af std Y+61, r25 ; 0x3d 369b0: ae af std Y+62, r26 ; 0x3e 369b2: bf af std Y+63, r27 ; 0x3f 369b4: 2e 97 sbiw r28, 0x0e ; 14 369b6: 06 97 sbiw r24, 0x06 ; 6 369b8: a1 05 cpc r26, r1 369ba: b1 05 cpc r27, r1 369bc: 0c f0 brlt .+2 ; 0x369c0 369be: 33 c7 rjmp .+3686 ; 0x37826 369c0: 84 81 ldd r24, Z+4 ; 0x04 369c2: 95 81 ldd r25, Z+5 ; 0x05 369c4: a6 81 ldd r26, Z+6 ; 0x06 369c6: b7 81 ldd r27, Z+7 ; 0x07 369c8: 06 97 sbiw r24, 0x06 ; 6 369ca: a1 05 cpc r26, r1 369cc: b1 05 cpc r27, r1 369ce: 0c f0 brlt .+2 ; 0x369d2 369d0: 2a c7 rjmp .+3668 ; 0x37826 369d2: 80 85 ldd r24, Z+8 ; 0x08 369d4: 91 85 ldd r25, Z+9 ; 0x09 369d6: a2 85 ldd r26, Z+10 ; 0x0a 369d8: b3 85 ldd r27, Z+11 ; 0x0b 369da: 06 97 sbiw r24, 0x06 ; 6 369dc: a1 05 cpc r26, r1 369de: b1 05 cpc r27, r1 369e0: 0c f0 brlt .+2 ; 0x369e4 369e2: 21 c7 rjmp .+3650 ; 0x37826 { block->millimeters = fabs(delta_mm[E_AXIS]); 369e4: 26 96 adiw r28, 0x06 ; 6 369e6: 8c ad ldd r24, Y+60 ; 0x3c 369e8: 9d ad ldd r25, Y+61 ; 0x3d 369ea: ae ad ldd r26, Y+62 ; 0x3e 369ec: bf ad ldd r27, Y+63 ; 0x3f 369ee: 26 97 sbiw r28, 0x06 ; 6 369f0: bf 77 andi r27, 0x7F ; 127 369f2: 85 a7 std Z+45, r24 ; 0x2d 369f4: 96 a7 std Z+46, r25 ; 0x2e 369f6: a7 a7 std Z+47, r26 ; 0x2f 369f8: 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 369fa: 8e e6 ldi r24, 0x6E ; 110 369fc: 82 9d mul r24, r2 369fe: f0 01 movw r30, r0 36a00: 83 9d mul r24, r3 36a02: f0 0d add r31, r0 36a04: 11 24 eor r1, r1 36a06: eb 53 subi r30, 0x3B ; 59 36a08: f9 4f sbci r31, 0xF9 ; 249 36a0a: 45 a4 ldd r4, Z+45 ; 0x2d 36a0c: 56 a4 ldd r5, Z+46 ; 0x2e 36a0e: 67 a4 ldd r6, Z+47 ; 0x2f 36a10: 70 a8 ldd r7, Z+48 ; 0x30 36a12: a3 01 movw r20, r6 36a14: 92 01 movw r18, r4 36a16: 60 e0 ldi r22, 0x00 ; 0 36a18: 70 e0 ldi r23, 0x00 ; 0 36a1a: 80 e8 ldi r24, 0x80 ; 128 36a1c: 9f e3 ldi r25, 0x3F ; 63 36a1e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 36a22: 29 a9 ldd r18, Y+49 ; 0x31 36a24: 39 ad ldd r19, Y+57 ; 0x39 36a26: 4d ad ldd r20, Y+61 ; 0x3d 36a28: 5d a9 ldd r21, Y+53 ; 0x35 36a2a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36a2e: 6b 01 movw r12, r22 36a30: 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); 36a32: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 36a36: 90 91 a6 0d lds r25, 0x0DA6 ; 0x800da6 36a3a: 89 1b sub r24, r25 36a3c: 8f 70 andi r24, 0x0F ; 15 36a3e: 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)) { 36a40: 82 50 subi r24, 0x02 ; 2 36a42: 86 30 cpi r24, 0x06 ; 6 36a44: 08 f0 brcs .+2 ; 0x36a48 36a46: 40 c0 rjmp .+128 ; 0x36ac8 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 36a48: a7 01 movw r20, r14 36a4a: 96 01 movw r18, r12 36a4c: 60 e0 ldi r22, 0x00 ; 0 36a4e: 74 e2 ldi r23, 0x24 ; 36 36a50: 84 e7 ldi r24, 0x74 ; 116 36a52: 99 e4 ldi r25, 0x49 ; 73 36a54: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36a58: 0f 94 88 e0 call 0x3c110 ; 0x3c110 36a5c: 4b 01 movw r8, r22 36a5e: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 36a60: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 36a64: 90 91 03 0e lds r25, 0x0E03 ; 0x800e03 36a68: a0 91 04 0e lds r26, 0x0E04 ; 0x800e04 36a6c: b0 91 05 0e lds r27, 0x0E05 ; 0x800e05 36a70: 88 16 cp r8, r24 36a72: 99 06 cpc r9, r25 36a74: aa 06 cpc r10, r26 36a76: bb 06 cpc r11, r27 36a78: 38 f5 brcc .+78 ; 0x36ac8 // 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)); 36a7a: bc 01 movw r22, r24 36a7c: cd 01 movw r24, r26 36a7e: 68 19 sub r22, r8 36a80: 79 09 sbc r23, r9 36a82: 8a 09 sbc r24, r10 36a84: 9b 09 sbc r25, r11 36a86: 66 0f add r22, r22 36a88: 77 1f adc r23, r23 36a8a: 88 1f adc r24, r24 36a8c: 99 1f adc r25, r25 36a8e: ad ad ldd r26, Y+61 ; 0x3d 36a90: 2a 2f mov r18, r26 36a92: 30 e0 ldi r19, 0x00 ; 0 36a94: 50 e0 ldi r21, 0x00 ; 0 36a96: 40 e0 ldi r20, 0x00 ; 0 36a98: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 36a9c: ca 01 movw r24, r20 36a9e: b9 01 movw r22, r18 36aa0: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 36aa4: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 36aa8: 68 0d add r22, r8 36aaa: 79 1d adc r23, r9 36aac: 8a 1d adc r24, r10 36aae: 9b 1d adc r25, r11 36ab0: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 36ab4: 9b 01 movw r18, r22 36ab6: ac 01 movw r20, r24 36ab8: 60 e0 ldi r22, 0x00 ; 0 36aba: 74 e2 ldi r23, 0x24 ; 36 36abc: 84 e7 ldi r24, 0x74 ; 116 36abe: 99 e4 ldi r25, 0x49 ; 73 36ac0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36ac4: 6b 01 movw r12, r22 36ac6: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 36ac8: a3 01 movw r20, r6 36aca: 92 01 movw r18, r4 36acc: c7 01 movw r24, r14 36ace: b6 01 movw r22, r12 36ad0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36ad4: 6d ab std Y+53, r22 ; 0x35 36ad6: 7e ab std Y+54, r23 ; 0x36 36ad8: 8f ab std Y+55, r24 ; 0x37 36ada: 98 af std Y+56, r25 ; 0x38 36adc: 8e e6 ldi r24, 0x6E ; 110 36ade: 82 9d mul r24, r2 36ae0: 80 01 movw r16, r0 36ae2: 83 9d mul r24, r3 36ae4: 10 0d add r17, r0 36ae6: 11 24 eor r1, r1 36ae8: 0b 53 subi r16, 0x3B ; 59 36aea: 19 4f sbci r17, 0xF9 ; 249 36aec: 2d a9 ldd r18, Y+53 ; 0x35 36aee: 3e a9 ldd r19, Y+54 ; 0x36 36af0: 4f a9 ldd r20, Y+55 ; 0x37 36af2: 58 ad ldd r21, Y+56 ; 0x38 36af4: d8 01 movw r26, r16 36af6: 91 96 adiw r26, 0x21 ; 33 36af8: 2d 93 st X+, r18 36afa: 3d 93 st X+, r19 36afc: 4d 93 st X+, r20 36afe: 5c 93 st X, r21 36b00: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 36b02: 50 96 adiw r26, 0x10 ; 16 36b04: 6d 91 ld r22, X+ 36b06: 7d 91 ld r23, X+ 36b08: 8d 91 ld r24, X+ 36b0a: 9c 91 ld r25, X 36b0c: 53 97 sbiw r26, 0x13 ; 19 36b0e: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 36b12: 69 af std Y+57, r22 ; 0x39 36b14: 7a af std Y+58, r23 ; 0x3a 36b16: 8b af std Y+59, r24 ; 0x3b 36b18: 9c af std Y+60, r25 ; 0x3c 36b1a: 9b 01 movw r18, r22 36b1c: ac 01 movw r20, r24 36b1e: c7 01 movw r24, r14 36b20: b6 01 movw r22, r12 36b22: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36b26: 0f 94 29 de call 0x3bc52 ; 0x3bc52 36b2a: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 36b2e: 62 96 adiw r28, 0x12 ; 18 36b30: 6c af std Y+60, r22 ; 0x3c 36b32: 7d af std Y+61, r23 ; 0x3d 36b34: 8e af std Y+62, r24 ; 0x3e 36b36: 9f af std Y+63, r25 ; 0x3f 36b38: 62 97 sbiw r28, 0x12 ; 18 36b3a: f8 01 movw r30, r16 36b3c: 66 ab std Z+54, r22 ; 0x36 36b3e: 77 ab std Z+55, r23 ; 0x37 36b40: 80 af std Z+56, r24 ; 0x38 36b42: 91 af std Z+57, r25 ; 0x39 36b44: 9e 01 movw r18, r28 36b46: 2f 5f subi r18, 0xFF ; 255 36b48: 3f 4f sbci r19, 0xFF ; 255 36b4a: 6c 96 adiw r28, 0x1c ; 28 36b4c: 3f af std Y+63, r19 ; 0x3f 36b4e: 2e af std Y+62, r18 ; 0x3e 36b50: 6c 97 sbiw r28, 0x1c ; 28 36b52: ae 01 movw r20, r28 36b54: 4f 5e subi r20, 0xEF ; 239 36b56: 5f 4f sbci r21, 0xFF ; 255 36b58: a0 96 adiw r28, 0x20 ; 32 36b5a: 5f af std Y+63, r21 ; 0x3f 36b5c: 4e af std Y+62, r20 ; 0x3e 36b5e: a0 97 sbiw r28, 0x20 ; 32 36b60: 80 91 71 02 lds r24, 0x0271 ; 0x800271 36b64: 90 91 72 02 lds r25, 0x0272 ; 0x800272 36b68: 9a ab std Y+50, r25 ; 0x32 36b6a: 89 ab std Y+49, r24 ; 0x31 36b6c: 40 96 adiw r24, 0x10 ; 16 36b6e: 6e 96 adiw r28, 0x1e ; 30 36b70: 9f af std Y+63, r25 ; 0x3f 36b72: 8e af std Y+62, r24 ; 0x3e 36b74: 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]) 36b76: 68 96 adiw r28, 0x18 ; 24 36b78: 5f af std Y+63, r21 ; 0x3f 36b7a: 4e af std Y+62, r20 ; 0x3e 36b7c: 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 36b7e: 19 a6 std Y+41, r1 ; 0x29 36b80: 1d a6 std Y+45, r1 ; 0x2d 36b82: 00 e8 ldi r16, 0x80 ; 128 36b84: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 36b86: 6c 96 adiw r28, 0x1c ; 28 36b88: ae ad ldd r26, Y+62 ; 0x3e 36b8a: bf ad ldd r27, Y+63 ; 0x3f 36b8c: 6c 97 sbiw r28, 0x1c ; 28 36b8e: 2d 91 ld r18, X+ 36b90: 3d 91 ld r19, X+ 36b92: 4d 91 ld r20, X+ 36b94: 5d 91 ld r21, X+ 36b96: 6c 96 adiw r28, 0x1c ; 28 36b98: bf af std Y+63, r27 ; 0x3f 36b9a: ae af std Y+62, r26 ; 0x3e 36b9c: 6c 97 sbiw r28, 0x1c ; 28 36b9e: c7 01 movw r24, r14 36ba0: b6 01 movw r22, r12 36ba2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36ba6: 68 96 adiw r28, 0x18 ; 24 36ba8: ee ad ldd r30, Y+62 ; 0x3e 36baa: ff ad ldd r31, Y+63 ; 0x3f 36bac: 68 97 sbiw r28, 0x18 ; 24 36bae: 61 93 st Z+, r22 36bb0: 71 93 st Z+, r23 36bb2: 81 93 st Z+, r24 36bb4: 91 93 st Z+, r25 36bb6: 68 96 adiw r28, 0x18 ; 24 36bb8: ff af std Y+63, r31 ; 0x3f 36bba: ee af std Y+62, r30 ; 0x3e 36bbc: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 36bbe: 4b 01 movw r8, r22 36bc0: 5c 01 movw r10, r24 36bc2: e8 94 clt 36bc4: b7 f8 bld r11, 7 36bc6: a9 a9 ldd r26, Y+49 ; 0x31 36bc8: ba a9 ldd r27, Y+50 ; 0x32 36bca: 2d 91 ld r18, X+ 36bcc: 3d 91 ld r19, X+ 36bce: 4d 91 ld r20, X+ 36bd0: 5d 91 ld r21, X+ 36bd2: ba ab std Y+50, r27 ; 0x32 36bd4: a9 ab std Y+49, r26 ; 0x31 36bd6: 66 96 adiw r28, 0x16 ; 22 36bd8: 2c af std Y+60, r18 ; 0x3c 36bda: 3d af std Y+61, r19 ; 0x3d 36bdc: 4e af std Y+62, r20 ; 0x3e 36bde: 5f af std Y+63, r21 ; 0x3f 36be0: 66 97 sbiw r28, 0x16 ; 22 36be2: c5 01 movw r24, r10 36be4: b4 01 movw r22, r8 36be6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 36bea: 18 16 cp r1, r24 36bec: b4 f4 brge .+44 ; 0x36c1a { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36bee: a5 01 movw r20, r10 36bf0: 94 01 movw r18, r8 36bf2: 66 96 adiw r28, 0x16 ; 22 36bf4: 6c ad ldd r22, Y+60 ; 0x3c 36bf6: 7d ad ldd r23, Y+61 ; 0x3d 36bf8: 8e ad ldd r24, Y+62 ; 0x3e 36bfa: 9f ad ldd r25, Y+63 ; 0x3f 36bfc: 66 97 sbiw r28, 0x16 ; 22 36bfe: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36c02: 4b 01 movw r8, r22 36c04: 5c 01 movw r10, r24 36c06: 29 a5 ldd r18, Y+41 ; 0x29 36c08: 3d a5 ldd r19, Y+45 ; 0x2d 36c0a: a8 01 movw r20, r16 36c0c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 36c10: 18 16 cp r1, r24 36c12: 1c f0 brlt .+6 ; 0x36c1a 36c14: 89 a6 std Y+41, r8 ; 0x29 36c16: 9d a6 std Y+45, r9 ; 0x2d 36c18: 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++) 36c1a: 6e 96 adiw r28, 0x1e ; 30 36c1c: ee ad ldd r30, Y+62 ; 0x3e 36c1e: ff ad ldd r31, Y+63 ; 0x3f 36c20: 6e 97 sbiw r28, 0x1e ; 30 36c22: 29 a9 ldd r18, Y+49 ; 0x31 36c24: 3a a9 ldd r19, Y+50 ; 0x32 36c26: e2 17 cp r30, r18 36c28: f3 07 cpc r31, r19 36c2a: 09 f0 breq .+2 ; 0x36c2e 36c2c: ac cf rjmp .-168 ; 0x36b86 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 36c2e: 20 e0 ldi r18, 0x00 ; 0 36c30: 30 e0 ldi r19, 0x00 ; 0 36c32: 40 e8 ldi r20, 0x80 ; 128 36c34: 5f e3 ldi r21, 0x3F ; 63 36c36: 69 a5 ldd r22, Y+41 ; 0x29 36c38: 7d a5 ldd r23, Y+45 ; 0x2d 36c3a: c8 01 movw r24, r16 36c3c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 36c40: 87 ff sbrs r24, 7 36c42: 50 c0 rjmp .+160 ; 0x36ce4 36c44: a0 96 adiw r28, 0x20 ; 32 36c46: ae ac ldd r10, Y+62 ; 0x3e 36c48: bf ac ldd r11, Y+63 ; 0x3f 36c4a: a0 97 sbiw r28, 0x20 ; 32 36c4c: 30 e1 ldi r19, 0x10 ; 16 36c4e: a3 0e add r10, r19 36c50: b1 1c adc r11, r1 36c52: a0 96 adiw r28, 0x20 ; 32 36c54: ce ac ldd r12, Y+62 ; 0x3e 36c56: df ac ldd r13, Y+63 ; 0x3f 36c58: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 36c5a: d6 01 movw r26, r12 36c5c: 6d 91 ld r22, X+ 36c5e: 7d 91 ld r23, X+ 36c60: 8d 91 ld r24, X+ 36c62: 9d 91 ld r25, X+ 36c64: 6d 01 movw r12, r26 36c66: 7d 01 movw r14, r26 36c68: b4 e0 ldi r27, 0x04 ; 4 36c6a: eb 1a sub r14, r27 36c6c: f1 08 sbc r15, r1 36c6e: 29 a5 ldd r18, Y+41 ; 0x29 36c70: 3d a5 ldd r19, Y+45 ; 0x2d 36c72: a8 01 movw r20, r16 36c74: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36c78: f7 01 movw r30, r14 36c7a: 60 83 st Z, r22 36c7c: 71 83 std Z+1, r23 ; 0x01 36c7e: 82 83 std Z+2, r24 ; 0x02 36c80: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36c82: ac 14 cp r10, r12 36c84: bd 04 cpc r11, r13 36c86: 49 f7 brne .-46 ; 0x36c5a { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 36c88: 2e e6 ldi r18, 0x6E ; 110 36c8a: 22 9d mul r18, r2 36c8c: c0 01 movw r24, r0 36c8e: 23 9d mul r18, r3 36c90: 90 0d add r25, r0 36c92: 11 24 eor r1, r1 36c94: 9c 01 movw r18, r24 36c96: 2b 53 subi r18, 0x3B ; 59 36c98: 39 4f sbci r19, 0xF9 ; 249 36c9a: 79 01 movw r14, r18 36c9c: 29 a5 ldd r18, Y+41 ; 0x29 36c9e: 3d a5 ldd r19, Y+45 ; 0x2d 36ca0: a8 01 movw r20, r16 36ca2: 6d a9 ldd r22, Y+53 ; 0x35 36ca4: 7e a9 ldd r23, Y+54 ; 0x36 36ca6: 8f a9 ldd r24, Y+55 ; 0x37 36ca8: 98 ad ldd r25, Y+56 ; 0x38 36caa: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36cae: d7 01 movw r26, r14 36cb0: 91 96 adiw r26, 0x21 ; 33 36cb2: 6d 93 st X+, r22 36cb4: 7d 93 st X+, r23 36cb6: 8d 93 st X+, r24 36cb8: 9c 93 st X, r25 36cba: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 36cbc: 62 96 adiw r28, 0x12 ; 18 36cbe: 6c ad ldd r22, Y+60 ; 0x3c 36cc0: 7d ad ldd r23, Y+61 ; 0x3d 36cc2: 8e ad ldd r24, Y+62 ; 0x3e 36cc4: 9f ad ldd r25, Y+63 ; 0x3f 36cc6: 62 97 sbiw r28, 0x12 ; 18 36cc8: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 36ccc: 29 a5 ldd r18, Y+41 ; 0x29 36cce: 3d a5 ldd r19, Y+45 ; 0x2d 36cd0: a8 01 movw r20, r16 36cd2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36cd6: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 36cda: f7 01 movw r30, r14 36cdc: 66 ab std Z+54, r22 ; 0x36 36cde: 77 ab std Z+55, r23 ; 0x37 36ce0: 80 af std Z+56, r24 ; 0x38 36ce2: 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; 36ce4: a3 01 movw r20, r6 36ce6: 92 01 movw r18, r4 36ce8: 69 ad ldd r22, Y+57 ; 0x39 36cea: 7a ad ldd r23, Y+58 ; 0x3a 36cec: 8b ad ldd r24, Y+59 ; 0x3b 36cee: 9c ad ldd r25, Y+60 ; 0x3c 36cf0: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36cf4: 69 a7 std Y+41, r22 ; 0x29 36cf6: 7a a7 std Y+42, r23 ; 0x2a 36cf8: 8b a7 std Y+43, r24 ; 0x2b 36cfa: 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) 36cfc: 2e 96 adiw r28, 0x0e ; 14 36cfe: 2c ad ldd r18, Y+60 ; 0x3c 36d00: 3d ad ldd r19, Y+61 ; 0x3d 36d02: 4e ad ldd r20, Y+62 ; 0x3e 36d04: 5f ad ldd r21, Y+63 ; 0x3f 36d06: 2e 97 sbiw r28, 0x0e ; 14 36d08: 23 2b or r18, r19 36d0a: 24 2b or r18, r20 36d0c: 25 2b or r18, r21 36d0e: 09 f0 breq .+2 ; 0x36d12 36d10: b9 c5 rjmp .+2930 ; 0x37884 36d12: 8e e6 ldi r24, 0x6E ; 110 36d14: 82 9d mul r24, r2 36d16: 80 01 movw r16, r0 36d18: 83 9d mul r24, r3 36d1a: 10 0d add r17, r0 36d1c: 11 24 eor r1, r1 36d1e: 0b 53 subi r16, 0x3B ; 59 36d20: 19 4f sbci r17, 0xF9 ; 249 36d22: f8 01 movw r30, r16 36d24: 84 81 ldd r24, Z+4 ; 0x04 36d26: 95 81 ldd r25, Z+5 ; 0x05 36d28: a6 81 ldd r26, Z+6 ; 0x06 36d2a: b7 81 ldd r27, Z+7 ; 0x07 36d2c: 89 2b or r24, r25 36d2e: 8a 2b or r24, r26 36d30: 8b 2b or r24, r27 36d32: 09 f0 breq .+2 ; 0x36d36 36d34: a7 c5 rjmp .+2894 ; 0x37884 36d36: 80 85 ldd r24, Z+8 ; 0x08 36d38: 91 85 ldd r25, Z+9 ; 0x09 36d3a: a2 85 ldd r26, Z+10 ; 0x0a 36d3c: b3 85 ldd r27, Z+11 ; 0x0b 36d3e: 89 2b or r24, r25 36d40: 8a 2b or r24, r26 36d42: 8b 2b or r24, r27 36d44: 09 f0 breq .+2 ; 0x36d48 36d46: 9e c5 rjmp .+2876 ; 0x37884 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 36d48: 20 91 f6 0d lds r18, 0x0DF6 ; 0x800df6 36d4c: 30 91 f7 0d lds r19, 0x0DF7 ; 0x800df7 36d50: 40 91 f8 0d lds r20, 0x0DF8 ; 0x800df8 36d54: 50 91 f9 0d lds r21, 0x0DF9 ; 0x800df9 36d58: 69 a5 ldd r22, Y+41 ; 0x29 36d5a: 7a a5 ldd r23, Y+42 ; 0x2a 36d5c: 8b a5 ldd r24, Y+43 ; 0x2b 36d5e: 9c a5 ldd r25, Y+44 ; 0x2c 36d60: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36d64: 0f 94 29 de call 0x3bc52 ; 0x3bc52 36d68: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 36d6c: 2b 01 movw r4, r22 36d6e: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 36d70: f8 01 movw r30, r16 36d72: e4 5b subi r30, 0xB4 ; 180 36d74: ff 4f sbci r31, 0xFF ; 255 36d76: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36d78: 6a 96 adiw r28, 0x1a ; 26 36d7a: 1c ae std Y+60, r1 ; 0x3c 36d7c: 1d ae std Y+61, r1 ; 0x3d 36d7e: 1e ae std Y+62, r1 ; 0x3e 36d80: 1f ae std Y+63, r1 ; 0x3f 36d82: 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; 36d84: 8e e6 ldi r24, 0x6E ; 110 36d86: 82 9d mul r24, r2 36d88: 80 01 movw r16, r0 36d8a: 83 9d mul r24, r3 36d8c: 10 0d add r17, r0 36d8e: 11 24 eor r1, r1 36d90: 0b 53 subi r16, 0x3B ; 59 36d92: 19 4f sbci r17, 0xF9 ; 249 36d94: f8 01 movw r30, r16 36d96: ee 5b subi r30, 0xBE ; 190 36d98: ff 4f sbci r31, 0xFF ; 255 36d9a: 40 82 st Z, r4 36d9c: 51 82 std Z+1, r5 ; 0x01 36d9e: 62 82 std Z+2, r6 ; 0x02 36da0: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36da2: c3 01 movw r24, r6 36da4: b2 01 movw r22, r4 36da6: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 36daa: 6b 01 movw r12, r22 36dac: 7c 01 movw r14, r24 36dae: 29 a5 ldd r18, Y+41 ; 0x29 36db0: 3a a5 ldd r19, Y+42 ; 0x2a 36db2: 4b a5 ldd r20, Y+43 ; 0x2b 36db4: 5c a5 ldd r21, Y+44 ; 0x2c 36db6: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36dba: e2 96 adiw r28, 0x32 ; 50 36dbc: 6c af std Y+60, r22 ; 0x3c 36dbe: 7d af std Y+61, r23 ; 0x3d 36dc0: 8e af std Y+62, r24 ; 0x3e 36dc2: 9f af std Y+63, r25 ; 0x3f 36dc4: e2 97 sbiw r28, 0x32 ; 50 36dc6: f8 01 movw r30, r16 36dc8: 61 ab std Z+49, r22 ; 0x31 36dca: 72 ab std Z+50, r23 ; 0x32 36dcc: 83 ab std Z+51, r24 ; 0x33 36dce: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36dd0: 2d eb ldi r18, 0xBD ; 189 36dd2: 37 e3 ldi r19, 0x37 ; 55 36dd4: 46 e0 ldi r20, 0x06 ; 6 36dd6: 51 e4 ldi r21, 0x41 ; 65 36dd8: c7 01 movw r24, r14 36dda: b6 01 movw r22, r12 36ddc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36de0: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 36de4: d8 01 movw r26, r16 36de6: 54 96 adiw r26, 0x14 ; 20 36de8: 6d 93 st X+, r22 36dea: 7d 93 st X+, r23 36dec: 8d 93 st X+, r24 36dee: 9c 93 st X, r25 36df0: 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; 36df2: 91 96 adiw r26, 0x21 ; 33 36df4: bc 91 ld r27, X 36df6: 27 96 adiw r28, 0x07 ; 7 36df8: bf af std Y+63, r27 ; 0x3f 36dfa: 27 97 sbiw r28, 0x07 ; 7 36dfc: f8 01 movw r30, r16 36dfe: f2 a1 ldd r31, Z+34 ; 0x22 36e00: 2b 96 adiw r28, 0x0b ; 11 36e02: ff af std Y+63, r31 ; 0x3f 36e04: 2b 97 sbiw r28, 0x0b ; 11 36e06: d8 01 movw r26, r16 36e08: 93 96 adiw r26, 0x23 ; 35 36e0a: bc 91 ld r27, X 36e0c: 2f 96 adiw r28, 0x0f ; 15 36e0e: bf af std Y+63, r27 ; 0x3f 36e10: 2f 97 sbiw r28, 0x0f ; 15 36e12: f8 01 movw r30, r16 36e14: f4 a1 ldd r31, Z+36 ; 0x24 36e16: 63 96 adiw r28, 0x13 ; 19 36e18: ff af std Y+63, r31 ; 0x3f 36e1a: 63 97 sbiw r28, 0x13 ; 19 36e1c: 26 e0 ldi r18, 0x06 ; 6 36e1e: 3e e0 ldi r19, 0x0E ; 14 36e20: ee 96 adiw r28, 0x3e ; 62 36e22: 3f af std Y+63, r19 ; 0x3f 36e24: 2e af std Y+62, r18 ; 0x3e 36e26: ee 97 sbiw r28, 0x3e ; 62 36e28: a0 96 adiw r28, 0x20 ; 32 36e2a: 4e ac ldd r4, Y+62 ; 0x3e 36e2c: 5f ac ldd r5, Y+63 ; 0x3f 36e2e: a0 97 sbiw r28, 0x20 ; 32 36e30: 30 e1 ldi r19, 0x10 ; 16 36e32: 43 0e add r4, r19 36e34: 51 1c adc r5, r1 36e36: 06 e0 ldi r16, 0x06 ; 6 36e38: 1e e0 ldi r17, 0x0E ; 14 36e3a: a0 96 adiw r28, 0x20 ; 32 36e3c: 6e ac ldd r6, Y+62 ; 0x3e 36e3e: 7f ac ldd r7, Y+63 ; 0x3f 36e40: a0 97 sbiw r28, 0x20 ; 32 36e42: 27 96 adiw r28, 0x07 ; 7 36e44: 4f ad ldd r20, Y+63 ; 0x3f 36e46: 27 97 sbiw r28, 0x07 ; 7 36e48: 49 a7 std Y+41, r20 ; 0x29 36e4a: 2b 96 adiw r28, 0x0b ; 11 36e4c: 5f ad ldd r21, Y+63 ; 0x3f 36e4e: 2b 97 sbiw r28, 0x0b ; 11 36e50: 5d a7 std Y+45, r21 ; 0x2d 36e52: b9 ab std Y+49, r27 ; 0x31 36e54: f9 af std Y+57, r31 ; 0x39 bool limited = false; 36e56: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 36e58: d3 01 movw r26, r6 36e5a: 8d 90 ld r8, X+ 36e5c: 9d 90 ld r9, X+ 36e5e: ad 90 ld r10, X+ 36e60: bd 90 ld r11, X+ 36e62: 3d 01 movw r6, r26 36e64: e8 94 clt 36e66: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 36e68: f8 01 movw r30, r16 36e6a: c1 90 ld r12, Z+ 36e6c: d1 90 ld r13, Z+ 36e6e: e1 90 ld r14, Z+ 36e70: f1 90 ld r15, Z+ 36e72: 8f 01 movw r16, r30 36e74: a5 01 movw r20, r10 36e76: 94 01 movw r18, r8 36e78: c7 01 movw r24, r14 36e7a: b6 01 movw r22, r12 36e7c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 36e80: 87 ff sbrs r24, 7 36e82: 3a c0 rjmp .+116 ; 0x36ef8 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 36e84: fd a9 ldd r31, Y+53 ; 0x35 36e86: ff 23 and r31, r31 36e88: 09 f4 brne .+2 ; 0x36e8c 36e8a: 7e c6 rjmp .+3324 ; 0x37b88 // 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; 36e8c: 29 a5 ldd r18, Y+41 ; 0x29 36e8e: 3d a5 ldd r19, Y+45 ; 0x2d 36e90: 49 a9 ldd r20, Y+49 ; 0x31 36e92: 59 ad ldd r21, Y+57 ; 0x39 36e94: c5 01 movw r24, r10 36e96: b4 01 movw r22, r8 36e98: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36e9c: 4b 01 movw r8, r22 36e9e: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36ea0: a7 01 movw r20, r14 36ea2: 96 01 movw r18, r12 36ea4: 27 96 adiw r28, 0x07 ; 7 36ea6: 6f ad ldd r22, Y+63 ; 0x3f 36ea8: 27 97 sbiw r28, 0x07 ; 7 36eaa: 2b 96 adiw r28, 0x0b ; 11 36eac: 7f ad ldd r23, Y+63 ; 0x3f 36eae: 2b 97 sbiw r28, 0x0b ; 11 36eb0: 2f 96 adiw r28, 0x0f ; 15 36eb2: 8f ad ldd r24, Y+63 ; 0x3f 36eb4: 2f 97 sbiw r28, 0x0f ; 15 36eb6: 63 96 adiw r28, 0x13 ; 19 36eb8: 9f ad ldd r25, Y+63 ; 0x3f 36eba: 63 97 sbiw r28, 0x13 ; 19 36ebc: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36ec0: 6b 01 movw r12, r22 36ec2: 7c 01 movw r14, r24 if (jerk > mjerk) { 36ec4: ac 01 movw r20, r24 36ec6: 9b 01 movw r18, r22 36ec8: c5 01 movw r24, r10 36eca: b4 01 movw r22, r8 36ecc: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 36ed0: 18 16 cp r1, r24 36ed2: 94 f4 brge .+36 ; 0x36ef8 safe_speed *= mjerk / jerk; 36ed4: a5 01 movw r20, r10 36ed6: 94 01 movw r18, r8 36ed8: c7 01 movw r24, r14 36eda: b6 01 movw r22, r12 36edc: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36ee0: 9b 01 movw r18, r22 36ee2: ac 01 movw r20, r24 36ee4: 69 a5 ldd r22, Y+41 ; 0x29 36ee6: 7d a5 ldd r23, Y+45 ; 0x2d 36ee8: 89 a9 ldd r24, Y+49 ; 0x31 36eea: 99 ad ldd r25, Y+57 ; 0x39 36eec: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 36ef0: 69 a7 std Y+41, r22 ; 0x29 36ef2: 7d a7 std Y+45, r23 ; 0x2d 36ef4: 89 ab std Y+49, r24 ; 0x31 36ef6: 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) { 36ef8: 46 14 cp r4, r6 36efa: 57 04 cpc r5, r7 36efc: 09 f0 breq .+2 ; 0x36f00 36efe: ac cf rjmp .-168 ; 0x36e58 } } } // Reset the block flag. block->flag = 0; 36f00: 8e e6 ldi r24, 0x6E ; 110 36f02: 82 9d mul r24, r2 36f04: f0 01 movw r30, r0 36f06: 83 9d mul r24, r3 36f08: f0 0d add r31, r0 36f0a: 11 24 eor r1, r1 36f0c: eb 53 subi r30, 0x3B ; 59 36f0e: f9 4f sbci r31, 0xF9 ; 249 36f10: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36f12: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> 36f16: 88 23 and r24, r24 36f18: 21 f0 breq .+8 ; 0x36f22 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 36f1a: 80 e1 ldi r24, 0x10 ; 16 36f1c: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 36f1e: 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) { 36f22: 3d ad ldd r19, Y+61 ; 0x3d 36f24: 32 30 cpi r19, 0x02 ; 2 36f26: 08 f4 brcc .+2 ; 0x36f2a 36f28: 8f c6 rjmp .+3358 ; 0x37c48 36f2a: 40 91 b9 04 lds r20, 0x04B9 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 36f2e: 6b 96 adiw r28, 0x1b ; 27 36f30: 4f af std Y+63, r20 ; 0x3f 36f32: 6b 97 sbiw r28, 0x1b ; 27 36f34: 50 91 ba 04 lds r21, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 36f38: 6d 96 adiw r28, 0x1d ; 29 36f3a: 5f af std Y+63, r21 ; 0x3f 36f3c: 6d 97 sbiw r28, 0x1d ; 29 36f3e: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 36f42: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> 36f46: 27 e1 ldi r18, 0x17 ; 23 36f48: 37 eb ldi r19, 0xB7 ; 183 36f4a: 41 ed ldi r20, 0xD1 ; 209 36f4c: 58 e3 ldi r21, 0x38 ; 56 36f4e: 6b 96 adiw r28, 0x1b ; 27 36f50: 6f ad ldd r22, Y+63 ; 0x3f 36f52: 6b 97 sbiw r28, 0x1b ; 27 36f54: 6d 96 adiw r28, 0x1d ; 29 36f56: 7f ad ldd r23, Y+63 ; 0x3f 36f58: 6d 97 sbiw r28, 0x1d ; 29 36f5a: c8 01 movw r24, r16 36f5c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 36f60: 18 16 cp r1, r24 36f62: 0c f0 brlt .+2 ; 0x36f66 36f64: 71 c6 rjmp .+3298 ; 0x37c48 // 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); 36f66: 6b 96 adiw r28, 0x1b ; 27 36f68: 2f ad ldd r18, Y+63 ; 0x3f 36f6a: 6b 97 sbiw r28, 0x1b ; 27 36f6c: 6d 96 adiw r28, 0x1d ; 29 36f6e: 3f ad ldd r19, Y+63 ; 0x3f 36f70: 6d 97 sbiw r28, 0x1d ; 29 36f72: a8 01 movw r20, r16 36f74: 27 96 adiw r28, 0x07 ; 7 36f76: 6f ad ldd r22, Y+63 ; 0x3f 36f78: 27 97 sbiw r28, 0x07 ; 7 36f7a: 2b 96 adiw r28, 0x0b ; 11 36f7c: 7f ad ldd r23, Y+63 ; 0x3f 36f7e: 2b 97 sbiw r28, 0x0b ; 11 36f80: 2f 96 adiw r28, 0x0f ; 15 36f82: 8f ad ldd r24, Y+63 ; 0x3f 36f84: 2f 97 sbiw r28, 0x0f ; 15 36f86: 63 96 adiw r28, 0x13 ; 19 36f88: 9f ad ldd r25, Y+63 ; 0x3f 36f8a: 63 97 sbiw r28, 0x13 ; 19 36f8c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 36f90: 87 ff sbrs r24, 7 36f92: 01 c6 rjmp .+3074 ; 0x37b96 36f94: 6b 96 adiw r28, 0x1b ; 27 36f96: 2f ad ldd r18, Y+63 ; 0x3f 36f98: 6b 97 sbiw r28, 0x1b ; 27 36f9a: 6d 96 adiw r28, 0x1d ; 29 36f9c: 3f ad ldd r19, Y+63 ; 0x3f 36f9e: 6d 97 sbiw r28, 0x1d ; 29 36fa0: a8 01 movw r20, r16 36fa2: 27 96 adiw r28, 0x07 ; 7 36fa4: 6f ad ldd r22, Y+63 ; 0x3f 36fa6: 27 97 sbiw r28, 0x07 ; 7 36fa8: 2b 96 adiw r28, 0x0b ; 11 36faa: 7f ad ldd r23, Y+63 ; 0x3f 36fac: 2b 97 sbiw r28, 0x0b ; 11 36fae: 2f 96 adiw r28, 0x0f ; 15 36fb0: 8f ad ldd r24, Y+63 ; 0x3f 36fb2: 2f 97 sbiw r28, 0x0f ; 15 36fb4: 63 96 adiw r28, 0x13 ; 19 36fb6: 9f ad ldd r25, Y+63 ; 0x3f 36fb8: 63 97 sbiw r28, 0x13 ; 19 36fba: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 36fbe: ec 96 adiw r28, 0x3c ; 60 36fc0: 6c af std Y+60, r22 ; 0x3c 36fc2: 7d af std Y+61, r23 ; 0x3d 36fc4: 8e af std Y+62, r24 ; 0x3e 36fc6: 9f af std Y+63, r25 ; 0x3f 36fc8: 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; 36fca: 27 96 adiw r28, 0x07 ; 7 36fcc: 8f ad ldd r24, Y+63 ; 0x3f 36fce: 27 97 sbiw r28, 0x07 ; 7 36fd0: 8d af std Y+61, r24 ; 0x3d 36fd2: 2b 96 adiw r28, 0x0b ; 11 36fd4: 9f ad ldd r25, Y+63 ; 0x3f 36fd6: 2b 97 sbiw r28, 0x0b ; 11 36fd8: 9d ab std Y+53, r25 ; 0x35 36fda: 2f 96 adiw r28, 0x0f ; 15 36fdc: af ad ldd r26, Y+63 ; 0x3f 36fde: 2f 97 sbiw r28, 0x0f ; 15 36fe0: ae af std Y+62, r26 ; 0x3e 36fe2: 63 96 adiw r28, 0x13 ; 19 36fe4: bf ad ldd r27, Y+63 ; 0x3f 36fe6: 63 97 sbiw r28, 0x13 ; 19 36fe8: 23 96 adiw r28, 0x03 ; 3 36fea: bf af std Y+63, r27 ; 0x3f 36fec: 23 97 sbiw r28, 0x03 ; 3 36fee: 2d eb ldi r18, 0xBD ; 189 36ff0: 34 e0 ldi r19, 0x04 ; 4 36ff2: e8 96 adiw r28, 0x38 ; 56 36ff4: 3f af std Y+63, r19 ; 0x3f 36ff6: 2e af std Y+62, r18 ; 0x3e 36ff8: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 36ffa: 41 2c mov r4, r1 36ffc: 51 2c mov r5, r1 36ffe: 30 e8 ldi r19, 0x80 ; 128 37000: 63 2e mov r6, r19 37002: 3f e3 ldi r19, 0x3F ; 63 37004: 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]; 37006: e8 96 adiw r28, 0x38 ; 56 37008: ae ad ldd r26, Y+62 ; 0x3e 3700a: bf ad ldd r27, Y+63 ; 0x3f 3700c: e8 97 sbiw r28, 0x38 ; 56 3700e: 8d 90 ld r8, X+ 37010: 9d 90 ld r9, X+ 37012: ad 90 ld r10, X+ 37014: bd 90 ld r11, X+ 37016: e8 96 adiw r28, 0x38 ; 56 37018: bf af std Y+63, r27 ; 0x3f 3701a: ae af std Y+62, r26 ; 0x3e 3701c: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 3701e: a0 96 adiw r28, 0x20 ; 32 37020: ee ad ldd r30, Y+62 ; 0x3e 37022: ff ad ldd r31, Y+63 ; 0x3f 37024: a0 97 sbiw r28, 0x20 ; 32 37026: c1 90 ld r12, Z+ 37028: d1 90 ld r13, Z+ 3702a: e1 90 ld r14, Z+ 3702c: f1 90 ld r15, Z+ 3702e: a0 96 adiw r28, 0x20 ; 32 37030: ff af std Y+63, r31 ; 0x3f 37032: ee af std Y+62, r30 ; 0x3e 37034: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 37036: 6b 96 adiw r28, 0x1b ; 27 37038: 2f ad ldd r18, Y+63 ; 0x3f 3703a: 6b 97 sbiw r28, 0x1b ; 27 3703c: 6d 96 adiw r28, 0x1d ; 29 3703e: 3f ad ldd r19, Y+63 ; 0x3f 37040: 6d 97 sbiw r28, 0x1d ; 29 37042: a8 01 movw r20, r16 37044: 27 96 adiw r28, 0x07 ; 7 37046: 6f ad ldd r22, Y+63 ; 0x3f 37048: 27 97 sbiw r28, 0x07 ; 7 3704a: 2b 96 adiw r28, 0x0b ; 11 3704c: 7f ad ldd r23, Y+63 ; 0x3f 3704e: 2b 97 sbiw r28, 0x0b ; 11 37050: 2f 96 adiw r28, 0x0f ; 15 37052: 8f ad ldd r24, Y+63 ; 0x3f 37054: 2f 97 sbiw r28, 0x0f ; 15 37056: 63 96 adiw r28, 0x13 ; 19 37058: 9f ad ldd r25, Y+63 ; 0x3f 3705a: 63 97 sbiw r28, 0x13 ; 19 3705c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37060: 87 ff sbrs r24, 7 37062: 0c c0 rjmp .+24 ; 0x3707c v_exit *= smaller_speed_factor; 37064: ec 96 adiw r28, 0x3c ; 60 37066: 2c ad ldd r18, Y+60 ; 0x3c 37068: 3d ad ldd r19, Y+61 ; 0x3d 3706a: 4e ad ldd r20, Y+62 ; 0x3e 3706c: 5f ad ldd r21, Y+63 ; 0x3f 3706e: ec 97 sbiw r28, 0x3c ; 60 37070: c5 01 movw r24, r10 37072: b4 01 movw r22, r8 37074: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37078: 4b 01 movw r8, r22 3707a: 5c 01 movw r10, r24 if (limited) { 3707c: a2 96 adiw r28, 0x22 ; 34 3707e: ff ad ldd r31, Y+63 ; 0x3f 37080: a2 97 sbiw r28, 0x22 ; 34 37082: ff 23 and r31, r31 37084: 81 f0 breq .+32 ; 0x370a6 v_exit *= v_factor; 37086: a3 01 movw r20, r6 37088: 92 01 movw r18, r4 3708a: c5 01 movw r24, r10 3708c: b4 01 movw r22, r8 3708e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37092: 4b 01 movw r8, r22 37094: 5c 01 movw r10, r24 v_entry *= v_factor; 37096: a3 01 movw r20, r6 37098: 92 01 movw r18, r4 3709a: c7 01 movw r24, r14 3709c: b6 01 movw r22, r12 3709e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 370a2: 6b 01 movw r12, r22 370a4: 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) ? 370a6: a7 01 movw r20, r14 370a8: 96 01 movw r18, r12 370aa: c5 01 movw r24, r10 370ac: b4 01 movw r22, r8 370ae: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 370b2: 20 e0 ldi r18, 0x00 ; 0 370b4: 30 e0 ldi r19, 0x00 ; 0 370b6: 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) ? 370b8: 18 16 cp r1, r24 370ba: 0c f0 brlt .+2 ; 0x370be 370bc: a3 c5 rjmp .+2886 ; 0x37c04 ((v_entry > 0.f || v_exit < 0.f) ? 370be: c7 01 movw r24, r14 370c0: b6 01 movw r22, r12 370c2: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 370c6: 18 16 cp r1, r24 370c8: 4c f0 brlt .+18 ; 0x370dc 370ca: 20 e0 ldi r18, 0x00 ; 0 370cc: 30 e0 ldi r19, 0x00 ; 0 370ce: a9 01 movw r20, r18 370d0: c5 01 movw r24, r10 370d2: b4 01 movw r22, r8 370d4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 370d8: 87 ff sbrs r24, 7 370da: 85 c5 rjmp .+2826 ; 0x37be6 370dc: a7 01 movw r20, r14 370de: 96 01 movw r18, r12 370e0: c5 01 movw r24, r10 370e2: 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) ? 370e4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 370e8: 6b 01 movw r12, r22 370ea: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 370ec: ee 96 adiw r28, 0x3e ; 62 370ee: ae ad ldd r26, Y+62 ; 0x3e 370f0: bf ad ldd r27, Y+63 ; 0x3f 370f2: ee 97 sbiw r28, 0x3e ; 62 370f4: 8d 90 ld r8, X+ 370f6: 9d 90 ld r9, X+ 370f8: ad 90 ld r10, X+ 370fa: bd 90 ld r11, X+ 370fc: ee 96 adiw r28, 0x3e ; 62 370fe: bf af std Y+63, r27 ; 0x3f 37100: ae af std Y+62, r26 ; 0x3e 37102: ee 97 sbiw r28, 0x3e ; 62 37104: a5 01 movw r20, r10 37106: 94 01 movw r18, r8 37108: c7 01 movw r24, r14 3710a: b6 01 movw r22, r12 3710c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37110: 18 16 cp r1, r24 37112: 94 f4 brge .+36 ; 0x37138 v_factor *= cs.max_jerk[axis] / jerk; 37114: a7 01 movw r20, r14 37116: 96 01 movw r18, r12 37118: c5 01 movw r24, r10 3711a: b4 01 movw r22, r8 3711c: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 37120: 9b 01 movw r18, r22 37122: ac 01 movw r20, r24 37124: c3 01 movw r24, r6 37126: b2 01 movw r22, r4 37128: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3712c: 2b 01 movw r4, r22 3712e: 3c 01 movw r6, r24 limited = true; 37130: b1 e0 ldi r27, 0x01 ; 1 37132: a2 96 adiw r28, 0x22 ; 34 37134: bf af std Y+63, r27 ; 0x3f 37136: 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) { 37138: ed ec ldi r30, 0xCD ; 205 3713a: f4 e0 ldi r31, 0x04 ; 4 3713c: e8 96 adiw r28, 0x38 ; 56 3713e: 2e ad ldd r18, Y+62 ; 0x3e 37140: 3f ad ldd r19, Y+63 ; 0x3f 37142: e8 97 sbiw r28, 0x38 ; 56 37144: e2 17 cp r30, r18 37146: f3 07 cpc r31, r19 37148: 09 f0 breq .+2 ; 0x3714c 3714a: 5d cf rjmp .-326 ; 0x37006 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 3714c: a2 96 adiw r28, 0x22 ; 34 3714e: 3f ad ldd r19, Y+63 ; 0x3f 37150: a2 97 sbiw r28, 0x22 ; 34 37152: 33 23 and r19, r19 37154: 81 f0 breq .+32 ; 0x37176 vmax_junction *= v_factor; 37156: a3 01 movw r20, r6 37158: 92 01 movw r18, r4 3715a: 6d ad ldd r22, Y+61 ; 0x3d 3715c: 7d a9 ldd r23, Y+53 ; 0x35 3715e: 8e ad ldd r24, Y+62 ; 0x3e 37160: 23 96 adiw r28, 0x03 ; 3 37162: 9f ad ldd r25, Y+63 ; 0x3f 37164: 23 97 sbiw r28, 0x03 ; 3 37166: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3716a: 6d af std Y+61, r22 ; 0x3d 3716c: 7d ab std Y+53, r23 ; 0x35 3716e: 8e af std Y+62, r24 ; 0x3e 37170: 23 96 adiw r28, 0x03 ; 3 37172: 9f af std Y+63, r25 ; 0x3f 37174: 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; 37176: 24 ea ldi r18, 0xA4 ; 164 37178: 30 e7 ldi r19, 0x70 ; 112 3717a: 4d e7 ldi r20, 0x7D ; 125 3717c: 5f e3 ldi r21, 0x3F ; 63 3717e: 6d ad ldd r22, Y+61 ; 0x3d 37180: 7d a9 ldd r23, Y+53 ; 0x35 37182: 8e ad ldd r24, Y+62 ; 0x3e 37184: 23 96 adiw r28, 0x03 ; 3 37186: 9f ad ldd r25, Y+63 ; 0x3f 37188: 23 97 sbiw r28, 0x03 ; 3 3718a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3718e: 6b 01 movw r12, r22 37190: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 37192: ac 01 movw r20, r24 37194: 9b 01 movw r18, r22 37196: 60 91 10 18 lds r22, 0x1810 ; 0x801810 3719a: 70 91 11 18 lds r23, 0x1811 ; 0x801811 3719e: 80 91 12 18 lds r24, 0x1812 ; 0x801812 371a2: 90 91 13 18 lds r25, 0x1813 ; 0x801813 371a6: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 371aa: 18 16 cp r1, r24 371ac: fc f4 brge .+62 ; 0x371ec 371ae: 29 a5 ldd r18, Y+41 ; 0x29 371b0: 3d a5 ldd r19, Y+45 ; 0x2d 371b2: 49 a9 ldd r20, Y+49 ; 0x31 371b4: 59 ad ldd r21, Y+57 ; 0x39 371b6: c7 01 movw r24, r14 371b8: b6 01 movw r22, r12 371ba: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 371be: 87 ff sbrs r24, 7 371c0: 15 c0 rjmp .+42 ; 0x371ec // 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; 371c2: 8e e6 ldi r24, 0x6E ; 110 371c4: 82 9d mul r24, r2 371c6: f0 01 movw r30, r0 371c8: 83 9d mul r24, r3 371ca: f0 0d add r31, r0 371cc: 11 24 eor r1, r1 371ce: eb 53 subi r30, 0x3B ; 59 371d0: f9 4f sbci r31, 0xF9 ; 249 371d2: 85 a9 ldd r24, Z+53 ; 0x35 371d4: 84 60 ori r24, 0x04 ; 4 371d6: 85 ab std Z+53, r24 ; 0x35 371d8: 49 a5 ldd r20, Y+41 ; 0x29 371da: 4d af std Y+61, r20 ; 0x3d 371dc: 5d a5 ldd r21, Y+45 ; 0x2d 371de: 5d ab std Y+53, r21 ; 0x35 371e0: 89 a9 ldd r24, Y+49 ; 0x31 371e2: 8e af std Y+62, r24 ; 0x3e 371e4: 99 ad ldd r25, Y+57 ; 0x39 371e6: 23 96 adiw r28, 0x03 ; 3 371e8: 9f af std Y+63, r25 ; 0x3f 371ea: 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; 371ec: 8e e6 ldi r24, 0x6E ; 110 371ee: 82 9d mul r24, r2 371f0: 80 01 movw r16, r0 371f2: 83 9d mul r24, r3 371f4: 10 0d add r17, r0 371f6: 11 24 eor r1, r1 371f8: 0b 53 subi r16, 0x3B ; 59 371fa: 19 4f sbci r17, 0xF9 ; 249 371fc: 8d ad ldd r24, Y+61 ; 0x3d 371fe: 9d a9 ldd r25, Y+53 ; 0x35 37200: ae ad ldd r26, Y+62 ; 0x3e 37202: 23 96 adiw r28, 0x03 ; 3 37204: bf ad ldd r27, Y+63 ; 0x3f 37206: 23 97 sbiw r28, 0x03 ; 3 37208: f8 01 movw r30, r16 3720a: 81 a7 std Z+41, r24 ; 0x29 3720c: 92 a7 std Z+42, r25 ; 0x2a 3720e: a3 a7 std Z+43, r26 ; 0x2b 37210: 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); 37212: 29 a5 ldd r18, Y+41 ; 0x29 37214: 3d a5 ldd r19, Y+45 ; 0x2d 37216: 49 a9 ldd r20, Y+49 ; 0x31 37218: 59 ad ldd r21, Y+57 ; 0x39 3721a: 69 a5 ldd r22, Y+41 ; 0x29 3721c: 7d a5 ldd r23, Y+45 ; 0x2d 3721e: 89 a9 ldd r24, Y+49 ; 0x31 37220: 99 ad ldd r25, Y+57 ; 0x39 37222: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37226: 6b 01 movw r12, r22 37228: 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); 3722a: e2 96 adiw r28, 0x32 ; 50 3722c: 6c ad ldd r22, Y+60 ; 0x3c 3722e: 7d ad ldd r23, Y+61 ; 0x3d 37230: 8e ad ldd r24, Y+62 ; 0x3e 37232: 9f ad ldd r25, Y+63 ; 0x3f 37234: e2 97 sbiw r28, 0x32 ; 50 37236: 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); 37238: 9b 01 movw r18, r22 3723a: ac 01 movw r20, r24 3723c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 37240: d8 01 movw r26, r16 37242: 9d 96 adiw r26, 0x2d ; 45 37244: 2d 91 ld r18, X+ 37246: 3d 91 ld r19, X+ 37248: 4d 91 ld r20, X+ 3724a: 5c 91 ld r21, X 3724c: d0 97 sbiw r26, 0x30 ; 48 3724e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37252: 9b 01 movw r18, r22 37254: ac 01 movw r20, r24 37256: c7 01 movw r24, r14 37258: b6 01 movw r22, r12 3725a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3725e: 0f 94 19 e1 call 0x3c232 ; 0x3c232 37262: d6 2e mov r13, r22 37264: e7 2e mov r14, r23 37266: 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); 37268: 2d ad ldd r18, Y+61 ; 0x3d 3726a: 3d a9 ldd r19, Y+53 ; 0x35 3726c: 4e ad ldd r20, Y+62 ; 0x3e 3726e: 23 96 adiw r28, 0x03 ; 3 37270: 5f ad ldd r21, Y+63 ; 0x3f 37272: 23 97 sbiw r28, 0x03 ; 3 37274: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37278: 18 16 cp r1, r24 3727a: 34 f0 brlt .+12 ; 0x37288 3727c: dd ae std Y+61, r13 ; 0x3d 3727e: ed aa std Y+53, r14 ; 0x35 37280: 0e af std Y+62, r16 ; 0x3e 37282: 23 96 adiw r28, 0x03 ; 3 37284: 1f af std Y+63, r17 ; 0x3f 37286: 23 97 sbiw r28, 0x03 ; 3 37288: 8e e6 ldi r24, 0x6E ; 110 3728a: 82 9d mul r24, r2 3728c: f0 01 movw r30, r0 3728e: 83 9d mul r24, r3 37290: f0 0d add r31, r0 37292: 11 24 eor r1, r1 37294: eb 53 subi r30, 0x3B ; 59 37296: f9 4f sbci r31, 0xF9 ; 249 37298: 8d ad ldd r24, Y+61 ; 0x3d 3729a: 9d a9 ldd r25, Y+53 ; 0x35 3729c: ae ad ldd r26, Y+62 ; 0x3e 3729e: 23 96 adiw r28, 0x03 ; 3 372a0: bf ad ldd r27, Y+63 ; 0x3f 372a2: 23 97 sbiw r28, 0x03 ; 3 372a4: 85 a3 std Z+37, r24 ; 0x25 372a6: 96 a3 std Z+38, r25 ; 0x26 372a8: a7 a3 std Z+39, r26 ; 0x27 372aa: 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; 372ac: f5 a8 ldd r15, Z+53 ; 0x35 372ae: 2d 2d mov r18, r13 372b0: 3e 2d mov r19, r14 372b2: a8 01 movw r20, r16 372b4: 27 96 adiw r28, 0x07 ; 7 372b6: 6f ad ldd r22, Y+63 ; 0x3f 372b8: 27 97 sbiw r28, 0x07 ; 7 372ba: 2b 96 adiw r28, 0x0b ; 11 372bc: 7f ad ldd r23, Y+63 ; 0x3f 372be: 2b 97 sbiw r28, 0x0b ; 11 372c0: 2f 96 adiw r28, 0x0f ; 15 372c2: 8f ad ldd r24, Y+63 ; 0x3f 372c4: 2f 97 sbiw r28, 0x0f ; 15 372c6: 63 96 adiw r28, 0x13 ; 19 372c8: 9f ad ldd r25, Y+63 ; 0x3f 372ca: 63 97 sbiw r28, 0x13 ; 19 372cc: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 372d0: 18 16 cp r1, r24 372d2: 0c f4 brge .+2 ; 0x372d6 372d4: cf c4 rjmp .+2462 ; 0x37c74 372d6: 83 e0 ldi r24, 0x03 ; 3 372d8: 9e e6 ldi r25, 0x6E ; 110 372da: 92 9d mul r25, r2 372dc: 80 01 movw r16, r0 372de: 93 9d mul r25, r3 372e0: 10 0d add r17, r0 372e2: 11 24 eor r1, r1 372e4: 0b 53 subi r16, 0x3B ; 59 372e6: 19 4f sbci r17, 0xF9 ; 249 372e8: f8 2a or r15, r24 372ea: f8 01 movw r30, r16 372ec: 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[] 372ee: 80 e1 ldi r24, 0x10 ; 16 372f0: fe 01 movw r30, r28 372f2: 71 96 adiw r30, 0x11 ; 17 372f4: ad eb ldi r26, 0xBD ; 189 372f6: b4 e0 ldi r27, 0x04 ; 4 372f8: 01 90 ld r0, Z+ 372fa: 0d 92 st X+, r0 372fc: 8a 95 dec r24 372fe: e1 f7 brne .-8 ; 0x372f8 previous_nominal_speed = block->nominal_speed; 37300: 27 96 adiw r28, 0x07 ; 7 37302: 8f ad ldd r24, Y+63 ; 0x3f 37304: 27 97 sbiw r28, 0x07 ; 7 37306: 2b 96 adiw r28, 0x0b ; 11 37308: 9f ad ldd r25, Y+63 ; 0x3f 3730a: 2b 97 sbiw r28, 0x0b ; 11 3730c: 2f 96 adiw r28, 0x0f ; 15 3730e: af ad ldd r26, Y+63 ; 0x3f 37310: 2f 97 sbiw r28, 0x0f ; 15 37312: 63 96 adiw r28, 0x13 ; 19 37314: bf ad ldd r27, Y+63 ; 0x3f 37316: 63 97 sbiw r28, 0x13 ; 19 37318: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 3731c: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 37320: a0 93 bb 04 sts 0x04BB, r26 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 37324: b0 93 bc 04 sts 0x04BC, r27 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> previous_safe_speed = safe_speed; 37328: 89 a5 ldd r24, Y+41 ; 0x29 3732a: 9d a5 ldd r25, Y+45 ; 0x2d 3732c: a9 a9 ldd r26, Y+49 ; 0x31 3732e: b9 ad ldd r27, Y+57 ; 0x39 37330: 80 93 10 18 sts 0x1810, r24 ; 0x801810 37334: 90 93 11 18 sts 0x1811, r25 ; 0x801811 37338: a0 93 12 18 sts 0x1812, r26 ; 0x801812 3733c: 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; 37340: d8 01 movw r26, r16 37342: d6 96 adiw r26, 0x36 ; 54 37344: 6d 91 ld r22, X+ 37346: 7d 91 ld r23, X+ 37348: 8d 91 ld r24, X+ 3734a: 9c 91 ld r25, X 3734c: d9 97 sbiw r26, 0x39 ; 57 3734e: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 37352: 27 96 adiw r28, 0x07 ; 7 37354: 2f ad ldd r18, Y+63 ; 0x3f 37356: 27 97 sbiw r28, 0x07 ; 7 37358: 2b 96 adiw r28, 0x0b ; 11 3735a: 3f ad ldd r19, Y+63 ; 0x3f 3735c: 2b 97 sbiw r28, 0x0b ; 11 3735e: 2f 96 adiw r28, 0x0f ; 15 37360: 4f ad ldd r20, Y+63 ; 0x3f 37362: 2f 97 sbiw r28, 0x0f ; 15 37364: 63 96 adiw r28, 0x13 ; 19 37366: 5f ad ldd r21, Y+63 ; 0x3f 37368: 63 97 sbiw r28, 0x13 ; 19 3736a: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 3736e: 2b 01 movw r4, r22 37370: 3c 01 movw r6, r24 37372: f8 01 movw r30, r16 37374: e8 5b subi r30, 0xB8 ; 184 37376: ff 4f sbci r31, 0xFF ; 255 37378: 40 82 st Z, r4 3737a: 51 82 std Z+1, r5 ; 0x01 3737c: 62 82 std Z+2, r6 ; 0x02 3737e: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 37380: 34 96 adiw r30, 0x04 ; 4 37382: 80 81 ld r24, Z 37384: 88 23 and r24, r24 37386: 09 f4 brne .+2 ; 0x3738a 37388: 89 c0 rjmp .+274 ; 0x3749c // 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)) 3738a: 20 91 65 05 lds r18, 0x0565 ; 0x800565 3738e: 30 91 66 05 lds r19, 0x0566 ; 0x800566 37392: 40 91 67 05 lds r20, 0x0567 ; 0x800567 37396: 50 91 68 05 lds r21, 0x0568 ; 0x800568 3739a: 6a 96 adiw r28, 0x1a ; 26 3739c: 6c ad ldd r22, Y+60 ; 0x3c 3739e: 7d ad ldd r23, Y+61 ; 0x3d 373a0: 8e ad ldd r24, Y+62 ; 0x3e 373a2: 9f ad ldd r25, Y+63 ; 0x3f 373a4: 6a 97 sbiw r28, 0x1a ; 26 373a6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 373aa: 4b 01 movw r8, r22 373ac: 5c 01 movw r10, r24 373ae: c0 90 ce 0d lds r12, 0x0DCE ; 0x800dce 373b2: d0 90 cf 0d lds r13, 0x0DCF ; 0x800dcf 373b6: e0 90 d0 0d lds r14, 0x0DD0 ; 0x800dd0 373ba: f0 90 d1 0d lds r15, 0x0DD1 ; 0x800dd1 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 373be: 0c 5a subi r16, 0xAC ; 172 373c0: 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)) 373c2: a7 01 movw r20, r14 373c4: 96 01 movw r18, r12 373c6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 373ca: a3 01 movw r20, r6 373cc: 92 01 movw r18, r4 373ce: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 373d2: f8 01 movw r30, r16 373d4: 60 83 st Z, r22 373d6: 71 83 std Z+1, r23 ; 0x01 373d8: 82 83 std Z+2, r24 ; 0x02 373da: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 373dc: 20 e0 ldi r18, 0x00 ; 0 373de: 30 e0 ldi r19, 0x00 ; 0 373e0: a9 01 movw r20, r18 373e2: 6a 96 adiw r28, 0x1a ; 26 373e4: 6c ad ldd r22, Y+60 ; 0x3c 373e6: 7d ad ldd r23, Y+61 ; 0x3d 373e8: 8e ad ldd r24, Y+62 ; 0x3e 373ea: 9f ad ldd r25, Y+63 ; 0x3f 373ec: 6a 97 sbiw r28, 0x1a ; 26 373ee: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 373f2: 18 16 cp r1, r24 373f4: 0c f0 brlt .+2 ; 0x373f8 373f6: 40 c4 rjmp .+2176 ; 0x37c78 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 373f8: a5 01 movw r20, r10 373fa: 94 01 movw r18, r8 373fc: e2 96 adiw r28, 0x32 ; 50 373fe: 6c ad ldd r22, Y+60 ; 0x3c 37400: 7d ad ldd r23, Y+61 ; 0x3d 37402: 8e ad ldd r24, Y+62 ; 0x3e 37404: 9f ad ldd r25, Y+63 ; 0x3f 37406: e2 97 sbiw r28, 0x32 ; 50 37408: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3740c: a7 01 movw r20, r14 3740e: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 37410: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37414: 6b 01 movw r12, r22 37416: 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; 37418: 20 e0 ldi r18, 0x00 ; 0 3741a: 30 e4 ldi r19, 0x40 ; 64 3741c: 4c e1 ldi r20, 0x1C ; 28 3741e: 57 e4 ldi r21, 0x47 ; 71 37420: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37424: 18 16 cp r1, r24 37426: 3c f4 brge .+14 ; 0x37436 37428: c1 2c mov r12, r1 3742a: 20 e4 ldi r18, 0x40 ; 64 3742c: d2 2e mov r13, r18 3742e: 2c e1 ldi r18, 0x1C ; 28 37430: e2 2e mov r14, r18 37432: 27 e4 ldi r18, 0x47 ; 71 37434: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 37436: a7 01 movw r20, r14 37438: 96 01 movw r18, r12 3743a: 60 e0 ldi r22, 0x00 ; 0 3743c: 74 e2 ldi r23, 0x24 ; 36 3743e: 84 ef ldi r24, 0xF4 ; 244 37440: 99 e4 ldi r25, 0x49 ; 73 37442: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 37446: 4b 01 movw r8, r22 37448: 5c 01 movw r10, r24 if (advance_speed > 20000) { 3744a: 20 e0 ldi r18, 0x00 ; 0 3744c: 30 e4 ldi r19, 0x40 ; 64 3744e: 4c e9 ldi r20, 0x9C ; 156 37450: 56 e4 ldi r21, 0x46 ; 70 37452: c7 01 movw r24, r14 37454: b6 01 movw r22, r12 37456: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 3745a: 18 16 cp r1, r24 3745c: 0c f0 brlt .+2 ; 0x37460 3745e: 17 c4 rjmp .+2094 ; 0x37c8e block->advance_rate = advance_rate * 4; 37460: 8e e6 ldi r24, 0x6E ; 110 37462: 82 9d mul r24, r2 37464: 80 01 movw r16, r0 37466: 83 9d mul r24, r3 37468: 10 0d add r17, r0 3746a: 11 24 eor r1, r1 3746c: 0b 53 subi r16, 0x3B ; 59 3746e: 19 4f sbci r17, 0xF9 ; 249 37470: 78 01 movw r14, r16 37472: fd e4 ldi r31, 0x4D ; 77 37474: ef 0e add r14, r31 37476: f1 1c adc r15, r1 37478: 20 e0 ldi r18, 0x00 ; 0 3747a: 30 e0 ldi r19, 0x00 ; 0 3747c: 40 e8 ldi r20, 0x80 ; 128 3747e: 50 e4 ldi r21, 0x40 ; 64 37480: c5 01 movw r24, r10 37482: b4 01 movw r22, r8 37484: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37488: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 3748c: d7 01 movw r26, r14 3748e: 6d 93 st X+, r22 37490: 7c 93 st X, r23 block->advance_step_loops = 4; 37492: f8 01 movw r30, r16 37494: ed 5a subi r30, 0xAD ; 173 37496: ff 4f sbci r31, 0xFF ; 255 37498: 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; 3749a: 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); 3749c: 09 a5 ldd r16, Y+41 ; 0x29 3749e: 1d a5 ldd r17, Y+45 ; 0x2d 374a0: 29 a9 ldd r18, Y+49 ; 0x31 374a2: 39 ad ldd r19, Y+57 ; 0x39 374a4: 4d ad ldd r20, Y+61 ; 0x3d 374a6: 5d a9 ldd r21, Y+53 ; 0x35 374a8: 6e ad ldd r22, Y+62 ; 0x3e 374aa: 23 96 adiw r28, 0x03 ; 3 374ac: 7f ad ldd r23, Y+63 ; 0x3f 374ae: 23 97 sbiw r28, 0x03 ; 3 374b0: a4 96 adiw r28, 0x24 ; 36 374b2: 8e ad ldd r24, Y+62 ; 0x3e 374b4: 9f ad ldd r25, Y+63 ; 0x3f 374b6: a4 97 sbiw r28, 0x24 ; 36 374b8: 8b 53 subi r24, 0x3B ; 59 374ba: 99 4f sbci r25, 0xF9 ; 249 374bc: 0f 94 5c ae call 0x35cb8 ; 0x35cb8 if (block->step_event_count.wide <= 32767) 374c0: 8e e6 ldi r24, 0x6E ; 110 374c2: 82 9d mul r24, r2 374c4: f0 01 movw r30, r0 374c6: 83 9d mul r24, r3 374c8: f0 0d add r31, r0 374ca: 11 24 eor r1, r1 374cc: eb 53 subi r30, 0x3B ; 59 374ce: f9 4f sbci r31, 0xF9 ; 249 374d0: 80 89 ldd r24, Z+16 ; 0x10 374d2: 91 89 ldd r25, Z+17 ; 0x11 374d4: a2 89 ldd r26, Z+18 ; 0x12 374d6: b3 89 ldd r27, Z+19 ; 0x13 374d8: 81 15 cp r24, r1 374da: 90 48 sbci r25, 0x80 ; 128 374dc: a1 05 cpc r26, r1 374de: b1 05 cpc r27, r1 374e0: 18 f4 brcc .+6 ; 0x374e8 block->flag |= BLOCK_FLAG_DDA_LOWRES; 374e2: 85 a9 ldd r24, Z+53 ; 0x35 374e4: 88 60 ori r24, 0x08 ; 8 374e6: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 374e8: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 374ea: 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; 374ec: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 374f0: 91 11 cpse r25, r1 374f2: 93 c4 rjmp .+2342 ; 0x37e1a block_buffer_head = next_buffer_head; 374f4: a1 96 adiw r28, 0x21 ; 33 374f6: 3f ad ldd r19, Y+63 ; 0x3f 374f8: a1 97 sbiw r28, 0x21 ; 33 374fa: 30 93 a5 0d sts 0x0DA5, r19 ; 0x800da5 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 374fe: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 37500: c2 58 subi r28, 0x82 ; 130 37502: df 4f sbci r29, 0xFF ; 255 37504: 88 81 ld r24, Y 37506: 99 81 ldd r25, Y+1 ; 0x01 37508: aa 81 ldd r26, Y+2 ; 0x02 3750a: bb 81 ldd r27, Y+3 ; 0x03 3750c: ce 57 subi r28, 0x7E ; 126 3750e: d0 40 sbci r29, 0x00 ; 0 37510: 80 93 a3 06 sts 0x06A3, r24 ; 0x8006a3 37514: 90 93 a4 06 sts 0x06A4, r25 ; 0x8006a4 37518: a0 93 a5 06 sts 0x06A5, r26 ; 0x8006a5 3751c: b0 93 a6 06 sts 0x06A6, r27 ; 0x8006a6 37520: ce 57 subi r28, 0x7E ; 126 37522: df 4f sbci r29, 0xFF ; 255 37524: 28 81 ld r18, Y 37526: 39 81 ldd r19, Y+1 ; 0x01 37528: 4a 81 ldd r20, Y+2 ; 0x02 3752a: 5b 81 ldd r21, Y+3 ; 0x03 3752c: c2 58 subi r28, 0x82 ; 130 3752e: d0 40 sbci r29, 0x00 ; 0 37530: 20 93 a7 06 sts 0x06A7, r18 ; 0x8006a7 37534: 30 93 a8 06 sts 0x06A8, r19 ; 0x8006a8 37538: 40 93 a9 06 sts 0x06A9, r20 ; 0x8006a9 3753c: 50 93 aa 06 sts 0x06AA, r21 ; 0x8006aa 37540: e6 96 adiw r28, 0x36 ; 54 37542: 8c ad ldd r24, Y+60 ; 0x3c 37544: 9d ad ldd r25, Y+61 ; 0x3d 37546: ae ad ldd r26, Y+62 ; 0x3e 37548: bf ad ldd r27, Y+63 ; 0x3f 3754a: e6 97 sbiw r28, 0x36 ; 54 3754c: 80 93 ab 06 sts 0x06AB, r24 ; 0x8006ab 37550: 90 93 ac 06 sts 0x06AC, r25 ; 0x8006ac 37554: a0 93 ad 06 sts 0x06AD, r26 ; 0x8006ad 37558: b0 93 ae 06 sts 0x06AE, r27 ; 0x8006ae 3755c: ae 96 adiw r28, 0x2e ; 46 3755e: 2c ad ldd r18, Y+60 ; 0x3c 37560: 3d ad ldd r19, Y+61 ; 0x3d 37562: 4e ad ldd r20, Y+62 ; 0x3e 37564: 5f ad ldd r21, Y+63 ; 0x3f 37566: ae 97 sbiw r28, 0x2e ; 46 37568: 20 93 af 06 sts 0x06AF, r18 ; 0x8006af 3756c: 30 93 b0 06 sts 0x06B0, r19 ; 0x8006b0 37570: 40 93 b1 06 sts 0x06B1, r20 ; 0x8006b1 37574: 50 93 b2 06 sts 0x06B2, r21 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37578: 89 a1 ldd r24, Y+33 ; 0x21 3757a: 9a a1 ldd r25, Y+34 ; 0x22 3757c: ab a1 ldd r26, Y+35 ; 0x23 3757e: bc a1 ldd r27, Y+36 ; 0x24 37580: 80 93 cd 04 sts 0x04CD, r24 ; 0x8004cd 37584: 90 93 ce 04 sts 0x04CE, r25 ; 0x8004ce 37588: a0 93 cf 04 sts 0x04CF, r26 ; 0x8004cf 3758c: b0 93 d0 04 sts 0x04D0, r27 ; 0x8004d0 position_float[Y_AXIS] = y; 37590: 8d a1 ldd r24, Y+37 ; 0x25 37592: 9e a1 ldd r25, Y+38 ; 0x26 37594: af a1 ldd r26, Y+39 ; 0x27 37596: b8 a5 ldd r27, Y+40 ; 0x28 37598: 80 93 d1 04 sts 0x04D1, r24 ; 0x8004d1 3759c: 90 93 d2 04 sts 0x04D2, r25 ; 0x8004d2 375a0: a0 93 d3 04 sts 0x04D3, r26 ; 0x8004d3 375a4: b0 93 d4 04 sts 0x04D4, r27 ; 0x8004d4 position_float[Z_AXIS] = z; 375a8: a8 96 adiw r28, 0x28 ; 40 375aa: 8c ad ldd r24, Y+60 ; 0x3c 375ac: 9d ad ldd r25, Y+61 ; 0x3d 375ae: ae ad ldd r26, Y+62 ; 0x3e 375b0: bf ad ldd r27, Y+63 ; 0x3f 375b2: a8 97 sbiw r28, 0x28 ; 40 375b4: 80 93 d5 04 sts 0x04D5, r24 ; 0x8004d5 375b8: 90 93 d6 04 sts 0x04D6, r25 ; 0x8004d6 375bc: a0 93 d7 04 sts 0x04D7, r26 ; 0x8004d7 375c0: b0 93 d8 04 sts 0x04D8, r27 ; 0x8004d8 position_float[E_AXIS] = e; 375c4: aa 96 adiw r28, 0x2a ; 42 375c6: ee ad ldd r30, Y+62 ; 0x3e 375c8: ff ad ldd r31, Y+63 ; 0x3f 375ca: aa 97 sbiw r28, 0x2a ; 42 375cc: 80 81 ld r24, Z 375ce: 91 81 ldd r25, Z+1 ; 0x01 375d0: a2 81 ldd r26, Z+2 ; 0x02 375d2: b3 81 ldd r27, Z+3 ; 0x03 375d4: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 375d8: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 375dc: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 375e0: 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; 375e4: 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); 375e8: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 375ec: 8f 19 sub r24, r15 375ee: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 375f0: 83 30 cpi r24, 0x03 ; 3 375f2: 40 f1 brcs .+80 ; 0x37644 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 375f4: 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) 375f8: 11 11 cpse r17, r1 375fa: 01 c0 rjmp .+2 ; 0x375fe block_index = BLOCK_BUFFER_SIZE; 375fc: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 375fe: 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; 37600: fe e6 ldi r31, 0x6E ; 110 37602: 1f 9f mul r17, r31 37604: c0 01 movw r24, r0 37606: 11 24 eor r1, r1 37608: 9c 01 movw r18, r24 3760a: 2b 53 subi r18, 0x3B ; 59 3760c: 39 4f sbci r19, 0xF9 ; 249 3760e: 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) 37610: 11 11 cpse r17, r1 37612: 01 c0 rjmp .+2 ; 0x37616 block_index = BLOCK_BUFFER_SIZE; 37614: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37616: 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)); 37618: 3e e6 ldi r19, 0x6E ; 110 3761a: 13 9f mul r17, r19 3761c: c0 01 movw r24, r0 3761e: 11 24 eor r1, r1 37620: ac 01 movw r20, r24 37622: 4b 53 subi r20, 0x3B ; 59 37624: 59 4f sbci r21, 0xF9 ; 249 37626: 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)); 37628: 9e e6 ldi r25, 0x6E ; 110 3762a: 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) { 3762c: f1 16 cp r15, r17 3762e: 69 f0 breq .+26 ; 0x3764a if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 37630: d6 01 movw r26, r12 37632: d5 96 adiw r26, 0x35 ; 53 37634: 0c 91 ld r16, X 37636: 02 ff sbrs r16, 2 37638: 7e c3 rjmp .+1788 ; 0x37d36 // 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); 3763a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 3763e: 81 1b sub r24, r17 37640: 8f 70 andi r24, 0x0F ; 15 37642: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 37644: 82 30 cpi r24, 0x02 ; 2 37646: 08 f4 brcc .+2 ; 0x3764a 37648: a3 c0 rjmp .+326 ; 0x37790 // 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; 3764a: 3e e6 ldi r19, 0x6E ; 110 3764c: f3 9e mul r15, r19 3764e: c0 01 movw r24, r0 37650: 11 24 eor r1, r1 37652: ac 01 movw r20, r24 37654: 4b 53 subi r20, 0x3B ; 59 37656: 59 4f sbci r21, 0xF9 ; 249 37658: 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) 3765a: f3 94 inc r15 3765c: 50 e1 ldi r21, 0x10 ; 16 3765e: f5 12 cpse r15, r21 37660: 01 c0 rjmp .+2 ; 0x37664 block_index = 0; 37662: 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)); 37664: ae e6 ldi r26, 0x6E ; 110 37666: fa 9e mul r15, r26 37668: c0 01 movw r24, r0 3766a: 11 24 eor r1, r1 3766c: fc 01 movw r30, r24 3766e: eb 53 subi r30, 0x3B ; 59 37670: f9 4f sbci r31, 0xF9 ; 249 37672: 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)); 37674: 8e e6 ldi r24, 0x6E ; 110 37676: 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) { 37678: d5 01 movw r26, r10 3767a: d5 96 adiw r26, 0x35 ; 53 3767c: 8c 91 ld r24, X 3767e: d5 97 sbiw r26, 0x35 ; 53 37680: 81 fd sbrc r24, 1 37682: 5a c0 rjmp .+180 ; 0x37738 37684: 95 96 adiw r26, 0x25 ; 37 37686: 4d 90 ld r4, X+ 37688: 5d 90 ld r5, X+ 3768a: 6d 90 ld r6, X+ 3768c: 7c 90 ld r7, X 3768e: 98 97 sbiw r26, 0x28 ; 40 37690: f6 01 movw r30, r12 37692: 95 a0 ldd r9, Z+37 ; 0x25 37694: e6 a0 ldd r14, Z+38 ; 0x26 37696: 07 a1 ldd r16, Z+39 ; 0x27 37698: 10 a5 ldd r17, Z+40 ; 0x28 3769a: 29 2d mov r18, r9 3769c: 3e 2d mov r19, r14 3769e: a8 01 movw r20, r16 376a0: c3 01 movw r24, r6 376a2: b2 01 movw r22, r4 376a4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 376a8: 87 ff sbrs r24, 7 376aa: 46 c0 rjmp .+140 ; 0x37738 // 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); 376ac: a3 01 movw r20, r6 376ae: 92 01 movw r18, r4 376b0: c3 01 movw r24, r6 376b2: b2 01 movw r22, r4 376b4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 376b8: 2b 01 movw r4, r22 376ba: 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)); 376bc: d5 01 movw r26, r10 376be: d1 96 adiw r26, 0x31 ; 49 376c0: 6d 91 ld r22, X+ 376c2: 7d 91 ld r23, X+ 376c4: 8d 91 ld r24, X+ 376c6: 9c 91 ld r25, X 376c8: d4 97 sbiw r26, 0x34 ; 52 376ca: 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); 376cc: 9b 01 movw r18, r22 376ce: ac 01 movw r20, r24 376d0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 376d4: f5 01 movw r30, r10 376d6: 25 a5 ldd r18, Z+45 ; 0x2d 376d8: 36 a5 ldd r19, Z+46 ; 0x2e 376da: 47 a5 ldd r20, Z+47 ; 0x2f 376dc: 50 a9 ldd r21, Z+48 ; 0x30 376de: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 376e2: 9b 01 movw r18, r22 376e4: ac 01 movw r20, r24 376e6: c3 01 movw r24, r6 376e8: b2 01 movw r22, r4 376ea: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 376ee: 0f 94 19 e1 call 0x3c232 ; 0x3c232 376f2: 2b 01 movw r4, r22 376f4: 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)); 376f6: 9b 01 movw r18, r22 376f8: ac 01 movw r20, r24 376fa: 69 2d mov r22, r9 376fc: 7e 2d mov r23, r14 376fe: c8 01 movw r24, r16 37700: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37704: 87 ff sbrs r24, 7 37706: 03 c0 rjmp .+6 ; 0x3770e 37708: 49 2c mov r4, r9 3770a: 5e 2c mov r5, r14 3770c: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 3770e: 92 01 movw r18, r4 37710: a3 01 movw r20, r6 37712: 69 2d mov r22, r9 37714: 7e 2d mov r23, r14 37716: c8 01 movw r24, r16 37718: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 3771c: 88 23 and r24, r24 3771e: 61 f0 breq .+24 ; 0x37738 37720: d6 01 movw r26, r12 37722: d5 96 adiw r26, 0x35 ; 53 37724: 2c 91 ld r18, X current->entry_speed = entry_speed; 37726: c2 01 movw r24, r4 37728: d3 01 movw r26, r6 3772a: f6 01 movw r30, r12 3772c: 85 a3 std Z+37, r24 ; 0x25 3772e: 96 a3 std Z+38, r25 ; 0x26 37730: a7 a3 std Z+39, r26 ; 0x27 37732: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 37734: 21 60 ori r18, 0x01 ; 1 37736: 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) { 37738: d5 01 movw r26, r10 3773a: d5 96 adiw r26, 0x35 ; 53 3773c: 8c 91 ld r24, X 3773e: d5 97 sbiw r26, 0x35 ; 53 37740: f6 01 movw r30, r12 37742: 95 a9 ldd r25, Z+53 ; 0x35 37744: 89 2b or r24, r25 37746: 80 ff sbrs r24, 0 37748: 14 c0 rjmp .+40 ; 0x37772 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 3774a: 05 a1 ldd r16, Z+37 ; 0x25 3774c: 16 a1 ldd r17, Z+38 ; 0x26 3774e: 27 a1 ldd r18, Z+39 ; 0x27 37750: 30 a5 ldd r19, Z+40 ; 0x28 37752: 95 96 adiw r26, 0x25 ; 37 37754: 4d 91 ld r20, X+ 37756: 5d 91 ld r21, X+ 37758: 6d 91 ld r22, X+ 3775a: 7c 91 ld r23, X 3775c: 98 97 sbiw r26, 0x28 ; 40 3775e: c5 01 movw r24, r10 37760: 0f 94 5c ae call 0x35cb8 ; 0x35cb8 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 37764: d5 01 movw r26, r10 37766: d5 96 adiw r26, 0x35 ; 53 37768: 8c 91 ld r24, X 3776a: d5 97 sbiw r26, 0x35 ; 53 3776c: 8e 7f andi r24, 0xFE ; 254 3776e: d5 96 adiw r26, 0x35 ; 53 37770: 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) 37772: f3 94 inc r15 37774: b0 e1 ldi r27, 0x10 ; 16 37776: fb 12 cpse r15, r27 37778: 01 c0 rjmp .+2 ; 0x3777c block_index = 0; 3777a: 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)); 3777c: f8 9c mul r15, r8 3777e: c0 01 movw r24, r0 37780: 11 24 eor r1, r1 37782: 8b 53 subi r24, 0x3B ; 59 37784: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 37786: 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; 3778a: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 3778c: f2 12 cpse r15, r18 3778e: 43 c3 rjmp .+1670 ; 0x37e16 } // 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); 37790: 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) 37794: 81 11 cpse r24, r1 37796: 01 c0 rjmp .+2 ; 0x3779a block_index = BLOCK_BUFFER_SIZE; 37798: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 3779a: 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); 3779c: ee e6 ldi r30, 0x6E ; 110 3779e: 8e 9f mul r24, r30 377a0: c0 01 movw r24, r0 377a2: 11 24 eor r1, r1 377a4: 9c 01 movw r18, r24 377a6: 2b 53 subi r18, 0x3B ; 59 377a8: 39 4f sbci r19, 0xF9 ; 249 377aa: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 377ac: d9 01 movw r26, r18 377ae: 95 96 adiw r26, 0x25 ; 37 377b0: 4d 91 ld r20, X+ 377b2: 5d 91 ld r21, X+ 377b4: 6d 91 ld r22, X+ 377b6: 7c 91 ld r23, X 377b8: 98 97 sbiw r26, 0x28 ; 40 377ba: 09 a5 ldd r16, Y+41 ; 0x29 377bc: 1d a5 ldd r17, Y+45 ; 0x2d 377be: 29 a9 ldd r18, Y+49 ; 0x31 377c0: 39 ad ldd r19, Y+57 ; 0x39 377c2: c7 01 movw r24, r14 377c4: 0f 94 5c ae call 0x35cb8 ; 0x35cb8 current->flag &= ~BLOCK_FLAG_RECALCULATE; 377c8: f7 01 movw r30, r14 377ca: 85 a9 ldd r24, Z+53 ; 0x35 377cc: 8e 7f andi r24, 0xFE ; 254 377ce: 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(); 377d0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377d4: 82 60 ori r24, 0x02 ; 2 377d6: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 377da: 0d 94 62 b1 jmp 0x362c4 ; 0x362c4 // 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)); 377de: a3 5e subi r26, 0xE3 ; 227 377e0: b8 4f sbci r27, 0xF8 ; 248 377e2: 80 e1 ldi r24, 0x10 ; 16 377e4: e2 e9 ldi r30, 0x92 ; 146 377e6: f6 e0 ldi r31, 0x06 ; 6 377e8: 0d 94 9d b1 jmp 0x3633a ; 0x3633a 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]); 377ec: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 377f0: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 377f4: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 377f8: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 377fc: a8 96 adiw r28, 0x28 ; 40 377fe: 6c ad ldd r22, Y+60 ; 0x3c 37800: 7d ad ldd r23, Y+61 ; 0x3d 37802: 8e ad ldd r24, Y+62 ; 0x3e 37804: 9f ad ldd r25, Y+63 ; 0x3f 37806: a8 97 sbiw r28, 0x28 ; 40 37808: 0d 94 33 b2 jmp 0x36466 ; 0x36466 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); 3780c: 81 e0 ldi r24, 0x01 ; 1 3780e: 80 8f std Z+24, r24 ; 0x18 37810: 0d 94 d9 b3 jmp 0x367b2 ; 0x367b2 { if(feed_rate 37818: b0 90 fb 0d lds r11, 0x0DFB ; 0x800dfb 3781c: 00 91 fc 0d lds r16, 0x0DFC ; 0x800dfc 37820: 10 91 fd 0d lds r17, 0x0DFD ; 0x800dfd 37824: 4c c8 rjmp .-3944 ; 0x368be 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])); 37826: c5 01 movw r24, r10 37828: b4 01 movw r22, r8 3782a: 0f 94 ec d6 call 0x3add8 ; 0x3add8 3782e: 4b 01 movw r8, r22 37830: 5c 01 movw r10, r24 37832: c7 01 movw r24, r14 37834: b6 01 movw r22, r12 37836: 0f 94 ec d6 call 0x3add8 ; 0x3add8 3783a: 9b 01 movw r18, r22 3783c: ac 01 movw r20, r24 3783e: c5 01 movw r24, r10 37840: b4 01 movw r22, r8 37842: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 37846: 6b 01 movw r12, r22 37848: 7c 01 movw r14, r24 3784a: 22 96 adiw r28, 0x02 ; 2 3784c: 6c ad ldd r22, Y+60 ; 0x3c 3784e: 7d ad ldd r23, Y+61 ; 0x3d 37850: 8e ad ldd r24, Y+62 ; 0x3e 37852: 9f ad ldd r25, Y+63 ; 0x3f 37854: 22 97 sbiw r28, 0x02 ; 2 37856: 0f 94 ec d6 call 0x3add8 ; 0x3add8 3785a: 9b 01 movw r18, r22 3785c: ac 01 movw r20, r24 3785e: c7 01 movw r24, r14 37860: b6 01 movw r22, r12 37862: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 37866: 0f 94 19 e1 call 0x3c232 ; 0x3c232 3786a: 2e e6 ldi r18, 0x6E ; 110 3786c: 22 9d mul r18, r2 3786e: f0 01 movw r30, r0 37870: 23 9d mul r18, r3 37872: f0 0d add r31, r0 37874: 11 24 eor r1, r1 37876: eb 53 subi r30, 0x3B ; 59 37878: f9 4f sbci r31, 0xF9 ; 249 3787a: 65 a7 std Z+45, r22 ; 0x2d 3787c: 76 a7 std Z+46, r23 ; 0x2e 3787e: 87 a7 std Z+47, r24 ; 0x2f 37880: 90 ab std Z+48, r25 ; 0x30 37882: bb c8 rjmp .-3722 ; 0x369fa 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 37884: 2a 96 adiw r28, 0x0a ; 10 37886: 2c ad ldd r18, Y+60 ; 0x3c 37888: 3d ad ldd r19, Y+61 ; 0x3d 3788a: 4e ad ldd r20, Y+62 ; 0x3e 3788c: 5f ad ldd r21, Y+63 ; 0x3f 3788e: 2a 97 sbiw r28, 0x0a ; 10 37890: 23 2b or r18, r19 37892: 24 2b or r18, r20 37894: 25 2b or r18, r21 37896: 09 f4 brne .+2 ; 0x3789a 37898: 0e c1 rjmp .+540 ; 0x37ab6 3789a: 60 91 f2 0d lds r22, 0x0DF2 ; 0x800df2 3789e: 70 91 f3 0d lds r23, 0x0DF3 ; 0x800df3 378a2: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 378a6: 90 91 f5 0d lds r25, 0x0DF5 ; 0x800df5 378aa: 29 a5 ldd r18, Y+41 ; 0x29 378ac: 3a a5 ldd r19, Y+42 ; 0x2a 378ae: 4b a5 ldd r20, Y+43 ; 0x2b 378b0: 5c a5 ldd r21, Y+44 ; 0x2c 378b2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 378b6: 0f 94 29 de call 0x3bc52 ; 0x3bc52 378ba: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 378be: 2b 01 movw r4, r22 378c0: 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 378c2: 80 91 65 05 lds r24, 0x0565 ; 0x800565 378c6: 90 91 66 05 lds r25, 0x0566 ; 0x800566 378ca: a0 91 67 05 lds r26, 0x0567 ; 0x800567 378ce: b0 91 68 05 lds r27, 0x0568 ; 0x800568 378d2: 8d a7 std Y+45, r24 ; 0x2d 378d4: 9e a7 std Y+46, r25 ; 0x2e 378d6: af a7 std Y+47, r26 ; 0x2f 378d8: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 378da: 20 e0 ldi r18, 0x00 ; 0 378dc: 30 e0 ldi r19, 0x00 ; 0 378de: a9 01 movw r20, r18 378e0: bc 01 movw r22, r24 378e2: cd 01 movw r24, r26 378e4: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 378e8: 18 16 cp r1, r24 378ea: 0c f0 brlt .+2 ; 0x378ee 378ec: ed c0 rjmp .+474 ; 0x37ac8 * 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 378ee: 20 e0 ldi r18, 0x00 ; 0 378f0: 30 e0 ldi r19, 0x00 ; 0 378f2: a9 01 movw r20, r18 378f4: 26 96 adiw r28, 0x06 ; 6 378f6: 6c ad ldd r22, Y+60 ; 0x3c 378f8: 7d ad ldd r23, Y+61 ; 0x3d 378fa: 8e ad ldd r24, Y+62 ; 0x3e 378fc: 9f ad ldd r25, Y+63 ; 0x3f 378fe: 26 97 sbiw r28, 0x06 ; 6 37900: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37904: 87 fd sbrc r24, 7 37906: e0 c0 rjmp .+448 ; 0x37ac8 && fabs(delta_mm[Z_AXIS]) < 0.5; 37908: 22 96 adiw r28, 0x02 ; 2 3790a: 6c ad ldd r22, Y+60 ; 0x3c 3790c: 7d ad ldd r23, Y+61 ; 0x3d 3790e: 8e ad ldd r24, Y+62 ; 0x3e 37910: 9f ad ldd r25, Y+63 ; 0x3f 37912: 22 97 sbiw r28, 0x02 ; 2 37914: 9f 77 andi r25, 0x7F ; 127 37916: 20 e0 ldi r18, 0x00 ; 0 37918: 30 e0 ldi r19, 0x00 ; 0 3791a: 40 e0 ldi r20, 0x00 ; 0 3791c: 5f e3 ldi r21, 0x3F ; 63 3791e: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37922: 87 ff sbrs r24, 7 37924: d1 c0 rjmp .+418 ; 0x37ac8 * * 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 37926: 8e e6 ldi r24, 0x6E ; 110 37928: 82 9d mul r24, r2 3792a: 80 01 movw r16, r0 3792c: 83 9d mul r24, r3 3792e: 10 0d add r17, r0 37930: 11 24 eor r1, r1 37932: 0f 5e subi r16, 0xEF ; 239 37934: 18 4f sbci r17, 0xF8 ; 248 37936: 81 e0 ldi r24, 0x01 ; 1 37938: d8 01 movw r26, r16 3793a: 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]) 3793c: 20 91 cd 04 lds r18, 0x04CD ; 0x8004cd 37940: 30 91 ce 04 lds r19, 0x04CE ; 0x8004ce 37944: 40 91 cf 04 lds r20, 0x04CF ; 0x8004cf 37948: 50 91 d0 04 lds r21, 0x04D0 ; 0x8004d0 3794c: 69 a1 ldd r22, Y+33 ; 0x21 3794e: 7a a1 ldd r23, Y+34 ; 0x22 37950: 8b a1 ldd r24, Y+35 ; 0x23 37952: 9c a1 ldd r25, Y+36 ; 0x24 37954: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 37958: 69 ab std Y+49, r22 ; 0x31 3795a: 7a ab std Y+50, r23 ; 0x32 3795c: 8b ab std Y+51, r24 ; 0x33 3795e: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 37960: 20 91 d1 04 lds r18, 0x04D1 ; 0x8004d1 37964: 30 91 d2 04 lds r19, 0x04D2 ; 0x8004d2 37968: 40 91 d3 04 lds r20, 0x04D3 ; 0x8004d3 3796c: 50 91 d4 04 lds r21, 0x04D4 ; 0x8004d4 37970: 6d a1 ldd r22, Y+37 ; 0x25 37972: 7e a1 ldd r23, Y+38 ; 0x26 37974: 8f a1 ldd r24, Y+39 ; 0x27 37976: 98 a5 ldd r25, Y+40 ; 0x28 37978: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3797c: 4b 01 movw r8, r22 3797e: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 37980: 20 91 d5 04 lds r18, 0x04D5 ; 0x8004d5 37984: 30 91 d6 04 lds r19, 0x04D6 ; 0x8004d6 37988: 40 91 d7 04 lds r20, 0x04D7 ; 0x8004d7 3798c: 50 91 d8 04 lds r21, 0x04D8 ; 0x8004d8 37990: a8 96 adiw r28, 0x28 ; 40 37992: 6c ad ldd r22, Y+60 ; 0x3c 37994: 7d ad ldd r23, Y+61 ; 0x3d 37996: 8e ad ldd r24, Y+62 ; 0x3e 37998: 9f ad ldd r25, Y+63 ; 0x3f 3799a: a8 97 sbiw r28, 0x28 ; 40 3799c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 379a0: 6b 01 movw r12, r22 379a2: 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]) 379a4: 29 a9 ldd r18, Y+49 ; 0x31 379a6: 3a a9 ldd r19, Y+50 ; 0x32 379a8: 4b a9 ldd r20, Y+51 ; 0x33 379aa: 5c a9 ldd r21, Y+52 ; 0x34 379ac: ca 01 movw r24, r20 379ae: b9 01 movw r22, r18 379b0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 379b4: 69 ab std Y+49, r22 ; 0x31 379b6: 7a ab std Y+50, r23 ; 0x32 379b8: 8b ab std Y+51, r24 ; 0x33 379ba: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 379bc: a5 01 movw r20, r10 379be: 94 01 movw r18, r8 379c0: c5 01 movw r24, r10 379c2: b4 01 movw r22, r8 379c4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 379c8: 9b 01 movw r18, r22 379ca: ac 01 movw r20, r24 379cc: 69 a9 ldd r22, Y+49 ; 0x31 379ce: 7a a9 ldd r23, Y+50 ; 0x32 379d0: 8b a9 ldd r24, Y+51 ; 0x33 379d2: 9c a9 ldd r25, Y+52 ; 0x34 379d4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 379d8: 4b 01 movw r8, r22 379da: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 379dc: a7 01 movw r20, r14 379de: 96 01 movw r18, r12 379e0: c7 01 movw r24, r14 379e2: b6 01 movw r22, r12 379e4: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 379e8: 9b 01 movw r18, r22 379ea: ac 01 movw r20, r24 379ec: c5 01 movw r24, r10 379ee: b4 01 movw r22, r8 379f0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__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]) 379f4: 0f 94 19 e1 call 0x3c232 ; 0x3c232 379f8: 6b 01 movw r12, r22 379fa: 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]); 379fc: 20 91 d9 04 lds r18, 0x04D9 ; 0x8004d9 37a00: 30 91 da 04 lds r19, 0x04DA ; 0x8004da 37a04: 40 91 db 04 lds r20, 0x04DB ; 0x8004db 37a08: 50 91 dc 04 lds r21, 0x04DC ; 0x8004dc 37a0c: aa 96 adiw r28, 0x2a ; 42 37a0e: ee ad ldd r30, Y+62 ; 0x3e 37a10: ff ad ldd r31, Y+63 ; 0x3f 37a12: aa 97 sbiw r28, 0x2a ; 42 37a14: 60 81 ld r22, Z 37a16: 71 81 ldd r23, Z+1 ; 0x01 37a18: 82 81 ldd r24, Z+2 ; 0x02 37a1a: 93 81 ldd r25, Z+3 ; 0x03 37a1c: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__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; 37a20: a7 01 movw r20, r14 37a22: 96 01 movw r18, r12 37a24: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 37a28: 6a 96 adiw r28, 0x1a ; 26 37a2a: 6c af std Y+60, r22 ; 0x3c 37a2c: 7d af std Y+61, r23 ; 0x3d 37a2e: 8e af std Y+62, r24 ; 0x3e 37a30: 9f af std Y+63, r25 ; 0x3f 37a32: 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) 37a34: 20 e0 ldi r18, 0x00 ; 0 37a36: 30 e0 ldi r19, 0x00 ; 0 37a38: 40 e4 ldi r20, 0x40 ; 64 37a3a: 50 e4 ldi r21, 0x40 ; 64 37a3c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37a40: 18 16 cp r1, r24 37a42: 0c f4 brge .+2 ; 0x37a46 37a44: 9e c0 rjmp .+316 ; 0x37b82 block->use_advance_lead = false; else if (e_D_ratio > 0) { 37a46: 20 e0 ldi r18, 0x00 ; 0 37a48: 30 e0 ldi r19, 0x00 ; 0 37a4a: a9 01 movw r20, r18 37a4c: 6a 96 adiw r28, 0x1a ; 26 37a4e: 6c ad ldd r22, Y+60 ; 0x3c 37a50: 7d ad ldd r23, Y+61 ; 0x3d 37a52: 8e ad ldd r24, Y+62 ; 0x3e 37a54: 9f ad ldd r25, Y+63 ; 0x3f 37a56: 6a 97 sbiw r28, 0x1a ; 26 37a58: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37a5c: 18 16 cp r1, r24 37a5e: 0c f0 brlt .+2 ; 0x37a62 37a60: 42 c0 rjmp .+132 ; 0x37ae6 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 37a62: 6a 96 adiw r28, 0x1a ; 26 37a64: 2c ad ldd r18, Y+60 ; 0x3c 37a66: 3d ad ldd r19, Y+61 ; 0x3d 37a68: 4e ad ldd r20, Y+62 ; 0x3e 37a6a: 5f ad ldd r21, Y+63 ; 0x3f 37a6c: 6a 97 sbiw r28, 0x1a ; 26 37a6e: 6d a5 ldd r22, Y+45 ; 0x2d 37a70: 7e a5 ldd r23, Y+46 ; 0x2e 37a72: 8f a5 ldd r24, Y+47 ; 0x2f 37a74: 98 a9 ldd r25, Y+48 ; 0x30 37a76: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37a7a: 9b 01 movw r18, r22 37a7c: ac 01 movw r20, r24 37a7e: 60 91 12 0e lds r22, 0x0E12 ; 0x800e12 37a82: 70 91 13 0e lds r23, 0x0E13 ; 0x800e13 37a86: 80 91 14 0e lds r24, 0x0E14 ; 0x800e14 37a8a: 90 91 15 0e lds r25, 0x0E15 ; 0x800e15 37a8e: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 37a92: 29 a5 ldd r18, Y+41 ; 0x29 37a94: 3a a5 ldd r19, Y+42 ; 0x2a 37a96: 4b a5 ldd r20, Y+43 ; 0x2b 37a98: 5c a5 ldd r21, Y+44 ; 0x2c 37a9a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37a9e: 0f 94 29 de call 0x3bc52 ; 0x3bc52 37aa2: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 37aa6: 64 15 cp r22, r4 37aa8: 75 05 cpc r23, r5 37aaa: 86 05 cpc r24, r6 37aac: 97 05 cpc r25, r7 37aae: d8 f4 brcc .+54 ; 0x37ae6 37ab0: 2b 01 movw r4, r22 37ab2: 3c 01 movw r6, r24 37ab4: 18 c0 rjmp .+48 ; 0x37ae6 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 37ab6: 60 91 7e 0e lds r22, 0x0E7E ; 0x800e7e 37aba: 70 91 7f 0e lds r23, 0x0E7F ; 0x800e7f 37abe: 80 91 80 0e lds r24, 0x0E80 ; 0x800e80 37ac2: 90 91 81 0e lds r25, 0x0E81 ; 0x800e81 37ac6: f1 ce rjmp .-542 ; 0x378aa * * 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 37ac8: 8e e6 ldi r24, 0x6E ; 110 37aca: 82 9d mul r24, r2 37acc: f0 01 movw r30, r0 37ace: 83 9d mul r24, r3 37ad0: f0 0d add r31, r0 37ad2: 11 24 eor r1, r1 37ad4: ef 5e subi r30, 0xEF ; 239 37ad6: f8 4f sbci r31, 0xF8 ; 248 37ad8: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 37ada: 6a 96 adiw r28, 0x1a ; 26 37adc: 1c ae std Y+60, r1 ; 0x3c 37ade: 1d ae std Y+61, r1 ; 0x3d 37ae0: 1e ae std Y+62, r1 ; 0x3e 37ae2: 1f ae std Y+63, r1 ; 0x3f 37ae4: 6a 97 sbiw r28, 0x1a ; 26 37ae6: 10 e0 ldi r17, 0x00 ; 0 37ae8: 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) 37aea: a4 96 adiw r28, 0x24 ; 36 37aec: ee ad ldd r30, Y+62 ; 0x3e 37aee: ff ad ldd r31, Y+63 ; 0x3f 37af0: a4 97 sbiw r28, 0x24 ; 36 37af2: e0 0f add r30, r16 37af4: f1 1f adc r31, r17 37af6: eb 53 subi r30, 0x3B ; 59 37af8: f9 4f sbci r31, 0xF9 ; 249 37afa: c0 80 ld r12, Z 37afc: d1 80 ldd r13, Z+1 ; 0x01 37afe: e2 80 ldd r14, Z+2 ; 0x02 37b00: f3 80 ldd r15, Z+3 ; 0x03 37b02: c1 14 cp r12, r1 37b04: d1 04 cpc r13, r1 37b06: e1 04 cpc r14, r1 37b08: f1 04 cpc r15, r1 37b0a: a1 f1 breq .+104 ; 0x37b74 37b0c: f8 01 movw r30, r16 37b0e: e2 5b subi r30, 0xB2 ; 178 37b10: fa 4f sbci r31, 0xFA ; 250 37b12: 60 81 ld r22, Z 37b14: 71 81 ldd r23, Z+1 ; 0x01 37b16: 82 81 ldd r24, Z+2 ; 0x02 37b18: 93 81 ldd r25, Z+3 ; 0x03 37b1a: 64 15 cp r22, r4 37b1c: 75 05 cpc r23, r5 37b1e: 86 05 cpc r24, r6 37b20: 97 05 cpc r25, r7 37b22: 40 f5 brcc .+80 ; 0x37b74 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 37b24: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 37b28: 29 ad ldd r18, Y+57 ; 0x39 37b2a: 3a ad ldd r19, Y+58 ; 0x3a 37b2c: 4b ad ldd r20, Y+59 ; 0x3b 37b2e: 5c ad ldd r21, Y+60 ; 0x3c 37b30: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37b34: 4b 01 movw r8, r22 37b36: 5c 01 movw r10, r24 37b38: c7 01 movw r24, r14 37b3a: b6 01 movw r22, r12 37b3c: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 37b40: 9b 01 movw r18, r22 37b42: ac 01 movw r20, r24 37b44: c5 01 movw r24, r10 37b46: b4 01 movw r22, r8 37b48: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 37b4c: 6b 01 movw r12, r22 37b4e: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 37b50: c3 01 movw r24, r6 37b52: b2 01 movw r22, r4 37b54: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 37b58: 9b 01 movw r18, r22 37b5a: ac 01 movw r20, r24 37b5c: c7 01 movw r24, r14 37b5e: b6 01 movw r22, r12 37b60: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37b64: 87 ff sbrs r24, 7 37b66: 06 c0 rjmp .+12 ; 0x37b74 37b68: c7 01 movw r24, r14 37b6a: b6 01 movw r22, r12 37b6c: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 37b70: 2b 01 movw r4, r22 37b72: 3c 01 movw r6, r24 37b74: 0c 5f subi r16, 0xFC ; 252 37b76: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 37b78: 00 31 cpi r16, 0x10 ; 16 37b7a: 11 05 cpc r17, r1 37b7c: 09 f0 breq .+2 ; 0x37b80 37b7e: b5 cf rjmp .-150 ; 0x37aea 37b80: 01 c9 rjmp .-3582 ; 0x36d84 // 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; 37b82: d8 01 movw r26, r16 37b84: 1c 92 st X, r1 37b86: af cf rjmp .-162 ; 0x37ae6 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 37b88: c9 a6 std Y+41, r12 ; 0x29 37b8a: dd a6 std Y+45, r13 ; 0x2d 37b8c: e9 aa std Y+49, r14 ; 0x31 37b8e: f9 ae std Y+57, r15 ; 0x39 limited = true; 37b90: 21 e0 ldi r18, 0x01 ; 1 37b92: 2d ab std Y+53, r18 ; 0x35 37b94: b1 c9 rjmp .-3230 ; 0x36ef8 // 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); 37b96: 27 96 adiw r28, 0x07 ; 7 37b98: 2f ad ldd r18, Y+63 ; 0x3f 37b9a: 27 97 sbiw r28, 0x07 ; 7 37b9c: 2b 96 adiw r28, 0x0b ; 11 37b9e: 3f ad ldd r19, Y+63 ; 0x3f 37ba0: 2b 97 sbiw r28, 0x0b ; 11 37ba2: 2f 96 adiw r28, 0x0f ; 15 37ba4: 4f ad ldd r20, Y+63 ; 0x3f 37ba6: 2f 97 sbiw r28, 0x0f ; 15 37ba8: 63 96 adiw r28, 0x13 ; 19 37baa: 5f ad ldd r21, Y+63 ; 0x3f 37bac: 63 97 sbiw r28, 0x13 ; 19 37bae: 6b 96 adiw r28, 0x1b ; 27 37bb0: 6f ad ldd r22, Y+63 ; 0x3f 37bb2: 6b 97 sbiw r28, 0x1b ; 27 37bb4: 6d 96 adiw r28, 0x1d ; 29 37bb6: 7f ad ldd r23, Y+63 ; 0x3f 37bb8: 6d 97 sbiw r28, 0x1d ; 29 37bba: c8 01 movw r24, r16 37bbc: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 37bc0: ec 96 adiw r28, 0x3c ; 60 37bc2: 6c af std Y+60, r22 ; 0x3c 37bc4: 7d af std Y+61, r23 ; 0x3d 37bc6: 8e af std Y+62, r24 ; 0x3e 37bc8: 9f af std Y+63, r25 ; 0x3f 37bca: 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; 37bcc: 6b 96 adiw r28, 0x1b ; 27 37bce: ef ad ldd r30, Y+63 ; 0x3f 37bd0: 6b 97 sbiw r28, 0x1b ; 27 37bd2: ed af std Y+61, r30 ; 0x3d 37bd4: 6d 96 adiw r28, 0x1d ; 29 37bd6: ff ad ldd r31, Y+63 ; 0x3f 37bd8: 6d 97 sbiw r28, 0x1d ; 29 37bda: fd ab std Y+53, r31 ; 0x35 37bdc: 0e af std Y+62, r16 ; 0x3e 37bde: 23 96 adiw r28, 0x03 ; 3 37be0: 1f af std Y+63, r17 ; 0x3f 37be2: 23 97 sbiw r28, 0x03 ; 3 37be4: 04 ca rjmp .-3064 ; 0x36fee (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 37be6: f7 fa bst r15, 7 37be8: f0 94 com r15 37bea: f7 f8 bld r15, 7 37bec: f0 94 com r15 37bee: a5 01 movw r20, r10 37bf0: 94 01 movw r18, r8 37bf2: c7 01 movw r24, r14 37bf4: b6 01 movw r22, r12 37bf6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37bfa: 87 ff sbrs r24, 7 37bfc: 77 ca rjmp .-2834 ; 0x370ec // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37bfe: 75 01 movw r14, r10 37c00: 64 01 movw r12, r8 37c02: 74 ca rjmp .-2840 ; 0x370ec // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 37c04: c7 01 movw r24, r14 37c06: b6 01 movw r22, r12 37c08: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37c0c: 87 fd sbrc r24, 7 37c0e: 09 c0 rjmp .+18 ; 0x37c22 37c10: 20 e0 ldi r18, 0x00 ; 0 37c12: 30 e0 ldi r19, 0x00 ; 0 37c14: a9 01 movw r20, r18 37c16: c5 01 movw r24, r10 37c18: b4 01 movw r22, r8 37c1a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37c1e: 18 16 cp r1, r24 37c20: 2c f4 brge .+10 ; 0x37c2c 37c22: a5 01 movw r20, r10 37c24: 94 01 movw r18, r8 37c26: c7 01 movw r24, r14 37c28: b6 01 movw r22, r12 37c2a: 5c ca rjmp .-2888 ; 0x370e4 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37c2c: b7 fa bst r11, 7 37c2e: b0 94 com r11 37c30: b7 f8 bld r11, 7 37c32: b0 94 com r11 37c34: a7 01 movw r20, r14 37c36: 96 01 movw r18, r12 37c38: c5 01 movw r24, r10 37c3a: b4 01 movw r22, r8 37c3c: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37c40: 18 16 cp r1, r24 37c42: 0c f0 brlt .+2 ; 0x37c46 37c44: 53 ca rjmp .-2906 ; 0x370ec 37c46: db cf rjmp .-74 ; 0x37bfe // 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; 37c48: 8e e6 ldi r24, 0x6E ; 110 37c4a: 82 9d mul r24, r2 37c4c: f0 01 movw r30, r0 37c4e: 83 9d mul r24, r3 37c50: f0 0d add r31, r0 37c52: 11 24 eor r1, r1 37c54: eb 53 subi r30, 0x3B ; 59 37c56: f9 4f sbci r31, 0xF9 ; 249 37c58: 85 a9 ldd r24, Z+53 ; 0x35 37c5a: 84 60 ori r24, 0x04 ; 4 37c5c: 85 ab std Z+53, r24 ; 0x35 37c5e: a9 a5 ldd r26, Y+41 ; 0x29 37c60: ad af std Y+61, r26 ; 0x3d 37c62: bd a5 ldd r27, Y+45 ; 0x2d 37c64: bd ab std Y+53, r27 ; 0x35 37c66: e9 a9 ldd r30, Y+49 ; 0x31 37c68: ee af std Y+62, r30 ; 0x3e 37c6a: f9 ad ldd r31, Y+57 ; 0x39 37c6c: 23 96 adiw r28, 0x03 ; 3 37c6e: ff af std Y+63, r31 ; 0x3f 37c70: 23 97 sbiw r28, 0x03 ; 3 37c72: bc ca rjmp .-2696 ; 0x371ec // 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; 37c74: 81 e0 ldi r24, 0x01 ; 1 37c76: 30 cb rjmp .-2464 ; 0x372d8 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]; 37c78: 20 91 12 0e lds r18, 0x0E12 ; 0x800e12 37c7c: 30 91 13 0e lds r19, 0x0E13 ; 0x800e13 37c80: 40 91 14 0e lds r20, 0x0E14 ; 0x800e14 37c84: 50 91 15 0e lds r21, 0x0E15 ; 0x800e15 37c88: c7 01 movw r24, r14 37c8a: b6 01 movw r22, r12 37c8c: c1 cb rjmp .-2174 ; 0x37410 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) { 37c8e: 20 e0 ldi r18, 0x00 ; 0 37c90: 30 e4 ldi r19, 0x40 ; 64 37c92: 4c e1 ldi r20, 0x1C ; 28 37c94: 56 e4 ldi r21, 0x46 ; 70 37c96: c7 01 movw r24, r14 37c98: b6 01 movw r22, r12 37c9a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 37c9e: 18 16 cp r1, r24 37ca0: d4 f4 brge .+52 ; 0x37cd6 block->advance_rate = advance_rate * 2; 37ca2: 8e e6 ldi r24, 0x6E ; 110 37ca4: 82 9d mul r24, r2 37ca6: 80 01 movw r16, r0 37ca8: 83 9d mul r24, r3 37caa: 10 0d add r17, r0 37cac: 11 24 eor r1, r1 37cae: 0b 53 subi r16, 0x3B ; 59 37cb0: 19 4f sbci r17, 0xF9 ; 249 37cb2: 78 01 movw r14, r16 37cb4: bd e4 ldi r27, 0x4D ; 77 37cb6: eb 0e add r14, r27 37cb8: f1 1c adc r15, r1 37cba: a5 01 movw r20, r10 37cbc: 94 01 movw r18, r8 37cbe: c5 01 movw r24, r10 37cc0: b4 01 movw r22, r8 37cc2: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 37cc6: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 37cca: f7 01 movw r30, r14 37ccc: 71 83 std Z+1, r23 ; 0x01 37cce: 60 83 st Z, r22 block->advance_step_loops = 2; 37cd0: 36 96 adiw r30, 0x06 ; 6 37cd2: 82 e0 ldi r24, 0x02 ; 2 37cd4: e2 cb rjmp .-2108 ; 0x3749a } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 37cd6: 20 e0 ldi r18, 0x00 ; 0 37cd8: 3f ef ldi r19, 0xFF ; 255 37cda: 4f e7 ldi r20, 0x7F ; 127 37cdc: 57 e4 ldi r21, 0x47 ; 71 37cde: c5 01 movw r24, r10 37ce0: b4 01 movw r22, r8 37ce2: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37ce6: 87 ff sbrs r24, 7 37ce8: 19 c0 rjmp .+50 ; 0x37d1c block->advance_rate = advance_rate; 37cea: 8e e6 ldi r24, 0x6E ; 110 37cec: 82 9d mul r24, r2 37cee: 80 01 movw r16, r0 37cf0: 83 9d mul r24, r3 37cf2: 10 0d add r17, r0 37cf4: 11 24 eor r1, r1 37cf6: 0e 5e subi r16, 0xEE ; 238 37cf8: 18 4f sbci r17, 0xF8 ; 248 37cfa: c5 01 movw r24, r10 37cfc: b4 01 movw r22, r8 37cfe: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 37d02: d8 01 movw r26, r16 37d04: 6d 93 st X+, r22 37d06: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 37d08: 8e e6 ldi r24, 0x6E ; 110 37d0a: 82 9d mul r24, r2 37d0c: f0 01 movw r30, r0 37d0e: 83 9d mul r24, r3 37d10: f0 0d add r31, r0 37d12: 11 24 eor r1, r1 37d14: e8 5e subi r30, 0xE8 ; 232 37d16: f8 4f sbci r31, 0xF8 ; 248 37d18: 81 e0 ldi r24, 0x01 ; 1 37d1a: bf cb rjmp .-2178 ; 0x3749a { // 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; 37d1c: 8e e6 ldi r24, 0x6E ; 110 37d1e: 82 9d mul r24, r2 37d20: f0 01 movw r30, r0 37d22: 83 9d mul r24, r3 37d24: f0 0d add r31, r0 37d26: 11 24 eor r1, r1 37d28: ee 5e subi r30, 0xEE ; 238 37d2a: f8 4f sbci r31, 0xF8 ; 248 37d2c: 8f ef ldi r24, 0xFF ; 255 37d2e: 9f ef ldi r25, 0xFF ; 255 37d30: 91 83 std Z+1, r25 ; 0x01 37d32: 80 83 st Z, r24 37d34: e9 cf rjmp .-46 ; 0x37d08 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) { 37d36: f6 01 movw r30, r12 37d38: 71 a4 ldd r7, Z+41 ; 0x29 37d3a: 82 a4 ldd r8, Z+42 ; 0x2a 37d3c: 93 a4 ldd r9, Z+43 ; 0x2b 37d3e: e4 a4 ldd r14, Z+44 ; 0x2c 37d40: 27 2d mov r18, r7 37d42: 38 2d mov r19, r8 37d44: 49 2d mov r20, r9 37d46: 5e 2d mov r21, r14 37d48: 65 a1 ldd r22, Z+37 ; 0x25 37d4a: 76 a1 ldd r23, Z+38 ; 0x26 37d4c: 87 a1 ldd r24, Z+39 ; 0x27 37d4e: 90 a5 ldd r25, Z+40 ; 0x28 37d50: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37d54: 88 23 and r24, r24 37d56: 09 f4 brne .+2 ; 0x37d5a 37d58: 51 c0 rjmp .+162 ; 0x37dfc // 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) ? 37d5a: 01 fd sbrc r16, 1 37d5c: 44 c0 rjmp .+136 ; 0x37de6 37d5e: d5 01 movw r26, r10 37d60: 95 96 adiw r26, 0x25 ; 37 37d62: 2d 90 ld r2, X+ 37d64: 3d 90 ld r3, X+ 37d66: 4d 90 ld r4, X+ 37d68: 5c 90 ld r5, X 37d6a: 98 97 sbiw r26, 0x28 ; 40 37d6c: a2 01 movw r20, r4 37d6e: 91 01 movw r18, r2 37d70: 67 2d mov r22, r7 37d72: 78 2d mov r23, r8 37d74: 89 2d mov r24, r9 37d76: 9e 2d mov r25, r14 37d78: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37d7c: 18 16 cp r1, r24 37d7e: 9c f5 brge .+102 ; 0x37de6 // 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); 37d80: a2 01 movw r20, r4 37d82: 91 01 movw r18, r2 37d84: c2 01 movw r24, r4 37d86: b1 01 movw r22, r2 37d88: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37d8c: 1b 01 movw r2, r22 37d8e: 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)); 37d90: f6 01 movw r30, r12 37d92: 61 a9 ldd r22, Z+49 ; 0x31 37d94: 72 a9 ldd r23, Z+50 ; 0x32 37d96: 83 a9 ldd r24, Z+51 ; 0x33 37d98: 94 a9 ldd r25, Z+52 ; 0x34 37d9a: 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); 37d9c: 9b 01 movw r18, r22 37d9e: ac 01 movw r20, r24 37da0: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 37da4: d6 01 movw r26, r12 37da6: 9d 96 adiw r26, 0x2d ; 45 37da8: 2d 91 ld r18, X+ 37daa: 3d 91 ld r19, X+ 37dac: 4d 91 ld r20, X+ 37dae: 5c 91 ld r21, X 37db0: d0 97 sbiw r26, 0x30 ; 48 37db2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37db6: 9b 01 movw r18, r22 37db8: ac 01 movw r20, r24 37dba: c2 01 movw r24, r4 37dbc: b1 01 movw r22, r2 37dbe: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 37dc2: 0f 94 19 e1 call 0x3c232 ; 0x3c232 37dc6: 2b 01 movw r4, r22 37dc8: 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)); 37dca: 9b 01 movw r18, r22 37dcc: ac 01 movw r20, r24 37dce: 67 2d mov r22, r7 37dd0: 78 2d mov r23, r8 37dd2: 89 2d mov r24, r9 37dd4: 9e 2d mov r25, r14 37dd6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 37dda: 87 fd sbrc r24, 7 37ddc: 04 c0 rjmp .+8 ; 0x37de6 37dde: 74 2c mov r7, r4 37de0: 85 2c mov r8, r5 37de2: 9a 2c mov r9, r10 37de4: 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) ? 37de6: 87 2d mov r24, r7 37de8: 98 2d mov r25, r8 37dea: a9 2d mov r26, r9 37dec: be 2d mov r27, r14 37dee: f6 01 movw r30, r12 37df0: 85 a3 std Z+37, r24 ; 0x25 37df2: 96 a3 std Z+38, r25 ; 0x26 37df4: a7 a3 std Z+39, r26 ; 0x27 37df6: 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; 37df8: 01 60 ori r16, 0x01 ; 1 37dfa: 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) 37dfc: 11 11 cpse r17, r1 37dfe: 01 c0 rjmp .+2 ; 0x37e02 block_index = BLOCK_BUFFER_SIZE; 37e00: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37e02: 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)); 37e04: 16 9d mul r17, r6 37e06: c0 01 movw r24, r0 37e08: 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; 37e0a: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37e0c: 9c 01 movw r18, r24 37e0e: 2b 53 subi r18, 0x3B ; 59 37e10: 39 4f sbci r19, 0xF9 ; 249 37e12: 69 01 movw r12, r18 37e14: 0b cc rjmp .-2026 ; 0x3762c 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)); 37e16: 6c 01 movw r12, r24 37e18: 2f cc rjmp .-1954 ; 0x37678 37e1a: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 37e1c: 0d 94 62 b1 jmp 0x362c4 ; 0x362c4 00037e20 : 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(){ 37e20: 4f 92 push r4 37e22: 5f 92 push r5 37e24: 6f 92 push r6 37e26: 7f 92 push r7 37e28: 8f 92 push r8 37e2a: 9f 92 push r9 37e2c: af 92 push r10 37e2e: bf 92 push r11 37e30: cf 92 push r12 37e32: df 92 push r13 37e34: ef 92 push r14 37e36: ff 92 push r15 37e38: cf 93 push r28 37e3a: df 93 push r29 37e3c: cd b7 in r28, 0x3d ; 61 37e3e: de b7 in r29, 0x3e ; 62 37e40: 2c 97 sbiw r28, 0x0c ; 12 37e42: 0f b6 in r0, 0x3f ; 63 37e44: f8 94 cli 37e46: de bf out 0x3e, r29 ; 62 37e48: 0f be out 0x3f, r0 ; 63 37e4a: 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]); 37e4c: c0 90 9a 06 lds r12, 0x069A ; 0x80069a 37e50: d0 90 9b 06 lds r13, 0x069B ; 0x80069b 37e54: e0 90 9c 06 lds r14, 0x069C ; 0x80069c 37e58: f0 90 9d 06 lds r15, 0x069D ; 0x80069d 37e5c: 80 91 96 06 lds r24, 0x0696 ; 0x800696 37e60: 90 91 97 06 lds r25, 0x0697 ; 0x800697 37e64: a0 91 98 06 lds r26, 0x0698 ; 0x800698 37e68: b0 91 99 06 lds r27, 0x0699 ; 0x800699 37e6c: 40 91 92 06 lds r20, 0x0692 ; 0x800692 37e70: 50 91 93 06 lds r21, 0x0693 ; 0x800693 37e74: 60 91 94 06 lds r22, 0x0694 ; 0x800694 37e78: 70 91 95 06 lds r23, 0x0695 ; 0x800695 37e7c: 4d 83 std Y+5, r20 ; 0x05 37e7e: 5e 83 std Y+6, r21 ; 0x06 37e80: 6f 83 std Y+7, r22 ; 0x07 37e82: 78 87 std Y+8, r23 ; 0x08 37e84: 89 83 std Y+1, r24 ; 0x01 37e86: 9a 83 std Y+2, r25 ; 0x02 37e88: ab 83 std Y+3, r26 ; 0x03 37e8a: 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); 37e8c: be 01 movw r22, r28 37e8e: 6f 5f subi r22, 0xFF ; 255 37e90: 7f 4f sbci r23, 0xFF ; 255 37e92: ce 01 movw r24, r28 37e94: 05 96 adiw r24, 0x05 ; 5 37e96: 0e 94 09 6a call 0xd412 ; 0xd412 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 37e9a: 4d 80 ldd r4, Y+5 ; 0x05 37e9c: 5e 80 ldd r5, Y+6 ; 0x06 37e9e: 6f 80 ldd r6, Y+7 ; 0x07 37ea0: 78 84 ldd r7, Y+8 ; 0x08 37ea2: 20 91 c2 0d lds r18, 0x0DC2 ; 0x800dc2 37ea6: 30 91 c3 0d lds r19, 0x0DC3 ; 0x800dc3 37eaa: 40 91 c4 0d lds r20, 0x0DC4 ; 0x800dc4 37eae: 50 91 c5 0d lds r21, 0x0DC5 ; 0x800dc5 37eb2: c3 01 movw r24, r6 37eb4: b2 01 movw r22, r4 37eb6: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37eba: 0f 94 88 e0 call 0x3c110 ; 0x3c110 37ebe: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 37ec2: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 37ec6: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 37eca: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37ece: 89 80 ldd r8, Y+1 ; 0x01 37ed0: 9a 80 ldd r9, Y+2 ; 0x02 37ed2: ab 80 ldd r10, Y+3 ; 0x03 37ed4: bc 80 ldd r11, Y+4 ; 0x04 37ed6: 20 91 c6 0d lds r18, 0x0DC6 ; 0x800dc6 37eda: 30 91 c7 0d lds r19, 0x0DC7 ; 0x800dc7 37ede: 40 91 c8 0d lds r20, 0x0DC8 ; 0x800dc8 37ee2: 50 91 c9 0d lds r21, 0x0DC9 ; 0x800dc9 37ee6: c5 01 movw r24, r10 37ee8: b4 01 movw r22, r8 37eea: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37eee: 0f 94 88 e0 call 0x3c110 ; 0x3c110 37ef2: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 37ef6: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 37efa: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 37efe: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37f02: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 37f06: 88 23 and r24, r24 37f08: 09 f4 brne .+2 ; 0x37f0c 37f0a: 8c c0 rjmp .+280 ; 0x38024 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37f0c: a5 01 movw r20, r10 37f0e: 94 01 movw r18, r8 37f10: c3 01 movw r24, r6 37f12: b2 01 movw r22, r4 37f14: 0f 94 b8 a1 call 0x34370 ; 0x34370 37f18: 9b 01 movw r18, r22 37f1a: ac 01 movw r20, r24 37f1c: c7 01 movw r24, r14 37f1e: b6 01 movw r22, r12 37f20: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 37f24: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 37f28: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 37f2c: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 37f30: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd lround(z*cs.axis_steps_per_mm[Z_AXIS]); 37f34: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__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 ? 37f38: 0f 94 88 e0 call 0x3c110 ; 0x3c110 37f3c: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 37f40: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 37f44: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 37f48: 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]); 37f4c: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 37f50: 90 91 9f 06 lds r25, 0x069F ; 0x80069f 37f54: a0 91 a0 06 lds r26, 0x06A0 ; 0x8006a0 37f58: b0 91 a1 06 lds r27, 0x06A1 ; 0x8006a1 37f5c: 89 87 std Y+9, r24 ; 0x09 37f5e: 9a 87 std Y+10, r25 ; 0x0a 37f60: ab 87 std Y+11, r26 ; 0x0b 37f62: bc 87 std Y+12, r27 ; 0x0c 37f64: 20 91 ce 0d lds r18, 0x0DCE ; 0x800dce 37f68: 30 91 cf 0d lds r19, 0x0DCF ; 0x800dcf 37f6c: 40 91 d0 0d lds r20, 0x0DD0 ; 0x800dd0 37f70: 50 91 d1 0d lds r21, 0x0DD1 ; 0x800dd1 37f74: bc 01 movw r22, r24 37f76: cd 01 movw r24, r26 37f78: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 37f7c: 0f 94 88 e0 call 0x3c110 ; 0x3c110 37f80: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 37f84: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 37f88: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 37f8c: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37f90: 40 92 cd 04 sts 0x04CD, r4 ; 0x8004cd 37f94: 50 92 ce 04 sts 0x04CE, r5 ; 0x8004ce 37f98: 60 92 cf 04 sts 0x04CF, r6 ; 0x8004cf 37f9c: 70 92 d0 04 sts 0x04D0, r7 ; 0x8004d0 position_float[Y_AXIS] = y; 37fa0: 80 92 d1 04 sts 0x04D1, r8 ; 0x8004d1 37fa4: 90 92 d2 04 sts 0x04D2, r9 ; 0x8004d2 37fa8: a0 92 d3 04 sts 0x04D3, r10 ; 0x8004d3 37fac: b0 92 d4 04 sts 0x04D4, r11 ; 0x8004d4 position_float[Z_AXIS] = z; 37fb0: c0 92 d5 04 sts 0x04D5, r12 ; 0x8004d5 37fb4: d0 92 d6 04 sts 0x04D6, r13 ; 0x8004d6 37fb8: e0 92 d7 04 sts 0x04D7, r14 ; 0x8004d7 37fbc: f0 92 d8 04 sts 0x04D8, r15 ; 0x8004d8 position_float[E_AXIS] = e; 37fc0: 89 85 ldd r24, Y+9 ; 0x09 37fc2: 9a 85 ldd r25, Y+10 ; 0x0a 37fc4: ab 85 ldd r26, Y+11 ; 0x0b 37fc6: bc 85 ldd r27, Y+12 ; 0x0c 37fc8: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 37fcc: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 37fd0: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 37fd4: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif st_set_position(position); 37fd8: 0f 94 f2 87 call 0x30fe4 ; 0x30fe4 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 37fdc: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 37fe0: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 37fe4: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 37fe8: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37fec: ed eb ldi r30, 0xBD ; 189 37fee: f4 e0 ldi r31, 0x04 ; 4 37ff0: 80 e1 ldi r24, 0x10 ; 16 37ff2: df 01 movw r26, r30 37ff4: 1d 92 st X+, r1 37ff6: 8a 95 dec r24 37ff8: e9 f7 brne .-6 ; 0x37ff4 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]); } 37ffa: 2c 96 adiw r28, 0x0c ; 12 37ffc: 0f b6 in r0, 0x3f ; 63 37ffe: f8 94 cli 38000: de bf out 0x3e, r29 ; 62 38002: 0f be out 0x3f, r0 ; 63 38004: cd bf out 0x3d, r28 ; 61 38006: df 91 pop r29 38008: cf 91 pop r28 3800a: ff 90 pop r15 3800c: ef 90 pop r14 3800e: df 90 pop r13 38010: cf 90 pop r12 38012: bf 90 pop r11 38014: af 90 pop r10 38016: 9f 90 pop r9 38018: 8f 90 pop r8 3801a: 7f 90 pop r7 3801c: 6f 90 pop r6 3801e: 5f 90 pop r5 38020: 4f 90 pop r4 38022: 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]); 38024: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 38028: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 3802c: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 38030: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 38034: c7 01 movw r24, r14 38036: b6 01 movw r22, r12 38038: 7d cf rjmp .-262 ; 0x37f34 0003803a : 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) { 3803a: 8f 92 push r8 3803c: 9f 92 push r9 3803e: af 92 push r10 38040: bf 92 push r11 38042: cf 92 push r12 38044: df 92 push r13 38046: ef 92 push r14 38048: ff 92 push r15 3804a: 0f 93 push r16 3804c: 1f 93 push r17 3804e: 4b 01 movw r8, r22 38050: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 38052: e4 e7 ldi r30, 0x74 ; 116 38054: f6 e0 ldi r31, 0x06 ; 6 38056: e0 84 ldd r14, Z+8 ; 0x08 38058: f1 84 ldd r15, Z+9 ; 0x09 3805a: 02 85 ldd r16, Z+10 ; 0x0a 3805c: 13 85 ldd r17, Z+11 ; 0x0b 3805e: 24 81 ldd r18, Z+4 ; 0x04 38060: 35 81 ldd r19, Z+5 ; 0x05 38062: 46 81 ldd r20, Z+6 ; 0x06 38064: 57 81 ldd r21, Z+7 ; 0x07 38066: 60 81 ld r22, Z 38068: 71 81 ldd r23, Z+1 ; 0x01 3806a: 82 81 ldd r24, Z+2 ; 0x02 3806c: 93 81 ldd r25, Z+3 ; 0x03 3806e: 1f 92 push r1 38070: 1f 92 push r1 38072: 1f 92 push r1 38074: 1f 92 push r1 38076: e0 e8 ldi r30, 0x80 ; 128 38078: ce 2e mov r12, r30 3807a: e6 e0 ldi r30, 0x06 ; 6 3807c: de 2e mov r13, r30 3807e: 0f 94 fb b0 call 0x361f6 ; 0x361f6 38082: 0f 90 pop r0 38084: 0f 90 pop r0 38086: 0f 90 pop r0 38088: 0f 90 pop r0 } 3808a: 1f 91 pop r17 3808c: 0f 91 pop r16 3808e: ff 90 pop r15 38090: ef 90 pop r14 38092: df 90 pop r13 38094: cf 90 pop r12 38096: bf 90 pop r11 38098: af 90 pop r10 3809a: 9f 90 pop r9 3809c: 8f 90 pop r8 3809e: 08 95 ret 000380a0 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 380a0: 8f 92 push r8 380a2: 9f 92 push r9 380a4: af 92 push r10 380a6: bf 92 push r11 380a8: cf 92 push r12 380aa: df 92 push r13 380ac: ef 92 push r14 380ae: ff 92 push r15 380b0: 0f 93 push r16 380b2: 1f 93 push r17 380b4: 4b 01 movw r8, r22 380b6: 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); 380b8: e2 e9 ldi r30, 0x92 ; 146 380ba: f6 e0 ldi r31, 0x06 ; 6 380bc: e0 84 ldd r14, Z+8 ; 0x08 380be: f1 84 ldd r15, Z+9 ; 0x09 380c0: 02 85 ldd r16, Z+10 ; 0x0a 380c2: 13 85 ldd r17, Z+11 ; 0x0b 380c4: 24 81 ldd r18, Z+4 ; 0x04 380c6: 35 81 ldd r19, Z+5 ; 0x05 380c8: 46 81 ldd r20, Z+6 ; 0x06 380ca: 57 81 ldd r21, Z+7 ; 0x07 380cc: 60 81 ld r22, Z 380ce: 71 81 ldd r23, Z+1 ; 0x01 380d0: 82 81 ldd r24, Z+2 ; 0x02 380d2: 93 81 ldd r25, Z+3 ; 0x03 380d4: 1f 92 push r1 380d6: 1f 92 push r1 380d8: 1f 92 push r1 380da: 1f 92 push r1 380dc: ee e9 ldi r30, 0x9E ; 158 380de: ce 2e mov r12, r30 380e0: e6 e0 ldi r30, 0x06 ; 6 380e2: de 2e mov r13, r30 380e4: 0f 94 fb b0 call 0x361f6 ; 0x361f6 380e8: 0f 90 pop r0 380ea: 0f 90 pop r0 380ec: 0f 90 pop r0 380ee: 0f 90 pop r0 } 380f0: 1f 91 pop r17 380f2: 0f 91 pop r16 380f4: ff 90 pop r15 380f6: ef 90 pop r14 380f8: df 90 pop r13 380fa: cf 90 pop r12 380fc: bf 90 pop r11 380fe: af 90 pop r10 38100: 9f 90 pop r9 38102: 8f 90 pop r8 38104: 08 95 ret 00038106 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 38106: 4f 92 push r4 38108: 5f 92 push r5 3810a: 6f 92 push r6 3810c: 7f 92 push r7 3810e: 8f 92 push r8 38110: 9f 92 push r9 38112: af 92 push r10 38114: bf 92 push r11 38116: cf 92 push r12 38118: df 92 push r13 3811a: ef 92 push r14 3811c: ff 92 push r15 3811e: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 38120: 80 e0 ldi r24, 0x00 ; 0 38122: 0f 94 cd 42 call 0x2859a ; 0x2859a 38126: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 3812a: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 3812e: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 38132: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 position[Y_AXIS] = st_get_position(Y_AXIS); 38136: 81 e0 ldi r24, 0x01 ; 1 38138: 0f 94 cd 42 call 0x2859a ; 0x2859a 3813c: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 38140: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 38144: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 38148: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa position[Z_AXIS] = st_get_position(Z_AXIS); 3814c: 82 e0 ldi r24, 0x02 ; 2 3814e: 0f 94 cd 42 call 0x2859a ; 0x2859a 38152: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 38156: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 3815a: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 3815e: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae position[E_AXIS] = st_get_position(E_AXIS); 38162: 83 e0 ldi r24, 0x03 ; 3 38164: 0f 94 cd 42 call 0x2859a ; 0x2859a 38168: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 3816c: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 38170: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 38174: 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); 38178: 80 e0 ldi r24, 0x00 ; 0 3817a: 0f 94 db 42 call 0x285b6 ; 0x285b6 3817e: 60 93 92 06 sts 0x0692, r22 ; 0x800692 38182: 70 93 93 06 sts 0x0693, r23 ; 0x800693 38186: 80 93 94 06 sts 0x0694, r24 ; 0x800694 3818a: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 3818e: 81 e0 ldi r24, 0x01 ; 1 38190: 0f 94 db 42 call 0x285b6 ; 0x285b6 38194: 60 93 96 06 sts 0x0696, r22 ; 0x800696 38198: 70 93 97 06 sts 0x0697, r23 ; 0x800697 3819c: 80 93 98 06 sts 0x0698, r24 ; 0x800698 381a0: 90 93 99 06 sts 0x0699, r25 ; 0x800699 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 381a4: 82 e0 ldi r24, 0x02 ; 2 381a6: 0f 94 db 42 call 0x285b6 ; 0x285b6 381aa: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 381ae: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 381b2: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 381b6: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d current_position[E_AXIS] = st_get_position_mm(E_AXIS); 381ba: 83 e0 ldi r24, 0x03 ; 3 381bc: 0f 94 db 42 call 0x285b6 ; 0x285b6 381c0: 60 93 9e 06 sts 0x069E, r22 ; 0x80069e 381c4: 70 93 9f 06 sts 0x069F, r23 ; 0x80069f 381c8: 80 93 a0 06 sts 0x06A0, r24 ; 0x8006a0 381cc: 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) { 381d0: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 381d4: 88 23 and r24, r24 381d6: 31 f1 breq .+76 ; 0x38224 #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]); 381d8: 20 91 96 06 lds r18, 0x0696 ; 0x800696 381dc: 30 91 97 06 lds r19, 0x0697 ; 0x800697 381e0: 40 91 98 06 lds r20, 0x0698 ; 0x800698 381e4: 50 91 99 06 lds r21, 0x0699 ; 0x800699 381e8: 60 91 92 06 lds r22, 0x0692 ; 0x800692 381ec: 70 91 93 06 lds r23, 0x0693 ; 0x800693 381f0: 80 91 94 06 lds r24, 0x0694 ; 0x800694 381f4: 90 91 95 06 lds r25, 0x0695 ; 0x800695 381f8: 0f 94 b8 a1 call 0x34370 ; 0x34370 381fc: 9b 01 movw r18, r22 381fe: ac 01 movw r20, r24 38200: 60 91 9a 06 lds r22, 0x069A ; 0x80069a 38204: 70 91 9b 06 lds r23, 0x069B ; 0x80069b 38208: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 3820c: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 38210: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 38214: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 38218: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 3821c: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 38220: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 38224: c0 91 0f 18 lds r28, 0x180F ; 0x80180f 38228: cc 23 and r28, r28 3822a: 09 f4 brne .+2 ; 0x3822e 3822c: 9a c0 rjmp .+308 ; 0x38362 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 3822e: c0 ff sbrs r28, 0 38230: 34 c0 rjmp .+104 ; 0x3829a // Then add the offset. x -= world2machine_shift[0]; 38232: 20 91 07 18 lds r18, 0x1807 ; 0x801807 38236: 30 91 08 18 lds r19, 0x1808 ; 0x801808 3823a: 40 91 09 18 lds r20, 0x1809 ; 0x801809 3823e: 50 91 0a 18 lds r21, 0x180A ; 0x80180a 38242: 60 91 92 06 lds r22, 0x0692 ; 0x800692 38246: 70 91 93 06 lds r23, 0x0693 ; 0x800693 3824a: 80 91 94 06 lds r24, 0x0694 ; 0x800694 3824e: 90 91 95 06 lds r25, 0x0695 ; 0x800695 38252: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 38256: 60 93 92 06 sts 0x0692, r22 ; 0x800692 3825a: 70 93 93 06 sts 0x0693, r23 ; 0x800693 3825e: 80 93 94 06 sts 0x0694, r24 ; 0x800694 38262: 90 93 95 06 sts 0x0695, r25 ; 0x800695 y -= world2machine_shift[1]; 38266: 20 91 0b 18 lds r18, 0x180B ; 0x80180b 3826a: 30 91 0c 18 lds r19, 0x180C ; 0x80180c 3826e: 40 91 0d 18 lds r20, 0x180D ; 0x80180d 38272: 50 91 0e 18 lds r21, 0x180E ; 0x80180e 38276: 60 91 96 06 lds r22, 0x0696 ; 0x800696 3827a: 70 91 97 06 lds r23, 0x0697 ; 0x800697 3827e: 80 91 98 06 lds r24, 0x0698 ; 0x800698 38282: 90 91 99 06 lds r25, 0x0699 ; 0x800699 38286: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3828a: 60 93 96 06 sts 0x0696, r22 ; 0x800696 3828e: 70 93 97 06 sts 0x0697, r23 ; 0x800697 38292: 80 93 98 06 sts 0x0698, r24 ; 0x800698 38296: 90 93 99 06 sts 0x0699, r25 ; 0x800699 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 3829a: c1 ff sbrs r28, 1 3829c: 62 c0 rjmp .+196 ; 0x38362 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 3829e: 80 90 92 06 lds r8, 0x0692 ; 0x800692 382a2: 90 90 93 06 lds r9, 0x0693 ; 0x800693 382a6: a0 90 94 06 lds r10, 0x0694 ; 0x800694 382aa: b0 90 95 06 lds r11, 0x0695 ; 0x800695 382ae: c0 90 96 06 lds r12, 0x0696 ; 0x800696 382b2: d0 90 97 06 lds r13, 0x0697 ; 0x800697 382b6: e0 90 98 06 lds r14, 0x0698 ; 0x800698 382ba: 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; 382be: 20 91 ff 17 lds r18, 0x17FF ; 0x8017ff 382c2: 30 91 00 18 lds r19, 0x1800 ; 0x801800 382c6: 40 91 01 18 lds r20, 0x1801 ; 0x801801 382ca: 50 91 02 18 lds r21, 0x1802 ; 0x801802 382ce: c5 01 movw r24, r10 382d0: b4 01 movw r22, r8 382d2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 382d6: 2b 01 movw r4, r22 382d8: 3c 01 movw r6, r24 382da: 20 91 03 18 lds r18, 0x1803 ; 0x801803 382de: 30 91 04 18 lds r19, 0x1804 ; 0x801804 382e2: 40 91 05 18 lds r20, 0x1805 ; 0x801805 382e6: 50 91 06 18 lds r21, 0x1806 ; 0x801806 382ea: c7 01 movw r24, r14 382ec: b6 01 movw r22, r12 382ee: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 382f2: 9b 01 movw r18, r22 382f4: ac 01 movw r20, r24 382f6: c3 01 movw r24, r6 382f8: b2 01 movw r22, r4 382fa: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 382fe: 2b 01 movw r4, r22 38300: 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; 38302: 20 91 f7 17 lds r18, 0x17F7 ; 0x8017f7 38306: 30 91 f8 17 lds r19, 0x17F8 ; 0x8017f8 3830a: 40 91 f9 17 lds r20, 0x17F9 ; 0x8017f9 3830e: 50 91 fa 17 lds r21, 0x17FA ; 0x8017fa 38312: c5 01 movw r24, r10 38314: b4 01 movw r22, r8 38316: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3831a: 4b 01 movw r8, r22 3831c: 5c 01 movw r10, r24 3831e: 20 91 fb 17 lds r18, 0x17FB ; 0x8017fb 38322: 30 91 fc 17 lds r19, 0x17FC ; 0x8017fc 38326: 40 91 fd 17 lds r20, 0x17FD ; 0x8017fd 3832a: 50 91 fe 17 lds r21, 0x17FE ; 0x8017fe 3832e: c7 01 movw r24, r14 38330: b6 01 movw r22, r12 38332: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 38336: 9b 01 movw r18, r22 38338: ac 01 movw r20, r24 3833a: c5 01 movw r24, r10 3833c: b4 01 movw r22, r8 3833e: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 38342: 60 93 92 06 sts 0x0692, r22 ; 0x800692 38346: 70 93 93 06 sts 0x0693, r23 ; 0x800693 3834a: 80 93 94 06 sts 0x0694, r24 ; 0x800694 3834e: 90 93 95 06 sts 0x0695, r25 ; 0x800695 y = out_y; 38352: 40 92 96 06 sts 0x0696, r4 ; 0x800696 38356: 50 92 97 06 sts 0x0697, r5 ; 0x800697 3835a: 60 92 98 06 sts 0x0698, r6 ; 0x800698 3835e: 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(); 38362: 0e 94 41 68 call 0xd082 ; 0xd082 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 38366: 80 e1 ldi r24, 0x10 ; 16 38368: e2 e9 ldi r30, 0x92 ; 146 3836a: f6 e0 ldi r31, 0x06 ; 6 3836c: ad ec ldi r26, 0xCD ; 205 3836e: b4 e0 ldi r27, 0x04 ; 4 38370: 01 90 ld r0, Z+ 38372: 0d 92 st X+, r0 38374: 8a 95 dec r24 38376: e1 f7 brne .-8 ; 0x38370 #endif } 38378: cf 91 pop r28 3837a: ff 90 pop r15 3837c: ef 90 pop r14 3837e: df 90 pop r13 38380: cf 90 pop r12 38382: bf 90 pop r11 38384: af 90 pop r10 38386: 9f 90 pop r9 38388: 8f 90 pop r8 3838a: 7f 90 pop r7 3838c: 6f 90 pop r6 3838e: 5f 90 pop r5 38390: 4f 90 pop r4 38392: 08 95 ret 00038394 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 38394: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 38398: 8d 7f andi r24, 0xFD ; 253 3839a: 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(); 3839e: 0f 94 83 c0 call 0x38106 ; 0x38106 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 383a2: 81 e0 ldi r24, 0x01 ; 1 383a4: 80 93 ac 0d sts 0x0DAC, r24 ; 0x800dac } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 383a8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 383ac: 8d 7f andi r24, 0xFD ; 253 383ae: 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); 383b2: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 383b6: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 while (blocks_queued()) plan_discard_current_block(); 383ba: 98 17 cp r25, r24 383bc: 69 f0 breq .+26 ; 0x383d8 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) { 383be: 90 91 a5 0d lds r25, 0x0DA5 ; 0x800da5 383c2: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 383c6: 98 17 cp r25, r24 383c8: a1 f3 breq .-24 ; 0x383b2 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 383ca: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 383ce: 8f 5f subi r24, 0xFF ; 255 383d0: 8f 70 andi r24, 0x0F ; 15 383d2: 80 93 a6 0d sts 0x0DA6, r24 ; 0x800da6 383d6: ed cf rjmp .-38 ; 0x383b2 current_block = NULL; 383d8: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 383dc: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 383e0: 8f ef ldi r24, 0xFF ; 255 383e2: 9f ef ldi r25, 0xFF ; 255 383e4: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.477+0x1> 383e8: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.477> current_adv_steps = 0; 383ec: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.479+0x1> 383f0: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.479> #endif st_reset_timer(); 383f4: 0f 94 49 43 call 0x28692 ; 0x28692 ENABLE_STEPPER_DRIVER_INTERRUPT(); 383f8: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 383fc: 82 60 ori r24, 0x02 ; 2 383fe: 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; 38402: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.488> 38406: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.488+0x1> 3840a: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.488+0x2> 3840e: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.488+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 38412: ed eb ldi r30, 0xBD ; 189 38414: f4 e0 ldi r31, 0x04 ; 4 38416: 80 e1 ldi r24, 0x10 ; 16 38418: df 01 movw r26, r30 3841a: 1d 92 st X+, r1 3841c: 8a 95 dec r24 3841e: e9 f7 brne .-6 ; 0x3841a // Reset position sync requests plan_reset_next_e_queue = false; 38420: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.486> plan_reset_next_e_sched = false; 38424: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.487> } 38428: 08 95 ret 0003842a : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 3842a: cf 93 push r28 3842c: c6 2f mov r28, r22 } uint8_t twi_w8(uint8_t address, uint8_t reg, uint8_t data) { if(twi_start(address, reg)) 3842e: 0f 94 ca 7a call 0x2f594 ; 0x2f594 38432: 81 11 cpse r24, r1 38434: 0f c0 rjmp .+30 ; 0x38454 return 1; // send data TWDR = data; 38436: c0 93 bb 00 sts 0x00BB, r28 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 3843a: 84 e8 ldi r24, 0x84 ; 132 3843c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 38440: 88 e2 ldi r24, 0x28 ; 40 38442: 0f 94 c0 29 call 0x25380 ; 0x25380 38446: 81 11 cpse r24, r1 38448: 05 c0 rjmp .+10 ; 0x38454 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 3844a: 84 e9 ldi r24, 0x94 ; 148 3844c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return; } 38450: cf 91 pop r28 38452: 08 95 ret goto error; #endif return; error: pat9125_PID1 = 0xff; 38454: 8f ef ldi r24, 0xFF ; 255 38456: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = 0xff; 3845a: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc 3845e: f8 cf rjmp .-16 ; 0x38450 00038460 : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 38460: cf 93 push r28 } uint8_t twi_r8(uint8_t address, uint8_t reg, uint8_t* data) { if(twi_start(address, reg)) 38462: 0f 94 ca 7a call 0x2f594 ; 0x2f594 38466: 81 11 cpse r24, r1 38468: 21 c0 rjmp .+66 ; 0x384ac return 1; // repeat start TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 3846a: 84 ea ldi r24, 0xA4 ; 164 3846c: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_REP_START)) 38470: 80 e1 ldi r24, 0x10 ; 16 38472: 0f 94 c0 29 call 0x25380 ; 0x25380 38476: 81 11 cpse r24, r1 38478: 19 c0 rjmp .+50 ; 0x384ac return 2; // start receiving TWDR = TW_READ | (address << 1); 3847a: 8b ee ldi r24, 0xEB ; 235 3847c: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 38480: c4 e8 ldi r28, 0x84 ; 132 38482: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_SLA_ACK)) 38486: 80 e4 ldi r24, 0x40 ; 64 38488: 0f 94 c0 29 call 0x25380 ; 0x25380 3848c: 81 11 cpse r24, r1 3848e: 0e c0 rjmp .+28 ; 0x384ac return 3; // receive data TWCR = _BV(TWEN) | _BV(TWINT); 38490: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_DATA_NACK)) 38494: 88 e5 ldi r24, 0x58 ; 88 38496: 0f 94 c0 29 call 0x25380 ; 0x25380 3849a: 81 11 cpse r24, r1 3849c: 07 c0 rjmp .+14 ; 0x384ac return 4; *data = TWDR; 3849e: 80 91 bb 00 lds r24, 0x00BB ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 384a2: 94 e9 ldi r25, 0x94 ; 148 384a4: 90 93 bc 00 sts 0x00BC, r25 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return 0; } 384a8: cf 91 pop r28 384aa: 08 95 ret goto error; #endif return data; error: pat9125_PID1 = 0xff; 384ac: 8f ef ldi r24, 0xFF ; 255 384ae: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd pat9125_PID2 = 0xff; 384b2: 80 93 bc 0d sts 0x0DBC, r24 ; 0x800dbc return 0; 384b6: 80 e0 ldi r24, 0x00 ; 0 384b8: f7 cf rjmp .-18 ; 0x384a8 000384ba : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 384ba: 0f 93 push r16 384bc: 1f 93 push r17 384be: cf 93 push r28 384c0: df 93 push r29 384c2: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 384c4: f8 01 movw r30, r16 384c6: d4 91 lpm r29, Z if (addr == 0xff) 384c8: df 3f cpi r29, 0xFF ; 255 384ca: 99 f0 breq .+38 ; 0x384f2 break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 384cc: 31 96 adiw r30, 0x01 ; 1 384ce: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 384d0: 6c 2f mov r22, r28 384d2: 8d 2f mov r24, r29 384d4: 0f 94 15 c2 call 0x3842a ; 0x3842a return pat9125_rd_reg(addr) == data; 384d8: 8d 2f mov r24, r29 384da: 0f 94 30 c2 call 0x38460 ; 0x38460 { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 384de: 0e 5f subi r16, 0xFE ; 254 384e0: 1f 4f sbci r17, 0xFF ; 255 384e2: c8 17 cp r28, r24 384e4: 79 f3 breq .-34 ; 0x384c4 // Verification of the register write failed. return 0; 384e6: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 384e8: df 91 pop r29 384ea: cf 91 pop r28 384ec: 1f 91 pop r17 384ee: 0f 91 pop r16 384f0: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 384f2: 81 e0 ldi r24, 0x01 ; 1 384f4: f9 cf rjmp .-14 ; 0x384e8 000384f6 : return 1; } uint8_t pat9125_update(void) { 384f6: cf 93 push r28 384f8: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 384fa: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 384fe: 81 33 cpi r24, 0x31 ; 49 38500: 21 f0 breq .+8 ; 0x3850a pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 38502: 80 e0 ldi r24, 0x00 ; 0 } 38504: df 91 pop r29 38506: cf 91 pop r28 38508: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 3850a: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 3850e: 81 39 cpi r24, 0x91 ; 145 38510: c1 f7 brne .-16 ; 0x38502 { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 38512: 82 e0 ldi r24, 0x02 ; 2 38514: 0f 94 30 c2 call 0x38460 ; 0x38460 38518: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 3851a: 87 e1 ldi r24, 0x17 ; 23 3851c: 0f 94 30 c2 call 0x38460 ; 0x38460 38520: 80 93 ba 0d sts 0x0DBA, r24 ; 0x800dba pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 38524: 84 e1 ldi r24, 0x14 ; 20 38526: 0f 94 30 c2 call 0x38460 ; 0x38460 3852a: 80 93 bb 0d sts 0x0DBB, r24 ; 0x800dbb if (pat9125_PID1 == 0xff) return 0; 3852e: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 38532: 8f 3f cpi r24, 0xFF ; 255 38534: 31 f3 breq .-52 ; 0x38502 if (ucMotion & 0x80) 38536: c7 ff sbrs r28, 7 38538: 36 c0 rjmp .+108 ; 0x385a6 { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 3853a: 83 e0 ldi r24, 0x03 ; 3 3853c: 0f 94 30 c2 call 0x38460 ; 0x38460 38540: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 38542: 84 e0 ldi r24, 0x04 ; 4 38544: 0f 94 30 c2 call 0x38460 ; 0x38460 38548: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 3854a: 82 e1 ldi r24, 0x12 ; 18 3854c: 0f 94 30 c2 call 0x38460 ; 0x38460 if (pat9125_PID1 == 0xff) return 0; 38550: 90 91 bd 0d lds r25, 0x0DBD ; 0x800dbd 38554: 9f 3f cpi r25, 0xFF ; 255 38556: a9 f2 breq .-86 ; 0x38502 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); 38558: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 3855a: 9c 01 movw r18, r24 3855c: 44 e0 ldi r20, 0x04 ; 4 3855e: 22 0f add r18, r18 38560: 33 1f adc r19, r19 38562: 4a 95 dec r20 38564: e1 f7 brne .-8 ; 0x3855e 38566: 22 27 eor r18, r18 38568: 3f 70 andi r19, 0x0F ; 15 3856a: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 3856c: 98 2f mov r25, r24 3856e: 88 27 eor r24, r24 38570: 88 27 eor r24, r24 38572: 9f 70 andi r25, 0x0F ; 15 38574: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 38576: 33 fd sbrc r19, 3 38578: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 3857a: 93 fd sbrc r25, 3 3857c: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 3857e: 40 91 97 03 lds r20, 0x0397 ; 0x800397 38582: 50 91 98 03 lds r21, 0x0398 ; 0x800398 38586: 24 0f add r18, r20 38588: 35 1f adc r19, r21 3858a: 30 93 98 03 sts 0x0398, r19 ; 0x800398 3858e: 20 93 97 03 sts 0x0397, r18 ; 0x800397 pat9125_y += iDY; 38592: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 38596: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 3859a: 82 0f add r24, r18 3859c: 93 1f adc r25, r19 3859e: 90 93 90 0e sts 0x0E90, r25 ; 0x800e90 385a2: 80 93 8f 0e sts 0x0E8F, r24 ; 0x800e8f } return 1; 385a6: 81 e0 ldi r24, 0x01 ; 1 385a8: ad cf rjmp .-166 ; 0x38504 000385aa : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 385aa: 84 b1 in r24, 0x04 ; 4 385ac: 81 7f andi r24, 0xF1 ; 241 385ae: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 385b0: 84 b1 in r24, 0x04 ; 4 385b2: 87 60 ori r24, 0x07 ; 7 385b4: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 385b6: 85 b1 in r24, 0x05 ; 5 385b8: 81 7f andi r24, 0xF1 ; 241 385ba: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 385bc: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 385be: 80 e5 ldi r24, 0x50 ; 80 385c0: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 385c2: 1d bc out 0x2d, r1 ; 45 } 385c4: 08 95 ret 000385c6 : //! @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() { 385c6: 2f 92 push r2 385c8: 3f 92 push r3 385ca: 4f 92 push r4 385cc: 5f 92 push r5 385ce: 6f 92 push r6 385d0: 7f 92 push r7 385d2: 8f 92 push r8 385d4: 9f 92 push r9 385d6: af 92 push r10 385d8: bf 92 push r11 385da: cf 92 push r12 385dc: df 92 push r13 385de: ef 92 push r14 385e0: ff 92 push r15 385e2: 0f 93 push r16 385e4: 1f 93 push r17 385e6: cf 93 push r28 385e8: df 93 push r29 385ea: cd b7 in r28, 0x3d ; 61 385ec: de b7 in r29, 0x3e ; 62 385ee: c6 50 subi r28, 0x06 ; 6 385f0: d1 40 sbci r29, 0x01 ; 1 385f2: 0f b6 in r0, 0x3f ; 63 385f4: f8 94 cli 385f6: de bf out 0x3e, r29 ; 62 385f8: 0f be out 0x3f, r0 ; 63 385fa: 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; 385fc: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7dc> 38600: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7dd> 38604: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7de> 38608: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7df> 3860c: 8a 3a cpi r24, 0xAA ; 170 3860e: 95 45 sbci r25, 0x55 ; 85 38610: aa 4a sbci r26, 0xAA ; 170 38612: b5 45 sbci r27, 0x55 ; 85 38614: 21 f4 brne .+8 ; 0x3861e 38616: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7db> 3861a: 87 fd sbrc r24, 7 3861c: c2 c1 rjmp .+900 ; 0x389a2 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(); 3861e: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38620: d0 90 39 05 lds r13, 0x0539 ; 0x800539 // Flush the serial line. while (RECV_READY) { 38624: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 38628: 87 ff sbrs r24, 7 3862a: 04 c0 rjmp .+8 ; 0x38634 wdt_reset(); 3862c: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 3862e: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38632: f8 cf rjmp .-16 ; 0x38624 } selectedSerialPort = 0; //switch to Serial0 38634: 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; 38638: 00 91 9b 04 lds r16, 0x049B ; 0x80049b 3863c: 10 91 9c 04 lds r17, 0x049C ; 0x80049c 38640: 10 93 9a 04 sts 0x049A, r17 ; 0x80049a 38644: 00 93 99 04 sts 0x0499, r16 ; 0x800499 38648: 5f e6 ldi r21, 0x6F ; 111 3864a: e5 2e mov r14, r21 3864c: 5d ea ldi r21, 0xAD ; 173 3864e: f5 2e mov r15, r21 38650: 65 e7 ldi r22, 0x75 ; 117 38652: a6 2e mov r10, r22 38654: 6d ea ldi r22, 0xAD ; 173 38656: 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 ++)); 38658: f7 01 movw r30, r14 3865a: 84 91 lpm r24, Z 3865c: 0f 94 3f ae call 0x35c7e ; 0x35c7e 38660: ff ef ldi r31, 0xFF ; 255 38662: ef 1a sub r14, r31 38664: 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) 38666: ae 14 cp r10, r14 38668: bf 04 cpc r11, r15 3866a: b1 f7 brne .-20 ; 0x38658 putch(pgm_read_byte(ptr ++)); wdt_reset(); 3866c: a8 95 wdr 3866e: 8f e0 ldi r24, 0x0F ; 15 38670: 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) 38672: 2e e6 ldi r18, 0x6E ; 110 38674: 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(); 38676: 40 e8 ldi r20, 0x80 ; 128 38678: 54 e8 ldi r21, 0x84 ; 132 3867a: 6e e1 ldi r22, 0x1E ; 30 3867c: 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) { 3867e: e0 91 99 04 lds r30, 0x0499 ; 0x800499 38682: f0 91 9a 04 lds r31, 0x049A ; 0x80049a 38686: e0 17 cp r30, r16 38688: f1 07 cpc r31, r17 3868a: 19 f5 brne .+70 ; 0x386d2 wdt_reset(); 3868c: a8 95 wdr 3868e: 41 50 subi r20, 0x01 ; 1 38690: 51 09 sbc r21, r1 38692: 61 09 sbc r22, r1 38694: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 38696: 99 f7 brne .-26 ; 0x3867e 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 38698: d0 92 39 05 sts 0x0539, r13 ; 0x800539 return 0; 3869c: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 3869e: ca 5f subi r28, 0xFA ; 250 386a0: de 4f sbci r29, 0xFE ; 254 386a2: 0f b6 in r0, 0x3f ; 63 386a4: f8 94 cli 386a6: de bf out 0x3e, r29 ; 62 386a8: 0f be out 0x3f, r0 ; 63 386aa: cd bf out 0x3d, r28 ; 61 386ac: df 91 pop r29 386ae: cf 91 pop r28 386b0: 1f 91 pop r17 386b2: 0f 91 pop r16 386b4: ff 90 pop r15 386b6: ef 90 pop r14 386b8: df 90 pop r13 386ba: cf 90 pop r12 386bc: bf 90 pop r11 386be: af 90 pop r10 386c0: 9f 90 pop r9 386c2: 8f 90 pop r8 386c4: 7f 90 pop r7 386c6: 6f 90 pop r6 386c8: 5f 90 pop r5 386ca: 4f 90 pop r4 386cc: 3f 90 pop r3 386ce: 2f 90 pop r2 386d0: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 386d2: f8 01 movw r30, r16 386d4: e7 5e subi r30, 0xE7 ; 231 386d6: fb 4f sbci r31, 0xFB ; 251 386d8: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 386da: 0f 5f subi r16, 0xFF ; 255 386dc: 1f 4f sbci r17, 0xFF ; 255 386de: 0f 77 andi r16, 0x7F ; 127 386e0: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 386e2: f9 01 movw r30, r18 386e4: e8 1b sub r30, r24 386e6: f9 0b sbc r31, r25 386e8: e4 91 lpm r30, Z 386ea: 4e 13 cpse r20, r30 386ec: d5 cf rjmp .-86 ; 0x38698 { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 386ee: a8 95 wdr 386f0: 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) { 386f2: 09 f0 breq .+2 ; 0x386f6 386f4: c0 cf rjmp .-128 ; 0x38676 selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 386f6: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 386fa: 8f 77 andi r24, 0x7F ; 127 386fc: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 38700: 01 e5 ldi r16, 0x51 ; 81 38702: 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 ++)); 38704: f8 01 movw r30, r16 38706: 84 91 lpm r24, Z 38708: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3870c: 0f 5f subi r16, 0xFF ; 255 3870e: 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) 38710: fd ea ldi r31, 0xAD ; 173 38712: 0e 35 cpi r16, 0x5E ; 94 38714: 1f 07 cpc r17, r31 38716: b1 f7 brne .-20 ; 0x38704 putch(pgm_read_byte(ptr ++)); } spi_init(); 38718: 0f 94 d5 c2 call 0x385aa ; 0x385aa xflash_init(); 3871c: 0e 94 1e ee call 0x1dc3c ; 0x1dc3c "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" ); 38720: 0f b6 in r0, 0x3f ; 63 38722: f8 94 cli 38724: a8 95 wdr 38726: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3872a: 88 61 ori r24, 0x18 ; 24 3872c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38730: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38734: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 38736: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 3873a: 4b e2 ldi r20, 0x2B ; 43 3873c: 5d ea ldi r21, 0xAD ; 173 3873e: 61 e0 ldi r22, 0x01 ; 1 38740: 80 e0 ldi r24, 0x00 ; 0 38742: 0e 94 fb 6e call 0xddf6 ; 0xddf6 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 38746: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7dc> 3874a: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7dd> 3874e: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7de> 38752: 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; 38756: cb 5f subi r28, 0xFB ; 251 38758: de 4f sbci r29, 0xFE ; 254 3875a: 18 82 st Y, r1 3875c: c5 50 subi r28, 0x05 ; 5 3875e: 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; 38760: 10 e0 ldi r17, 0x00 ; 0 38762: 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; 38764: 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); 38766: ae 01 movw r20, r28 38768: 4f 5f subi r20, 0xFF ; 255 3876a: 5f 4f sbci r21, 0xFF ; 255 3876c: 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(); 3876e: 0f 94 46 ae call 0x35c8c ; 0x35c8c if(ch == STK_GET_PARAMETER) { 38772: 81 34 cpi r24, 0x41 ; 65 38774: a9 f4 brne .+42 ; 0x387a0 unsigned char which = getch(); 38776: 0f 94 46 ae call 0x35c8c ; 0x35c8c 3877a: e8 2e mov r14, r24 verifySpace(); 3877c: 0f 94 be b0 call 0x3617c ; 0x3617c /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 38780: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 38782: 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) { 38784: e5 16 cp r14, r21 38786: 21 f0 breq .+8 ; 0x38790 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 38788: 81 e8 ldi r24, 0x81 ; 129 3878a: e8 12 cpse r14, r24 3878c: 07 c0 rjmp .+14 ; 0x3879c putch(optiboot_version >> 8); 3878e: 86 e0 ldi r24, 0x06 ; 6 38790: 0f 94 3f ae call 0x35c7e ; 0x35c7e } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 38794: 80 e1 ldi r24, 0x10 ; 16 38796: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3879a: e9 cf rjmp .-46 ; 0x3876e } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 3879c: 83 e0 ldi r24, 0x03 ; 3 3879e: f8 cf rjmp .-16 ; 0x38790 } } else if(ch == STK_SET_DEVICE) { 387a0: 82 34 cpi r24, 0x42 ; 66 387a2: 21 f4 brne .+8 ; 0x387ac // SET DEVICE is ignored getNch(20); 387a4: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 387a6: 0f 94 ca b0 call 0x36194 ; 0x36194 387aa: f4 cf rjmp .-24 ; 0x38794 } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 387ac: 85 34 cpi r24, 0x45 ; 69 387ae: 11 f4 brne .+4 ; 0x387b4 // SET DEVICE EXT is ignored getNch(5); 387b0: 85 e0 ldi r24, 0x05 ; 5 387b2: f9 cf rjmp .-14 ; 0x387a6 } else if(ch == STK_LOAD_ADDRESS) { 387b4: 85 35 cpi r24, 0x55 ; 85 387b6: c9 f4 brne .+50 ; 0x387ea // 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(); 387b8: 0f 94 46 ae call 0x35c8c ; 0x35c8c 387bc: 08 2f mov r16, r24 newAddress |= getch(); 387be: 0f 94 46 ae call 0x35c8c ; 0x35c8c 387c2: 08 2b or r16, r24 387c4: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 387c6: 0f 94 46 ae call 0x35c8c ; 0x35c8c 387ca: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 387cc: 0f 94 46 ae call 0x35c8c ; 0x35c8c 387d0: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 387d2: 17 ff sbrs r17, 7 387d4: 07 c0 rjmp .+14 ; 0x387e4 rampz |= 0x01; 387d6: 68 94 set 387d8: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 387da: 00 0f add r16, r16 387dc: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 387de: 0f 94 be b0 call 0x3617c ; 0x3617c 387e2: d8 cf rjmp .-80 ; 0x38794 newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 387e4: e8 94 clt 387e6: f0 f8 bld r15, 0 387e8: f8 cf rjmp .-16 ; 0x387da newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 387ea: 86 35 cpi r24, 0x56 ; 86 387ec: a1 f4 brne .+40 ; 0x38816 // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 387ee: 0f 94 46 ae call 0x35c8c ; 0x35c8c 387f2: 8d 34 cpi r24, 0x4D ; 77 387f4: 71 f4 brne .+28 ; 0x38812 // get address getch(); // get '0' 387f6: 0f 94 46 ae call 0x35c8c ; 0x35c8c rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 387fa: 0f 94 46 ae call 0x35c8c ; 0x35c8c 387fe: 9f 2d mov r25, r15 38800: 91 70 andi r25, 0x01 ; 1 38802: f9 2e mov r15, r25 38804: 88 0f add r24, r24 38806: f8 2a or r15, r24 getNch(1); // get last '0' 38808: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 3880a: 0f 94 ca b0 call 0x36194 ; 0x36194 putch(0x00); 3880e: 80 e0 ldi r24, 0x00 ; 0 38810: bf cf rjmp .-130 ; 0x38790 // response putch(0x00); } else { // everything else is ignored getNch(3); 38812: 83 e0 ldi r24, 0x03 ; 3 38814: fa cf rjmp .-12 ; 0x3880a putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 38816: 84 36 cpi r24, 0x64 ; 100 38818: 09 f0 breq .+2 ; 0x3881c 3881a: 77 c0 rjmp .+238 ; 0x3890a 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; 3881c: 0f 94 46 ae call 0x35c8c ; 0x35c8c 38820: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38822: 0f 94 46 ae call 0x35c8c ; 0x35c8c 38826: c8 2e mov r12, r24 length |= getch(); 38828: 0f 94 46 ae call 0x35c8c ; 0x35c8c 3882c: e8 2e mov r14, r24 length |= getch(); 3882e: 0f 94 46 ae call 0x35c8c ; 0x35c8c 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; 38832: d1 2c mov r13, r1 38834: dc 2c mov r13, r12 38836: cc 24 eor r12, r12 38838: db 28 or r13, r11 length |= getch(); length |= getch(); 3883a: 8e 29 or r24, r14 3883c: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 3883e: 0f 94 46 ae call 0x35c8c ; 0x35c8c 38842: 58 2e mov r5, r24 38844: fe 01 movw r30, r28 38846: 31 96 adiw r30, 0x01 ; 1 38848: 5f 01 movw r10, r30 3884a: 46 01 movw r8, r12 3884c: 8e 0e add r8, r30 3884e: 9f 1e adc r9, r31 38850: ee 2e mov r14, r30 38852: ca 5f subi r28, 0xFA ; 250 38854: de 4f sbci r29, 0xFE ; 254 38856: b8 82 st Y, r11 38858: c6 50 subi r28, 0x06 ; 6 3885a: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 3885c: 0f 94 46 ae call 0x35c8c ; 0x35c8c 38860: f5 01 movw r30, r10 38862: 81 93 st Z+, r24 38864: 5f 01 movw r10, r30 while (--length); 38866: 8e 16 cp r8, r30 38868: 9f 06 cpc r9, r31 3886a: c1 f7 brne .-16 ; 0x3885c // Read command terminator, start reply verifySpace(); 3886c: 0f 94 be b0 call 0x3617c ; 0x3617c if (desttype == 'E') { 38870: f5 e4 ldi r31, 0x45 ; 69 38872: 5f 12 cpse r5, r31 38874: 01 c0 rjmp .+2 ; 0x38878 38876: ff cf rjmp .-2 ; 0x38876 while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 38878: 18 01 movw r2, r16 3887a: 51 2c mov r5, r1 3887c: 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) { 3887e: 01 15 cp r16, r1 38880: 11 05 cpc r17, r1 38882: 61 f5 brne .+88 ; 0x388dc 38884: 42 01 movw r8, r4 38886: aa 24 eor r10, r10 38888: bb 24 eor r11, r11 3888a: cb 5f subi r28, 0xFB ; 251 3888c: de 4f sbci r29, 0xFE ; 254 3888e: 28 81 ld r18, Y 38890: c5 50 subi r28, 0x05 ; 5 38892: d1 40 sbci r29, 0x01 ; 1 38894: 82 2f mov r24, r18 38896: 90 e0 ldi r25, 0x00 ; 0 38898: 08 2c mov r0, r8 3889a: 02 c0 rjmp .+4 ; 0x388a0 3889c: 95 95 asr r25 3889e: 87 95 ror r24 388a0: 0a 94 dec r0 388a2: e2 f7 brpl .-8 ; 0x3889c 388a4: 80 fd sbrc r24, 0 388a6: 1a c0 rjmp .+52 ; 0x388dc xflash_wait_busy(); 388a8: 0e 94 ab ec call 0x1d956 ; 0x1d956 xflash_enable_wr(); 388ac: 0e 94 47 ed call 0x1da8e ; 0x1da8e return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 388b0: b2 01 movw r22, r4 388b2: a8 01 movw r20, r16 388b4: 88 ed ldi r24, 0xD8 ; 216 388b6: 0e 94 c9 ec call 0x1d992 ; 0x1d992 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 388ba: 81 e0 ldi r24, 0x01 ; 1 388bc: 90 e0 ldi r25, 0x00 ; 0 388be: 01 c0 rjmp .+2 ; 0x388c2 388c0: 88 0f add r24, r24 388c2: 8a 94 dec r8 388c4: ea f7 brpl .-6 ; 0x388c0 388c6: cb 5f subi r28, 0xFB ; 251 388c8: de 4f sbci r29, 0xFE ; 254 388ca: 48 81 ld r20, Y 388cc: c5 50 subi r28, 0x05 ; 5 388ce: d1 40 sbci r29, 0x01 ; 1 388d0: 48 2b or r20, r24 388d2: cb 5f subi r28, 0xFB ; 251 388d4: de 4f sbci r29, 0xFE ; 254 388d6: 48 83 st Y, r20 388d8: c5 50 subi r28, 0x05 ; 5 388da: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 388dc: 0e 94 ab ec call 0x1d956 ; 0x1d956 xflash_enable_wr(); 388e0: 0e 94 47 ed call 0x1da8e ; 0x1da8e xflash_page_program(addr, buff, savelength); 388e4: 96 01 movw r18, r12 388e6: 4e 2d mov r20, r14 388e8: ca 5f subi r28, 0xFA ; 250 388ea: de 4f sbci r29, 0xFE ; 254 388ec: 58 81 ld r21, Y 388ee: c6 50 subi r28, 0x06 ; 6 388f0: d1 40 sbci r29, 0x01 ; 1 388f2: c2 01 movw r24, r4 388f4: b1 01 movw r22, r2 388f6: 0e 94 ce ec call 0x1d99c ; 0x1d99c xflash_wait_busy(); 388fa: 0e 94 ab ec call 0x1d956 ; 0x1d956 _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 388fe: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 38900: 84 e0 ldi r24, 0x04 ; 4 38902: 0e 94 a5 ec call 0x1d94a ; 0x1d94a _CS_HIGH(); 38906: 45 9a sbi 0x08, 5 ; 8 38908: 45 cf rjmp .-374 ; 0x38794 xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 3890a: 84 37 cpi r24, 0x74 ; 116 3890c: 81 f5 brne .+96 ; 0x3896e uint32_t addr = (((uint32_t)rampz) << 16) | address; 3890e: b1 2c mov r11, r1 38910: 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; 38912: 0f 94 46 ae call 0x35c8c ; 0x35c8c 38916: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 38918: 0f 94 46 ae call 0x35c8c ; 0x35c8c 3891c: c8 2e mov r12, r24 length |= getch(); 3891e: 0f 94 46 ae call 0x35c8c ; 0x35c8c 38922: e8 2e mov r14, r24 length |= getch(); 38924: 0f 94 46 ae call 0x35c8c ; 0x35c8c 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; 38928: 2c 2d mov r18, r12 3892a: 30 e0 ldi r19, 0x00 ; 0 3892c: 32 2f mov r19, r18 3892e: 22 27 eor r18, r18 38930: f9 01 movw r30, r18 38932: fd 29 or r31, r13 38934: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 38936: 8e 29 or r24, r14 38938: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 3893a: 0f 94 46 ae call 0x35c8c ; 0x35c8c verifySpace(); 3893e: 0f 94 be b0 call 0x3617c ; 0x3617c xflash_wait_busy(); 38942: 0e 94 ab ec call 0x1d956 ; 0x1d956 xflash_rd_data(addr, buff, length); 38946: 96 01 movw r18, r12 38948: a3 01 movw r20, r6 3894a: c5 01 movw r24, r10 3894c: b8 01 movw r22, r16 3894e: 0e 94 ee ec call 0x1d9dc ; 0x1d9dc 38952: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 38954: c5 01 movw r24, r10 38956: 86 19 sub r24, r6 38958: 97 09 sbc r25, r7 3895a: 8c 15 cp r24, r12 3895c: 9d 05 cpc r25, r13 3895e: 08 f0 brcs .+2 ; 0x38962 38960: 19 cf rjmp .-462 ; 0x38794 putch(buff[i]); 38962: f5 01 movw r30, r10 38964: 81 91 ld r24, Z+ 38966: 5f 01 movw r10, r30 38968: 0f 94 3f ae call 0x35c7e ; 0x35c7e 3896c: f3 cf rjmp .-26 ; 0x38954 } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 3896e: 85 37 cpi r24, 0x75 ; 117 38970: 51 f4 brne .+20 ; 0x38986 // READ SIGN - return what Avrdude wants to hear verifySpace(); 38972: 0f 94 be b0 call 0x3617c ; 0x3617c putch(XFLASH_SIGNATURE_0); 38976: 8e e1 ldi r24, 0x1E ; 30 38978: 0f 94 3f ae call 0x35c7e ; 0x35c7e putch(XFLASH_SIGNATURE_1); 3897c: 88 e9 ldi r24, 0x98 ; 152 3897e: 0f 94 3f ae call 0x35c7e ; 0x35c7e putch(XFLASH_SIGNATURE_2); 38982: 81 e0 ldi r24, 0x01 ; 1 38984: 05 cf rjmp .-502 ; 0x38790 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 38986: 81 35 cpi r24, 0x51 ; 81 38988: 09 f0 breq .+2 ; 0x3898c 3898a: 29 cf rjmp .-430 ; 0x387de : "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" ); 3898c: f8 e1 ldi r31, 0x18 ; 24 3898e: 28 e0 ldi r18, 0x08 ; 8 38990: 0f b6 in r0, 0x3f ; 63 38992: f8 94 cli 38994: a8 95 wdr 38996: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3899a: 0f be out 0x3f, r0 ; 63 3899c: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 389a0: 1e cf rjmp .-452 ; 0x387de 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; 389a2: 81 e0 ldi r24, 0x01 ; 1 389a4: 7c ce rjmp .-776 ; 0x3869e 000389a6 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 389a6: 81 e0 ldi r24, 0x01 ; 1 389a8: 0c 94 2c 6f jmp 0xde58 ; 0xde58 000389ac : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 389ac: 0f 93 push r16 389ae: 1f 93 push r17 389b0: cf 93 push r28 389b2: 8c 01 movw r16, r24 389b4: c6 2f mov r28, r22 lcd_update_enable(false); 389b6: 80 e0 ldi r24, 0x00 ; 0 389b8: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 389bc: 0e 94 1a 6f call 0xde34 ; 0xde34 lcd_puts_at_P(0, 1, pgmS); 389c0: a8 01 movw r20, r16 389c2: 61 e0 ldi r22, 0x01 ; 1 389c4: 80 e0 ldi r24, 0x00 ; 0 389c6: 0e 94 fb 6e call 0xddf6 ; 0xddf6 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 389ca: 80 e2 ldi r24, 0x20 ; 32 389cc: 0e 94 96 6f call 0xdf2c ; 0xdf2c lcd_print(' '); lcd_print(slot + 1); 389d0: 6c 2f mov r22, r28 389d2: 70 e0 ldi r23, 0x00 ; 0 389d4: 6f 5f subi r22, 0xFF ; 255 389d6: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 389d8: 07 2e mov r0, r23 389da: 00 0c add r0, r0 389dc: 88 0b sbc r24, r24 389de: 99 0b sbc r25, r25 } 389e0: cf 91 pop r28 389e2: 1f 91 pop r17 389e4: 0f 91 pop r16 389e6: 0c 94 a0 70 jmp 0xe140 ; 0xe140 000389ea : 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); 389ea: 82 ed ldi r24, 0xD2 ; 210 389ec: 9e e0 ldi r25, 0x0E ; 14 389ee: 0e 94 2f 76 call 0xec5e ; 0xec5e eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 389f2: 83 ed ldi r24, 0xD3 ; 211 389f4: 9e e0 ldi r25, 0x0E ; 14 389f6: 0c 94 22 76 jmp 0xec44 ; 0xec44 000389fa : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 389fa: 41 e0 ldi r20, 0x01 ; 1 389fc: 80 91 90 13 lds r24, 0x1390 ; 0x801390 38a00: 81 11 cpse r24, r1 38a02: 01 c0 rjmp .+2 ; 0x38a06 38a04: 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'); 38a06: 40 5d subi r20, 0xD0 ; 208 38a08: 62 e0 ldi r22, 0x02 ; 2 38a0a: 83 e0 ldi r24, 0x03 ; 3 38a0c: 0e 94 07 6f call 0xde0e ; 0xde0e class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 38a10: 41 e0 ldi r20, 0x01 ; 1 38a12: 80 91 b7 17 lds r24, 0x17B7 ; 0x8017b7 38a16: 81 11 cpse r24, r1 38a18: 01 c0 rjmp .+2 ; 0x38a1c 38a1a: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38a1c: 40 5d subi r20, 0xD0 ; 208 38a1e: 62 e0 ldi r22, 0x02 ; 2 38a20: 88 e0 ldi r24, 0x08 ; 8 38a22: 0e 94 07 6f call 0xde0e ; 0xde0e // print active/changing filament slot lcd_set_cursor(10, 2); 38a26: 62 e0 ldi r22, 0x02 ; 2 38a28: 8a e0 ldi r24, 0x0A ; 10 38a2a: 0e 94 e7 6e call 0xddce ; 0xddce lcdui_print_extruder(); 38a2e: 0f 94 4f 21 call 0x2429e ; 0x2429e // Print active extruder temperature lcd_set_cursor(16, 2); 38a32: 62 e0 ldi r22, 0x02 ; 2 38a34: 80 e1 ldi r24, 0x10 ; 16 38a36: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 38a3a: 20 e0 ldi r18, 0x00 ; 0 38a3c: 30 e0 ldi r19, 0x00 ; 0 38a3e: 40 e0 ldi r20, 0x00 ; 0 38a40: 5f e3 ldi r21, 0x3F ; 63 38a42: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 38a46: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 38a4a: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 38a4e: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 38a52: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 38a56: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> 38a5a: 7f 93 push r23 38a5c: 6f 93 push r22 38a5e: 89 e1 ldi r24, 0x19 ; 25 38a60: 9c ea ldi r25, 0xAC ; 172 38a62: 9f 93 push r25 38a64: 8f 93 push r24 38a66: 0e 94 c0 6e call 0xdd80 ; 0xdd80 38a6a: 0f 90 pop r0 38a6c: 0f 90 pop r0 38a6e: 0f 90 pop r0 38a70: 0f 90 pop r0 } 38a72: 08 95 ret 00038a74 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 38a74: 8a 30 cpi r24, 0x0A ; 10 38a76: 20 f0 brcs .+8 ; 0x38a80 38a78: 80 31 cpi r24, 0x10 ; 16 38a7a: 20 f4 brcc .+8 ; 0x38a84 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 38a7c: 89 5a subi r24, 0xA9 ; 169 38a7e: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 38a80: 80 5d subi r24, 0xD0 ; 208 38a82: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38a84: 80 e0 ldi r24, 0x00 ; 0 } } 38a86: 08 95 ret 00038a88 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 38a88: 0f 93 push r16 38a8a: 1f 93 push r17 38a8c: cf 93 push r28 38a8e: df 93 push r29 38a90: 08 2f mov r16, r24 38a92: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38a94: 90 e0 ldi r25, 0x00 ; 0 38a96: 24 e0 ldi r18, 0x04 ; 4 38a98: 95 95 asr r25 38a9a: 87 95 ror r24 38a9c: 2a 95 dec r18 38a9e: e1 f7 brne .-8 ; 0x38a98 uint8_t charsOut = 1; 38aa0: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38aa2: 00 97 sbiw r24, 0x00 ; 0 38aa4: 21 f0 breq .+8 ; 0x38aae *dst = Nibble2Char(v); 38aa6: 0f 94 3a c5 call 0x38a74 ; 0x38a74 38aaa: 89 93 st Y+, r24 ++dst; charsOut = 2; 38aac: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 38aae: 80 2f mov r24, r16 38ab0: 8f 70 andi r24, 0x0F ; 15 38ab2: 0f 94 3a c5 call 0x38a74 ; 0x38a74 38ab6: 88 83 st Y, r24 return charsOut; } 38ab8: 81 2f mov r24, r17 38aba: df 91 pop r29 38abc: cf 91 pop r28 38abe: 1f 91 pop r17 38ac0: 0f 91 pop r16 38ac2: 08 95 ret 00038ac4 : } 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) { 38ac4: 80 33 cpi r24, 0x30 ; 48 38ac6: 30 f0 brcs .+12 ; 0x38ad4 38ac8: 8a 33 cpi r24, 0x3A ; 58 38aca: 30 f0 brcs .+12 ; 0x38ad8 38acc: 9f e9 ldi r25, 0x9F ; 159 38ace: 98 0f add r25, r24 38ad0: 96 30 cpi r25, 0x06 ; 6 38ad2: 20 f0 brcs .+8 ; 0x38adc case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 38ad4: 80 e0 ldi r24, 0x00 ; 0 } } 38ad6: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 38ad8: 80 53 subi r24, 0x30 ; 48 38ada: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 38adc: 87 55 subi r24, 0x57 ; 87 38ade: 08 95 ret 00038ae0 : /// 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 { 38ae0: cf 93 push r28 38ae2: df 93 push r29 38ae4: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 38ae6: 68 81 ld r22, Y 38ae8: 80 e0 ldi r24, 0x00 ; 0 38aea: 0f 94 52 ae call 0x35ca4 ; 0x35ca4 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 38aee: 69 81 ldd r22, Y+1 ; 0x01 38af0: 0f 94 52 ae call 0x35ca4 ; 0x35ca4 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 38af4: 6a 81 ldd r22, Y+2 ; 0x02 38af6: 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]); 38af8: 0f 94 52 ae call 0x35ca4 ; 0x35ca4 38afc: 6c 2f mov r22, r28 return crc; } 38afe: df 91 pop r29 38b00: cf 91 pop r28 38b02: 0d 94 52 ae jmp 0x35ca4 ; 0x35ca4 00038b06 : 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 { 38b06: cf 93 push r28 38b08: df 93 push r29 38b0a: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 38b0c: 0f 94 70 c5 call 0x38ae0 ; 0x38ae0 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 38b10: 6d 81 ldd r22, Y+5 ; 0x05 38b12: 0f 94 52 ae call 0x35ca4 ; 0x35ca4 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38b16: 6e 81 ldd r22, Y+6 ; 0x06 38b18: cf 81 ldd r28, Y+7 ; 0x07 38b1a: 0f 94 52 ae call 0x35ca4 ; 0x35ca4 38b1e: 6c 2f mov r22, r28 return crc; } 38b20: df 91 pop r29 38b22: cf 91 pop r28 38b24: 0d 94 52 ae jmp 0x35ca4 ; 0x35ca4 00038b28 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38b28: cf 93 push r28 38b2a: df 93 push r29 38b2c: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 38b2e: 68 83 st Y, r22 38b30: 49 83 std Y+1, r20 ; 0x01 38b32: 1b 82 std Y+3, r1 ; 0x03 38b34: 1a 82 std Y+2, r1 ; 0x02 38b36: 0f 94 70 c5 call 0x38ae0 ; 0x38ae0 38b3a: 8c 83 std Y+4, r24 ; 0x04 } 38b3c: df 91 pop r29 38b3e: cf 91 pop r28 38b40: 08 95 ret 00038b42 : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 38b42: 9f b7 in r25, 0x3f ; 63 38b44: f8 94 cli 38b46: e5 e0 ldi r30, 0x05 ; 5 38b48: f1 e0 ldi r31, 0x01 ; 1 38b4a: 80 81 ld r24, Z 38b4c: 8f 7d andi r24, 0xDF ; 223 38b4e: 80 83 st Z, r24 38b50: 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); 38b52: 8f e8 ldi r24, 0x8F ; 143 38b54: 91 e0 ldi r25, 0x01 ; 1 38b56: 01 97 sbiw r24, 0x01 ; 1 38b58: f1 f7 brne .-4 ; 0x38b56 38b5a: 00 c0 rjmp .+0 ; 0x38b5c 38b5c: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 38b5e: 9f b7 in r25, 0x3f ; 63 38b60: f8 94 cli 38b62: 80 81 ld r24, Z 38b64: 80 62 ori r24, 0x20 ; 32 38b66: 80 83 st Z, r24 38b68: 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 } 38b6a: 08 95 ret 00038b6c : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 38b6c: 14 9a sbi 0x02, 4 ; 2 } 38b6e: 08 95 ret 00038b70 : 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) { 38b70: cf 92 push r12 38b72: df 92 push r13 38b74: ef 92 push r14 38b76: ff 92 push r15 38b78: cf 93 push r28 38b7a: df 93 push r29 38b7c: 69 01 movw r12, r18 38b7e: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38b80: c2 e9 ldi r28, 0x92 ; 146 38b82: d6 e0 ldi r29, 0x06 ; 6 38b84: 9b 01 movw r18, r22 38b86: ac 01 movw r20, r24 38b88: 6c 85 ldd r22, Y+12 ; 0x0c 38b8a: 7d 85 ldd r23, Y+13 ; 0x0d 38b8c: 8e 85 ldd r24, Y+14 ; 0x0e 38b8e: 9f 85 ldd r25, Y+15 ; 0x0f 38b90: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 38b94: 6c 87 std Y+12, r22 ; 0x0c 38b96: 7d 87 std Y+13, r23 ; 0x0d 38b98: 8e 87 std Y+14, r24 ; 0x0e 38b9a: 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); 38b9c: c7 01 movw r24, r14 38b9e: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38ba0: df 91 pop r29 38ba2: cf 91 pop r28 38ba4: ff 90 pop r15 38ba6: ef 90 pop r14 38ba8: df 90 pop r13 38baa: 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); 38bac: 0d 94 50 c0 jmp 0x380a0 ; 0x380a0 00038bb0 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 38bb0: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 38bb4: 0d 94 ef 42 jmp 0x285de ; 0x285de 00038bb8 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 38bb8: cf 93 push r28 38bba: df 93 push r29 38bbc: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 38bbe: 80 ed ldi r24, 0xD0 ; 208 38bc0: 9b ea ldi r25, 0xAB ; 171 38bc2: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_MMU2(); 38bc6: 83 e1 ldi r24, 0x13 ; 19 38bc8: 9c ea ldi r25, 0xAC ; 172 38bca: 0e 94 57 77 call 0xeeae ; 0xeeae SERIAL_ECHOLNRPGM(msg); 38bce: ce 01 movw r24, r28 } 38bd0: df 91 pop r29 38bd2: 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); 38bd4: 0c 94 82 79 jmp 0xf304 ; 0xf304 00038bd8 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 38bd8: 81 e0 ldi r24, 0x01 ; 1 38bda: 90 91 b7 17 lds r25, 0x17B7 ; 0x8017b7 38bde: 91 11 cpse r25, r1 38be0: 01 c0 rjmp .+2 ; 0x38be4 38be2: 80 e0 ldi r24, 0x00 ; 0 } 38be4: 08 95 ret 00038be6 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38be6: 89 32 cpi r24, 0x29 ; 41 38be8: 20 e8 ldi r18, 0x80 ; 128 38bea: 92 07 cpc r25, r18 38bec: 09 f4 brne .+2 ; 0x38bf0 38bee: 97 c0 rjmp .+302 ; 0x38d1e 38bf0: 08 f0 brcs .+2 ; 0x38bf4 38bf2: 48 c0 rjmp .+144 ; 0x38c84 38bf4: 86 30 cpi r24, 0x06 ; 6 38bf6: 60 e8 ldi r22, 0x80 ; 128 38bf8: 96 07 cpc r25, r22 38bfa: 09 f4 brne .+2 ; 0x38bfe 38bfc: 9a c0 rjmp .+308 ; 0x38d32 38bfe: 30 f5 brcc .+76 ; 0x38c4c 38c00: 83 30 cpi r24, 0x03 ; 3 38c02: 40 e8 ldi r20, 0x80 ; 128 38c04: 94 07 cpc r25, r20 38c06: 09 f4 brne .+2 ; 0x38c0a 38c08: 80 c0 rjmp .+256 ; 0x38d0a 38c0a: a8 f4 brcc .+42 ; 0x38c36 38c0c: 81 30 cpi r24, 0x01 ; 1 38c0e: 20 e8 ldi r18, 0x80 ; 128 38c10: 92 07 cpc r25, r18 38c12: 09 f4 brne .+2 ; 0x38c16 38c14: 17 c1 rjmp .+558 ; 0x38e44 38c16: 82 30 cpi r24, 0x02 ; 2 38c18: 40 e8 ldi r20, 0x80 ; 128 38c1a: 94 07 cpc r25, r20 38c1c: 09 f4 brne .+2 ; 0x38c20 38c1e: 73 c0 rjmp .+230 ; 0x38d06 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); 38c20: 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)) { 38c22: 86 ff sbrs r24, 6 38c24: 8e c0 rjmp .+284 ; 0x38d42 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); 38c26: 22 27 eor r18, r18 38c28: 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) { 38c2a: 21 15 cp r18, r1 38c2c: 32 4c sbci r19, 0xC2 ; 194 38c2e: 09 f0 breq .+2 ; 0x38c32 38c30: 9e c0 rjmp .+316 ; 0x38d6e return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38c32: 8e e1 ldi r24, 0x1E ; 30 38c34: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c36: 84 30 cpi r24, 0x04 ; 4 38c38: 60 e8 ldi r22, 0x80 ; 128 38c3a: 96 07 cpc r25, r22 38c3c: 09 f4 brne .+2 ; 0x38c40 38c3e: 67 c0 rjmp .+206 ; 0x38d0e 38c40: 85 30 cpi r24, 0x05 ; 5 38c42: 20 e8 ldi r18, 0x80 ; 128 38c44: 92 07 cpc r25, r18 38c46: 61 f7 brne .-40 ; 0x38c20 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); 38c48: 84 e2 ldi r24, 0x24 ; 36 38c4a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c4c: 8a 30 cpi r24, 0x0A ; 10 38c4e: 40 e8 ldi r20, 0x80 ; 128 38c50: 94 07 cpc r25, r20 38c52: 09 f4 brne .+2 ; 0x38c56 38c54: 5e c0 rjmp .+188 ; 0x38d12 38c56: 58 f4 brcc .+22 ; 0x38c6e 38c58: 88 30 cpi r24, 0x08 ; 8 38c5a: 20 e8 ldi r18, 0x80 ; 128 38c5c: 92 07 cpc r25, r18 38c5e: 09 f4 brne .+2 ; 0x38c62 38c60: 6e c0 rjmp .+220 ; 0x38d3e 38c62: 89 30 cpi r24, 0x09 ; 9 38c64: 40 e8 ldi r20, 0x80 ; 128 38c66: 94 07 cpc r25, r20 38c68: d9 f6 brne .-74 ; 0x38c20 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); 38c6a: 85 e0 ldi r24, 0x05 ; 5 38c6c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c6e: 8c 30 cpi r24, 0x0C ; 12 38c70: 60 e8 ldi r22, 0x80 ; 128 38c72: 96 07 cpc r25, r22 38c74: 09 f4 brne .+2 ; 0x38c78 38c76: 51 c0 rjmp .+162 ; 0x38d1a 38c78: 8d 30 cpi r24, 0x0D ; 13 38c7a: 20 e8 ldi r18, 0x80 ; 128 38c7c: 92 07 cpc r25, r18 38c7e: 81 f6 brne .-96 ; 0x38c20 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); 38c80: 81 e2 ldi r24, 0x21 ; 33 38c82: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38c84: 8f 32 cpi r24, 0x2F ; 47 38c86: 40 e8 ldi r20, 0x80 ; 128 38c88: 94 07 cpc r25, r20 38c8a: 09 f4 brne .+2 ; 0x38c8e 38c8c: 56 c0 rjmp .+172 ; 0x38d3a 38c8e: e0 f4 brcc .+56 ; 0x38cc8 38c90: 8c 32 cpi r24, 0x2C ; 44 38c92: 20 e8 ldi r18, 0x80 ; 128 38c94: 92 07 cpc r25, r18 38c96: 09 f4 brne .+2 ; 0x38c9a 38c98: 4e c0 rjmp .+156 ; 0x38d36 38c9a: 58 f4 brcc .+22 ; 0x38cb2 38c9c: 8a 32 cpi r24, 0x2A ; 42 38c9e: 60 e8 ldi r22, 0x80 ; 128 38ca0: 96 07 cpc r25, r22 38ca2: c9 f1 breq .+114 ; 0x38d16 38ca4: 8b 32 cpi r24, 0x2B ; 43 38ca6: 20 e8 ldi r18, 0x80 ; 128 38ca8: 92 07 cpc r25, r18 38caa: 09 f0 breq .+2 ; 0x38cae 38cac: b9 cf rjmp .-142 ; 0x38c20 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); 38cae: 86 e2 ldi r24, 0x26 ; 38 38cb0: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38cb2: 8d 32 cpi r24, 0x2D ; 45 38cb4: 40 e8 ldi r20, 0x80 ; 128 38cb6: 94 07 cpc r25, r20 38cb8: d1 f1 breq .+116 ; 0x38d2e 38cba: 8e 32 cpi r24, 0x2E ; 46 38cbc: 60 e8 ldi r22, 0x80 ; 128 38cbe: 96 07 cpc r25, r22 38cc0: 09 f0 breq .+2 ; 0x38cc4 38cc2: ae cf rjmp .-164 ; 0x38c20 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); 38cc4: 82 e2 ldi r24, 0x22 ; 34 38cc6: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38cc8: 87 38 cpi r24, 0x87 ; 135 38cca: 20 e8 ldi r18, 0x80 ; 128 38ccc: 92 07 cpc r25, r18 38cce: 49 f1 breq .+82 ; 0x38d22 38cd0: 58 f4 brcc .+22 ; 0x38ce8 38cd2: 87 34 cpi r24, 0x47 ; 71 38cd4: 60 e8 ldi r22, 0x80 ; 128 38cd6: 96 07 cpc r25, r22 38cd8: 29 f0 breq .+10 ; 0x38ce4 38cda: 8b 34 cpi r24, 0x4B ; 75 38cdc: 20 e8 ldi r18, 0x80 ; 128 38cde: 92 07 cpc r25, r18 38ce0: 09 f0 breq .+2 ; 0x38ce4 38ce2: 9e cf rjmp .-196 ; 0x38c20 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); 38ce4: 84 e0 ldi r24, 0x04 ; 4 38ce6: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38ce8: 87 30 cpi r24, 0x07 ; 7 38cea: 41 e8 ldi r20, 0x81 ; 129 38cec: 94 07 cpc r25, r20 38cee: d9 f0 breq .+54 ; 0x38d26 38cf0: 8b 30 cpi r24, 0x0B ; 11 38cf2: 61 e8 ldi r22, 0x81 ; 129 38cf4: 96 07 cpc r25, r22 38cf6: c9 f0 breq .+50 ; 0x38d2a 38cf8: 8b 38 cpi r24, 0x8B ; 139 38cfa: 20 e8 ldi r18, 0x80 ; 128 38cfc: 92 07 cpc r25, r18 38cfe: 09 f0 breq .+2 ; 0x38d02 38d00: 8f cf rjmp .-226 ; 0x38c20 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); 38d02: 89 e0 ldi r24, 0x09 ; 9 38d04: 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); 38d06: 81 e0 ldi r24, 0x01 ; 1 38d08: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 38d0a: 82 e0 ldi r24, 0x02 ; 2 38d0c: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 38d0e: 83 e0 ldi r24, 0x03 ; 3 38d10: 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); 38d12: 86 e0 ldi r24, 0x06 ; 6 38d14: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 38d16: 87 e0 ldi r24, 0x07 ; 7 38d18: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 38d1a: 8a e2 ldi r24, 0x2A ; 42 38d1c: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38d1e: 8b e2 ldi r24, 0x2B ; 43 38d20: 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); 38d22: 88 e0 ldi r24, 0x08 ; 8 38d24: 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); 38d26: 8a e0 ldi r24, 0x0A ; 10 38d28: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 38d2a: 8b e0 ldi r24, 0x0B ; 11 38d2c: 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); 38d2e: 83 e2 ldi r24, 0x23 ; 35 38d30: 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); 38d32: 85 e2 ldi r24, 0x25 ; 37 38d34: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 38d36: 87 e2 ldi r24, 0x27 ; 39 38d38: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 38d3a: 88 e2 ldi r24, 0x28 ; 40 38d3c: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38d3e: 89 e2 ldi r24, 0x29 ; 41 38d40: 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)) { 38d42: 87 ff sbrs r24, 7 38d44: 07 c0 rjmp .+14 ; 0x38d54 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); 38d46: 22 27 eor r18, r18 38d48: 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) { 38d4a: 21 15 cp r18, r1 38d4c: 32 4c sbci r19, 0xC2 ; 194 38d4e: a1 f5 brne .+104 ; 0x38db8 return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38d50: 8f e1 ldi r24, 0x1F ; 31 38d52: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38d54: 22 27 eor r18, r18 38d56: 31 70 andi r19, 0x01 ; 1 38d58: 90 ff sbrs r25, 0 38d5a: 52 c0 rjmp .+164 ; 0x38e00 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); 38d5c: ac 01 movw r20, r24 38d5e: 44 27 eor r20, r20 38d60: 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) { 38d62: 41 15 cp r20, r1 38d64: 52 4c sbci r21, 0xC2 ; 194 38d66: 09 f0 breq .+2 ; 0x38d6a 38d68: 4b c0 rjmp .+150 ; 0x38e00 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 38d6a: 80 e2 ldi r24, 0x20 ; 32 38d6c: 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; 38d6e: 9c 01 movw r18, r24 38d70: 22 27 eor r18, r18 38d72: 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)) { 38d74: 23 2b or r18, r19 38d76: 09 f0 breq .+2 ; 0x38d7a 38d78: 67 c0 rjmp .+206 ; 0x38e48 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; 38d7a: 9c 01 movw r18, r24 38d7c: 22 27 eor r18, r18 38d7e: 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)) { 38d80: 23 2b or r18, r19 38d82: 09 f0 breq .+2 ; 0x38d86 38d84: 63 c0 rjmp .+198 ; 0x38e4c 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; 38d86: 9c 01 movw r18, r24 38d88: 22 27 eor r18, r18 38d8a: 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)) { 38d8c: 23 2b or r18, r19 38d8e: 09 f0 breq .+2 ; 0x38d92 38d90: 5f c0 rjmp .+190 ; 0x38e50 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; 38d92: 9c 01 movw r18, r24 38d94: 22 27 eor r18, r18 38d96: 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)) { 38d98: 23 2b or r18, r19 38d9a: 09 f0 breq .+2 ; 0x38d9e 38d9c: 5b c0 rjmp .+182 ; 0x38e54 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; 38d9e: 9c 01 movw r18, r24 38da0: 22 27 eor r18, r18 38da2: 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)) { 38da4: 23 2b or r18, r19 38da6: 09 f0 breq .+2 ; 0x38daa 38da8: 57 c0 rjmp .+174 ; 0x38e58 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: 88 27 eor r24, r24 38dac: 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)) { 38dae: 89 2b or r24, r25 38db0: 09 f4 brne .+2 ; 0x38db4 38db2: 68 c0 rjmp .+208 ; 0x38e84 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 38db4: 8f e0 ldi r24, 0x0F ; 15 38db6: 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; 38db8: 9c 01 movw r18, r24 38dba: 22 27 eor r18, r18 38dbc: 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)) { 38dbe: 23 2b or r18, r19 38dc0: 09 f0 breq .+2 ; 0x38dc4 38dc2: 4c c0 rjmp .+152 ; 0x38e5c 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; 38dc4: 9c 01 movw r18, r24 38dc6: 22 27 eor r18, r18 38dc8: 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)) { 38dca: 23 2b or r18, r19 38dcc: 09 f0 breq .+2 ; 0x38dd0 38dce: 48 c0 rjmp .+144 ; 0x38e60 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; 38dd0: 9c 01 movw r18, r24 38dd2: 22 27 eor r18, r18 38dd4: 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)) { 38dd6: 23 2b or r18, r19 38dd8: 09 f0 breq .+2 ; 0x38ddc 38dda: 44 c0 rjmp .+136 ; 0x38e64 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; 38ddc: 9c 01 movw r18, r24 38dde: 22 27 eor r18, r18 38de0: 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)) { 38de2: 23 2b or r18, r19 38de4: 09 f0 breq .+2 ; 0x38de8 38de6: 40 c0 rjmp .+128 ; 0x38e68 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; 38de8: 9c 01 movw r18, r24 38dea: 22 27 eor r18, r18 38dec: 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)) { 38dee: 23 2b or r18, r19 38df0: e9 f5 brne .+122 ; 0x38e6c 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; 38df2: 88 27 eor r24, r24 38df4: 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)) { 38df6: 89 2b or r24, r25 38df8: 09 f4 brne .+2 ; 0x38dfc 38dfa: 44 c0 rjmp .+136 ; 0x38e84 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 38dfc: 80 e1 ldi r24, 0x10 ; 16 38dfe: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38e00: 23 2b or r18, r19 38e02: 09 f4 brne .+2 ; 0x38e06 38e04: 3f c0 rjmp .+126 ; 0x38e84 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; 38e06: 9c 01 movw r18, r24 38e08: 22 27 eor r18, r18 38e0a: 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)) { 38e0c: 23 2b or r18, r19 38e0e: 81 f5 brne .+96 ; 0x38e70 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; 38e10: 9c 01 movw r18, r24 38e12: 22 27 eor r18, r18 38e14: 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)) { 38e16: 23 2b or r18, r19 38e18: 69 f5 brne .+90 ; 0x38e74 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; 38e1a: 9c 01 movw r18, r24 38e1c: 22 27 eor r18, r18 38e1e: 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)) { 38e20: 23 2b or r18, r19 38e22: 51 f5 brne .+84 ; 0x38e78 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; 38e24: 9c 01 movw r18, r24 38e26: 22 27 eor r18, r18 38e28: 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)) { 38e2a: 23 2b or r18, r19 38e2c: 39 f5 brne .+78 ; 0x38e7c 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; 38e2e: 9c 01 movw r18, r24 38e30: 22 27 eor r18, r18 38e32: 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)) { 38e34: 23 2b or r18, r19 38e36: 21 f5 brne .+72 ; 0x38e80 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; 38e38: 88 27 eor r24, r24 38e3a: 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)) { 38e3c: 89 2b or r24, r25 38e3e: 11 f1 breq .+68 ; 0x38e84 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38e40: 81 e1 ldi r24, 0x11 ; 17 38e42: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 38e44: 80 e0 ldi r24, 0x00 ; 0 38e46: 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); 38e48: 82 e1 ldi r24, 0x12 ; 18 38e4a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 38e4c: 85 e1 ldi r24, 0x15 ; 21 38e4e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38e50: 88 e1 ldi r24, 0x18 ; 24 38e52: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 38e54: 8b e1 ldi r24, 0x1B ; 27 38e56: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 38e58: 8c e0 ldi r24, 0x0C ; 12 38e5a: 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); 38e5c: 83 e1 ldi r24, 0x13 ; 19 38e5e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38e60: 86 e1 ldi r24, 0x16 ; 22 38e62: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 38e64: 89 e1 ldi r24, 0x19 ; 25 38e66: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 38e68: 8c e1 ldi r24, 0x1C ; 28 38e6a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 38e6c: 8d e0 ldi r24, 0x0D ; 13 38e6e: 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); 38e70: 84 e1 ldi r24, 0x14 ; 20 38e72: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 38e74: 87 e1 ldi r24, 0x17 ; 23 38e76: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 38e78: 8a e1 ldi r24, 0x1A ; 26 38e7a: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 38e7c: 8d e1 ldi r24, 0x1D ; 29 38e7e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38e80: 8e e0 ldi r24, 0x0E ; 14 38e82: 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); 38e84: 8c e2 ldi r24, 0x2C ; 44 } 38e86: 08 95 ret 00038e88 : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 38e88: cf 92 push r12 38e8a: df 92 push r13 38e8c: ef 92 push r14 38e8e: ff 92 push r15 38e90: 0f 93 push r16 38e92: 1f 93 push r17 38e94: cf 93 push r28 38e96: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 38e98: 20 91 8b 13 lds r18, 0x138B ; 0x80138b 38e9c: 30 91 8c 13 lds r19, 0x138C ; 0x80138c 38ea0: 21 30 cpi r18, 0x01 ; 1 38ea2: 31 05 cpc r19, r1 38ea4: 39 f4 brne .+14 ; 0x38eb4 38ea6: 20 91 b4 13 lds r18, 0x13B4 ; 0x8013b4 38eaa: 21 30 cpi r18, 0x01 ; 1 38eac: 19 f4 brne .+6 ; 0x38eb4 // 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; 38eae: 22 e0 ldi r18, 0x02 ; 2 38eb0: 20 93 f6 17 sts 0x17F6, r18 ; 0x8017f6 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 38eb4: 0f 94 f3 c5 call 0x38be6 ; 0x38be6 38eb8: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 38eba: 80 91 f6 17 lds r24, 0x17F6 ; 0x8017f6 38ebe: 81 30 cpi r24, 0x01 ; 1 38ec0: 09 f4 brne .+2 ; 0x38ec4 38ec2: 64 c0 rjmp .+200 ; 0x38f8c 38ec4: 60 f0 brcs .+24 ; 0x38ede 38ec6: 82 30 cpi r24, 0x02 ; 2 38ec8: 09 f4 brne .+2 ; 0x38ecc 38eca: f4 c0 rjmp .+488 ; 0x390b4 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 38ecc: df 91 pop r29 38ece: cf 91 pop r28 38ed0: 1f 91 pop r17 38ed2: 0f 91 pop r16 38ed4: ff 90 pop r15 38ed6: ef 90 pop r14 38ed8: df 90 pop r13 38eda: cf 90 pop r12 38edc: 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); 38ede: 84 e0 ldi r24, 0x04 ; 4 38ee0: 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); 38ee4: 0d 2f mov r16, r29 38ee6: 10 e0 ldi r17, 0x00 ; 0 38ee8: f8 01 movw r30, r16 38eea: e3 58 subi r30, 0x83 ; 131 38eec: f3 45 sbci r31, 0x53 ; 83 38eee: 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); 38ef0: fc 2e mov r15, r28 38ef2: f2 94 swap r15 38ef4: 6f e0 ldi r22, 0x0F ; 15 38ef6: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 38ef8: 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); 38efa: 80 e0 ldi r24, 0x00 ; 0 38efc: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_clear(); 38f00: 0e 94 1a 6f call 0xde34 ; 0xde34 // 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); 38f04: 00 0f add r16, r16 38f06: 11 1f adc r17, r17 38f08: f8 01 movw r30, r16 38f0a: e6 55 subi r30, 0x56 ; 86 38f0c: f3 45 sbci r31, 0x53 ; 83 38f0e: c5 90 lpm r12, Z+ 38f10: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 38f12: 0b 5b subi r16, 0xBB ; 187 38f14: 16 45 sbci r17, 0x56 ; 86 38f16: f8 01 movw r30, r16 38f18: 85 91 lpm r24, Z+ 38f1a: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 38f1c: 0e 94 b3 72 call 0xe566 ; 0xe566 38f20: df 92 push r13 38f22: cf 92 push r12 38f24: 9f 93 push r25 38f26: 8f 93 push r24 38f28: 86 e1 ldi r24, 0x16 ; 22 38f2a: 9d ea ldi r25, 0xAD ; 173 38f2c: 9f 93 push r25 38f2e: 8f 93 push r24 38f30: 0e 94 c0 6e call 0xdd80 ; 0xdd80 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)); 38f34: 4d eb ldi r20, 0xBD ; 189 38f36: 59 ea ldi r21, 0xA9 ; 169 38f38: 62 e0 ldi r22, 0x02 ; 2 38f3a: 80 e0 ldi r24, 0x00 ; 0 38f3c: 0e 94 fb 6e call 0xddf6 ; 0xddf6 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()); 38f40: 0f 90 pop r0 38f42: 0f 90 pop r0 38f44: 0f 90 pop r0 38f46: 0f 90 pop r0 38f48: 0f 90 pop r0 38f4a: 0f 90 pop r0 38f4c: f1 10 cpse r15, r1 38f4e: c6 c0 rjmp .+396 ; 0x390dc 38f50: 10 e0 ldi r17, 0x00 ; 0 38f52: 00 e0 ldi r16, 0x00 ; 0 38f54: 42 e1 ldi r20, 0x12 ; 18 38f56: e4 2e mov r14, r20 38f58: 50 e0 ldi r21, 0x00 ; 0 38f5a: c5 2e mov r12, r21 38f5c: 51 e7 ldi r21, 0x71 ; 113 38f5e: 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); 38f60: ec 2f mov r30, r28 38f62: f0 e0 ldi r31, 0x00 ; 0 38f64: ee 0f add r30, r30 38f66: ff 1f adc r31, r31 38f68: ee 5f subi r30, 0xFE ; 254 38f6a: f2 45 sbci r31, 0x52 ; 82 38f6c: 85 91 lpm r24, Z+ 38f6e: 94 91 lpm r25, Z 38f70: 0e 94 b3 72 call 0xe566 ; 0xe566 38f74: bc 01 movw r22, r24 38f76: 81 e0 ldi r24, 0x01 ; 1 38f78: f1 10 cpse r15, r1 38f7a: 01 c0 rjmp .+2 ; 0x38f7e 38f7c: 80 e0 ldi r24, 0x00 ; 0 38f7e: 2e 2d mov r18, r14 38f80: a6 01 movw r20, r12 38f82: 0f 94 9a 1f call 0x23f34 ; 0x23f34 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38f86: 81 e0 ldi r24, 0x01 ; 1 38f88: 80 93 f6 17 sts 0x17F6, r24 ; 0x8017f6 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38f8c: 81 e0 ldi r24, 0x01 ; 1 38f8e: 80 93 c3 06 sts 0x06C3, r24 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> ReportErrorHookDynamicRender(); // Render dynamic characters 38f92: 0f 94 fd c4 call 0x389fa ; 0x389fa sound_wait_for_user(); 38f96: 0f 94 f1 51 call 0x2a3e2 ; 0x2a3e2 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); 38f9a: 0d 2f mov r16, r29 38f9c: 10 e0 ldi r17, 0x00 ; 0 38f9e: f8 01 movw r30, r16 38fa0: e3 58 subi r30, 0x83 ; 131 38fa2: f3 45 sbci r31, 0x53 ; 83 38fa4: 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); 38fa6: dc 2f mov r29, r28 38fa8: d2 95 swap r29 38faa: 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; 38fac: 80 91 ee 17 lds r24, 0x17EE ; 0x8017ee 38fb0: 81 11 cpse r24, r1 38fb2: 09 c0 rjmp .+18 ; 0x38fc6 38fb4: 81 e0 ldi r24, 0x01 ; 1 38fb6: d1 11 cpse r29, r1 38fb8: 01 c0 rjmp .+2 ; 0x38fbc 38fba: 80 e0 ldi r24, 0x00 ; 0 38fbc: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed 38fc0: 81 e0 ldi r24, 0x01 ; 1 38fc2: 80 93 ee 17 sts 0x17EE, r24 ; 0x8017ee static int8_t choice_selected = -1; if (reset_button_selection) { 38fc6: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec 38fca: 88 23 and r24, r24 38fcc: 41 f0 breq .+16 ; 0x38fde // 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; 38fce: 81 e0 ldi r24, 0x01 ; 1 38fd0: d1 11 cpse r29, r1 38fd2: 01 c0 rjmp .+2 ; 0x38fd6 38fd4: 80 e0 ldi r24, 0x00 ; 0 38fd6: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed choice_selected = -1; reset_button_selection = 0; 38fda: 10 92 ec 17 sts 0x17EC, r1 ; 0x8017ec } // Check if knob was rotated if (lcd_encoder) { 38fde: 20 91 70 06 lds r18, 0x0670 ; 0x800670 38fe2: 30 91 71 06 lds r19, 0x0671 ; 0x800671 38fe6: 21 15 cp r18, r1 38fe8: 31 05 cpc r19, r1 38fea: b9 f1 breq .+110 ; 0x3905a 38fec: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38ff0: dd 23 and r29, r29 38ff2: 61 f0 breq .+24 ; 0x3900c if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38ff4: 37 ff sbrs r19, 7 38ff6: 06 c0 rjmp .+12 ; 0x39004 38ff8: 88 23 and r24, r24 38ffa: 69 f0 breq .+26 ; 0x39016 // Rotating knob counter clockwise current_selection--; 38ffc: 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; 38ffe: 80 93 ed 17 sts 0x17ED, r24 ; 0x8017ed 39002: 09 c0 rjmp .+18 ; 0x39016 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) { 39004: 82 30 cpi r24, 0x02 ; 2 39006: 39 f0 breq .+14 ; 0x39016 // Rotating knob clockwise current_selection++; 39008: 8f 5f subi r24, 0xFF ; 255 3900a: f9 cf rjmp .-14 ; 0x38ffe } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 3900c: 37 ff sbrs r19, 7 3900e: 41 c0 rjmp .+130 ; 0x39092 39010: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 39012: 10 92 ed 17 sts 0x17ED, r1 ; 0x8017ed //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 39016: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 3901a: 4e e3 ldi r20, 0x3E ; 62 3901c: 81 11 cpse r24, r1 3901e: 40 e2 ldi r20, 0x20 ; 32 39020: 63 e0 ldi r22, 0x03 ; 3 39022: 80 e0 ldi r24, 0x00 ; 0 39024: 0e 94 07 6f call 0xde0e ; 0xde0e 39028: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed if (two_choices == false) 3902c: dd 23 and r29, r29 3902e: b1 f1 breq .+108 ; 0x3909c { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 39030: 4e e3 ldi r20, 0x3E ; 62 39032: 81 30 cpi r24, 0x01 ; 1 39034: 09 f0 breq .+2 ; 0x39038 39036: 40 e2 ldi r20, 0x20 ; 32 39038: 63 e0 ldi r22, 0x03 ; 3 3903a: 89 e0 ldi r24, 0x09 ; 9 3903c: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 39040: 80 91 ed 17 lds r24, 0x17ED ; 0x8017ed 39044: 82 30 cpi r24, 0x02 ; 2 39046: 61 f5 brne .+88 ; 0x390a0 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 39048: 4e e3 ldi r20, 0x3E ; 62 3904a: 63 e0 ldi r22, 0x03 ; 3 3904c: 82 e1 ldi r24, 0x12 ; 18 3904e: 0e 94 07 6f call 0xde0e ; 0xde0e } // Consume rotation event lcd_encoder = 0; 39052: 10 92 71 06 sts 0x0671, r1 ; 0x800671 39056: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 3905a: 0e 94 04 71 call 0xe208 ; 0xe208 3905e: 88 23 and r24, r24 39060: 09 f4 brne .+2 ; 0x39064 39062: 34 cf rjmp .-408 ; 0x38ecc choice_selected = current_selection; 39064: 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 39068: d1 11 cpse r29, r1 3906a: 1c c0 rjmp .+56 ; 0x390a4 3906c: 81 30 cpi r24, 0x01 ; 1 3906e: 89 f5 brne .+98 ; 0x390d2 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); 39070: f8 01 movw r30, r16 39072: ee 0f add r30, r30 39074: ff 1f adc r31, r31 39076: ed 5d subi r30, 0xDD ; 221 39078: f3 45 sbci r31, 0x53 ; 83 3907a: 85 91 lpm r24, Z+ 3907c: 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))); 3907e: 0e 94 b3 72 call 0xe566 ; 0xe566 39082: 0f 94 f8 1f call 0x23ff0 ; 0x23ff0 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 39086: 81 e0 ldi r24, 0x01 ; 1 39088: 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; 3908c: 10 92 f6 17 sts 0x17F6, r1 ; 0x8017f6 39090: 1d cf rjmp .-454 ; 0x38ecc } } 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) { 39092: 81 30 cpi r24, 0x01 ; 1 39094: 09 f4 brne .+2 ; 0x39098 39096: bf cf rjmp .-130 ; 0x39016 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 39098: 81 e0 ldi r24, 0x01 ; 1 3909a: b1 cf rjmp .-158 ; 0x38ffe { 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 ? '>': ' '); 3909c: 81 30 cpi r24, 0x01 ; 1 3909e: a1 f2 breq .-88 ; 0x39048 390a0: 40 e2 ldi r20, 0x20 ; 32 390a2: d3 cf rjmp .-90 ; 0x3904a // 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 390a4: 82 30 cpi r24, 0x02 ; 2 390a6: 21 f3 breq .-56 ; 0x39070 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 390a8: 81 30 cpi r24, 0x01 ; 1 390aa: 99 f4 brne .+38 ; 0x390d2 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 390ac: 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; 390b0: 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); 390b4: 81 e0 ldi r24, 0x01 ; 1 390b6: 0e 94 2c 6f call 0xde58 ; 0xde58 lcd_return_to_status(); 390ba: 0f 94 ad 1e call 0x23d5a ; 0x23d5a 390be: 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; 390c2: 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; 390c6: 10 92 c3 06 sts 0x06C3, r1 ; 0x8006c3 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.490> KEEPALIVE_STATE(IN_HANDLER); 390ca: 82 e0 ldi r24, 0x02 ; 2 390cc: 80 93 be 02 sts 0x02BE, r24 ; 0x8002be 390d0: dd cf rjmp .-70 ; 0x3908c 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); 390d2: cf 70 andi r28, 0x0F ; 15 390d4: 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; 390d8: 81 e0 ldi r24, 0x01 ; 1 390da: ea cf rjmp .-44 ; 0x390b0 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); 390dc: ef 2d mov r30, r15 390de: f0 e0 ldi r31, 0x00 ; 0 390e0: ee 0f add r30, r30 390e2: ff 1f adc r31, r31 390e4: ee 5f subi r30, 0xFE ; 254 390e6: f2 45 sbci r31, 0x52 ; 82 390e8: 85 91 lpm r24, Z+ 390ea: 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()); 390ec: 0e 94 b3 72 call 0xe566 ; 0xe566 390f0: 6c 01 movw r12, r24 390f2: 00 e0 ldi r16, 0x00 ; 0 390f4: 11 e7 ldi r17, 0x71 ; 113 390f6: 99 e0 ldi r25, 0x09 ; 9 390f8: e9 2e mov r14, r25 390fa: 32 cf rjmp .-412 ; 0x38f60 000390fc : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 390fc: 0f 94 f3 c5 call 0x38be6 ; 0x38be6 // 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); 39100: e8 2f mov r30, r24 39102: f0 e0 ldi r31, 0x00 ; 0 39104: ee 0f add r30, r30 39106: ff 1f adc r31, r31 39108: e6 55 subi r30, 0x56 ; 86 3910a: f3 45 sbci r31, 0x53 ; 83 3910c: 25 91 lpm r18, Z+ 3910e: 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) ) { 39110: 23 33 cpi r18, 0x33 ; 51 39112: 81 e0 ldi r24, 0x01 ; 1 39114: 38 07 cpc r19, r24 39116: 08 f0 brcs .+2 ; 0x3911a 39118: 41 c0 rjmp .+130 ; 0x3919c 3911a: 2d 32 cpi r18, 0x2D ; 45 3911c: 81 e0 ldi r24, 0x01 ; 1 3911e: 38 07 cpc r19, r24 39120: 78 f5 brcc .+94 ; 0x39180 39122: 2e 37 cpi r18, 0x7E ; 126 39124: 31 05 cpc r19, r1 39126: 09 f4 brne .+2 ; 0x3912a 39128: 83 c0 rjmp .+262 ; 0x39230 3912a: f0 f4 brcc .+60 ; 0x39168 3912c: 2c 36 cpi r18, 0x6C ; 108 3912e: 31 05 cpc r19, r1 39130: 09 f4 brne .+2 ; 0x39134 39132: 85 c0 rjmp .+266 ; 0x3923e 39134: 30 f4 brcc .+12 ; 0x39142 39136: 25 36 cpi r18, 0x65 ; 101 39138: 31 05 cpc r19, r1 3913a: 08 f0 brcs .+2 ; 0x3913e 3913c: 79 c0 rjmp .+242 ; 0x39230 default: break; } return Buttons::NoButton; 3913e: 8f ef ldi r24, 0xFF ; 255 39140: 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) ) { 39142: 24 37 cpi r18, 0x74 ; 116 39144: 31 05 cpc r19, r1 39146: 09 f4 brne .+2 ; 0x3914a 39148: 73 c0 rjmp .+230 ; 0x39230 3914a: 2d 37 cpi r18, 0x7D ; 125 3914c: 31 05 cpc r19, r1 3914e: 19 f0 breq .+6 ; 0x39156 39150: 23 37 cpi r18, 0x73 ; 115 39152: 31 05 cpc r19, r1 39154: a1 f7 brne .-24 ; 0x3913e break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 39156: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 3915a: 81 30 cpi r24, 0x01 ; 1 3915c: 09 f4 brne .+2 ; 0x39160 3915e: 6d c0 rjmp .+218 ; 0x3923a 39160: 87 30 cpi r24, 0x07 ; 7 39162: 69 f7 brne .-38 ; 0x3913e // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 39164: 88 e0 ldi r24, 0x08 ; 8 39166: 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) ) { 39168: 23 3d cpi r18, 0xD3 ; 211 3916a: 31 05 cpc r19, r1 3916c: 09 f4 brne .+2 ; 0x39170 3916e: 6e c0 rjmp .+220 ; 0x3924c 39170: 50 f4 brcc .+20 ; 0x39186 39172: 29 3c cpi r18, 0xC9 ; 201 39174: 31 05 cpc r19, r1 39176: 09 f4 brne .+2 ; 0x3917a 39178: 69 c0 rjmp .+210 ; 0x3924c 3917a: 2a 3c cpi r18, 0xCA ; 202 3917c: 31 05 cpc r19, r1 3917e: f9 f6 brne .-66 ; 0x3913e 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) { 39180: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39184: 67 c0 rjmp .+206 ; 0x39254 // 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) ) { 39186: 2d 3d cpi r18, 0xDD ; 221 39188: 31 05 cpc r19, r1 3918a: 09 f4 brne .+2 ; 0x3918e 3918c: 5f c0 rjmp .+190 ; 0x3924c 3918e: 2e 3d cpi r18, 0xDE ; 222 39190: 31 05 cpc r19, r1 39192: b1 f3 breq .-20 ; 0x39180 39194: 24 3d cpi r18, 0xD4 ; 212 39196: 31 05 cpc r19, r1 39198: 91 f6 brne .-92 ; 0x3913e 3919a: f2 cf rjmp .-28 ; 0x39180 3919c: 25 3f cpi r18, 0xF5 ; 245 3919e: 81 e0 ldi r24, 0x01 ; 1 391a0: 38 07 cpc r19, r24 391a2: 09 f4 brne .+2 ; 0x391a6 391a4: 5c c0 rjmp .+184 ; 0x3925e 391a6: f8 f4 brcc .+62 ; 0x391e6 391a8: 26 34 cpi r18, 0x46 ; 70 391aa: 81 e0 ldi r24, 0x01 ; 1 391ac: 38 07 cpc r19, r24 391ae: 58 f4 brcc .+22 ; 0x391c6 391b0: 21 34 cpi r18, 0x41 ; 65 391b2: 81 e0 ldi r24, 0x01 ; 1 391b4: 38 07 cpc r19, r24 391b6: 20 f7 brcc .-56 ; 0x39180 391b8: 27 53 subi r18, 0x37 ; 55 391ba: 31 40 sbci r19, 0x01 ; 1 391bc: 25 30 cpi r18, 0x05 ; 5 391be: 31 05 cpc r19, r1 391c0: 08 f0 brcs .+2 ; 0x391c4 391c2: bd cf rjmp .-134 ; 0x3913e 391c4: dd cf rjmp .-70 ; 0x39180 391c6: 21 59 subi r18, 0x91 ; 145 391c8: 31 40 sbci r19, 0x01 ; 1 391ca: 22 30 cpi r18, 0x02 ; 2 391cc: 31 05 cpc r19, r1 391ce: 08 f0 brcs .+2 ; 0x391d2 391d0: b6 cf rjmp .-148 ; 0x3913e } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 391d2: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391d6: 83 30 cpi r24, 0x03 ; 3 391d8: 09 f4 brne .+2 ; 0x391dc 391da: 3f c0 rjmp .+126 ; 0x3925a 391dc: 89 30 cpi r24, 0x09 ; 9 391de: 09 f0 breq .+2 ; 0x391e2 391e0: ae cf rjmp .-164 ; 0x3913e case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 391e2: 87 e0 ldi r24, 0x07 ; 7 391e4: 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) ) { 391e6: 29 3f cpi r18, 0xF9 ; 249 391e8: 81 e0 ldi r24, 0x01 ; 1 391ea: 38 07 cpc r19, r24 391ec: 49 f2 breq .-110 ; 0x39180 391ee: 70 f4 brcc .+28 ; 0x3920c 391f0: 27 3f cpi r18, 0xF7 ; 247 391f2: 81 e0 ldi r24, 0x01 ; 1 391f4: 38 07 cpc r19, r24 391f6: 21 f2 breq .-120 ; 0x39180 391f8: 60 f7 brcc .-40 ; 0x391d2 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 391fa: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 391fe: 83 30 cpi r24, 0x03 ; 3 39200: 61 f1 breq .+88 ; 0x3925a 39202: 88 30 cpi r24, 0x08 ; 8 39204: 09 f0 breq .+2 ; 0x39208 39206: 9b cf rjmp .-202 ; 0x3913e case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 39208: 86 e0 ldi r24, 0x06 ; 6 3920a: 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) ) { 3920c: 2b 3f cpi r18, 0xFB ; 251 3920e: 81 e0 ldi r24, 0x01 ; 1 39210: 38 07 cpc r19, r24 39212: a9 f0 breq .+42 ; 0x3923e 39214: 68 f0 brcs .+26 ; 0x39230 39216: 2c 3f cpi r18, 0xFC ; 252 39218: 31 40 sbci r19, 0x01 ; 1 3921a: 09 f0 breq .+2 ; 0x3921e 3921c: 90 cf rjmp .-224 ; 0x3913e default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 3921e: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39222: 85 30 cpi r24, 0x05 ; 5 39224: 89 f0 breq .+34 ; 0x39248 39226: 86 30 cpi r24, 0x06 ; 6 39228: 09 f0 breq .+2 ; 0x3922c 3922a: 89 cf rjmp .-238 ; 0x3913e case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 3922c: 85 e0 ldi r24, 0x05 ; 5 3922e: 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) { 39230: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39234: 81 30 cpi r24, 0x01 ; 1 39236: 09 f0 breq .+2 ; 0x3923a 39238: 82 cf rjmp .-252 ; 0x3913e 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; 3923a: 81 e0 ldi r24, 0x01 ; 1 3923c: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 3923e: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39242: 82 30 cpi r24, 0x02 ; 2 39244: d1 f3 breq .-12 ; 0x3923a 39246: 7b cf rjmp .-266 ; 0x3913e } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 39248: 84 e0 ldi r24, 0x04 ; 4 3924a: 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) { 3924c: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39250: 82 30 cpi r24, 0x02 ; 2 39252: 61 f0 breq .+24 ; 0x3926c 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) { 39254: 83 30 cpi r24, 0x03 ; 3 39256: 09 f0 breq .+2 ; 0x3925a 39258: 72 cf rjmp .-284 ; 0x3913e 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; 3925a: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 3925c: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 3925e: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.493> 39262: 82 30 cpi r24, 0x02 ; 2 39264: 29 f0 breq .+10 ; 0x39270 39266: 84 30 cpi r24, 0x04 ; 4 39268: 09 f0 breq .+2 ; 0x3926c 3926a: 69 cf rjmp .-302 ; 0x3913e 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; 3926c: 82 e0 ldi r24, 0x02 ; 2 3926e: 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; 39270: 80 e0 ldi r24, 0x00 ; 0 39272: 08 95 ret 00039274 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 39274: cf 93 push r28 39276: df 93 push r29 39278: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 3927a: 60 91 b0 0d lds r22, 0x0DB0 ; 0x800db0 3927e: 70 91 b1 0d lds r23, 0x0DB1 ; 0x800db1 39282: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 39286: 90 91 b3 0d lds r25, 0x0DB3 ; 0x800db3 3928a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 3928e: 20 91 b6 0d lds r18, 0x0DB6 ; 0x800db6 39292: 30 91 b7 0d lds r19, 0x0DB7 ; 0x800db7 39296: c9 01 movw r24, r18 39298: 86 1b sub r24, r22 3929a: 97 0b sbc r25, r23 3929c: 06 97 sbiw r24, 0x06 ; 6 3929e: 24 f0 brlt .+8 ; 0x392a8 (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); 392a0: ce 01 movw r24, r28 392a2: 0e 94 eb 8c call 0x119d6 ; 0x119d6 392a6: e9 cf rjmp .-46 ; 0x3927a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.385]+0x6> f(); safe_delay_keep_alive(delay); } } 392a8: df 91 pop r29 392aa: cf 91 pop r28 392ac: 08 95 ret 000392ae : } //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) { 392ae: cf 93 push r28 392b0: df 93 push r29 392b2: 00 d0 rcall .+0 ; 0x392b4 392b4: 00 d0 rcall .+0 ; 0x392b6 392b6: 1f 92 push r1 392b8: cd b7 in r28, 0x3d ; 61 392ba: 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)) 392bc: 87 30 cpi r24, 0x07 ; 7 392be: 50 f5 brcc .+84 ; 0x39314 392c0: 67 30 cpi r22, 0x07 ; 7 392c2: 40 f5 brcc .+80 ; 0x39314 return false; uint8_t valid_points_mask[7] = { 392c4: 97 e0 ldi r25, 0x07 ; 7 392c6: e6 ec ldi r30, 0xC6 ; 198 392c8: f2 e0 ldi r31, 0x02 ; 2 392ca: de 01 movw r26, r28 392cc: 11 96 adiw r26, 0x01 ; 1 392ce: 01 90 ld r0, Z+ 392d0: 0d 92 st X+, r0 392d2: 9a 95 dec r25 392d4: e1 f7 brne .-8 ; 0x392ce 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 392d6: 46 e0 ldi r20, 0x06 ; 6 392d8: 50 e0 ldi r21, 0x00 ; 0 392da: fa 01 movw r30, r20 392dc: e6 1b sub r30, r22 392de: f1 09 sbc r31, r1 392e0: 21 e0 ldi r18, 0x01 ; 1 392e2: 30 e0 ldi r19, 0x00 ; 0 392e4: 2c 0f add r18, r28 392e6: 3d 1f adc r19, r29 392e8: e2 0f add r30, r18 392ea: f3 1f adc r31, r19 392ec: 20 81 ld r18, Z 392ee: 30 e0 ldi r19, 0x00 ; 0 392f0: 48 1b sub r20, r24 392f2: 51 09 sbc r21, r1 392f4: c9 01 movw r24, r18 392f6: 02 c0 rjmp .+4 ; 0x392fc 392f8: 95 95 asr r25 392fa: 87 95 ror r24 392fc: 4a 95 dec r20 392fe: e2 f7 brpl .-8 ; 0x392f8 39300: 81 70 andi r24, 0x01 ; 1 } 39302: 27 96 adiw r28, 0x07 ; 7 39304: 0f b6 in r0, 0x3f ; 63 39306: f8 94 cli 39308: de bf out 0x3e, r29 ; 62 3930a: 0f be out 0x3f, r0 ; 63 3930c: cd bf out 0x3d, r28 ; 61 3930e: df 91 pop r29 39310: cf 91 pop r28 39312: 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; 39314: 80 e0 ldi r24, 0x00 ; 0 39316: f5 cf rjmp .-22 ; 0x39302 00039318 : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 39318: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 3931c: 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)) 39320: 80 e1 ldi r24, 0x10 ; 16 39322: 0e 94 a6 ee call 0x1dd4c ; 0x1dd4c 39326: 88 23 and r24, r24 39328: 91 f0 breq .+36 ; 0x3934e { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 3932a: 0e 94 86 79 call 0xf30c ; 0xf30c // 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))); 3932e: 81 ea ldi r24, 0xA1 ; 161 39330: 9d e0 ldi r25, 0x0D ; 13 39332: 0f 94 23 dc call 0x3b846 ; 0x3b846 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-> 39336: 2b e0 ldi r18, 0x0B ; 11 39338: 82 9f mul r24, r18 3933a: c0 01 movw r24, r0 3933c: 11 24 eor r1, r1 3933e: 80 5b subi r24, 0xB0 ; 176 39340: 92 4f sbci r25, 0xF2 ; 242 39342: 0f 94 31 dc call 0x3b862 ; 0x3b862 39346: 90 93 8b 06 sts 0x068B, r25 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 3934a: 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 } } 3934e: 08 95 ret 00039350 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 39350: 0f 93 push r16 39352: 1f 93 push r17 39354: cf 93 push r28 39356: df 93 push r29 39358: 00 d0 rcall .+0 ; 0x3935a 3935a: 1f 92 push r1 3935c: cd b7 in r28, 0x3d ; 61 3935e: de b7 in r29, 0x3e ; 62 39360: 9b 01 movw r18, r22 39362: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 39364: 02 e9 ldi r16, 0x92 ; 146 39366: 16 e0 ldi r17, 0x06 ; 6 39368: f8 01 movw r30, r16 3936a: 60 85 ldd r22, Z+8 ; 0x08 3936c: 71 85 ldd r23, Z+9 ; 0x09 3936e: 82 85 ldd r24, Z+10 ; 0x0a 39370: 93 85 ldd r25, Z+11 ; 0x0b 39372: 69 83 std Y+1, r22 ; 0x01 39374: 7a 83 std Y+2, r23 ; 0x02 39376: 8b 83 std Y+3, r24 ; 0x03 39378: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 3937a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3937e: f8 01 movw r30, r16 39380: 60 87 std Z+8, r22 ; 0x08 39382: 71 87 std Z+9, r23 ; 0x09 39384: 82 87 std Z+10, r24 ; 0x0a 39386: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 39388: 65 e5 ldi r22, 0x55 ; 85 3938a: 75 e5 ldi r23, 0x55 ; 85 3938c: 85 e5 ldi r24, 0x55 ; 85 3938e: 91 e4 ldi r25, 0x41 ; 65 39390: 0f 94 50 c0 call 0x380a0 ; 0x380a0 st_synchronize(); 39394: 0f 94 ef 42 call 0x285de ; 0x285de current_position[Z_AXIS] = curpos_z; 39398: 89 81 ldd r24, Y+1 ; 0x01 3939a: 9a 81 ldd r25, Y+2 ; 0x02 3939c: ab 81 ldd r26, Y+3 ; 0x03 3939e: bc 81 ldd r27, Y+4 ; 0x04 393a0: f8 01 movw r30, r16 393a2: 80 87 std Z+8, r24 ; 0x08 393a4: 91 87 std Z+9, r25 ; 0x09 393a6: a2 87 std Z+10, r26 ; 0x0a 393a8: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 393aa: ce 01 movw r24, r28 393ac: 01 96 adiw r24, 0x01 ; 1 393ae: 0f 94 f8 63 call 0x2c7f0 ; 0x2c7f0 } 393b2: 0f 90 pop r0 393b4: 0f 90 pop r0 393b6: 0f 90 pop r0 393b8: 0f 90 pop r0 393ba: df 91 pop r29 393bc: cf 91 pop r28 393be: 1f 91 pop r17 393c0: 0f 91 pop r16 393c2: 08 95 ret 000393c4 : 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])); 393c4: 60 91 8a 06 lds r22, 0x068A ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> 393c8: 70 91 8b 06 lds r23, 0x068B ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 393cc: 07 2e mov r0, r23 393ce: 00 0c add r0, r0 393d0: 88 0b sbc r24, r24 393d2: 99 0b sbc r25, r25 393d4: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 393d8: 20 91 ca 0d lds r18, 0x0DCA ; 0x800dca 393dc: 30 91 cb 0d lds r19, 0x0DCB ; 0x800dcb 393e0: 40 91 cc 0d lds r20, 0x0DCC ; 0x800dcc 393e4: 50 91 cd 0d lds r21, 0x0DCD ; 0x800dcd 393e8: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 393ec: 0f 94 a8 c9 call 0x39350 ; 0x39350 babystepLoadZ = 0; 393f0: 10 92 8b 06 sts 0x068B, r1 ; 0x80068b <_ZL13babystepLoadZ.lto_priv.497+0x1> 393f4: 10 92 8a 06 sts 0x068A, r1 ; 0x80068a <_ZL13babystepLoadZ.lto_priv.497> } 393f8: 08 95 ret 000393fa : return sampled; } void go_home_with_z_lift() { 393fa: cf 93 push r28 393fc: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 393fe: 0e 94 ca 66 call 0xcd94 ; 0xcd94 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 39402: c2 e9 ldi r28, 0x92 ; 146 39404: d6 e0 ldi r29, 0x06 ; 6 39406: 80 e0 ldi r24, 0x00 ; 0 39408: 90 e0 ldi r25, 0x00 ; 0 3940a: a0 ea ldi r26, 0xA0 ; 160 3940c: b0 e4 ldi r27, 0x40 ; 64 3940e: 88 87 std Y+8, r24 ; 0x08 39410: 99 87 std Y+9, r25 ; 0x09 39412: aa 87 std Y+10, r26 ; 0x0a 39414: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 39416: 65 e5 ldi r22, 0x55 ; 85 39418: 75 e5 ldi r23, 0x55 ; 85 3941a: 85 e5 ldi r24, 0x55 ; 85 3941c: 91 e4 ldi r25, 0x41 ; 65 3941e: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 39422: 8d ec ldi r24, 0xCD ; 205 39424: 9c ec ldi r25, 0xCC ; 204 39426: ac e4 ldi r26, 0x4C ; 76 39428: be e3 ldi r27, 0x3E ; 62 3942a: 88 83 st Y, r24 3942c: 99 83 std Y+1, r25 ; 0x01 3942e: aa 83 std Y+2, r26 ; 0x02 39430: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 39432: 83 e3 ldi r24, 0x33 ; 51 39434: 93 e3 ldi r25, 0x33 ; 51 39436: a3 e7 ldi r26, 0x73 ; 115 39438: b0 ec ldi r27, 0xC0 ; 192 3943a: 8c 83 std Y+4, r24 ; 0x04 3943c: 9d 83 std Y+5, r25 ; 0x05 3943e: ae 83 std Y+6, r26 ; 0x06 39440: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 39442: 66 e9 ldi r22, 0x96 ; 150 39444: 76 e0 ldi r23, 0x06 ; 6 39446: ce 01 movw r24, r28 39448: 0e 94 b1 6a call 0xd562 ; 0xd562 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 3944c: 60 e0 ldi r22, 0x00 ; 0 3944e: 70 e0 ldi r23, 0x00 ; 0 39450: 86 e1 ldi r24, 0x16 ; 22 39452: 93 e4 ldi r25, 0x43 ; 67 39454: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 39458: 8a e9 ldi r24, 0x9A ; 154 3945a: 99 e9 ldi r25, 0x99 ; 153 3945c: a9 e1 ldi r26, 0x19 ; 25 3945e: be e3 ldi r27, 0x3E ; 62 39460: 88 87 std Y+8, r24 ; 0x08 39462: 99 87 std Y+9, r25 ; 0x09 39464: aa 87 std Y+10, r26 ; 0x0a 39466: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 39468: 65 e5 ldi r22, 0x55 ; 85 3946a: 75 e5 ldi r23, 0x55 ; 85 3946c: 85 e5 ldi r24, 0x55 ; 85 3946e: 91 e4 ldi r25, 0x41 ; 65 } 39470: df 91 pop r29 39472: 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); 39474: 0d 94 d8 c5 jmp 0x38bb0 ; 0x38bb0 00039478 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 39478: 68 2f mov r22, r24 3947a: 70 e0 ldi r23, 0x00 ; 0 3947c: 90 e0 ldi r25, 0x00 ; 0 3947e: 80 e0 ldi r24, 0x00 ; 0 39480: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 39484: 20 e0 ldi r18, 0x00 ; 0 39486: 30 e0 ldi r19, 0x00 ; 0 39488: 48 e0 ldi r20, 0x08 ; 8 3948a: 52 e4 ldi r21, 0x42 ; 66 3948c: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 39490: 20 e0 ldi r18, 0x00 ; 0 39492: 30 e0 ldi r19, 0x00 ; 0 39494: 40 e8 ldi r20, 0x80 ; 128 39496: 5f e3 ldi r21, 0x3F ; 63 39498: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> } 3949c: 08 95 ret 0003949e : // 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() { 3949e: 2f 92 push r2 394a0: 3f 92 push r3 394a2: 4f 92 push r4 394a4: 5f 92 push r5 394a6: 6f 92 push r6 394a8: 7f 92 push r7 394aa: 8f 92 push r8 394ac: 9f 92 push r9 394ae: af 92 push r10 394b0: bf 92 push r11 394b2: cf 92 push r12 394b4: df 92 push r13 394b6: ef 92 push r14 394b8: ff 92 push r15 394ba: 0f 93 push r16 394bc: 1f 93 push r17 394be: cf 93 push r28 394c0: df 93 push r29 394c2: 00 d0 rcall .+0 ; 0x394c4 394c4: 00 d0 rcall .+0 ; 0x394c6 394c6: cd b7 in r28, 0x3d ; 61 394c8: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 394ca: 84 e0 ldi r24, 0x04 ; 4 394cc: 0f 94 df 25 call 0x24bbe ; 0x24bbe return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 394d0: 80 91 b7 02 lds r24, 0x02B7 ; 0x8002b7 <_ZL14check_endstops.lto_priv.402> 394d4: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 394d6: 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); 394da: 80 e0 ldi r24, 0x00 ; 0 394dc: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 394e0: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 394e2: 0e 94 ca 66 call 0xcd94 ; 0xcd94 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 394e6: 8d e9 ldi r24, 0x9D ; 157 394e8: 9b e5 ldi r25, 0x5B ; 91 394ea: 0e 94 b3 72 call 0xe566 ; 0xe566 394ee: 0f 94 eb 1f call 0x23fd6 ; 0x23fd6 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 394f2: 4c ef ldi r20, 0xFC ; 252 394f4: 50 e7 ldi r21, 0x70 ; 112 394f6: 63 e0 ldi r22, 0x03 ; 3 394f8: 80 e0 ldi r24, 0x00 ; 0 394fa: 0e 94 fb 6e call 0xddf6 ; 0xddf6 394fe: 81 e0 ldi r24, 0x01 ; 1 39500: 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; 39504: 80 e0 ldi r24, 0x00 ; 0 39506: 90 e0 ldi r25, 0x00 ; 0 39508: a0 ea ldi r26, 0xA0 ; 160 3950a: b0 e4 ldi r27, 0x40 ; 64 3950c: 80 93 9a 06 sts 0x069A, r24 ; 0x80069a 39510: 90 93 9b 06 sts 0x069B, r25 ; 0x80069b 39514: a0 93 9c 06 sts 0x069C, r26 ; 0x80069c 39518: b0 93 9d 06 sts 0x069D, r27 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 3951c: 65 e5 ldi r22, 0x55 ; 85 3951e: 75 e5 ldi r23, 0x55 ; 85 39520: 85 e5 ldi r24, 0x55 ; 85 39522: 91 e4 ldi r25, 0x41 ; 65 39524: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 #ifdef TMC2130 check_Z_crash(); 39528: 0e 94 38 7a call 0xf470 ; 0xf470 3952c: 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; 39530: 80 e0 ldi r24, 0x00 ; 0 39532: 90 e0 ldi r25, 0x00 ; 0 39534: a0 e8 ldi r26, 0x80 ; 128 39536: bf e3 ldi r27, 0x3F ; 63 39538: 80 93 92 06 sts 0x0692, r24 ; 0x800692 3953c: 90 93 93 06 sts 0x0693, r25 ; 0x800693 39540: a0 93 94 06 sts 0x0694, r26 ; 0x800694 39544: b0 93 95 06 sts 0x0695, r27 ; 0x800695 current_position[Y_AXIS] = BED_Y0; 39548: 80 93 96 06 sts 0x0696, r24 ; 0x800696 3954c: 90 93 97 06 sts 0x0697, r25 ; 0x800697 39550: a0 93 98 06 sts 0x0698, r26 ; 0x800698 39554: b0 93 99 06 sts 0x0699, r27 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 39558: 66 e9 ldi r22, 0x96 ; 150 3955a: 76 e0 ldi r23, 0x06 ; 6 3955c: 82 e9 ldi r24, 0x92 ; 146 3955e: 96 e0 ldi r25, 0x06 ; 6 39560: 0e 94 b1 6a call 0xd562 ; 0xd562 go_to_current(homing_feedrate[X_AXIS]/60); 39564: 60 e0 ldi r22, 0x00 ; 0 39566: 70 e0 ldi r23, 0x00 ; 0 39568: 88 e4 ldi r24, 0x48 ; 72 3956a: 92 e4 ldi r25, 0x42 ; 66 3956c: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 set_destination_to_current(); 39570: 0e 94 41 68 call 0xd082 ; 0xd082 homeaxis(Z_AXIS); 39574: 50 e0 ldi r21, 0x00 ; 0 39576: 40 e0 ldi r20, 0x00 ; 0 39578: 61 e0 ldi r22, 0x01 ; 1 3957a: 82 e0 ldi r24, 0x02 ; 2 3957c: 0e 94 72 7a call 0xf4e4 ; 0xf4e4 if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39580: 43 e0 ldi r20, 0x03 ; 3 39582: 60 e0 ldi r22, 0x00 ; 0 39584: 70 e0 ldi r23, 0x00 ; 0 39586: 80 e2 ldi r24, 0x20 ; 32 39588: 91 ec ldi r25, 0xC1 ; 193 3958a: 0f 94 5e 8c call 0x318bc ; 0x318bc 3958e: 81 11 cpse r24, r1 39590: 06 c0 rjmp .+12 ; 0x3959e 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)); 39592: 81 e5 ldi r24, 0x51 ; 81 39594: 94 e6 ldi r25, 0x64 ; 100 39596: 0e 94 b3 72 call 0xe566 ; 0xe566 3959a: 0e 94 11 7a call 0xf422 ; 0xf422 float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 3959e: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 395a2: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 395a6: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 395aa: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 395ae: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 395b2: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 395b6: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 395ba: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 395be: e2 e0 ldi r30, 0x02 ; 2 395c0: f0 e0 ldi r31, 0x00 ; 0 395c2: fa 83 std Y+2, r31 ; 0x02 395c4: 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; 395c6: c1 2c mov r12, r1 395c8: d1 2c mov r13, r1 395ca: 30 ea ldi r19, 0xA0 ; 160 395cc: e3 2e mov r14, r19 395ce: 30 e4 ldi r19, 0x40 ; 64 395d0: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 395d2: 43 e0 ldi r20, 0x03 ; 3 395d4: 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 395d6: 52 e0 ldi r21, 0x02 ; 2 395d8: 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); 395da: 0e e0 ldi r16, 0x0E ; 14 395dc: 1c ea ldi r17, 0xAC ; 172 395de: 67 e0 ldi r22, 0x07 ; 7 395e0: 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(); 395e2: 0e 94 ca 66 call 0xcd94 ; 0xcd94 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 395e6: c0 92 9a 06 sts 0x069A, r12 ; 0x80069a 395ea: d0 92 9b 06 sts 0x069B, r13 ; 0x80069b 395ee: e0 92 9c 06 sts 0x069C, r14 ; 0x80069c 395f2: f0 92 9d 06 sts 0x069D, r15 ; 0x80069d go_to_current(homing_feedrate[Z_AXIS]/60); 395f6: 65 e5 ldi r22, 0x55 ; 85 395f8: 75 e5 ldi r23, 0x55 ; 85 395fa: 85 e5 ldi r24, 0x55 ; 85 395fc: 91 e4 ldi r25, 0x41 ; 65 395fe: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 39602: 29 81 ldd r18, Y+1 ; 0x01 39604: 21 50 subi r18, 0x01 ; 1 39606: 82 2f mov r24, r18 39608: 6b 2d mov r22, r11 3960a: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 3960e: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 39610: 82 2f mov r24, r18 39612: 0f 94 de dc call 0x3b9bc ; 0x3b9bc <__divmodqi4> 39616: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 39618: 80 ff sbrs r24, 0 3961a: 03 c0 rjmp .+6 ; 0x39622 3961c: f9 2d mov r31, r9 3961e: f8 19 sub r31, r8 39620: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 39622: 88 2d mov r24, r8 39624: 88 0f add r24, r24 39626: 88 0d add r24, r8 39628: 0f 94 3c ca call 0x39478 ; 0x39478 3962c: 60 93 92 06 sts 0x0692, r22 ; 0x800692 39630: 70 93 93 06 sts 0x0693, r23 ; 0x800693 39634: 80 93 94 06 sts 0x0694, r24 ; 0x800694 39638: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = BED_Y(iy * 3); 3963c: 87 2d mov r24, r7 3963e: 88 0f add r24, r24 39640: 87 0d add r24, r7 39642: 0f 94 3c ca call 0x39478 ; 0x39478 39646: 60 93 96 06 sts 0x0696, r22 ; 0x800696 3964a: 70 93 97 06 sts 0x0697, r23 ; 0x800697 3964e: 80 93 98 06 sts 0x0698, r24 ; 0x800698 39652: 90 93 99 06 sts 0x0699, r25 ; 0x800699 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 39656: 66 e9 ldi r22, 0x96 ; 150 39658: 76 e0 ldi r23, 0x06 ; 6 3965a: 82 e9 ldi r24, 0x92 ; 146 3965c: 96 e0 ldi r25, 0x06 ; 6 3965e: 0e 94 b1 6a call 0xd562 ; 0xd562 go_to_current(homing_feedrate[X_AXIS]/60); 39662: 60 e0 ldi r22, 0x00 ; 0 39664: 70 e0 ldi r23, 0x00 ; 0 39666: 88 e4 ldi r24, 0x48 ; 72 39668: 92 e4 ldi r25, 0x42 ; 66 3966a: 0f 94 d8 c5 call 0x38bb0 ; 0x38bb0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 3966e: 63 e0 ldi r22, 0x03 ; 3 39670: 80 e0 ldi r24, 0x00 ; 0 39672: 0e 94 e7 6e call 0xddce ; 0xddce lcd_printf_P(PSTR("%d/9"),mesh_point+1); 39676: 8a 81 ldd r24, Y+2 ; 0x02 39678: 8f 93 push r24 3967a: 99 81 ldd r25, Y+1 ; 0x01 3967c: 9f 93 push r25 3967e: 1f 93 push r17 39680: 0f 93 push r16 39682: 0e 94 c0 6e call 0xdd80 ; 0xdd80 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39686: 43 e0 ldi r20, 0x03 ; 3 39688: 60 e0 ldi r22, 0x00 ; 0 3968a: 70 e0 ldi r23, 0x00 ; 0 3968c: 80 e2 ldi r24, 0x20 ; 32 3968e: 91 ec ldi r25, 0xC1 ; 193 39690: 0f 94 5e 8c call 0x318bc ; 0x318bc 39694: 58 2e mov r5, r24 39696: 0f 90 pop r0 39698: 0f 90 pop r0 3969a: 0f 90 pop r0 3969c: 0f 90 pop r0 3969e: 88 23 and r24, r24 396a0: 09 f4 brne .+2 ; 0x396a4 396a2: 77 cf rjmp .-274 ; 0x39592 396a4: a7 9c mul r10, r7 396a6: f0 01 movw r30, r0 396a8: 11 24 eor r1, r1 396aa: e8 0d add r30, r8 396ac: f1 1d adc r31, r1 396ae: ee 0f add r30, r30 396b0: ff 1f adc r31, r31 396b2: ee 0f add r30, r30 396b4: ff 1f adc r31, r31 396b6: ee 53 subi r30, 0x3E ; 62 396b8: fc 4e sbci r31, 0xEC ; 236 396ba: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 396be: 90 91 9b 06 lds r25, 0x069B ; 0x80069b 396c2: a0 91 9c 06 lds r26, 0x069C ; 0x80069c 396c6: b0 91 9d 06 lds r27, 0x069D ; 0x80069d 396ca: 81 83 std Z+1, r24 ; 0x01 396cc: 92 83 std Z+2, r25 ; 0x02 396ce: a3 83 std Z+3, r26 ; 0x03 396d0: b4 83 std Z+4, r27 ; 0x04 396d2: e9 81 ldd r30, Y+1 ; 0x01 396d4: fa 81 ldd r31, Y+2 ; 0x02 396d6: 31 96 adiw r30, 0x01 ; 1 396d8: fa 83 std Y+2, r31 ; 0x02 396da: 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) { 396dc: 3a 97 sbiw r30, 0x0a ; 10 396de: 09 f0 breq .+2 ; 0x396e2 396e0: 80 cf rjmp .-256 ; 0x395e2 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 396e2: 60 90 c3 13 lds r6, 0x13C3 ; 0x8013c3 396e6: 70 90 c4 13 lds r7, 0x13C4 ; 0x8013c4 396ea: 80 90 c5 13 lds r8, 0x13C5 ; 0x8013c5 396ee: 90 90 c6 13 lds r9, 0x13C6 ; 0x8013c6 float zmax = zmin; 396f2: 46 2c mov r4, r6 396f4: a7 2c mov r10, r7 396f6: b8 2c mov r11, r8 396f8: 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]; 396fa: 1e 82 std Y+6, r1 ; 0x06 396fc: 1d 82 std Y+5, r1 ; 0x05 396fe: 02 ec ldi r16, 0xC2 ; 194 39700: 13 e1 ldi r17, 0x13 ; 19 39702: 8d 81 ldd r24, Y+5 ; 0x05 39704: 9e 81 ldd r25, Y+6 ; 0x06 39706: 8d 53 subi r24, 0x3D ; 61 39708: 9c 4e sbci r25, 0xEC ; 236 3970a: 9a 83 std Y+2, r25 ; 0x02 3970c: 89 83 std Y+1, r24 ; 0x01 3970e: 93 e0 ldi r25, 0x03 ; 3 39710: 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]); 39712: e9 81 ldd r30, Y+1 ; 0x01 39714: fa 81 ldd r31, Y+2 ; 0x02 39716: c1 90 ld r12, Z+ 39718: d1 90 ld r13, Z+ 3971a: e1 90 ld r14, Z+ 3971c: f1 90 ld r15, Z+ 3971e: fa 83 std Y+2, r31 ; 0x02 39720: e9 83 std Y+1, r30 ; 0x01 39722: 93 01 movw r18, r6 39724: a4 01 movw r20, r8 39726: c7 01 movw r24, r14 39728: b6 01 movw r22, r12 3972a: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 3972e: 18 16 cp r1, r24 39730: 14 f0 brlt .+4 ; 0x39736 39732: 36 01 movw r6, r12 39734: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 39736: 24 2d mov r18, r4 39738: 3a 2d mov r19, r10 3973a: 4b 2d mov r20, r11 3973c: 52 2d mov r21, r2 3973e: c7 01 movw r24, r14 39740: b6 01 movw r22, r12 39742: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39746: 87 fd sbrc r24, 7 39748: 04 c0 rjmp .+8 ; 0x39752 3974a: 4c 2c mov r4, r12 3974c: ad 2c mov r10, r13 3974e: be 2c mov r11, r14 39750: 2f 2c mov r2, r15 39752: 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) { 39754: 31 10 cpse r3, r1 39756: dd cf rjmp .-70 ; 0x39712 39758: 8d 81 ldd r24, Y+5 ; 0x05 3975a: 9e 81 ldd r25, Y+6 ; 0x06 3975c: 4c 96 adiw r24, 0x1c ; 28 3975e: 9e 83 std Y+6, r25 ; 0x06 39760: 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) 39762: 84 35 cpi r24, 0x54 ; 84 39764: 91 05 cpc r25, r1 39766: 59 f6 brne .-106 ; 0x396fe 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) { 39768: 93 01 movw r18, r6 3976a: a4 01 movw r20, r8 3976c: 64 2d mov r22, r4 3976e: 7a 2d mov r23, r10 39770: 8b 2d mov r24, r11 39772: 92 2d mov r25, r2 39774: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 39778: 20 e0 ldi r18, 0x00 ; 0 3977a: 30 e0 ldi r19, 0x00 ; 0 3977c: 40 e4 ldi r20, 0x40 ; 64 3977e: 50 e4 ldi r21, 0x40 ; 64 39780: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 39784: 18 16 cp r1, r24 39786: 3c f5 brge .+78 ; 0x397d6 // 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!"); 39788: 81 ef ldi r24, 0xF1 ; 241 3978a: 9b ea ldi r25, 0xAB ; 171 3978c: 0e 94 82 79 call 0xf304 ; 0xf304 // 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; 39790: 51 2c mov r5, r1 39792: fc 81 ldd r31, Y+4 ; 0x04 39794: 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); 39798: 8b 81 ldd r24, Y+3 ; 0x03 3979a: 0f 94 e9 4d call 0x29bd2 ; 0x29bd2 #ifdef TMC2130 tmc2130_home_exit(); 3979e: 0f 94 b0 25 call 0x24b60 ; 0x24b60 #endif return result; } 397a2: 85 2d mov r24, r5 397a4: 26 96 adiw r28, 0x06 ; 6 397a6: 0f b6 in r0, 0x3f ; 63 397a8: f8 94 cli 397aa: de bf out 0x3e, r29 ; 62 397ac: 0f be out 0x3f, r0 ; 63 397ae: cd bf out 0x3d, r28 ; 61 397b0: df 91 pop r29 397b2: cf 91 pop r28 397b4: 1f 91 pop r17 397b6: 0f 91 pop r16 397b8: ff 90 pop r15 397ba: ef 90 pop r14 397bc: df 90 pop r13 397be: cf 90 pop r12 397c0: bf 90 pop r11 397c2: af 90 pop r10 397c4: 9f 90 pop r9 397c6: 8f 90 pop r8 397c8: 7f 90 pop r7 397ca: 6f 90 pop r6 397cc: 5f 90 pop r5 397ce: 4f 90 pop r4 397d0: 3f 90 pop r3 397d2: 2f 90 pop r2 397d4: 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) 397d6: 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; 397d8: 85 ec ldi r24, 0xC5 ; 197 397da: e8 2e mov r14, r24 397dc: 8f e0 ldi r24, 0x0F ; 15 397de: f8 2e mov r15, r24 397e0: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 397e2: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 397e4: 9d 81 ldd r25, Y+5 ; 0x05 397e6: 91 11 cpse r25, r1 397e8: 03 c0 rjmp .+6 ; 0x397f0 397ea: e9 81 ldd r30, Y+1 ; 0x01 397ec: ee 23 and r30, r30 397ee: 29 f1 breq .+74 ; 0x3983a continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 397f0: 20 91 c3 13 lds r18, 0x13C3 ; 0x8013c3 397f4: 30 91 c4 13 lds r19, 0x13C4 ; 0x8013c4 397f8: 40 91 c5 13 lds r20, 0x13C5 ; 0x8013c5 397fc: 50 91 c6 13 lds r21, 0x13C6 ; 0x8013c6 39800: f6 01 movw r30, r12 39802: 61 81 ldd r22, Z+1 ; 0x01 39804: 72 81 ldd r23, Z+2 ; 0x02 39806: 83 81 ldd r24, Z+3 ; 0x03 39808: 94 81 ldd r25, Z+4 ; 0x04 3980a: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 3980e: 20 e0 ldi r18, 0x00 ; 0 39810: 30 e0 ldi r19, 0x00 ; 0 39812: 48 ec ldi r20, 0xC8 ; 200 39814: 52 e4 ldi r21, 0x42 ; 66 39816: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3981a: 20 e0 ldi r18, 0x00 ; 0 3981c: 30 e0 ldi r19, 0x00 ; 0 3981e: 40 e0 ldi r20, 0x00 ; 0 39820: 5f e3 ldi r21, 0x3F ; 63 39822: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 39826: 0f 94 f2 de call 0x3bde4 ; 0x3bde4 3982a: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 3982e: c7 01 movw r24, r14 39830: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 39834: f2 e0 ldi r31, 0x02 ; 2 39836: ef 0e add r14, r31 39838: f1 1c adc r15, r1 3983a: 84 e0 ldi r24, 0x04 ; 4 3983c: c8 0e add r12, r24 3983e: d1 1c adc r13, r1 39840: 9d 81 ldd r25, Y+5 ; 0x05 39842: 9f 5f subi r25, 0xFF ; 255 39844: 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) { 39846: 93 30 cpi r25, 0x03 ; 3 39848: 69 f6 brne .-102 ; 0x397e4 3984a: 04 5e subi r16, 0xE4 ; 228 3984c: 1f 4f sbci r17, 0xFF ; 255 3984e: e9 81 ldd r30, Y+1 ; 0x01 39850: ef 5f subi r30, 0xFF ; 255 39852: 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) 39854: e3 30 cpi r30, 0x03 ; 3 39856: 21 f6 brne .-120 ; 0x397e0 #endif addr += 2; } } mbl.reset(); 39858: 0f 94 54 8c call 0x318a8 ; 0x318a8 go_home_with_z_lift(); 3985c: 0f 94 fd c9 call 0x393fa ; 0x393fa 39860: 98 cf rjmp .-208 ; 0x39792 00039862 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 39862: 82 e0 ldi r24, 0x02 ; 2 39864: 0f 94 db 42 call 0x285b6 ; 0x285b6 39868: 60 93 9a 06 sts 0x069A, r22 ; 0x80069a 3986c: 70 93 9b 06 sts 0x069B, r23 ; 0x80069b 39870: 80 93 9c 06 sts 0x069C, r24 ; 0x80069c 39874: 90 93 9d 06 sts 0x069D, r25 ; 0x80069d plan_set_z_position(current_position[Z_AXIS]); 39878: 8a e9 ldi r24, 0x9A ; 154 3987a: 96 e0 ldi r25, 0x06 ; 6 3987c: 0d 94 f8 63 jmp 0x2c7f0 ; 0x2c7f0 00039880 : * 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() { 39880: 4f 92 push r4 39882: 5f 92 push r5 39884: 6f 92 push r6 39886: 7f 92 push r7 39888: 8f 92 push r8 3988a: 9f 92 push r9 3988c: af 92 push r10 3988e: bf 92 push r11 39890: cf 92 push r12 39892: df 92 push r13 39894: ef 92 push r14 39896: ff 92 push r15 39898: 0f 93 push r16 3989a: 1f 93 push r17 3989c: cf 93 push r28 3989e: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 398a0: 02 e9 ldi r16, 0x92 ; 146 398a2: 16 e0 ldi r17, 0x06 ; 6 398a4: c7 e0 ldi r28, 0x07 ; 7 398a6: d8 e1 ldi r29, 0x18 ; 24 398a8: 28 81 ld r18, Y 398aa: 39 81 ldd r19, Y+1 ; 0x01 398ac: 4a 81 ldd r20, Y+2 ; 0x02 398ae: 5b 81 ldd r21, Y+3 ; 0x03 398b0: f8 01 movw r30, r16 398b2: 60 81 ld r22, Z 398b4: 71 81 ldd r23, Z+1 ; 0x01 398b6: 82 81 ldd r24, Z+2 ; 0x02 398b8: 93 81 ldd r25, Z+3 ; 0x03 398ba: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 398be: 4b 01 movw r8, r22 398c0: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 398c2: 2c 81 ldd r18, Y+4 ; 0x04 398c4: 3d 81 ldd r19, Y+5 ; 0x05 398c6: 4e 81 ldd r20, Y+6 ; 0x06 398c8: 5f 81 ldd r21, Y+7 ; 0x07 398ca: f8 01 movw r30, r16 398cc: 64 81 ldd r22, Z+4 ; 0x04 398ce: 75 81 ldd r23, Z+5 ; 0x05 398d0: 86 81 ldd r24, Z+6 ; 0x06 398d2: 97 81 ldd r25, Z+7 ; 0x07 398d4: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 398d8: 6b 01 movw r12, r22 398da: 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; 398dc: c7 ef ldi r28, 0xF7 ; 247 398de: d7 e1 ldi r29, 0x17 ; 23 398e0: 28 81 ld r18, Y 398e2: 39 81 ldd r19, Y+1 ; 0x01 398e4: 4a 81 ldd r20, Y+2 ; 0x02 398e6: 5b 81 ldd r21, Y+3 ; 0x03 398e8: c5 01 movw r24, r10 398ea: b4 01 movw r22, r8 398ec: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 398f0: 2b 01 movw r4, r22 398f2: 3c 01 movw r6, r24 398f4: 2c 81 ldd r18, Y+4 ; 0x04 398f6: 3d 81 ldd r19, Y+5 ; 0x05 398f8: 4e 81 ldd r20, Y+6 ; 0x06 398fa: 5f 81 ldd r21, Y+7 ; 0x07 398fc: c7 01 movw r24, r14 398fe: b6 01 movw r22, r12 39900: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 39904: 9b 01 movw r18, r22 39906: ac 01 movw r20, r24 39908: c3 01 movw r24, r6 3990a: b2 01 movw r22, r4 3990c: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 39910: f8 01 movw r30, r16 39912: 60 83 st Z, r22 39914: 71 83 std Z+1, r23 ; 0x01 39916: 82 83 std Z+2, r24 ; 0x02 39918: 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; 3991a: 28 85 ldd r18, Y+8 ; 0x08 3991c: 39 85 ldd r19, Y+9 ; 0x09 3991e: 4a 85 ldd r20, Y+10 ; 0x0a 39920: 5b 85 ldd r21, Y+11 ; 0x0b 39922: c5 01 movw r24, r10 39924: b4 01 movw r22, r8 39926: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3992a: 4b 01 movw r8, r22 3992c: 5c 01 movw r10, r24 3992e: 2c 85 ldd r18, Y+12 ; 0x0c 39930: 3d 85 ldd r19, Y+13 ; 0x0d 39932: 4e 85 ldd r20, Y+14 ; 0x0e 39934: 5f 85 ldd r21, Y+15 ; 0x0f 39936: c7 01 movw r24, r14 39938: b6 01 movw r22, r12 3993a: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3993e: 9b 01 movw r18, r22 39940: ac 01 movw r20, r24 39942: c5 01 movw r24, r10 39944: b4 01 movw r22, r8 39946: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3994a: f8 01 movw r30, r16 3994c: 64 83 std Z+4, r22 ; 0x04 3994e: 75 83 std Z+5, r23 ; 0x05 39950: 86 83 std Z+6, r24 ; 0x06 39952: 97 83 std Z+7, r25 ; 0x07 } 39954: df 91 pop r29 39956: cf 91 pop r28 39958: 1f 91 pop r17 3995a: 0f 91 pop r16 3995c: ff 90 pop r15 3995e: ef 90 pop r14 39960: df 90 pop r13 39962: cf 90 pop r12 39964: bf 90 pop r11 39966: af 90 pop r10 39968: 9f 90 pop r9 3996a: 8f 90 pop r8 3996c: 7f 90 pop r7 3996e: 6f 90 pop r6 39970: 5f 90 pop r5 39972: 4f 90 pop r4 39974: 08 95 ret 00039976 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 39976: 4f 92 push r4 39978: 5f 92 push r5 3997a: 6f 92 push r6 3997c: 7f 92 push r7 3997e: 8f 92 push r8 39980: 9f 92 push r9 39982: af 92 push r10 39984: bf 92 push r11 39986: cf 92 push r12 39988: df 92 push r13 3998a: ef 92 push r14 3998c: ff 92 push r15 3998e: 0f 93 push r16 39990: 1f 93 push r17 39992: cf 93 push r28 39994: df 93 push r29 39996: 00 d0 rcall .+0 ; 0x39998 39998: 00 d0 rcall .+0 ; 0x3999a 3999a: 1f 92 push r1 3999c: 1f 92 push r1 3999e: cd b7 in r28, 0x3d ; 61 399a0: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 399a2: dc 01 movw r26, r24 399a4: cd 90 ld r12, X+ 399a6: dd 90 ld r13, X+ 399a8: ed 90 ld r14, X+ 399aa: fc 90 ld r15, X 399ac: 13 97 sbiw r26, 0x03 ; 3 399ae: c0 92 dc 17 sts 0x17DC, r12 ; 0x8017dc 399b2: d0 92 dd 17 sts 0x17DD, r13 ; 0x8017dd 399b6: e0 92 de 17 sts 0x17DE, r14 ; 0x8017de 399ba: f0 92 df 17 sts 0x17DF, r15 ; 0x8017df world2machine_rotation_and_skew[1][0] = vec_x[1]; 399be: 14 96 adiw r26, 0x04 ; 4 399c0: 0d 91 ld r16, X+ 399c2: 1d 91 ld r17, X+ 399c4: 2d 91 ld r18, X+ 399c6: 3c 91 ld r19, X 399c8: 17 97 sbiw r26, 0x07 ; 7 399ca: 09 83 std Y+1, r16 ; 0x01 399cc: 1a 83 std Y+2, r17 ; 0x02 399ce: 2b 83 std Y+3, r18 ; 0x03 399d0: 3c 83 std Y+4, r19 ; 0x04 399d2: 00 93 e4 17 sts 0x17E4, r16 ; 0x8017e4 399d6: 10 93 e5 17 sts 0x17E5, r17 ; 0x8017e5 399da: 20 93 e6 17 sts 0x17E6, r18 ; 0x8017e6 399de: 30 93 e7 17 sts 0x17E7, r19 ; 0x8017e7 world2machine_rotation_and_skew[0][1] = vec_y[0]; 399e2: db 01 movw r26, r22 399e4: 0d 91 ld r16, X+ 399e6: 1d 91 ld r17, X+ 399e8: 2d 91 ld r18, X+ 399ea: 3c 91 ld r19, X 399ec: 13 97 sbiw r26, 0x03 ; 3 399ee: 0d 83 std Y+5, r16 ; 0x05 399f0: 1e 83 std Y+6, r17 ; 0x06 399f2: 2f 83 std Y+7, r18 ; 0x07 399f4: 38 87 std Y+8, r19 ; 0x08 399f6: 00 93 e0 17 sts 0x17E0, r16 ; 0x8017e0 399fa: 10 93 e1 17 sts 0x17E1, r17 ; 0x8017e1 399fe: 20 93 e2 17 sts 0x17E2, r18 ; 0x8017e2 39a02: 30 93 e3 17 sts 0x17E3, r19 ; 0x8017e3 world2machine_rotation_and_skew[1][1] = vec_y[1]; 39a06: 14 96 adiw r26, 0x04 ; 4 39a08: 4d 90 ld r4, X+ 39a0a: 5d 90 ld r5, X+ 39a0c: 6d 90 ld r6, X+ 39a0e: 7c 90 ld r7, X 39a10: 17 97 sbiw r26, 0x07 ; 7 39a12: 40 92 e8 17 sts 0x17E8, r4 ; 0x8017e8 39a16: 50 92 e9 17 sts 0x17E9, r5 ; 0x8017e9 39a1a: 60 92 ea 17 sts 0x17EA, r6 ; 0x8017ea 39a1e: 70 92 eb 17 sts 0x17EB, r7 ; 0x8017eb world2machine_shift[0] = cntr[0]; 39a22: fa 01 movw r30, r20 39a24: 60 81 ld r22, Z 39a26: 71 81 ldd r23, Z+1 ; 0x01 39a28: 82 81 ldd r24, Z+2 ; 0x02 39a2a: 93 81 ldd r25, Z+3 ; 0x03 39a2c: 60 93 07 18 sts 0x1807, r22 ; 0x801807 39a30: 70 93 08 18 sts 0x1808, r23 ; 0x801808 39a34: 80 93 09 18 sts 0x1809, r24 ; 0x801809 39a38: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a world2machine_shift[1] = cntr[1]; 39a3c: 84 80 ldd r8, Z+4 ; 0x04 39a3e: 95 80 ldd r9, Z+5 ; 0x05 39a40: a6 80 ldd r10, Z+6 ; 0x06 39a42: b7 80 ldd r11, Z+7 ; 0x07 39a44: 80 92 0b 18 sts 0x180B, r8 ; 0x80180b 39a48: 90 92 0c 18 sts 0x180C, r9 ; 0x80180c 39a4c: a0 92 0d 18 sts 0x180D, r10 ; 0x80180d 39a50: 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) 39a54: 20 e0 ldi r18, 0x00 ; 0 39a56: 30 e0 ldi r19, 0x00 ; 0 39a58: a9 01 movw r20, r18 39a5a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39a5e: 81 11 cpse r24, r1 39a60: aa c0 rjmp .+340 ; 0x39bb6 39a62: 20 e0 ldi r18, 0x00 ; 0 39a64: 30 e0 ldi r19, 0x00 ; 0 39a66: a9 01 movw r20, r18 39a68: c5 01 movw r24, r10 39a6a: b4 01 movw r22, r8 39a6c: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39a70: 81 11 cpse r24, r1 39a72: a1 c0 rjmp .+322 ; 0x39bb6 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; 39a74: 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 || 39a78: 20 e0 ldi r18, 0x00 ; 0 39a7a: 30 e0 ldi r19, 0x00 ; 0 39a7c: 40 e8 ldi r20, 0x80 ; 128 39a7e: 5f e3 ldi r21, 0x3F ; 63 39a80: c7 01 movw r24, r14 39a82: b6 01 movw r22, r12 39a84: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39a88: 81 11 cpse r24, r1 39a8a: 21 c0 rjmp .+66 ; 0x39ace 39a8c: 20 e0 ldi r18, 0x00 ; 0 39a8e: 30 e0 ldi r19, 0x00 ; 0 39a90: a9 01 movw r20, r18 39a92: 6d 81 ldd r22, Y+5 ; 0x05 39a94: 7e 81 ldd r23, Y+6 ; 0x06 39a96: 8f 81 ldd r24, Y+7 ; 0x07 39a98: 98 85 ldd r25, Y+8 ; 0x08 39a9a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39a9e: 81 11 cpse r24, r1 39aa0: 16 c0 rjmp .+44 ; 0x39ace 39aa2: 20 e0 ldi r18, 0x00 ; 0 39aa4: 30 e0 ldi r19, 0x00 ; 0 39aa6: a9 01 movw r20, r18 39aa8: 69 81 ldd r22, Y+1 ; 0x01 39aaa: 7a 81 ldd r23, Y+2 ; 0x02 39aac: 8b 81 ldd r24, Y+3 ; 0x03 39aae: 9c 81 ldd r25, Y+4 ; 0x04 39ab0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39ab4: 81 11 cpse r24, r1 39ab6: 0b c0 rjmp .+22 ; 0x39ace world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 39ab8: 20 e0 ldi r18, 0x00 ; 0 39aba: 30 e0 ldi r19, 0x00 ; 0 39abc: 40 e8 ldi r20, 0x80 ; 128 39abe: 5f e3 ldi r21, 0x3F ; 63 39ac0: c3 01 movw r24, r6 39ac2: b2 01 movw r22, r4 39ac4: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39ac8: 88 23 and r24, r24 39aca: 09 f4 brne .+2 ; 0x39ace 39acc: 78 c0 rjmp .+240 ; 0x39bbe // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 39ace: 80 91 0f 18 lds r24, 0x180F ; 0x80180f 39ad2: 82 60 ori r24, 0x02 ; 2 39ad4: 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]; 39ad8: a3 01 movw r20, r6 39ada: 92 01 movw r18, r4 39adc: c7 01 movw r24, r14 39ade: b6 01 movw r22, r12 39ae0: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 39ae4: 4b 01 movw r8, r22 39ae6: 5c 01 movw r10, r24 39ae8: 2d 81 ldd r18, Y+5 ; 0x05 39aea: 3e 81 ldd r19, Y+6 ; 0x06 39aec: 4f 81 ldd r20, Y+7 ; 0x07 39aee: 58 85 ldd r21, Y+8 ; 0x08 39af0: 69 81 ldd r22, Y+1 ; 0x01 39af2: 7a 81 ldd r23, Y+2 ; 0x02 39af4: 8b 81 ldd r24, Y+3 ; 0x03 39af6: 9c 81 ldd r25, Y+4 ; 0x04 39af8: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 39afc: 9b 01 movw r18, r22 39afe: ac 01 movw r20, r24 39b00: c5 01 movw r24, r10 39b02: b4 01 movw r22, r8 39b04: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 39b08: 4b 01 movw r8, r22 39b0a: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 39b0c: ac 01 movw r20, r24 39b0e: 9b 01 movw r18, r22 39b10: c3 01 movw r24, r6 39b12: b2 01 movw r22, r4 39b14: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 39b18: 60 93 f7 17 sts 0x17F7, r22 ; 0x8017f7 39b1c: 70 93 f8 17 sts 0x17F8, r23 ; 0x8017f8 39b20: 80 93 f9 17 sts 0x17F9, r24 ; 0x8017f9 39b24: 90 93 fa 17 sts 0x17FA, r25 ; 0x8017fa world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 39b28: 6d 81 ldd r22, Y+5 ; 0x05 39b2a: 7e 81 ldd r23, Y+6 ; 0x06 39b2c: 8f 81 ldd r24, Y+7 ; 0x07 39b2e: 98 85 ldd r25, Y+8 ; 0x08 39b30: 90 58 subi r25, 0x80 ; 128 39b32: a5 01 movw r20, r10 39b34: 94 01 movw r18, r8 39b36: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 39b3a: 60 93 fb 17 sts 0x17FB, r22 ; 0x8017fb 39b3e: 70 93 fc 17 sts 0x17FC, r23 ; 0x8017fc 39b42: 80 93 fd 17 sts 0x17FD, r24 ; 0x8017fd 39b46: 90 93 fe 17 sts 0x17FE, r25 ; 0x8017fe world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 39b4a: 69 81 ldd r22, Y+1 ; 0x01 39b4c: 7a 81 ldd r23, Y+2 ; 0x02 39b4e: 8b 81 ldd r24, Y+3 ; 0x03 39b50: 9c 81 ldd r25, Y+4 ; 0x04 39b52: 90 58 subi r25, 0x80 ; 128 39b54: a5 01 movw r20, r10 39b56: 94 01 movw r18, r8 39b58: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 39b5c: 60 93 ff 17 sts 0x17FF, r22 ; 0x8017ff 39b60: 70 93 00 18 sts 0x1800, r23 ; 0x801800 39b64: 80 93 01 18 sts 0x1801, r24 ; 0x801801 39b68: 90 93 02 18 sts 0x1802, r25 ; 0x801802 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 39b6c: a5 01 movw r20, r10 39b6e: 94 01 movw r18, r8 39b70: c7 01 movw r24, r14 39b72: b6 01 movw r22, r12 39b74: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__divsf3> 39b78: 60 93 03 18 sts 0x1803, r22 ; 0x801803 39b7c: 70 93 04 18 sts 0x1804, r23 ; 0x801804 39b80: 80 93 05 18 sts 0x1805, r24 ; 0x801805 39b84: 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; } } 39b88: 28 96 adiw r28, 0x08 ; 8 39b8a: 0f b6 in r0, 0x3f ; 63 39b8c: f8 94 cli 39b8e: de bf out 0x3e, r29 ; 62 39b90: 0f be out 0x3f, r0 ; 63 39b92: cd bf out 0x3d, r28 ; 61 39b94: df 91 pop r29 39b96: cf 91 pop r28 39b98: 1f 91 pop r17 39b9a: 0f 91 pop r16 39b9c: ff 90 pop r15 39b9e: ef 90 pop r14 39ba0: df 90 pop r13 39ba2: cf 90 pop r12 39ba4: bf 90 pop r11 39ba6: af 90 pop r10 39ba8: 9f 90 pop r9 39baa: 8f 90 pop r8 39bac: 7f 90 pop r7 39bae: 6f 90 pop r6 39bb0: 5f 90 pop r5 39bb2: 4f 90 pop r4 39bb4: 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; 39bb6: 81 e0 ldi r24, 0x01 ; 1 39bb8: 80 93 0f 18 sts 0x180F, r24 ; 0x80180f 39bbc: 5d cf rjmp .-326 ; 0x39a78 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; 39bbe: 80 e0 ldi r24, 0x00 ; 0 39bc0: 90 e0 ldi r25, 0x00 ; 0 39bc2: a0 e8 ldi r26, 0x80 ; 128 39bc4: bf e3 ldi r27, 0x3F ; 63 39bc6: 80 93 f7 17 sts 0x17F7, r24 ; 0x8017f7 39bca: 90 93 f8 17 sts 0x17F8, r25 ; 0x8017f8 39bce: a0 93 f9 17 sts 0x17F9, r26 ; 0x8017f9 39bd2: b0 93 fa 17 sts 0x17FA, r27 ; 0x8017fa world2machine_rotation_and_skew_inv[0][1] = 0.f; 39bd6: 10 92 fb 17 sts 0x17FB, r1 ; 0x8017fb 39bda: 10 92 fc 17 sts 0x17FC, r1 ; 0x8017fc 39bde: 10 92 fd 17 sts 0x17FD, r1 ; 0x8017fd 39be2: 10 92 fe 17 sts 0x17FE, r1 ; 0x8017fe world2machine_rotation_and_skew_inv[1][0] = 0.f; 39be6: 10 92 ff 17 sts 0x17FF, r1 ; 0x8017ff 39bea: 10 92 00 18 sts 0x1800, r1 ; 0x801800 39bee: 10 92 01 18 sts 0x1801, r1 ; 0x801801 39bf2: 10 92 02 18 sts 0x1802, r1 ; 0x801802 world2machine_rotation_and_skew_inv[1][1] = 1.f; 39bf6: 80 93 03 18 sts 0x1803, r24 ; 0x801803 39bfa: 90 93 04 18 sts 0x1804, r25 ; 0x801804 39bfe: a0 93 05 18 sts 0x1805, r26 ; 0x801805 39c02: b0 93 06 18 sts 0x1806, r27 ; 0x801806 39c06: c0 cf rjmp .-128 ; 0x39b88 00039c08 : * * 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() { 39c08: cf 93 push r28 39c0a: df 93 push r29 39c0c: cd b7 in r28, 0x3d ; 61 39c0e: de b7 in r29, 0x3e ; 62 39c10: 68 97 sbiw r28, 0x18 ; 24 39c12: 0f b6 in r0, 0x3f ; 63 39c14: f8 94 cli 39c16: de bf out 0x3e, r29 ; 62 39c18: 0f be out 0x3f, r0 ; 63 39c1a: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 39c1c: 80 e0 ldi r24, 0x00 ; 0 39c1e: 90 e0 ldi r25, 0x00 ; 0 39c20: a0 e8 ldi r26, 0x80 ; 128 39c22: bf e3 ldi r27, 0x3F ; 63 39c24: 89 83 std Y+1, r24 ; 0x01 39c26: 9a 83 std Y+2, r25 ; 0x02 39c28: ab 83 std Y+3, r26 ; 0x03 39c2a: bc 83 std Y+4, r27 ; 0x04 39c2c: 1d 82 std Y+5, r1 ; 0x05 39c2e: 1e 82 std Y+6, r1 ; 0x06 39c30: 1f 82 std Y+7, r1 ; 0x07 39c32: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 39c34: 19 86 std Y+9, r1 ; 0x09 39c36: 1a 86 std Y+10, r1 ; 0x0a 39c38: 1b 86 std Y+11, r1 ; 0x0b 39c3a: 1c 86 std Y+12, r1 ; 0x0c 39c3c: 8d 87 std Y+13, r24 ; 0x0d 39c3e: 9e 87 std Y+14, r25 ; 0x0e 39c40: af 87 std Y+15, r26 ; 0x0f 39c42: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 39c44: 19 8a std Y+17, r1 ; 0x11 39c46: 1a 8a std Y+18, r1 ; 0x12 39c48: 1b 8a std Y+19, r1 ; 0x13 39c4a: 1c 8a std Y+20, r1 ; 0x14 39c4c: 1d 8a std Y+21, r1 ; 0x15 39c4e: 1e 8a std Y+22, r1 ; 0x16 39c50: 1f 8a std Y+23, r1 ; 0x17 39c52: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 39c54: ae 01 movw r20, r28 39c56: 4f 5e subi r20, 0xEF ; 239 39c58: 5f 4f sbci r21, 0xFF ; 255 39c5a: be 01 movw r22, r28 39c5c: 67 5f subi r22, 0xF7 ; 247 39c5e: 7f 4f sbci r23, 0xFF ; 255 39c60: ce 01 movw r24, r28 39c62: 01 96 adiw r24, 0x01 ; 1 39c64: 0f 94 bb cc call 0x39976 ; 0x39976 } 39c68: 68 96 adiw r28, 0x18 ; 24 39c6a: 0f b6 in r0, 0x3f ; 63 39c6c: f8 94 cli 39c6e: de bf out 0x3e, r29 ; 62 39c70: 0f be out 0x3f, r0 ; 63 39c72: cd bf out 0x3d, r28 ; 61 39c74: df 91 pop r29 39c76: cf 91 pop r28 39c78: 08 95 ret 00039c7a : * * 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) { 39c7a: 80 91 0f 18 lds r24, 0x180F ; 0x80180f 39c7e: 88 23 and r24, r24 39c80: d1 f0 breq .+52 ; 0x39cb6 world2machine_reset(); 39c82: 0f 94 04 ce call 0x39c08 ; 0x39c08 st_synchronize(); 39c86: 0f 94 ef 42 call 0x285de ; 0x285de current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39c8a: 80 e0 ldi r24, 0x00 ; 0 39c8c: 0f 94 db 42 call 0x285b6 ; 0x285b6 39c90: 60 93 92 06 sts 0x0692, r22 ; 0x800692 39c94: 70 93 93 06 sts 0x0693, r23 ; 0x800693 39c98: 80 93 94 06 sts 0x0694, r24 ; 0x800694 39c9c: 90 93 95 06 sts 0x0695, r25 ; 0x800695 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39ca0: 81 e0 ldi r24, 0x01 ; 1 39ca2: 0f 94 db 42 call 0x285b6 ; 0x285b6 39ca6: 60 93 96 06 sts 0x0696, r22 ; 0x800696 39caa: 70 93 97 06 sts 0x0697, r23 ; 0x800697 39cae: 80 93 98 06 sts 0x0698, r24 ; 0x800698 39cb2: 90 93 99 06 sts 0x0699, r25 ; 0x800699 } } 39cb6: 08 95 ret 00039cb8 : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 39cb8: 4f ef ldi r20, 0xFF ; 255 39cba: 5f ef ldi r21, 0xFF ; 255 39cbc: ba 01 movw r22, r20 39cbe: 85 ee ldi r24, 0xE5 ; 229 39cc0: 9f e0 ldi r25, 0x0F ; 15 39cc2: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39cc6: 4f ef ldi r20, 0xFF ; 255 39cc8: 5f ef ldi r21, 0xFF ; 255 39cca: ba 01 movw r22, r20 39ccc: 89 ee ldi r24, 0xE9 ; 233 39cce: 9f e0 ldi r25, 0x0F ; 15 39cd0: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39cd4: 4f ef ldi r20, 0xFF ; 255 39cd6: 5f ef ldi r21, 0xFF ; 255 39cd8: ba 01 movw r22, r20 39cda: 8d ed ldi r24, 0xDD ; 221 39cdc: 9f e0 ldi r25, 0x0F ; 15 39cde: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39ce2: 4f ef ldi r20, 0xFF ; 255 39ce4: 5f ef ldi r21, 0xFF ; 255 39ce6: ba 01 movw r22, r20 39ce8: 81 ee ldi r24, 0xE1 ; 225 39cea: 9f e0 ldi r25, 0x0F ; 15 39cec: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39cf0: 4f ef ldi r20, 0xFF ; 255 39cf2: 5f ef ldi r21, 0xFF ; 255 39cf4: ba 01 movw r22, r20 39cf6: 85 ed ldi r24, 0xD5 ; 213 39cf8: 9f e0 ldi r25, 0x0F ; 15 39cfa: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39cfe: 4f ef ldi r20, 0xFF ; 255 39d00: 5f ef ldi r21, 0xFF ; 255 39d02: ba 01 movw r22, r20 39d04: 89 ed ldi r24, 0xD9 ; 217 39d06: 9f e0 ldi r25, 0x0F ; 15 39d08: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39d0c: 4f ef ldi r20, 0xFF ; 255 39d0e: 5f ef ldi r21, 0xFF ; 255 39d10: ba 01 movw r22, r20 39d12: 85 ec ldi r24, 0xC5 ; 197 39d14: 9f e0 ldi r25, 0x0F ; 15 39d16: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39d1a: 4f ef ldi r20, 0xFF ; 255 39d1c: 5f ef ldi r21, 0xFF ; 255 39d1e: ba 01 movw r22, r20 39d20: 89 ec ldi r24, 0xC9 ; 201 39d22: 9f e0 ldi r25, 0x0F ; 15 39d24: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39d28: 4f ef ldi r20, 0xFF ; 255 39d2a: 5f ef ldi r21, 0xFF ; 255 39d2c: ba 01 movw r22, r20 39d2e: 8d ec ldi r24, 0xCD ; 205 39d30: 9f e0 ldi r25, 0x0F ; 15 39d32: 0f 94 59 dc call 0x3b8b2 ; 0x3b8b2 39d36: 4f ef ldi r20, 0xFF ; 255 39d38: 5f ef ldi r21, 0xFF ; 255 39d3a: ba 01 movw r22, r20 39d3c: 81 ed ldi r24, 0xD1 ; 209 39d3e: 9f e0 ldi r25, 0x0F ; 15 39d40: 0d 94 59 dc jmp 0x3b8b2 ; 0x3b8b2 00039d44 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 39d44: 4f 92 push r4 39d46: 5f 92 push r5 39d48: 6f 92 push r6 39d4a: 7f 92 push r7 39d4c: 8f 92 push r8 39d4e: 9f 92 push r9 39d50: af 92 push r10 39d52: bf 92 push r11 39d54: cf 92 push r12 39d56: df 92 push r13 39d58: ef 92 push r14 39d5a: ff 92 push r15 39d5c: 1f 93 push r17 39d5e: cf 93 push r28 39d60: df 93 push r29 39d62: cd b7 in r28, 0x3d ; 61 39d64: de b7 in r29, 0x3e ; 62 39d66: a8 97 sbiw r28, 0x28 ; 40 39d68: 0f b6 in r0, 0x3f ; 63 39d6a: f8 94 cli 39d6c: de bf out 0x3e, r29 ; 62 39d6e: 0f be out 0x3f, r0 ; 63 39d70: 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); 39d72: 48 e0 ldi r20, 0x08 ; 8 39d74: 50 e0 ldi r21, 0x00 ; 0 39d76: 6d ed ldi r22, 0xDD ; 221 39d78: 7f e0 ldi r23, 0x0F ; 15 39d7a: ce 01 movw r24, r28 39d7c: 01 96 adiw r24, 0x01 ; 1 39d7e: 0f 94 13 dc call 0x3b826 ; 0x3b826 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39d82: 48 e0 ldi r20, 0x08 ; 8 39d84: 50 e0 ldi r21, 0x00 ; 0 39d86: 65 ed ldi r22, 0xD5 ; 213 39d88: 7f e0 ldi r23, 0x0F ; 15 39d8a: ce 01 movw r24, r28 39d8c: 09 96 adiw r24, 0x09 ; 9 39d8e: 0f 94 13 dc call 0x3b826 ; 0x3b826 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39d92: 48 e0 ldi r20, 0x08 ; 8 39d94: 50 e0 ldi r21, 0x00 ; 0 39d96: 65 ee ldi r22, 0xE5 ; 229 39d98: 7f e0 ldi r23, 0x0F ; 15 39d9a: ce 01 movw r24, r28 39d9c: 41 96 adiw r24, 0x11 ; 17 39d9e: 0f 94 13 dc call 0x3b826 ; 0x3b826 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39da2: 89 89 ldd r24, Y+17 ; 0x11 39da4: 9a 89 ldd r25, Y+18 ; 0x12 39da6: ab 89 ldd r26, Y+19 ; 0x13 39da8: bc 89 ldd r27, Y+20 ; 0x14 39daa: 89 a3 std Y+33, r24 ; 0x21 39dac: 9a a3 std Y+34, r25 ; 0x22 39dae: ab a3 std Y+35, r26 ; 0x23 39db0: bc a3 std Y+36, r27 ; 0x24 39db2: 8f 3f cpi r24, 0xFF ; 255 39db4: 9f 4f sbci r25, 0xFF ; 255 39db6: af 4f sbci r26, 0xFF ; 255 39db8: bf 4f sbci r27, 0xFF ; 255 39dba: 09 f4 brne .+2 ; 0x39dbe 39dbc: b1 c0 rjmp .+354 ; 0x39f20 39dbe: 8d 89 ldd r24, Y+21 ; 0x15 39dc0: 9e 89 ldd r25, Y+22 ; 0x16 39dc2: af 89 ldd r26, Y+23 ; 0x17 39dc4: b8 8d ldd r27, Y+24 ; 0x18 39dc6: 8d a3 std Y+37, r24 ; 0x25 39dc8: 9e a3 std Y+38, r25 ; 0x26 39dca: af a3 std Y+39, r26 ; 0x27 39dcc: b8 a7 std Y+40, r27 ; 0x28 39dce: 8f 3f cpi r24, 0xFF ; 255 39dd0: 9f 4f sbci r25, 0xFF ; 255 39dd2: af 4f sbci r26, 0xFF ; 255 39dd4: bf 4f sbci r27, 0xFF ; 255 39dd6: 09 f4 brne .+2 ; 0x39dda 39dd8: a3 c0 rjmp .+326 ; 0x39f20 39dda: 89 80 ldd r8, Y+1 ; 0x01 39ddc: 9a 80 ldd r9, Y+2 ; 0x02 39dde: ab 80 ldd r10, Y+3 ; 0x03 39de0: bc 80 ldd r11, Y+4 ; 0x04 39de2: 8f ef ldi r24, 0xFF ; 255 39de4: 88 16 cp r8, r24 39de6: 98 06 cpc r9, r24 39de8: a8 06 cpc r10, r24 39dea: b8 06 cpc r11, r24 39dec: 09 f4 brne .+2 ; 0x39df0 39dee: 98 c0 rjmp .+304 ; 0x39f20 39df0: 8d 81 ldd r24, Y+5 ; 0x05 39df2: 9e 81 ldd r25, Y+6 ; 0x06 39df4: af 81 ldd r26, Y+7 ; 0x07 39df6: b8 85 ldd r27, Y+8 ; 0x08 39df8: 89 8f std Y+25, r24 ; 0x19 39dfa: 9a 8f std Y+26, r25 ; 0x1a 39dfc: ab 8f std Y+27, r26 ; 0x1b 39dfe: bc 8f std Y+28, r27 ; 0x1c 39e00: 8f 3f cpi r24, 0xFF ; 255 39e02: 9f 4f sbci r25, 0xFF ; 255 39e04: af 4f sbci r26, 0xFF ; 255 39e06: bf 4f sbci r27, 0xFF ; 255 39e08: 09 f4 brne .+2 ; 0x39e0c 39e0a: 8a c0 rjmp .+276 ; 0x39f20 39e0c: c9 84 ldd r12, Y+9 ; 0x09 39e0e: da 84 ldd r13, Y+10 ; 0x0a 39e10: eb 84 ldd r14, Y+11 ; 0x0b 39e12: fc 84 ldd r15, Y+12 ; 0x0c 39e14: 8f ef ldi r24, 0xFF ; 255 39e16: c8 16 cp r12, r24 39e18: d8 06 cpc r13, r24 39e1a: e8 06 cpc r14, r24 39e1c: f8 06 cpc r15, r24 39e1e: 09 f4 brne .+2 ; 0x39e22 39e20: 7f c0 rjmp .+254 ; 0x39f20 39e22: 8d 85 ldd r24, Y+13 ; 0x0d 39e24: 9e 85 ldd r25, Y+14 ; 0x0e 39e26: af 85 ldd r26, Y+15 ; 0x0f 39e28: b8 89 ldd r27, Y+16 ; 0x10 39e2a: 8d 8f std Y+29, r24 ; 0x1d 39e2c: 9e 8f std Y+30, r25 ; 0x1e 39e2e: af 8f std Y+31, r26 ; 0x1f 39e30: b8 a3 std Y+32, r27 ; 0x20 39e32: 8f 3f cpi r24, 0xFF ; 255 39e34: 9f 4f sbci r25, 0xFF ; 255 39e36: af 4f sbci r26, 0xFF ; 255 39e38: bf 4f sbci r27, 0xFF ; 255 39e3a: 09 f4 brne .+2 ; 0x39e3e 39e3c: 71 c0 rjmp .+226 ; 0x39f20 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39e3e: 29 8d ldd r18, Y+25 ; 0x19 39e40: 3a 8d ldd r19, Y+26 ; 0x1a 39e42: 4b 8d ldd r20, Y+27 ; 0x1b 39e44: 5c 8d ldd r21, Y+28 ; 0x1c 39e46: c5 01 movw r24, r10 39e48: b4 01 movw r22, r8 39e4a: 0f 94 e7 df call 0x3bfce ; 0x3bfce 39e4e: 2b 01 movw r4, r22 39e50: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39e52: 26 e6 ldi r18, 0x66 ; 102 39e54: 36 e6 ldi r19, 0x66 ; 102 39e56: 46 e6 ldi r20, 0x66 ; 102 39e58: 5f e3 ldi r21, 0x3F ; 63 39e5a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__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; 39e5e: 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) 39e60: 87 fd sbrc r24, 7 39e62: 0b c0 rjmp .+22 ; 0x39e7a 39e64: 2d ec ldi r18, 0xCD ; 205 39e66: 3c ec ldi r19, 0xCC ; 204 39e68: 4c e8 ldi r20, 0x8C ; 140 39e6a: 5f e3 ldi r21, 0x3F ; 63 39e6c: c3 01 movw r24, r6 39e6e: b2 01 movw r22, r4 39e70: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 39e74: 18 16 cp r1, r24 39e76: 0c f0 brlt .+2 ; 0x39e7a 39e78: 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]); 39e7a: 2d 8d ldd r18, Y+29 ; 0x1d 39e7c: 3e 8d ldd r19, Y+30 ; 0x1e 39e7e: 4f 8d ldd r20, Y+31 ; 0x1f 39e80: 58 a1 ldd r21, Y+32 ; 0x20 39e82: c7 01 movw r24, r14 39e84: b6 01 movw r22, r12 39e86: 0f 94 e7 df call 0x3bfce ; 0x3bfce 39e8a: 2b 01 movw r4, r22 39e8c: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39e8e: 26 e6 ldi r18, 0x66 ; 102 39e90: 36 e6 ldi r19, 0x66 ; 102 39e92: 46 e6 ldi r20, 0x66 ; 102 39e94: 5f e3 ldi r21, 0x3F ; 63 39e96: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 39e9a: 87 fd sbrc r24, 7 39e9c: 7f c0 rjmp .+254 ; 0x39f9c 39e9e: 2d ec ldi r18, 0xCD ; 205 39ea0: 3c ec ldi r19, 0xCC ; 204 39ea2: 4c e8 ldi r20, 0x8C ; 140 39ea4: 5f e3 ldi r21, 0x3F ; 63 39ea6: c3 01 movw r24, r6 39ea8: b2 01 movw r22, r4 39eaa: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 39eae: 18 16 cp r1, r24 39eb0: 0c f4 brge .+2 ; 0x39eb4 39eb2: 74 c0 rjmp .+232 ; 0x39f9c 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]); 39eb4: 2d a1 ldd r18, Y+37 ; 0x25 39eb6: 3e a1 ldd r19, Y+38 ; 0x26 39eb8: 4f a1 ldd r20, Y+39 ; 0x27 39eba: 58 a5 ldd r21, Y+40 ; 0x28 39ebc: 69 a1 ldd r22, Y+33 ; 0x21 39ebe: 7a a1 ldd r23, Y+34 ; 0x22 39ec0: 8b a1 ldd r24, Y+35 ; 0x23 39ec2: 9c a1 ldd r25, Y+36 ; 0x24 39ec4: 0f 94 e7 df call 0x3bfce ; 0x3bfce if (l > 15.f) 39ec8: 20 e0 ldi r18, 0x00 ; 0 39eca: 30 e0 ldi r19, 0x00 ; 0 39ecc: 40 e7 ldi r20, 0x70 ; 112 39ece: 51 e4 ldi r21, 0x41 ; 65 39ed0: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 39ed4: 18 16 cp r1, r24 39ed6: 0c f4 brge .+2 ; 0x39eda #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 39ed8: 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]; 39eda: a5 01 movw r20, r10 39edc: 94 01 movw r18, r8 39ede: c7 01 movw r24, r14 39ee0: b6 01 movw r22, r12 39ee2: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 39ee6: 6b 01 movw r12, r22 39ee8: 7c 01 movw r14, r24 39eea: 2d 8d ldd r18, Y+29 ; 0x1d 39eec: 3e 8d ldd r19, Y+30 ; 0x1e 39eee: 4f 8d ldd r20, Y+31 ; 0x1f 39ef0: 58 a1 ldd r21, Y+32 ; 0x20 39ef2: 69 8d ldd r22, Y+25 ; 0x19 39ef4: 7a 8d ldd r23, Y+26 ; 0x1a 39ef6: 8b 8d ldd r24, Y+27 ; 0x1b 39ef8: 9c 8d ldd r25, Y+28 ; 0x1c 39efa: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 39efe: 9b 01 movw r18, r22 39f00: ac 01 movw r20, r24 39f02: c7 01 movw r24, r14 39f04: b6 01 movw r22, r12 39f06: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> if (fabs(l) > 0.1f) 39f0a: 9f 77 andi r25, 0x7F ; 127 39f0c: 2d ec ldi r18, 0xCD ; 205 39f0e: 3c ec ldi r19, 0xCC ; 204 39f10: 4c ec ldi r20, 0xCC ; 204 39f12: 5d e3 ldi r21, 0x3D ; 61 39f14: 0f 94 d4 df call 0x3bfa8 ; 0x3bfa8 <__gesf2> 39f18: 18 16 cp r1, r24 39f1a: 14 f0 brlt .+4 ; 0x39f20 #endif reset = true; } } if (reset) 39f1c: 11 23 and r17, r17 39f1e: f1 f0 breq .+60 ; 0x39f5c { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39f20: 0f 94 5c ce call 0x39cb8 ; 0x39cb8 * @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; 39f24: 80 e0 ldi r24, 0x00 ; 0 39f26: 90 e0 ldi r25, 0x00 ; 0 39f28: a0 e8 ldi r26, 0x80 ; 128 39f2a: bf e3 ldi r27, 0x3F ; 63 39f2c: 89 83 std Y+1, r24 ; 0x01 39f2e: 9a 83 std Y+2, r25 ; 0x02 39f30: ab 83 std Y+3, r26 ; 0x03 39f32: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39f34: 1d 82 std Y+5, r1 ; 0x05 39f36: 1e 82 std Y+6, r1 ; 0x06 39f38: 1f 82 std Y+7, r1 ; 0x07 39f3a: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 39f3c: 19 86 std Y+9, r1 ; 0x09 39f3e: 1a 86 std Y+10, r1 ; 0x0a 39f40: 1b 86 std Y+11, r1 ; 0x0b 39f42: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39f44: 8d 87 std Y+13, r24 ; 0x0d 39f46: 9e 87 std Y+14, r25 ; 0x0e 39f48: af 87 std Y+15, r26 ; 0x0f 39f4a: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 39f4c: 19 8a std Y+17, r1 ; 0x11 39f4e: 1a 8a std Y+18, r1 ; 0x12 39f50: 1b 8a std Y+19, r1 ; 0x13 39f52: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39f54: 1d 8a std Y+21, r1 ; 0x15 39f56: 1e 8a std Y+22, r1 ; 0x16 39f58: 1f 8a std Y+23, r1 ; 0x17 39f5a: 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); 39f5c: ae 01 movw r20, r28 39f5e: 4f 5e subi r20, 0xEF ; 239 39f60: 5f 4f sbci r21, 0xFF ; 255 39f62: be 01 movw r22, r28 39f64: 67 5f subi r22, 0xF7 ; 247 39f66: 7f 4f sbci r23, 0xFF ; 255 39f68: ce 01 movw r24, r28 39f6a: 01 96 adiw r24, 0x01 ; 1 39f6c: 0f 94 bb cc call 0x39976 ; 0x39976 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39f70: a8 96 adiw r28, 0x28 ; 40 39f72: 0f b6 in r0, 0x3f ; 63 39f74: f8 94 cli 39f76: de bf out 0x3e, r29 ; 62 39f78: 0f be out 0x3f, r0 ; 63 39f7a: cd bf out 0x3d, r28 ; 61 39f7c: df 91 pop r29 39f7e: cf 91 pop r28 39f80: 1f 91 pop r17 39f82: ff 90 pop r15 39f84: ef 90 pop r14 39f86: df 90 pop r13 39f88: cf 90 pop r12 39f8a: bf 90 pop r11 39f8c: af 90 pop r10 39f8e: 9f 90 pop r9 39f90: 8f 90 pop r8 39f92: 7f 90 pop r7 39f94: 6f 90 pop r6 39f96: 5f 90 pop r5 39f98: 4f 90 pop r4 39f9a: 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; 39f9c: 11 e0 ldi r17, 0x01 ; 1 39f9e: 8a cf rjmp .-236 ; 0x39eb4 00039fa0 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39fa0: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39fa2: 24 e1 ldi r18, 0x14 ; 20 39fa4: ac 01 movw r20, r24 39fa6: 24 9f mul r18, r20 39fa8: c0 01 movw r24, r0 39faa: 25 9f mul r18, r21 39fac: 90 0d add r25, r0 39fae: 11 24 eor r1, r1 39fb0: 60 91 da 17 lds r22, 0x17DA ; 0x8017da 39fb4: 70 91 db 17 lds r23, 0x17DB ; 0x8017db 39fb8: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 39fbc: c6 2f mov r28, r22 39fbe: 65 31 cpi r22, 0x15 ; 21 39fc0: 08 f0 brcs .+2 ; 0x39fc4 39fc2: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39fc4: 80 91 d9 17 lds r24, 0x17D9 ; 0x8017d9 39fc8: 8c 17 cp r24, r28 39fca: 48 f4 brcc .+18 ; 0x39fde } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39fcc: 8f ef ldi r24, 0xFF ; 255 39fce: 0e 94 96 6f call 0xdf2c ; 0xdf2c { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39fd2: 80 91 d9 17 lds r24, 0x17D9 ; 0x8017d9 39fd6: 8f 5f subi r24, 0xFF ; 255 39fd8: 80 93 d9 17 sts 0x17D9, r24 ; 0x8017d9 39fdc: f3 cf rjmp .-26 ; 0x39fc4 } } 39fde: cf 91 pop r28 39fe0: 08 95 ret 00039fe2 : void menu_progressbar_finish(void) { progressbar_total = 1; 39fe2: 81 e0 ldi r24, 0x01 ; 1 39fe4: 90 e0 ldi r25, 0x00 ; 0 39fe6: 90 93 db 17 sts 0x17DB, r25 ; 0x8017db 39fea: 80 93 da 17 sts 0x17DA, r24 ; 0x8017da menu_progressbar_update(1); 39fee: 0f 94 d0 cf call 0x39fa0 ; 0x39fa0 _delay(300); 39ff2: 6c e2 ldi r22, 0x2C ; 44 39ff4: 71 e0 ldi r23, 0x01 ; 1 39ff6: 80 e0 ldi r24, 0x00 ; 0 39ff8: 90 e0 ldi r25, 0x00 ; 0 39ffa: 0d 94 5a 27 jmp 0x24eb4 ; 0x24eb4 00039ffe : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39ffe: 0f 93 push r16 3a000: 1f 93 push r17 3a002: cf 93 push r28 3a004: df 93 push r29 3a006: 8c 01 movw r16, r24 3a008: eb 01 movw r28, r22 lcd_clear(); 3a00a: 0e 94 1a 6f call 0xde34 ; 0xde34 progressbar_block_count = 0; 3a00e: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 progressbar_total = total; 3a012: 10 93 db 17 sts 0x17DB, r17 ; 0x8017db 3a016: 00 93 da 17 sts 0x17DA, r16 ; 0x8017da lcd_set_cursor(0, 1); 3a01a: 61 e0 ldi r22, 0x01 ; 1 3a01c: 80 e0 ldi r24, 0x00 ; 0 3a01e: 0e 94 e7 6e call 0xddce ; 0xddce lcd_print_pad_P(title, LCD_WIDTH); 3a022: 64 e1 ldi r22, 0x14 ; 20 3a024: ce 01 movw r24, r28 3a026: 0e 94 bc 70 call 0xe178 ; 0xe178 lcd_set_cursor(0, 2); 3a02a: 62 e0 ldi r22, 0x02 ; 2 3a02c: 80 e0 ldi r24, 0x00 ; 0 } 3a02e: df 91 pop r29 3a030: cf 91 pop r28 3a032: 1f 91 pop r17 3a034: 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); 3a036: 0c 94 e7 6e jmp 0xddce ; 0xddce 0003a03a : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 3a03a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a03e: 90 91 14 05 lds r25, 0x0514 ; 0x800514 3a042: 89 13 cpse r24, r25 3a044: 0b c0 rjmp .+22 ; 0x3a05c 3a046: 90 91 13 05 lds r25, 0x0513 ; 0x800513 3a04a: 99 23 and r25, r25 3a04c: 39 f0 breq .+14 ; 0x3a05c 3a04e: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a052: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a056: 82 17 cp r24, r18 3a058: 13 06 cpc r1, r19 3a05a: 39 f0 breq .+14 ; 0x3a06a 3a05c: 81 e0 ldi r24, 0x01 ; 1 3a05e: 90 91 d7 03 lds r25, 0x03D7 ; 0x8003d7 3a062: 91 11 cpse r25, r1 3a064: 03 c0 rjmp .+6 ; 0x3a06c 3a066: 80 e0 ldi r24, 0x00 ; 0 3a068: 08 95 ret 3a06a: 81 e0 ldi r24, 0x01 ; 1 } 3a06c: 08 95 ret 0003a06e : //! @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) { 3a06e: 0f 93 push r16 3a070: 1f 93 push r17 3a072: cf 93 push r28 3a074: df 93 push r29 3a076: 8c 01 movw r16, r24 3a078: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 3a07a: 83 e9 ldi r24, 0x93 ; 147 3a07c: 9d e4 ldi r25, 0x4D ; 77 3a07e: 0e 94 b3 72 call 0xe566 ; 0xe566 3a082: 9f 93 push r25 3a084: 8f 93 push r24 3a086: 86 ee ldi r24, 0xE6 ; 230 3a088: 9b ea ldi r25, 0xAB ; 171 3a08a: 9f 93 push r25 3a08c: 8f 93 push r24 3a08e: df 93 push r29 3a090: cf 93 push r28 3a092: 0f 94 3a db call 0x3b674 ; 0x3b674 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 3a096: c8 0f add r28, r24 3a098: d1 1d adc r29, r1 3a09a: 47 e0 ldi r20, 0x07 ; 7 3a09c: 50 e0 ldi r21, 0x00 ; 0 3a09e: b8 01 movw r22, r16 3a0a0: ce 01 movw r24, r28 3a0a2: 0f 94 13 dc call 0x3b826 ; 0x3b826 //index += 7; buffer.c[index + 7] = '\0'; 3a0a6: 1f 82 std Y+7, r1 ; 0x07 3a0a8: 0f 90 pop r0 3a0aa: 0f 90 pop r0 3a0ac: 0f 90 pop r0 3a0ae: 0f 90 pop r0 3a0b0: 0f 90 pop r0 3a0b2: 0f 90 pop r0 } 3a0b4: df 91 pop r29 3a0b6: cf 91 pop r28 3a0b8: 1f 91 pop r17 3a0ba: 0f 91 pop r16 3a0bc: 08 95 ret 0003a0be : 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)?'>':' '; 3a0be: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a0c2: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a0c6: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a0ca: 28 17 cp r18, r24 3a0cc: 19 06 cpc r1, r25 3a0ce: 11 f0 breq .+4 ; 0x3a0d4 3a0d0: 80 e2 ldi r24, 0x20 ; 32 3a0d2: 08 95 ret 3a0d4: 8e e3 ldi r24, 0x3E ; 62 } 3a0d6: 08 95 ret 0003a0d8 : static void menu_draw_item_puts_P(char type_char, const char* str) { 3a0d8: 0f 93 push r16 3a0da: 1f 93 push r17 3a0dc: cf 93 push r28 3a0de: c8 2f mov r28, r24 3a0e0: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a0e2: 0f 94 5f d0 call 0x3a0be ; 0x3a0be 3a0e6: 48 2f mov r20, r24 3a0e8: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a0ec: 80 e0 ldi r24, 0x00 ; 0 3a0ee: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_print_pad_P(str, LCD_WIDTH - 2); 3a0f2: 62 e1 ldi r22, 0x12 ; 18 3a0f4: c8 01 movw r24, r16 3a0f6: 0e 94 bc 70 call 0xe178 ; 0xe178 lcd_putc(type_char); 3a0fa: 8c 2f mov r24, r28 } 3a0fc: cf 91 pop r28 3a0fe: 1f 91 pop r17 3a100: 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); 3a102: 0c 94 d6 6e jmp 0xddac ; 0xddac 0003a106 : } } void menu_item_ret(void) { lcd_draw_update = 2; 3a106: 82 e0 ldi r24, 0x02 ; 2 3a108: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 3a10c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a110: 8f 5f subi r24, 0xFF ; 255 3a112: 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 3a116: 84 e0 ldi r24, 0x04 ; 4 3a118: 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 3a11c: 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 3a120: 10 92 13 05 sts 0x0513, r1 ; 0x800513 } 3a124: 08 95 ret 0003a126 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 3a126: cf 93 push r28 3a128: df 93 push r29 if (menu_item == menu_line) 3a12a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a12e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a132: 32 13 cpse r19, r18 3a134: 20 c0 rjmp .+64 ; 0x3a176 3a136: eb 01 movw r28, r22 3a138: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a13a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a13e: 88 23 and r24, r24 3a140: 19 f0 breq .+6 ; 0x3a148 3a142: 80 e2 ldi r24, 0x20 ; 32 3a144: 0f 94 6c d0 call 0x3a0d8 ; 0x3a0d8 if (menu_clicked && (lcd_encoder == menu_item)) 3a148: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a14c: 88 23 and r24, r24 3a14e: 99 f0 breq .+38 ; 0x3a176 3a150: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a154: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a158: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a15c: 28 17 cp r18, r24 3a15e: 19 06 cpc r1, r25 3a160: 51 f4 brne .+20 ; 0x3a176 { if (str_gcode) enquecommand_P(str_gcode); 3a162: 20 97 sbiw r28, 0x00 ; 0 3a164: 21 f0 breq .+8 ; 0x3a16e 3a166: 61 e0 ldi r22, 0x01 ; 1 3a168: ce 01 movw r24, r28 3a16a: 0e 94 27 88 call 0x1104e ; 0x1104e menu_item_ret(); return; } } menu_item++; } 3a16e: df 91 pop r29 3a170: 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(); 3a172: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 return; } } menu_item++; 3a176: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a17a: 8f 5f subi r24, 0xFF ; 255 3a17c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a180: df 91 pop r29 3a182: cf 91 pop r28 3a184: 08 95 ret 0003a186 : //! @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) { 3a186: ef 92 push r14 3a188: ff 92 push r15 3a18a: 0f 93 push r16 3a18c: 1f 93 push r17 3a18e: cf 93 push r28 3a190: df 93 push r29 if (menu_item == menu_line) 3a192: 70 91 15 05 lds r23, 0x0515 ; 0x800515 3a196: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a19a: 73 13 cpse r23, r19 3a19c: 3f c0 rjmp .+126 ; 0x3a21c 3a19e: 12 2f mov r17, r18 3a1a0: ea 01 movw r28, r20 3a1a2: 06 2f mov r16, r22 3a1a4: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 3a1a6: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a1aa: 88 23 and r24, r24 3a1ac: d1 f0 breq .+52 ; 0x3a1e2 } 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()); 3a1ae: 0f 94 5f d0 call 0x3a0be ; 0x3a0be 3a1b2: 48 2f mov r20, r24 3a1b4: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1b8: 80 e0 ldi r24, 0x00 ; 0 3a1ba: 0e 94 07 6f call 0xde0e ; 0xde0e uint8_t len = lcd_print_pad_P(str, max_strlen); 3a1be: 61 e1 ldi r22, 0x11 ; 17 3a1c0: c7 01 movw r24, r14 3a1c2: 0e 94 bc 70 call 0xe178 ; 0xe178 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 3a1c6: 40 2f mov r20, r16 3a1c8: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1cc: 93 e1 ldi r25, 0x13 ; 19 3a1ce: 98 1b sub r25, r24 3a1d0: 89 2f mov r24, r25 3a1d2: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 3a1d6: 40 e2 ldi r20, 0x20 ; 32 3a1d8: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1dc: 83 e1 ldi r24, 0x13 ; 19 3a1de: 0e 94 07 6f call 0xde0e ; 0xde0e 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)) 3a1e2: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a1e6: 88 23 and r24, r24 3a1e8: c9 f0 breq .+50 ; 0x3a21c 3a1ea: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a1ee: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a1f2: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a1f6: 28 17 cp r18, r24 3a1f8: 19 06 cpc r1, r25 3a1fa: 81 f4 brne .+32 ; 0x3a21c { lcd_update_enabled = 0; 3a1fc: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 3a200: 81 2f mov r24, r17 3a202: fe 01 movw r30, r28 3a204: 19 95 eicall lcd_update_enabled = 1; 3a206: 81 e0 ldi r24, 0x01 ; 1 3a208: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a20c: df 91 pop r29 3a20e: cf 91 pop r28 3a210: 1f 91 pop r17 3a212: 0f 91 pop r16 3a214: ff 90 pop r15 3a216: 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(); 3a218: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 return; } } menu_item++; 3a21c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a220: 8f 5f subi r24, 0xFF ; 255 3a222: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a226: df 91 pop r29 3a228: cf 91 pop r28 3a22a: 1f 91 pop r17 3a22c: 0f 91 pop r16 3a22e: ff 90 pop r15 3a230: ef 90 pop r14 3a232: 08 95 ret 0003a234 : 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) { 3a234: cf 93 push r28 3a236: df 93 push r29 if (menu_item == menu_line) 3a238: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a23c: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a240: 32 13 cpse r19, r18 3a242: 21 c0 rjmp .+66 ; 0x3a286 3a244: eb 01 movw r28, r22 3a246: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a248: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a24c: 88 23 and r24, r24 3a24e: 19 f0 breq .+6 ; 0x3a256 3a250: 80 e2 ldi r24, 0x20 ; 32 3a252: 0f 94 6c d0 call 0x3a0d8 ; 0x3a0d8 if (menu_clicked && (lcd_encoder == menu_item)) 3a256: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a25a: 88 23 and r24, r24 3a25c: a1 f0 breq .+40 ; 0x3a286 3a25e: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a262: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a266: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a26a: 28 17 cp r18, r24 3a26c: 19 06 cpc r1, r25 3a26e: 59 f4 brne .+22 ; 0x3a286 { lcd_update_enabled = 0; 3a270: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a274: fe 01 movw r30, r28 3a276: 19 95 eicall lcd_update_enabled = 1; 3a278: 81 e0 ldi r24, 0x01 ; 1 3a27a: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 3a27e: df 91 pop r29 3a280: 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(); 3a282: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 return; } } menu_item++; 3a286: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a28a: 8f 5f subi r24, 0xFF ; 255 3a28c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a290: df 91 pop r29 3a292: cf 91 pop r28 3a294: 08 95 ret 0003a296 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 3a296: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a29a: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a29e: 32 13 cpse r19, r18 3a2a0: 19 c0 rjmp .+50 ; 0x3a2d4 3a2a2: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 3a2a4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a2a8: 88 23 and r24, r24 3a2aa: 19 f0 breq .+6 ; 0x3a2b2 3a2ac: 80 e2 ldi r24, 0x20 ; 32 3a2ae: 0f 94 6c d0 call 0x3a0d8 ; 0x3a0d8 if (menu_clicked && (lcd_encoder == menu_item)) 3a2b2: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a2b6: 88 23 and r24, r24 3a2b8: 69 f0 breq .+26 ; 0x3a2d4 3a2ba: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a2be: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a2c2: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a2c6: 28 17 cp r18, r24 3a2c8: 19 06 cpc r1, r25 3a2ca: 21 f4 brne .+8 ; 0x3a2d4 { menu_item_ret(); 3a2cc: 0f 94 83 d0 call 0x3a106 ; 0x3a106 return 1; 3a2d0: 81 e0 ldi r24, 0x01 ; 1 3a2d2: 08 95 ret } } menu_item++; 3a2d4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2d8: 8f 5f subi r24, 0xFF ; 255 3a2da: 80 93 15 05 sts 0x0515, r24 ; 0x800515 return 0; 3a2de: 80 e0 ldi r24, 0x00 ; 0 } 3a2e0: 08 95 ret 0003a2e2 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 3a2e2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a2e6: 84 30 cpi r24, 0x04 ; 4 3a2e8: 38 f5 brcc .+78 ; 0x3a338 { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 3a2ea: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2ee: 90 e0 ldi r25, 0x00 ; 0 3a2f0: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a2f4: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a2f8: 28 17 cp r18, r24 3a2fa: 39 07 cpc r19, r25 3a2fc: 44 f0 brlt .+16 ; 0x3a30e { lcd_encoder = menu_item - 1; 3a2fe: 01 97 sbiw r24, 0x01 ; 1 3a300: 90 93 71 06 sts 0x0671, r25 ; 0x800671 3a304: 80 93 70 06 sts 0x0670, r24 ; 0x800670 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a308: 87 e0 ldi r24, 0x07 ; 7 3a30a: 0f 94 0e 4e call 0x29c1c ; 0x29c1c } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 3a30e: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a312: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 3a316: 30 e0 ldi r19, 0x00 ; 0 3a318: 2d 5f subi r18, 0xFD ; 253 3a31a: 3f 4f sbci r19, 0xFF ; 255 3a31c: 82 17 cp r24, r18 3a31e: 13 06 cpc r1, r19 3a320: 59 f0 breq .+22 ; 0x3a338 3a322: 54 f0 brlt .+20 ; 0x3a338 { menu_top = lcd_encoder - LCD_HEIGHT + 1; 3a324: 9d ef ldi r25, 0xFD ; 253 3a326: 98 0f add r25, r24 3a328: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 menu_line = menu_top - 1; 3a32c: 84 50 subi r24, 0x04 ; 4 3a32e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_row = -1; 3a332: 8f ef ldi r24, 0xFF ; 255 3a334: 80 93 12 05 sts 0x0512, r24 ; 0x800512 } } 3a338: 08 95 ret 0003a33a : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 3a33a: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a33e: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a342: 97 ff sbrs r25, 7 3a344: 07 c0 rjmp .+14 ; 0x3a354 { lcd_encoder = 0; 3a346: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a34a: 10 92 70 06 sts 0x0670, r1 ; 0x800670 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 3a34e: 87 e0 ldi r24, 0x07 ; 7 3a350: 0f 94 0e 4e call 0x29c1c ; 0x29c1c } if (lcd_encoder < menu_top) 3a354: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a358: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a35c: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 3a360: 28 17 cp r18, r24 3a362: 19 06 cpc r1, r25 3a364: 19 f0 breq .+6 ; 0x3a36c 3a366: 14 f0 brlt .+4 ; 0x3a36c menu_top = lcd_encoder; 3a368: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_line = menu_top; 3a36c: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 3a370: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_clicked = lcd_clicked(); // Consume click event 3a374: 0e 94 04 71 call 0xe208 ; 0xe208 3a378: 80 93 13 05 sts 0x0513, r24 ; 0x800513 } 3a37c: 08 95 ret 0003a37e : 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)); 3a37e: e9 ea ldi r30, 0xA9 ; 169 3a380: f3 e0 ldi r31, 0x03 ; 3 3a382: 80 e2 ldi r24, 0x20 ; 32 3a384: df 01 movw r26, r30 3a386: 1d 92 st X+, r1 3a388: 8a 95 dec r24 3a38a: e9 f7 brne .-6 ; 0x3a386 } 3a38c: 08 95 ret 0003a38e : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 3a38e: cf 93 push r28 CRITICAL_SECTION_START; 3a390: 3f b7 in r19, 0x3f ; 63 3a392: f8 94 cli if (menu_menu != menu) 3a394: e0 91 13 04 lds r30, 0x0413 ; 0x800413 3a398: f0 91 14 04 lds r31, 0x0414 ; 0x800414 3a39c: e8 17 cp r30, r24 3a39e: f9 07 cpc r31, r25 3a3a0: c9 f0 breq .+50 ; 0x3a3d4 3a3a2: c4 2f mov r28, r20 { menu_menu = menu; 3a3a4: 90 93 14 04 sts 0x0414, r25 ; 0x800414 3a3a8: 80 93 13 04 sts 0x0413, r24 ; 0x800413 lcd_encoder = encoder; 3a3ac: 70 93 71 06 sts 0x0671, r23 ; 0x800671 3a3b0: 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 3a3b4: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_draw_update = 2; // Full LCD re-draw 3a3b8: 82 e0 ldi r24, 0x02 ; 2 3a3ba: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 3a3be: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 3a3c0: 22 23 and r18, r18 3a3c2: 19 f0 breq .+6 ; 0x3a3ca } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 3a3c4: 80 e0 ldi r24, 0x00 ; 0 3a3c6: 0f 94 0e 4e call 0x29c1c ; 0x29c1c if (reset_menu_state) menu_data_reset(); 3a3ca: cc 23 and r28, r28 3a3cc: 21 f0 breq .+8 ; 0x3a3d6 } else CRITICAL_SECTION_END; } 3a3ce: 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(); 3a3d0: 0d 94 bf d1 jmp 0x3a37e ; 0x3a37e } else CRITICAL_SECTION_END; 3a3d4: 3f bf out 0x3f, r19 ; 63 } 3a3d6: cf 91 pop r28 3a3d8: 08 95 ret 0003a3da : 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) { 3a3da: 7f 92 push r7 3a3dc: 8f 92 push r8 3a3de: 9f 92 push r9 3a3e0: af 92 push r10 3a3e2: bf 92 push r11 3a3e4: cf 92 push r12 3a3e6: df 92 push r13 3a3e8: ef 92 push r14 3a3ea: ff 92 push r15 3a3ec: 0f 93 push r16 3a3ee: 1f 93 push r17 3a3f0: cf 93 push r28 3a3f2: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 3a3f4: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a3f8: 50 91 14 05 lds r21, 0x0514 ; 0x800514 3a3fc: e5 13 cpse r30, r21 3a3fe: 73 c0 rjmp .+230 ; 0x3a4e6 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 3a400: fb 01 movw r30, r22 3a402: 48 30 cpi r20, 0x08 ; 8 3a404: 09 f0 breq .+2 ; 0x3a408 3a406: 6c c0 rjmp .+216 ; 0x3a4e0 3a408: c0 81 ld r28, Z 3a40a: d0 e0 ldi r29, 0x00 ; 0 3a40c: 49 01 movw r8, r18 3a40e: 74 2e mov r7, r20 3a410: 6b 01 movw r12, r22 3a412: 5c 01 movw r10, r24 if (lcd_draw_update) 3a414: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a418: 88 23 and r24, r24 3a41a: 59 f0 breq .+22 ; 0x3a432 { lcd_set_cursor(0, menu_row); 3a41c: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a420: 80 e0 ldi r24, 0x00 ; 0 3a422: 0e 94 e7 6e call 0xddce ; 0xddce menu_draw_P(menu_selection_mark(), str, cur_val); 3a426: 0f 94 5f d0 call 0x3a0be ; 0x3a0be 3a42a: ae 01 movw r20, r28 3a42c: b5 01 movw r22, r10 3a42e: 0f 94 d3 b0 call 0x361a6 ; 0x361a6 } if (menu_clicked && (lcd_encoder == menu_item)) 3a432: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a436: 88 23 and r24, r24 3a438: 09 f4 brne .+2 ; 0x3a43c 3a43a: 55 c0 rjmp .+170 ; 0x3a4e6 3a43c: 90 91 15 05 lds r25, 0x0515 ; 0x800515 3a440: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3a444: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3a448: 92 17 cp r25, r18 3a44a: 13 06 cpc r1, r19 3a44c: 09 f0 breq .+2 ; 0x3a450 3a44e: 4b c0 rjmp .+150 ; 0x3a4e6 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 3a450: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a454: 87 30 cpi r24, 0x07 ; 7 3a456: d8 f4 brcc .+54 ; 0x3a48e { menu_stack[menu_depth].menu = menu_menu; 3a458: 28 2f mov r18, r24 3a45a: 30 e0 ldi r19, 0x00 ; 0 3a45c: f9 01 movw r30, r18 3a45e: ee 0f add r30, r30 3a460: ff 1f adc r31, r31 3a462: e2 0f add r30, r18 3a464: f3 1f adc r31, r19 3a466: ec 53 subi r30, 0x3C ; 60 3a468: f8 4e sbci r31, 0xE8 ; 232 3a46a: 20 91 13 04 lds r18, 0x0413 ; 0x800413 3a46e: 30 91 14 04 lds r19, 0x0414 ; 0x800414 3a472: 31 83 std Z+1, r19 ; 0x01 3a474: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 3a476: 8f 5f subi r24, 0xFF ; 255 3a478: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 3a47c: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 3a47e: 20 e0 ldi r18, 0x00 ; 0 3a480: 40 e0 ldi r20, 0x00 ; 0 3a482: 70 e0 ldi r23, 0x00 ; 0 3a484: 60 e0 ldi r22, 0x00 ; 0 3a486: 80 e3 ldi r24, 0x30 ; 48 3a488: 9a e3 ldi r25, 0x3A ; 58 3a48a: 0f 94 c7 d1 call 0x3a38e ; 0x3a38e 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; 3a48e: b0 92 aa 03 sts 0x03AA, r11 ; 0x8003aa 3a492: a0 92 a9 03 sts 0x03A9, r10 ; 0x8003a9 _md->editValuePtr = pval; 3a496: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 3a49a: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->editValueBits = pbits; 3a49e: 70 92 ab 03 sts 0x03AB, r7 ; 0x8003ab _md->currentValue = cur_val; 3a4a2: d0 93 af 03 sts 0x03AF, r29 ; 0x8003af 3a4a6: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae _md->minEditValue = min_val; 3a4aa: 90 92 b1 03 sts 0x03B1, r9 ; 0x8003b1 3a4ae: 80 92 b0 03 sts 0x03B0, r8 ; 0x8003b0 _md->maxEditValue = max_val; 3a4b2: 10 93 b3 03 sts 0x03B3, r17 ; 0x8003b3 3a4b6: 00 93 b2 03 sts 0x03B2, r16 ; 0x8003b2 _md->minJumpValue = jmp_val; 3a4ba: f0 92 b5 03 sts 0x03B5, r15 ; 0x8003b5 3a4be: e0 92 b4 03 sts 0x03B4, r14 ; 0x8003b4 menu_item_ret(); return; } } menu_item++; } 3a4c2: df 91 pop r29 3a4c4: cf 91 pop r28 3a4c6: 1f 91 pop r17 3a4c8: 0f 91 pop r16 3a4ca: ff 90 pop r15 3a4cc: ef 90 pop r14 3a4ce: df 90 pop r13 3a4d0: cf 90 pop r12 3a4d2: bf 90 pop r11 3a4d4: af 90 pop r10 3a4d6: 9f 90 pop r9 3a4d8: 8f 90 pop r8 3a4da: 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(); 3a4dc: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 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)); 3a4e0: c0 81 ld r28, Z 3a4e2: d1 81 ldd r29, Z+1 ; 0x01 3a4e4: 93 cf rjmp .-218 ; 0x3a40c _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 3a4e6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a4ea: 8f 5f subi r24, 0xFF ; 255 3a4ec: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a4f0: df 91 pop r29 3a4f2: cf 91 pop r28 3a4f4: 1f 91 pop r17 3a4f6: 0f 91 pop r16 3a4f8: ff 90 pop r15 3a4fa: ef 90 pop r14 3a4fc: df 90 pop r13 3a4fe: cf 90 pop r12 3a500: bf 90 pop r11 3a502: af 90 pop r10 3a504: 9f 90 pop r9 3a506: 8f 90 pop r8 3a508: 7f 90 pop r7 3a50a: 08 95 ret 0003a50c <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 3a50c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a510: 88 23 and r24, r24 3a512: 09 f4 brne .+2 ; 0x3a516 <_menu_edit_P()+0xa> 3a514: 52 c0 rjmp .+164 ; 0x3a5ba <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 3a516: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 3a51a: 30 91 b5 03 lds r19, 0x03B5 ; 0x8003b5 3a51e: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 3a522: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 3a526: 21 15 cp r18, r1 3a528: 31 05 cpc r19, r1 3a52a: d9 f0 breq .+54 ; 0x3a562 <_menu_edit_P()+0x56> 3a52c: 40 91 70 06 lds r20, 0x0670 ; 0x800670 3a530: 50 91 71 06 lds r21, 0x0671 ; 0x800671 3a534: 41 15 cp r20, r1 3a536: 51 05 cpc r21, r1 3a538: a1 f0 breq .+40 ; 0x3a562 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 3a53a: 7c f0 brlt .+30 ; 0x3a55a <_menu_edit_P()+0x4e> 3a53c: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a540: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a544: 48 17 cp r20, r24 3a546: 59 07 cpc r21, r25 3a548: 41 f4 brne .+16 ; 0x3a55a <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 3a54a: 30 93 af 03 sts 0x03AF, r19 ; 0x8003af 3a54e: 20 93 ae 03 sts 0x03AE, r18 ; 0x8003ae lcd_encoder = 0; 3a552: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a556: 10 92 70 06 sts 0x0670, r1 ; 0x800670 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 3a55a: 10 92 b5 03 sts 0x03B5, r1 ; 0x8003b5 3a55e: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } _md->currentValue += lcd_encoder; 3a562: 20 91 ae 03 lds r18, 0x03AE ; 0x8003ae 3a566: 30 91 af 03 lds r19, 0x03AF ; 0x8003af 3a56a: 40 91 70 06 lds r20, 0x0670 ; 0x800670 3a56e: 50 91 71 06 lds r21, 0x0671 ; 0x800671 3a572: 24 0f add r18, r20 3a574: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 3a576: 10 92 71 06 sts 0x0671, r1 ; 0x800671 3a57a: 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); 3a57e: 28 17 cp r18, r24 3a580: 39 07 cpc r19, r25 3a582: 44 f0 brlt .+16 ; 0x3a594 <_menu_edit_P()+0x88> 3a584: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a588: 90 91 b3 03 lds r25, 0x03B3 ; 0x8003b3 3a58c: 28 17 cp r18, r24 3a58e: 39 07 cpc r19, r25 3a590: 0c f4 brge .+2 ; 0x3a594 <_menu_edit_P()+0x88> 3a592: c9 01 movw r24, r18 3a594: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 3a598: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae lcd_set_cursor(0, 1); 3a59c: 61 e0 ldi r22, 0x01 ; 1 3a59e: 80 e0 ldi r24, 0x00 ; 0 3a5a0: 0e 94 e7 6e call 0xddce ; 0xddce menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a5a4: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a5a8: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a5ac: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 3a5b0: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 3a5b4: 80 e2 ldi r24, 0x20 ; 32 3a5b6: 0f 94 d3 b0 call 0x361a6 ; 0x361a6 } if (lcd_clicked()) 3a5ba: 0e 94 04 71 call 0xe208 ; 0xe208 3a5be: 88 23 and r24, r24 3a5c0: 41 f1 breq .+80 ; 0x3a612 <_menu_edit_P()+0x106> 3a5c2: e0 91 ac 03 lds r30, 0x03AC ; 0x8003ac 3a5c6: f0 91 ad 03 lds r31, 0x03AD ; 0x8003ad 3a5ca: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 3a5ce: 90 91 af 03 lds r25, 0x03AF ; 0x8003af { if (_md->editValueBits == 8) 3a5d2: 20 91 ab 03 lds r18, 0x03AB ; 0x8003ab *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a5d6: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a5d8: 28 30 cpi r18, 0x08 ; 8 3a5da: c9 f4 brne .+50 ; 0x3a60e <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a5dc: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a5e0: 88 23 and r24, r24 3a5e2: b9 f0 breq .+46 ; 0x3a612 <_menu_edit_P()+0x106> { menu_depth--; 3a5e4: 81 50 subi r24, 0x01 ; 1 3a5e6: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a5ea: 90 e0 ldi r25, 0x00 ; 0 3a5ec: fc 01 movw r30, r24 3a5ee: ee 0f add r30, r30 3a5f0: ff 1f adc r31, r31 3a5f2: e8 0f add r30, r24 3a5f4: f9 1f adc r31, r25 3a5f6: ec 53 subi r30, 0x3C ; 60 3a5f8: f8 4e sbci r31, 0xE8 ; 232 3a5fa: 62 81 ldd r22, Z+2 ; 0x02 3a5fc: 06 2e mov r0, r22 3a5fe: 00 0c add r0, r0 3a600: 77 0b sbc r23, r23 3a602: 20 e0 ldi r18, 0x00 ; 0 3a604: 40 e0 ldi r20, 0x00 ; 0 3a606: 80 81 ld r24, Z 3a608: 91 81 ldd r25, Z+1 ; 0x01 3a60a: 0d 94 c7 d1 jmp 0x3a38e ; 0x3a38e if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a60e: 91 83 std Z+1, r25 ; 0x01 3a610: e5 cf rjmp .-54 ; 0x3a5dc <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a612: 08 95 ret 0003a614 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a614: dc 01 movw r26, r24 3a616: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a618: 90 91 f8 03 lds r25, 0x03F8 ; 0x8003f8 3a61c: 97 30 cpi r25, 0x07 ; 7 3a61e: d8 f4 brcc .+54 ; 0x3a656 { menu_stack[menu_depth].menu = menu_menu; 3a620: 49 2f mov r20, r25 3a622: 50 e0 ldi r21, 0x00 ; 0 3a624: fa 01 movw r30, r20 3a626: ee 0f add r30, r30 3a628: ff 1f adc r31, r31 3a62a: e4 0f add r30, r20 3a62c: f5 1f adc r31, r21 3a62e: ec 53 subi r30, 0x3C ; 60 3a630: f8 4e sbci r31, 0xE8 ; 232 3a632: 40 91 13 04 lds r20, 0x0413 ; 0x800413 3a636: 50 91 14 04 lds r21, 0x0414 ; 0x800414 3a63a: 51 83 std Z+1, r21 ; 0x01 3a63c: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a63e: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a642: 9f 5f subi r25, 0xFF ; 255 3a644: 90 93 f8 03 sts 0x03F8, r25 ; 0x8003f8 3a648: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a64a: 41 e0 ldi r20, 0x01 ; 1 3a64c: 70 e0 ldi r23, 0x00 ; 0 3a64e: 60 e0 ldi r22, 0x00 ; 0 3a650: cd 01 movw r24, r26 3a652: 0d 94 c7 d1 jmp 0x3a38e ; 0x3a38e } } 3a656: 08 95 ret 0003a658 : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a658: 8f 92 push r8 3a65a: 9f 92 push r9 3a65c: af 92 push r10 3a65e: bf 92 push r11 3a660: cf 92 push r12 3a662: df 92 push r13 3a664: ef 92 push r14 3a666: ff 92 push r15 3a668: 0f 93 push r16 3a66a: 1f 93 push r17 3a66c: cf 93 push r28 3a66e: df 93 push r29 if (menu_item == menu_line) 3a670: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a674: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a678: e3 13 cpse r30, r19 3a67a: 73 c0 rjmp .+230 ; 0x3a762 3a67c: c2 2f mov r28, r18 3a67e: 6a 01 movw r12, r20 3a680: 7b 01 movw r14, r22 3a682: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a684: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a688: 88 23 and r24, r24 3a68a: a1 f1 breq .+104 ; 0x3a6f4 3a68c: 0f 94 5f d0 call 0x3a0be ; 0x3a0be 3a690: 01 e0 ldi r16, 0x01 ; 1 3a692: 8e 33 cpi r24, 0x3E ; 62 3a694: 09 f0 breq .+2 ; 0x3a698 3a696: 00 e0 ldi r16, 0x00 ; 0 3a698: 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; 3a69a: 80 2f mov r24, r16 3a69c: 82 70 andi r24, 0x02 ; 2 3a69e: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a6a0: e1 14 cp r14, r1 3a6a2: f1 04 cpc r15, r1 3a6a4: 09 f4 brne .+2 ; 0x3a6a8 3a6a6: 6f c0 rjmp .+222 ; 0x3a786 3a6a8: e7 01 movw r28, r14 3a6aa: 90 e2 ldi r25, 0x20 ; 32 3a6ac: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a6ae: 88 20 and r8, r8 3a6b0: 09 f4 brne .+2 ; 0x3a6b4 3a6b2: 41 c0 rjmp .+130 ; 0x3a736 3a6b4: ce 01 movw r24, r28 3a6b6: 0f 94 e1 d9 call 0x3b3c2 ; 0x3b3c2 <__strlen_P> 3a6ba: 14 e0 ldi r17, 0x04 ; 4 3a6bc: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a6be: 4e e3 ldi r20, 0x3E ; 62 3a6c0: 00 ff sbrs r16, 0 3a6c2: 40 e2 ldi r20, 0x20 ; 32 3a6c4: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a6c8: 80 e0 ldi r24, 0x00 ; 0 3a6ca: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_print_pad_P(str, LCD_WIDTH - len); 3a6ce: 64 e1 ldi r22, 0x14 ; 20 3a6d0: 61 1b sub r22, r17 3a6d2: c5 01 movw r24, r10 3a6d4: 0e 94 bc 70 call 0xe178 ; 0xe178 lcd_putc('['); 3a6d8: 8b e5 ldi r24, 0x5B ; 91 3a6da: 0e 94 d6 6e call 0xddac ; 0xddac if (is_progmem) { lcd_puts_P(toggle); 3a6de: 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) 3a6e0: 88 20 and r8, r8 3a6e2: 89 f1 breq .+98 ; 0x3a746 { lcd_puts_P(toggle); 3a6e4: 0e 94 d2 6e call 0xdda4 ; 0xdda4 } else { lcd_print(toggle); } lcd_putc(']'); 3a6e8: 8d e5 ldi r24, 0x5D ; 93 3a6ea: 0e 94 d6 6e call 0xddac ; 0xddac lcd_putc(eol); 3a6ee: 89 2d mov r24, r9 3a6f0: 0e 94 d6 6e call 0xddac ; 0xddac 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)) 3a6f4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a6f8: 88 23 and r24, r24 3a6fa: 99 f1 breq .+102 ; 0x3a762 3a6fc: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a700: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a704: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a708: 28 17 cp r18, r24 3a70a: 19 06 cpc r1, r25 3a70c: 51 f5 brne .+84 ; 0x3a762 { if (toggle == NULL) // print N/A warning message 3a70e: ef 28 or r14, r15 3a710: e9 f4 brne .+58 ; 0x3a74c { menu_submenu(func); 3a712: 60 e0 ldi r22, 0x00 ; 0 3a714: c6 01 movw r24, r12 3a716: 0f 94 0a d3 call 0x3a614 ; 0x3a614 menu_item_ret(); return; } } menu_item++; } 3a71a: df 91 pop r29 3a71c: cf 91 pop r28 3a71e: 1f 91 pop r17 3a720: 0f 91 pop r16 3a722: ff 90 pop r15 3a724: ef 90 pop r14 3a726: df 90 pop r13 3a728: cf 90 pop r12 3a72a: bf 90 pop r11 3a72c: af 90 pop r10 3a72e: 9f 90 pop r9 3a730: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a732: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 //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)); 3a736: fe 01 movw r30, r28 3a738: 01 90 ld r0, Z+ 3a73a: 00 20 and r0, r0 3a73c: e9 f7 brne .-6 ; 0x3a738 3a73e: ec 1b sub r30, r28 3a740: 13 e0 ldi r17, 0x03 ; 3 3a742: 1e 0f add r17, r30 3a744: bc cf rjmp .-136 ; 0x3a6be lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a746: 0e 94 ee 70 call 0xe1dc ; 0xe1dc 3a74a: ce cf rjmp .-100 ; 0x3a6e8 { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a74c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a750: c1 14 cp r12, r1 3a752: d1 04 cpc r13, r1 3a754: 11 f0 breq .+4 ; 0x3a75a 3a756: f6 01 movw r30, r12 3a758: 19 95 eicall lcd_update_enabled = 1; 3a75a: 81 e0 ldi r24, 0x01 ; 1 3a75c: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a760: dc cf rjmp .-72 ; 0x3a71a } menu_item_ret(); return; } } menu_item++; 3a762: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a766: 8f 5f subi r24, 0xFF ; 255 3a768: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a76c: df 91 pop r29 3a76e: cf 91 pop r28 3a770: 1f 91 pop r17 3a772: 0f 91 pop r16 3a774: ff 90 pop r15 3a776: ef 90 pop r14 3a778: df 90 pop r13 3a77a: cf 90 pop r12 3a77c: bf 90 pop r11 3a77e: af 90 pop r10 3a780: 9f 90 pop r9 3a782: 8f 90 pop r8 3a784: 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); 3a786: 86 ee ldi r24, 0xE6 ; 230 3a788: 97 e4 ldi r25, 0x47 ; 71 3a78a: 0e 94 b3 72 call 0xe566 ; 0xe566 3a78e: 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] : ' '; 3a790: 8e e7 ldi r24, 0x7E ; 126 3a792: 98 2e mov r9, r24 3a794: 8c cf rjmp .-232 ; 0x3a6ae 0003a796 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a796: 0f 93 push r16 3a798: 1f 93 push r17 3a79a: cf 93 push r28 3a79c: df 93 push r29 3a79e: cd b7 in r28, 0x3d ; 61 3a7a0: de b7 in r29, 0x3e ; 62 3a7a2: 63 97 sbiw r28, 0x13 ; 19 3a7a4: 0f b6 in r0, 0x3f ; 63 3a7a6: f8 94 cli 3a7a8: de bf out 0x3e, r29 ; 62 3a7aa: 0f be out 0x3f, r0 ; 63 3a7ac: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a7ae: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a7b2: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a7b6: 32 13 cpse r19, r18 3a7b8: 38 c0 rjmp .+112 ; 0x3a82a 3a7ba: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a7bc: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a7c0: 22 23 and r18, r18 3a7c2: a9 f0 breq .+42 ; 0x3a7ee static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a7c4: be 01 movw r22, r28 3a7c6: 6f 5f subi r22, 0xFF ; 255 3a7c8: 7f 4f sbci r23, 0xFF ; 255 3a7ca: 0f 94 37 d0 call 0x3a06e ; 0x3a06e lcd_putc_at(0, menu_row, menu_selection_mark()); 3a7ce: 0f 94 5f d0 call 0x3a0be ; 0x3a0be 3a7d2: 48 2f mov r20, r24 3a7d4: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a7d8: 80 e0 ldi r24, 0x00 ; 0 3a7da: 0e 94 07 6f call 0xde0e ; 0xde0e lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a7de: 62 e1 ldi r22, 0x12 ; 18 3a7e0: ce 01 movw r24, r28 3a7e2: 01 96 adiw r24, 0x01 ; 1 3a7e4: 0e 94 d6 70 call 0xe1ac ; 0xe1ac lcd_putc(type_char); 3a7e8: 8e e7 ldi r24, 0x7E ; 126 3a7ea: 0e 94 d6 6e call 0xddac ; 0xddac 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)) 3a7ee: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a7f2: 88 23 and r24, r24 3a7f4: d1 f0 breq .+52 ; 0x3a82a 3a7f6: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a7fa: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a7fe: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a802: 28 17 cp r18, r24 3a804: 19 06 cpc r1, r25 3a806: 89 f4 brne .+34 ; 0x3a82a 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); 3a808: 60 e0 ldi r22, 0x00 ; 0 3a80a: c8 01 movw r24, r16 3a80c: 0f 94 0a d3 call 0x3a614 ; 0x3a614 menu_item_ret(); 3a810: 0f 94 83 d0 call 0x3a106 ; 0x3a106 menu_item_ret(); return; } } menu_item++; } 3a814: 63 96 adiw r28, 0x13 ; 19 3a816: 0f b6 in r0, 0x3f ; 63 3a818: f8 94 cli 3a81a: de bf out 0x3e, r29 ; 62 3a81c: 0f be out 0x3f, r0 ; 63 3a81e: cd bf out 0x3d, r28 ; 61 3a820: df 91 pop r29 3a822: cf 91 pop r28 3a824: 1f 91 pop r17 3a826: 0f 91 pop r16 3a828: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a82a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a82e: 8f 5f subi r24, 0xFF ; 255 3a830: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a834: ef cf rjmp .-34 ; 0x3a814 0003a836 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a836: cf 93 push r28 3a838: df 93 push r29 if (menu_item == menu_line) 3a83a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a83e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a842: 32 13 cpse r19, r18 3a844: 1e c0 rjmp .+60 ; 0x3a882 3a846: eb 01 movw r28, r22 3a848: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a84a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a84e: 88 23 and r24, r24 3a850: 19 f0 breq .+6 ; 0x3a858 3a852: 8e e7 ldi r24, 0x7E ; 126 3a854: 0f 94 6c d0 call 0x3a0d8 ; 0x3a0d8 if (menu_clicked && (lcd_encoder == menu_item)) 3a858: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a85c: 88 23 and r24, r24 3a85e: 89 f0 breq .+34 ; 0x3a882 3a860: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a864: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a868: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a86c: 28 17 cp r18, r24 3a86e: 19 06 cpc r1, r25 3a870: 41 f4 brne .+16 ; 0x3a882 { menu_submenu(submenu); 3a872: 60 e0 ldi r22, 0x00 ; 0 3a874: ce 01 movw r24, r28 3a876: 0f 94 0a d3 call 0x3a614 ; 0x3a614 menu_item_ret(); return; } } menu_item++; } 3a87a: df 91 pop r29 3a87c: 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(); 3a87e: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 return; } } menu_item++; 3a882: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a886: 8f 5f subi r24, 0xFF ; 255 3a888: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a88c: df 91 pop r29 3a88e: cf 91 pop r28 3a890: 08 95 ret 0003a892 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a892: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a894: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 3a898: 98 17 cp r25, r24 3a89a: a8 f4 brcc .+42 ; 0x3a8c6 3a89c: 89 1b sub r24, r25 3a89e: 80 93 f8 03 sts 0x03F8, r24 ; 0x8003f8 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a8a2: 90 e0 ldi r25, 0x00 ; 0 3a8a4: fc 01 movw r30, r24 3a8a6: ee 0f add r30, r30 3a8a8: ff 1f adc r31, r31 3a8aa: e8 0f add r30, r24 3a8ac: f9 1f adc r31, r25 3a8ae: ec 53 subi r30, 0x3C ; 60 3a8b0: f8 4e sbci r31, 0xE8 ; 232 3a8b2: 62 81 ldd r22, Z+2 ; 0x02 3a8b4: 06 2e mov r0, r22 3a8b6: 00 0c add r0, r0 3a8b8: 77 0b sbc r23, r23 3a8ba: 20 e0 ldi r18, 0x00 ; 0 3a8bc: 41 e0 ldi r20, 0x01 ; 1 3a8be: 80 81 ld r24, Z 3a8c0: 91 81 ldd r25, Z+1 ; 0x01 3a8c2: 0d 94 c7 d1 jmp 0x3a38e ; 0x3a38e } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a8c6: 80 e0 ldi r24, 0x00 ; 0 3a8c8: ea cf rjmp .-44 ; 0x3a89e 0003a8ca : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a8ca: 81 e0 ldi r24, 0x01 ; 1 3a8cc: 0d 94 49 d4 jmp 0x3a892 ; 0x3a892 0003a8d0 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a8d0: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a8d4: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a8d8: 32 13 cpse r19, r18 3a8da: 19 c0 rjmp .+50 ; 0x3a90e 3a8dc: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a8de: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a8e2: 88 23 and r24, r24 3a8e4: 19 f0 breq .+6 ; 0x3a8ec 3a8e6: 83 e8 ldi r24, 0x83 ; 131 3a8e8: 0f 94 6c d0 call 0x3a0d8 ; 0x3a0d8 if (menu_clicked && (lcd_encoder == menu_item)) 3a8ec: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a8f0: 88 23 and r24, r24 3a8f2: 69 f0 breq .+26 ; 0x3a90e 3a8f4: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a8f8: 80 91 70 06 lds r24, 0x0670 ; 0x800670 3a8fc: 90 91 71 06 lds r25, 0x0671 ; 0x800671 3a900: 28 17 cp r18, r24 3a902: 19 06 cpc r1, r25 3a904: 21 f4 brne .+8 ; 0x3a90e { menu_back(); 3a906: 0f 94 65 d4 call 0x3a8ca ; 0x3a8ca menu_item_ret(); 3a90a: 0d 94 83 d0 jmp 0x3a106 ; 0x3a106 return; } } menu_item++; 3a90e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a912: 8f 5f subi r24, 0xFF ; 255 3a914: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a918: 08 95 ret 0003a91a : }; 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() { 3a91a: ef 92 push r14 3a91c: ff 92 push r15 3a91e: 0f 93 push r16 3a920: 1f 93 push r17 3a922: cf 93 push r28 3a924: df 93 push r29 3a926: 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) 3a92a: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a92e: 81 11 cpse r24, r1 3a930: 23 c0 rjmp .+70 ; 0x3a978 { _md->status = 1; // Menu entered for the first time 3a932: 81 e0 ldi r24, 0x01 ; 1 3a934: 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; 3a938: 81 e0 ldi r24, 0x01 ; 1 3a93a: 90 e0 ldi r25, 0x00 ; 0 3a93c: 20 91 8b 13 lds r18, 0x138B ; 0x80138b 3a940: 30 91 8c 13 lds r19, 0x138C ; 0x80138c 3a944: 27 30 cpi r18, 0x07 ; 7 3a946: 31 48 sbci r19, 0x81 ; 129 3a948: 11 f0 breq .+4 ; 0x3a94e 3a94a: 90 e0 ldi r25, 0x00 ; 0 3a94c: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a94e: bc 01 movw r22, r24 3a950: 66 0f add r22, r22 3a952: 77 1f adc r23, r23 3a954: 68 0f add r22, r24 3a956: 79 1f adc r23, r25 3a958: 63 5e subi r22, 0xE3 ; 227 3a95a: 73 45 sbci r23, 0x53 ; 83 3a95c: 43 e0 ldi r20, 0x03 ; 3 3a95e: 50 e0 ldi r21, 0x00 ; 0 3a960: 88 eb ldi r24, 0xB8 ; 184 3a962: 93 e0 ldi r25, 0x03 ; 3 3a964: 0f 94 bd d9 call 0x3b37a ; 0x3b37a // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a968: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a96c: 0f 94 a2 0f call 0x21f44 ; 0x21f44 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a970: 80 91 b6 13 lds r24, 0x13B6 ; 0x8013b6 3a974: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 } MENU_BEGIN(); 3a978: 0f 94 9d d1 call 0x3a33a ; 0x3a33a 3a97c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 3a980: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a984: 84 30 cpi r24, 0x04 ; 4 3a986: e0 f5 brcc .+120 ; 0x3aa00 3a988: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 3a98c: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 3a990: 88 23 and r24, r24 3a992: 89 f0 breq .+34 ; 0x3a9b6 3a994: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 3a998: 70 e0 ldi r23, 0x00 ; 0 3a99a: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a99e: 0e 94 4b e8 call 0x1d096 ; 0x1d096 3a9a2: 10 92 ad 0d sts 0x0DAD, r1 ; 0x800dad <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.496> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a9a6: df 91 pop r29 3a9a8: cf 91 pop r28 3a9aa: 1f 91 pop r17 3a9ac: 0f 91 pop r16 3a9ae: ff 90 pop r15 3a9b0: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a9b2: 0d 94 ad 1e jmp 0x23d5a ; 0x23d5a mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a9b6: 82 eb ldi r24, 0xB2 ; 178 3a9b8: 94 e6 ldi r25, 0x64 ; 100 3a9ba: 0e 94 b3 72 call 0xe566 ; 0xe566 3a9be: 0f 94 68 d4 call 0x3a8d0 ; 0x3a8d0 MENU_ITEM_EDIT_int3_P( 3a9c2: 00 91 ba 03 lds r16, 0x03BA ; 0x8003ba 3a9c6: 10 e0 ldi r17, 0x00 ; 0 3a9c8: c0 91 b9 03 lds r28, 0x03B9 ; 0x8003b9 3a9cc: d0 e0 ldi r29, 0x00 ; 0 3a9ce: 84 ea ldi r24, 0xA4 ; 164 3a9d0: 94 e6 ldi r25, 0x64 ; 100 3a9d2: 0e 94 b3 72 call 0xe566 ; 0xe566 3a9d6: f1 2c mov r15, r1 3a9d8: e1 2c mov r14, r1 3a9da: 9e 01 movw r18, r28 3a9dc: 48 e0 ldi r20, 0x08 ; 8 3a9de: 67 eb ldi r22, 0xB7 ; 183 3a9e0: 73 e0 ldi r23, 0x03 ; 3 3a9e2: 0f 94 ed d1 call 0x3a3da ; 0x3a3da _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a9e6: 0f 94 71 d1 call 0x3a2e2 ; 0x3a2e2 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a9ea: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a9ee: 8f 5f subi r24, 0xFF ; 255 3a9f0: 80 93 12 05 sts 0x0512, r24 ; 0x800512 3a9f4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a9f8: 8f 5f subi r24, 0xFF ; 255 3a9fa: 80 93 14 05 sts 0x0514, r24 ; 0x800514 3a9fe: c0 cf rjmp .-128 ; 0x3a980 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3aa00: df 91 pop r29 3aa02: cf 91 pop r28 3aa04: 1f 91 pop r17 3aa06: 0f 91 pop r16 3aa08: ff 90 pop r15 3aa0a: ef 90 pop r14 3aa0c: 08 95 ret 0003aa0e : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3aa0e: 0e 94 04 71 call 0xe208 ; 0xe208 3aa12: 81 11 cpse r24, r1 menu_back(); 3aa14: 0d 94 65 d4 jmp 0x3a8ca ; 0x3a8ca } 3aa18: 08 95 ret 0003aa1a : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3aa1a: 8f 92 push r8 3aa1c: 9f 92 push r9 3aa1e: af 92 push r10 3aa20: bf 92 push r11 3aa22: ef 92 push r14 3aa24: ff 92 push r15 3aa26: 0f 93 push r16 3aa28: 1f 93 push r17 3aa2a: cf 93 push r28 3aa2c: df 93 push r29 3aa2e: cd b7 in r28, 0x3d ; 61 3aa30: de b7 in r29, 0x3e ; 62 3aa32: a0 97 sbiw r28, 0x20 ; 32 3aa34: 0f b6 in r0, 0x3f ; 63 3aa36: f8 94 cli 3aa38: de bf out 0x3e, r29 ; 62 3aa3a: 0f be out 0x3f, r0 ; 63 3aa3c: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3aa3e: 61 15 cp r22, r1 3aa40: 71 05 cpc r23, r1 3aa42: 81 05 cpc r24, r1 3aa44: 91 05 cpc r25, r1 3aa46: 99 f4 brne .+38 ; 0x3aa6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aa48: 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)); } 3aa4a: a0 96 adiw r28, 0x20 ; 32 3aa4c: 0f b6 in r0, 0x3f ; 63 3aa4e: f8 94 cli 3aa50: de bf out 0x3e, r29 ; 62 3aa52: 0f be out 0x3f, r0 ; 63 3aa54: cd bf out 0x3d, r28 ; 61 3aa56: df 91 pop r29 3aa58: cf 91 pop r28 3aa5a: 1f 91 pop r17 3aa5c: 0f 91 pop r16 3aa5e: ff 90 pop r15 3aa60: ef 90 pop r14 3aa62: bf 90 pop r11 3aa64: af 90 pop r10 3aa66: 9f 90 pop r9 3aa68: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aa6a: 0c 94 3e 77 jmp 0xee7c ; 0xee7c // 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; 3aa6e: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3aa70: 84 2e mov r8, r20 3aa72: 91 2c mov r9, r1 3aa74: b1 2c mov r11, r1 3aa76: a1 2c mov r10, r1 3aa78: 9e 01 movw r18, r28 3aa7a: 2f 5f subi r18, 0xFF ; 255 3aa7c: 3f 4f sbci r19, 0xFF ; 255 3aa7e: 79 01 movw r14, r18 3aa80: a5 01 movw r20, r10 3aa82: 94 01 movw r18, r8 3aa84: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 3aa88: f7 01 movw r30, r14 3aa8a: e0 0f add r30, r16 3aa8c: f1 1d adc r31, r1 3aa8e: 60 83 st Z, r22 n /= base; 3aa90: b9 01 movw r22, r18 3aa92: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3aa94: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3aa96: 61 15 cp r22, r1 3aa98: 71 05 cpc r23, r1 3aa9a: 81 05 cpc r24, r1 3aa9c: 91 05 cpc r25, r1 3aa9e: 81 f7 brne .-32 ; 0x3aa80 3aaa0: 0e 0d add r16, r14 3aaa2: 1f 2d mov r17, r15 3aaa4: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3aaa6: e0 16 cp r14, r16 3aaa8: f1 06 cpc r15, r17 3aaaa: 59 f0 breq .+22 ; 0x3aac2 print((char) (buf[i - 1] < 10 ? 3aaac: f8 01 movw r30, r16 3aaae: 82 91 ld r24, -Z 3aab0: 8f 01 movw r16, r30 3aab2: 8a 30 cpi r24, 0x0A ; 10 3aab4: 20 f4 brcc .+8 ; 0x3aabe '0' + buf[i - 1] : 3aab6: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aab8: 0e 94 3e 77 call 0xee7c ; 0xee7c 3aabc: f4 cf rjmp .-24 ; 0x3aaa6 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3aabe: 89 5c subi r24, 0xC9 ; 201 3aac0: fb cf rjmp .-10 ; 0x3aab8 } 3aac2: a0 96 adiw r28, 0x20 ; 32 3aac4: 0f b6 in r0, 0x3f ; 63 3aac6: f8 94 cli 3aac8: de bf out 0x3e, r29 ; 62 3aaca: 0f be out 0x3f, r0 ; 63 3aacc: cd bf out 0x3d, r28 ; 61 3aace: df 91 pop r29 3aad0: cf 91 pop r28 3aad2: 1f 91 pop r17 3aad4: 0f 91 pop r16 3aad6: ff 90 pop r15 3aad8: ef 90 pop r14 3aada: bf 90 pop r11 3aadc: af 90 pop r10 3aade: 9f 90 pop r9 3aae0: 8f 90 pop r8 3aae2: 08 95 ret 0003aae4 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3aae4: cf 92 push r12 3aae6: df 92 push r13 3aae8: ef 92 push r14 3aaea: ff 92 push r15 3aaec: 6b 01 movw r12, r22 3aaee: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3aaf0: f7 fe sbrs r15, 7 3aaf2: 0b c0 rjmp .+22 ; 0x3ab0a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aaf4: 8d e2 ldi r24, 0x2D ; 45 3aaf6: 0e 94 3e 77 call 0xee7c ; 0xee7c } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3aafa: f0 94 com r15 3aafc: e0 94 com r14 3aafe: d0 94 com r13 3ab00: c0 94 com r12 3ab02: c1 1c adc r12, r1 3ab04: d1 1c adc r13, r1 3ab06: e1 1c adc r14, r1 3ab08: f1 1c adc r15, r1 } printNumber(n, 10); 3ab0a: 4a e0 ldi r20, 0x0A ; 10 3ab0c: c7 01 movw r24, r14 3ab0e: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3ab10: ff 90 pop r15 3ab12: ef 90 pop r14 3ab14: df 90 pop r13 3ab16: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3ab18: 0d 94 0d d5 jmp 0x3aa1a ; 0x3aa1a 0003ab1c : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3ab1c: 8f 92 push r8 3ab1e: 9f 92 push r9 3ab20: af 92 push r10 3ab22: bf 92 push r11 3ab24: cf 92 push r12 3ab26: df 92 push r13 3ab28: ef 92 push r14 3ab2a: ff 92 push r15 3ab2c: cf 93 push r28 3ab2e: 6b 01 movw r12, r22 3ab30: 7c 01 movw r14, r24 3ab32: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3ab34: 20 e0 ldi r18, 0x00 ; 0 3ab36: 30 e0 ldi r19, 0x00 ; 0 3ab38: a9 01 movw r20, r18 3ab3a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__cmpsf2> 3ab3e: 87 ff sbrs r24, 7 3ab40: 07 c0 rjmp .+14 ; 0x3ab50 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab42: 8d e2 ldi r24, 0x2D ; 45 3ab44: 0e 94 3e 77 call 0xee7c ; 0xee7c { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3ab48: f7 fa bst r15, 7 3ab4a: f0 94 com r15 3ab4c: f7 f8 bld r15, 7 3ab4e: 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; 3ab5e: 20 e0 ldi r18, 0x00 ; 0 3ab60: 30 e0 ldi r19, 0x00 ; 0 3ab62: 40 e2 ldi r20, 0x20 ; 32 3ab64: 51 e4 ldi r21, 0x41 ; 65 3ab66: 0f 94 4a de call 0x3bc94 ; 0x3bc94 <__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; 3ab6e: 9b 01 movw r18, r22 3ab70: ac 01 movw r20, r24 3ab72: c7 01 movw r24, r14 3ab74: b6 01 movw r22, r12 3ab76: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3ab7a: 6b 01 movw r12, r22 3ab7c: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ab7e: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 3ab82: 4b 01 movw r8, r22 3ab84: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3ab86: 4a e0 ldi r20, 0x0A ; 10 3ab88: 0f 94 0d d5 call 0x3aa1a ; 0x3aa1a 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) 3ab8c: cc 23 and r28, r28 3ab8e: 91 f1 breq .+100 ; 0x3abf4 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; 3ab90: c5 01 movw r24, r10 3ab92: b4 01 movw r22, r8 3ab94: 0f 94 af d6 call 0x3ad5e ; 0x3ad5e <__floatunsisf> 3ab98: 9b 01 movw r18, r22 3ab9a: ac 01 movw r20, r24 3ab9c: c7 01 movw r24, r14 3ab9e: b6 01 movw r22, r12 3aba0: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3aba4: 6b 01 movw r12, r22 3aba6: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3aba8: 8e e2 ldi r24, 0x2E ; 46 3abaa: 0e 94 3e 77 call 0xee7c ; 0xee7c // 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) 3abae: c1 50 subi r28, 0x01 ; 1 3abb0: 08 f1 brcs .+66 ; 0x3abf4 { remainder *= 10.0; 3abb2: 20 e0 ldi r18, 0x00 ; 0 3abb4: 30 e0 ldi r19, 0x00 ; 0 3abb6: 40 e2 ldi r20, 0x20 ; 32 3abb8: 51 e4 ldi r21, 0x41 ; 65 3abba: c7 01 movw r24, r14 3abbc: b6 01 movw r22, r12 3abbe: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3abc2: 4b 01 movw r8, r22 3abc4: 5c 01 movw r10, r24 int toPrint = int(remainder); 3abc6: 0f 94 bc de call 0x3bd78 ; 0x3bd78 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3abca: 6b 01 movw r12, r22 3abcc: 77 0f add r23, r23 3abce: ee 08 sbc r14, r14 3abd0: ff 08 sbc r15, r15 3abd2: c7 01 movw r24, r14 3abd4: b6 01 movw r22, r12 3abd6: 0f 94 72 d5 call 0x3aae4 ; 0x3aae4 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3abda: c7 01 movw r24, r14 3abdc: b6 01 movw r22, r12 3abde: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3abe2: 9b 01 movw r18, r22 3abe4: ac 01 movw r20, r24 3abe6: c5 01 movw r24, r10 3abe8: b4 01 movw r22, r8 3abea: 0f 94 4a dd call 0x3ba94 ; 0x3ba94 <__subsf3> 3abee: 6b 01 movw r12, r22 3abf0: 7c 01 movw r14, r24 3abf2: dd cf rjmp .-70 ; 0x3abae } } 3abf4: cf 91 pop r28 3abf6: ff 90 pop r15 3abf8: ef 90 pop r14 3abfa: df 90 pop r13 3abfc: cf 90 pop r12 3abfe: bf 90 pop r11 3ac00: af 90 pop r10 3ac02: 9f 90 pop r9 3ac04: 8f 90 pop r8 3ac06: 08 95 ret 0003ac08 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac08: 8a e0 ldi r24, 0x0A ; 10 3ac0a: 0c 94 3e 77 jmp 0xee7c ; 0xee7c 0003ac0e : 3ac0e: 0e 94 1b 88 call 0x11036 ; 0x11036 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ac12: 0d 94 04 d6 jmp 0x3ac08 ; 0x3ac08 0003ac16 : } 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) { 3ac16: 20 91 9b 04 lds r18, 0x049B ; 0x80049b 3ac1a: 30 91 9c 04 lds r19, 0x049C ; 0x80049c 3ac1e: 80 91 99 04 lds r24, 0x0499 ; 0x800499 3ac22: 90 91 9a 04 lds r25, 0x049A ; 0x80049a 3ac26: 82 17 cp r24, r18 3ac28: 93 07 cpc r25, r19 3ac2a: 71 f0 breq .+28 ; 0x3ac48 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ac2c: f9 01 movw r30, r18 3ac2e: e7 5e subi r30, 0xE7 ; 231 3ac30: fb 4f sbci r31, 0xFB ; 251 3ac32: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ac34: 2f 5f subi r18, 0xFF ; 255 3ac36: 3f 4f sbci r19, 0xFF ; 255 3ac38: 2f 77 andi r18, 0x7F ; 127 3ac3a: 33 27 eor r19, r19 3ac3c: 30 93 9c 04 sts 0x049C, r19 ; 0x80049c 3ac40: 20 93 9b 04 sts 0x049B, r18 ; 0x80049b return c; 3ac44: 90 e0 ldi r25, 0x00 ; 0 3ac46: 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; 3ac48: 8f ef ldi r24, 0xFF ; 255 3ac4a: 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; } } 3ac4c: 08 95 ret 0003ac4e <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3ac4e: 1f 92 push r1 3ac50: 0f 92 push r0 3ac52: 0f b6 in r0, 0x3f ; 63 3ac54: 0f 92 push r0 3ac56: 11 24 eor r1, r1 3ac58: 0b b6 in r0, 0x3b ; 59 3ac5a: 0f 92 push r0 3ac5c: 2f 93 push r18 3ac5e: 3f 93 push r19 3ac60: 4f 93 push r20 3ac62: 6f 93 push r22 3ac64: 7f 93 push r23 3ac66: 8f 93 push r24 3ac68: 9f 93 push r25 3ac6a: ef 93 push r30 3ac6c: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3ac72: 84 ff sbrs r24, 4 3ac74: 12 c0 rjmp .+36 ; 0x3ac9a <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3ac76: 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 } } 3ac7a: ff 91 pop r31 3ac7c: ef 91 pop r30 3ac7e: 9f 91 pop r25 3ac80: 8f 91 pop r24 3ac82: 7f 91 pop r23 3ac84: 6f 91 pop r22 3ac86: 4f 91 pop r20 3ac88: 3f 91 pop r19 3ac8a: 2f 91 pop r18 3ac8c: 0f 90 pop r0 3ac8e: 0b be out 0x3b, r0 ; 59 3ac90: 0f 90 pop r0 3ac92: 0f be out 0x3f, r0 ; 63 3ac94: 0f 90 pop r0 3ac96: 1f 90 pop r1 3ac98: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3ac9a: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3ac9e: 80 91 39 05 lds r24, 0x0539 ; 0x800539 3aca2: 81 30 cpi r24, 0x01 ; 1 3aca4: 51 f7 brne .-44 ; 0x3ac7a <__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; 3aca6: 20 91 99 04 lds r18, 0x0499 ; 0x800499 3acaa: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 3acae: c9 01 movw r24, r18 3acb0: 01 96 adiw r24, 0x01 ; 1 3acb2: 8f 77 andi r24, 0x7F ; 127 3acb4: 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) { 3acb6: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 3acba: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 3acbe: 86 17 cp r24, r22 3acc0: 97 07 cpc r25, r23 3acc2: d9 f2 breq .-74 ; 0x3ac7a <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3acc4: 27 5e subi r18, 0xE7 ; 231 3acc6: 3b 4f sbci r19, 0xFB ; 251 3acc8: f9 01 movw r30, r18 3acca: 40 83 st Z, r20 rx_buffer.head = i; 3accc: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 3acd0: 80 93 99 04 sts 0x0499, r24 ; 0x800499 3acd4: d2 cf rjmp .-92 ; 0x3ac7a <__vector_36+0x2c> 0003acd6 <__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) { 3acd6: 1f 92 push r1 3acd8: 0f 92 push r0 3acda: 0f b6 in r0, 0x3f ; 63 3acdc: 0f 92 push r0 3acde: 11 24 eor r1, r1 3ace0: 0b b6 in r0, 0x3b ; 59 3ace2: 0f 92 push r0 3ace4: 2f 93 push r18 3ace6: 3f 93 push r19 3ace8: 4f 93 push r20 3acea: 6f 93 push r22 3acec: 7f 93 push r23 3acee: 8f 93 push r24 3acf0: 9f 93 push r25 3acf2: ef 93 push r30 3acf4: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3acfa: 84 ff sbrs r24, 4 3acfc: 12 c0 rjmp .+36 ; 0x3ad22 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3acfe: 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 } } 3ad02: ff 91 pop r31 3ad04: ef 91 pop r30 3ad06: 9f 91 pop r25 3ad08: 8f 91 pop r24 3ad0a: 7f 91 pop r23 3ad0c: 6f 91 pop r22 3ad0e: 4f 91 pop r20 3ad10: 3f 91 pop r19 3ad12: 2f 91 pop r18 3ad14: 0f 90 pop r0 3ad16: 0b be out 0x3b, r0 ; 59 3ad18: 0f 90 pop r0 3ad1a: 0f be out 0x3f, r0 ; 63 3ad1c: 0f 90 pop r0 3ad1e: 1f 90 pop r1 3ad20: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ad22: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ad26: 80 91 39 05 lds r24, 0x0539 ; 0x800539 3ad2a: 81 11 cpse r24, r1 3ad2c: ea cf rjmp .-44 ; 0x3ad02 <__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; 3ad2e: 20 91 99 04 lds r18, 0x0499 ; 0x800499 3ad32: 30 91 9a 04 lds r19, 0x049A ; 0x80049a 3ad36: c9 01 movw r24, r18 3ad38: 01 96 adiw r24, 0x01 ; 1 3ad3a: 8f 77 andi r24, 0x7F ; 127 3ad3c: 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) { 3ad3e: 60 91 9b 04 lds r22, 0x049B ; 0x80049b 3ad42: 70 91 9c 04 lds r23, 0x049C ; 0x80049c 3ad46: 86 17 cp r24, r22 3ad48: 97 07 cpc r25, r23 3ad4a: d9 f2 breq .-74 ; 0x3ad02 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ad4c: 27 5e subi r18, 0xE7 ; 231 3ad4e: 3b 4f sbci r19, 0xFB ; 251 3ad50: f9 01 movw r30, r18 3ad52: 40 83 st Z, r20 rx_buffer.head = i; 3ad54: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a 3ad58: 80 93 99 04 sts 0x0499, r24 ; 0x800499 3ad5c: d2 cf rjmp .-92 ; 0x3ad02 <__vector_25+0x2c> 0003ad5e <__floatunsisf>: 3ad5e: e8 94 clt 3ad60: 09 c0 rjmp .+18 ; 0x3ad74 <__floatsisf+0x12> 0003ad62 <__floatsisf>: 3ad62: 97 fb bst r25, 7 3ad64: 3e f4 brtc .+14 ; 0x3ad74 <__floatsisf+0x12> 3ad66: 90 95 com r25 3ad68: 80 95 com r24 3ad6a: 70 95 com r23 3ad6c: 61 95 neg r22 3ad6e: 7f 4f sbci r23, 0xFF ; 255 3ad70: 8f 4f sbci r24, 0xFF ; 255 3ad72: 9f 4f sbci r25, 0xFF ; 255 3ad74: 99 23 and r25, r25 3ad76: a9 f0 breq .+42 ; 0x3ada2 <__floatsisf+0x40> 3ad78: f9 2f mov r31, r25 3ad7a: 96 e9 ldi r25, 0x96 ; 150 3ad7c: bb 27 eor r27, r27 3ad7e: 93 95 inc r25 3ad80: f6 95 lsr r31 3ad82: 87 95 ror r24 3ad84: 77 95 ror r23 3ad86: 67 95 ror r22 3ad88: b7 95 ror r27 3ad8a: f1 11 cpse r31, r1 3ad8c: f8 cf rjmp .-16 ; 0x3ad7e <__floatsisf+0x1c> 3ad8e: fa f4 brpl .+62 ; 0x3adce <__floatsisf+0x6c> 3ad90: bb 0f add r27, r27 3ad92: 11 f4 brne .+4 ; 0x3ad98 <__floatsisf+0x36> 3ad94: 60 ff sbrs r22, 0 3ad96: 1b c0 rjmp .+54 ; 0x3adce <__floatsisf+0x6c> 3ad98: 6f 5f subi r22, 0xFF ; 255 3ad9a: 7f 4f sbci r23, 0xFF ; 255 3ad9c: 8f 4f sbci r24, 0xFF ; 255 3ad9e: 9f 4f sbci r25, 0xFF ; 255 3ada0: 16 c0 rjmp .+44 ; 0x3adce <__floatsisf+0x6c> 3ada2: 88 23 and r24, r24 3ada4: 11 f0 breq .+4 ; 0x3adaa <__floatsisf+0x48> 3ada6: 96 e9 ldi r25, 0x96 ; 150 3ada8: 11 c0 rjmp .+34 ; 0x3adcc <__floatsisf+0x6a> 3adaa: 77 23 and r23, r23 3adac: 21 f0 breq .+8 ; 0x3adb6 <__floatsisf+0x54> 3adae: 9e e8 ldi r25, 0x8E ; 142 3adb0: 87 2f mov r24, r23 3adb2: 76 2f mov r23, r22 3adb4: 05 c0 rjmp .+10 ; 0x3adc0 <__floatsisf+0x5e> 3adb6: 66 23 and r22, r22 3adb8: 71 f0 breq .+28 ; 0x3add6 <__floatsisf+0x74> 3adba: 96 e8 ldi r25, 0x86 ; 134 3adbc: 86 2f mov r24, r22 3adbe: 70 e0 ldi r23, 0x00 ; 0 3adc0: 60 e0 ldi r22, 0x00 ; 0 3adc2: 2a f0 brmi .+10 ; 0x3adce <__floatsisf+0x6c> 3adc4: 9a 95 dec r25 3adc6: 66 0f add r22, r22 3adc8: 77 1f adc r23, r23 3adca: 88 1f adc r24, r24 3adcc: da f7 brpl .-10 ; 0x3adc4 <__floatsisf+0x62> 3adce: 88 0f add r24, r24 3add0: 96 95 lsr r25 3add2: 87 95 ror r24 3add4: 97 f9 bld r25, 7 3add6: 08 95 ret 0003add8 : 3add8: 9b 01 movw r18, r22 3adda: ac 01 movw r20, r24 3addc: 0d 94 f0 d6 jmp 0x3ade0 ; 0x3ade0 <__mulsf3> 0003ade0 <__mulsf3>: 3ade0: 0f 94 03 d7 call 0x3ae06 ; 0x3ae06 <__mulsf3x> 3ade4: 0d 94 74 d7 jmp 0x3aee8 ; 0x3aee8 <__fp_round> 3ade8: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscA> 3adec: 38 f0 brcs .+14 ; 0x3adfc <__mulsf3+0x1c> 3adee: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_pscB> 3adf2: 20 f0 brcs .+8 ; 0x3adfc <__mulsf3+0x1c> 3adf4: 95 23 and r25, r21 3adf6: 11 f0 breq .+4 ; 0x3adfc <__mulsf3+0x1c> 3adf8: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3adfc: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3ae00: 11 24 eor r1, r1 3ae02: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 0003ae06 <__mulsf3x>: 3ae06: 0f 94 85 d7 call 0x3af0a ; 0x3af0a <__fp_split3> 3ae0a: 70 f3 brcs .-36 ; 0x3ade8 <__mulsf3+0x8> 0003ae0c <__mulsf3_pse>: 3ae0c: 95 9f mul r25, r21 3ae0e: c1 f3 breq .-16 ; 0x3ae00 <__mulsf3+0x20> 3ae10: 95 0f add r25, r21 3ae12: 50 e0 ldi r21, 0x00 ; 0 3ae14: 55 1f adc r21, r21 3ae16: 62 9f mul r22, r18 3ae18: f0 01 movw r30, r0 3ae1a: 72 9f mul r23, r18 3ae1c: bb 27 eor r27, r27 3ae1e: f0 0d add r31, r0 3ae20: b1 1d adc r27, r1 3ae22: 63 9f mul r22, r19 3ae24: aa 27 eor r26, r26 3ae26: f0 0d add r31, r0 3ae28: b1 1d adc r27, r1 3ae2a: aa 1f adc r26, r26 3ae2c: 64 9f mul r22, r20 3ae2e: 66 27 eor r22, r22 3ae30: b0 0d add r27, r0 3ae32: a1 1d adc r26, r1 3ae34: 66 1f adc r22, r22 3ae36: 82 9f mul r24, r18 3ae38: 22 27 eor r18, r18 3ae3a: b0 0d add r27, r0 3ae3c: a1 1d adc r26, r1 3ae3e: 62 1f adc r22, r18 3ae40: 73 9f mul r23, r19 3ae42: b0 0d add r27, r0 3ae44: a1 1d adc r26, r1 3ae46: 62 1f adc r22, r18 3ae48: 83 9f mul r24, r19 3ae4a: a0 0d add r26, r0 3ae4c: 61 1d adc r22, r1 3ae4e: 22 1f adc r18, r18 3ae50: 74 9f mul r23, r20 3ae52: 33 27 eor r19, r19 3ae54: a0 0d add r26, r0 3ae56: 61 1d adc r22, r1 3ae58: 23 1f adc r18, r19 3ae5a: 84 9f mul r24, r20 3ae5c: 60 0d add r22, r0 3ae5e: 21 1d adc r18, r1 3ae60: 82 2f mov r24, r18 3ae62: 76 2f mov r23, r22 3ae64: 6a 2f mov r22, r26 3ae66: 11 24 eor r1, r1 3ae68: 9f 57 subi r25, 0x7F ; 127 3ae6a: 50 40 sbci r21, 0x00 ; 0 3ae6c: 9a f0 brmi .+38 ; 0x3ae94 <__mulsf3_pse+0x88> 3ae6e: f1 f0 breq .+60 ; 0x3aeac <__mulsf3_pse+0xa0> 3ae70: 88 23 and r24, r24 3ae72: 4a f0 brmi .+18 ; 0x3ae86 <__mulsf3_pse+0x7a> 3ae74: ee 0f add r30, r30 3ae76: ff 1f adc r31, r31 3ae78: bb 1f adc r27, r27 3ae7a: 66 1f adc r22, r22 3ae7c: 77 1f adc r23, r23 3ae7e: 88 1f adc r24, r24 3ae80: 91 50 subi r25, 0x01 ; 1 3ae82: 50 40 sbci r21, 0x00 ; 0 3ae84: a9 f7 brne .-22 ; 0x3ae70 <__mulsf3_pse+0x64> 3ae86: 9e 3f cpi r25, 0xFE ; 254 3ae88: 51 05 cpc r21, r1 3ae8a: 80 f0 brcs .+32 ; 0x3aeac <__mulsf3_pse+0xa0> 3ae8c: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3ae90: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3ae94: 5f 3f cpi r21, 0xFF ; 255 3ae96: e4 f3 brlt .-8 ; 0x3ae90 <__mulsf3_pse+0x84> 3ae98: 98 3e cpi r25, 0xE8 ; 232 3ae9a: d4 f3 brlt .-12 ; 0x3ae90 <__mulsf3_pse+0x84> 3ae9c: 86 95 lsr r24 3ae9e: 77 95 ror r23 3aea0: 67 95 ror r22 3aea2: b7 95 ror r27 3aea4: f7 95 ror r31 3aea6: e7 95 ror r30 3aea8: 9f 5f subi r25, 0xFF ; 255 3aeaa: c1 f7 brne .-16 ; 0x3ae9c <__mulsf3_pse+0x90> 3aeac: fe 2b or r31, r30 3aeae: 88 0f add r24, r24 3aeb0: 91 1d adc r25, r1 3aeb2: 96 95 lsr r25 3aeb4: 87 95 ror r24 3aeb6: 97 f9 bld r25, 7 3aeb8: 08 95 ret 0003aeba <__fp_inf>: 3aeba: 97 f9 bld r25, 7 3aebc: 9f 67 ori r25, 0x7F ; 127 3aebe: 80 e8 ldi r24, 0x80 ; 128 3aec0: 70 e0 ldi r23, 0x00 ; 0 3aec2: 60 e0 ldi r22, 0x00 ; 0 3aec4: 08 95 ret 0003aec6 <__fp_nan>: 3aec6: 9f ef ldi r25, 0xFF ; 255 3aec8: 80 ec ldi r24, 0xC0 ; 192 3aeca: 08 95 ret 0003aecc <__fp_pscA>: 3aecc: 00 24 eor r0, r0 3aece: 0a 94 dec r0 3aed0: 16 16 cp r1, r22 3aed2: 17 06 cpc r1, r23 3aed4: 18 06 cpc r1, r24 3aed6: 09 06 cpc r0, r25 3aed8: 08 95 ret 0003aeda <__fp_pscB>: 3aeda: 00 24 eor r0, r0 3aedc: 0a 94 dec r0 3aede: 12 16 cp r1, r18 3aee0: 13 06 cpc r1, r19 3aee2: 14 06 cpc r1, r20 3aee4: 05 06 cpc r0, r21 3aee6: 08 95 ret 0003aee8 <__fp_round>: 3aee8: 09 2e mov r0, r25 3aeea: 03 94 inc r0 3aeec: 00 0c add r0, r0 3aeee: 11 f4 brne .+4 ; 0x3aef4 <__fp_round+0xc> 3aef0: 88 23 and r24, r24 3aef2: 52 f0 brmi .+20 ; 0x3af08 <__fp_round+0x20> 3aef4: bb 0f add r27, r27 3aef6: 40 f4 brcc .+16 ; 0x3af08 <__fp_round+0x20> 3aef8: bf 2b or r27, r31 3aefa: 11 f4 brne .+4 ; 0x3af00 <__fp_round+0x18> 3aefc: 60 ff sbrs r22, 0 3aefe: 04 c0 rjmp .+8 ; 0x3af08 <__fp_round+0x20> 3af00: 6f 5f subi r22, 0xFF ; 255 3af02: 7f 4f sbci r23, 0xFF ; 255 3af04: 8f 4f sbci r24, 0xFF ; 255 3af06: 9f 4f sbci r25, 0xFF ; 255 3af08: 08 95 ret 0003af0a <__fp_split3>: 3af0a: 57 fd sbrc r21, 7 3af0c: 90 58 subi r25, 0x80 ; 128 3af0e: 44 0f add r20, r20 3af10: 55 1f adc r21, r21 3af12: 59 f0 breq .+22 ; 0x3af2a <__fp_splitA+0x10> 3af14: 5f 3f cpi r21, 0xFF ; 255 3af16: 71 f0 breq .+28 ; 0x3af34 <__fp_splitA+0x1a> 3af18: 47 95 ror r20 0003af1a <__fp_splitA>: 3af1a: 88 0f add r24, r24 3af1c: 97 fb bst r25, 7 3af1e: 99 1f adc r25, r25 3af20: 61 f0 breq .+24 ; 0x3af3a <__fp_splitA+0x20> 3af22: 9f 3f cpi r25, 0xFF ; 255 3af24: 79 f0 breq .+30 ; 0x3af44 <__fp_splitA+0x2a> 3af26: 87 95 ror r24 3af28: 08 95 ret 3af2a: 12 16 cp r1, r18 3af2c: 13 06 cpc r1, r19 3af2e: 14 06 cpc r1, r20 3af30: 55 1f adc r21, r21 3af32: f2 cf rjmp .-28 ; 0x3af18 <__fp_split3+0xe> 3af34: 46 95 lsr r20 3af36: f1 df rcall .-30 ; 0x3af1a <__fp_splitA> 3af38: 08 c0 rjmp .+16 ; 0x3af4a <__fp_splitA+0x30> 3af3a: 16 16 cp r1, r22 3af3c: 17 06 cpc r1, r23 3af3e: 18 06 cpc r1, r24 3af40: 99 1f adc r25, r25 3af42: f1 cf rjmp .-30 ; 0x3af26 <__fp_splitA+0xc> 3af44: 86 95 lsr r24 3af46: 71 05 cpc r23, r1 3af48: 61 05 cpc r22, r1 3af4a: 08 94 sec 3af4c: 08 95 ret 0003af4e <__fp_zero>: 3af4e: e8 94 clt 0003af50 <__fp_szero>: 3af50: bb 27 eor r27, r27 3af52: 66 27 eor r22, r22 3af54: 77 27 eor r23, r23 3af56: cb 01 movw r24, r22 3af58: 97 f9 bld r25, 7 3af5a: 08 95 ret 0003af5c : 3af5c: 3f 92 push r3 3af5e: 4f 92 push r4 3af60: 5f 92 push r5 3af62: 6f 92 push r6 3af64: 7f 92 push r7 3af66: 8f 92 push r8 3af68: 9f 92 push r9 3af6a: af 92 push r10 3af6c: bf 92 push r11 3af6e: cf 92 push r12 3af70: df 92 push r13 3af72: ef 92 push r14 3af74: ff 92 push r15 3af76: 0f 93 push r16 3af78: 1f 93 push r17 3af7a: cf 93 push r28 3af7c: df 93 push r29 3af7e: 5c 01 movw r10, r24 3af80: 6b 01 movw r12, r22 3af82: 7a 01 movw r14, r20 3af84: 61 15 cp r22, r1 3af86: 71 05 cpc r23, r1 3af88: 19 f0 breq .+6 ; 0x3af90 3af8a: fb 01 movw r30, r22 3af8c: 91 83 std Z+1, r25 ; 0x01 3af8e: 80 83 st Z, r24 3af90: e1 14 cp r14, r1 3af92: f1 04 cpc r15, r1 3af94: 51 f0 breq .+20 ; 0x3afaa 3af96: c7 01 movw r24, r14 3af98: 02 97 sbiw r24, 0x02 ; 2 3af9a: 83 97 sbiw r24, 0x23 ; 35 3af9c: 30 f0 brcs .+12 ; 0x3afaa 3af9e: 40 e0 ldi r20, 0x00 ; 0 3afa0: 30 e0 ldi r19, 0x00 ; 0 3afa2: 20 e0 ldi r18, 0x00 ; 0 3afa4: 90 e0 ldi r25, 0x00 ; 0 3afa6: 6b c0 rjmp .+214 ; 0x3b07e 3afa8: 5e 01 movw r10, r28 3afaa: e5 01 movw r28, r10 3afac: 21 96 adiw r28, 0x01 ; 1 3afae: f5 01 movw r30, r10 3afb0: 10 81 ld r17, Z 3afb2: 81 2f mov r24, r17 3afb4: 90 e0 ldi r25, 0x00 ; 0 3afb6: 0f 94 b4 d9 call 0x3b368 ; 0x3b368 3afba: 89 2b or r24, r25 3afbc: a9 f7 brne .-22 ; 0x3afa8 3afbe: 1d 32 cpi r17, 0x2D ; 45 3afc0: 01 f5 brne .+64 ; 0x3b002 3afc2: 21 96 adiw r28, 0x01 ; 1 3afc4: f5 01 movw r30, r10 3afc6: 11 81 ldd r17, Z+1 ; 0x01 3afc8: 01 e0 ldi r16, 0x01 ; 1 3afca: e1 14 cp r14, r1 3afcc: f1 04 cpc r15, r1 3afce: 09 f4 brne .+2 ; 0x3afd2 3afd0: e6 c0 rjmp .+460 ; 0x3b19e 3afd2: f0 e1 ldi r31, 0x10 ; 16 3afd4: ef 16 cp r14, r31 3afd6: f1 04 cpc r15, r1 3afd8: 09 f0 breq .+2 ; 0x3afdc 3afda: 88 c0 rjmp .+272 ; 0x3b0ec 3afdc: 10 33 cpi r17, 0x30 ; 48 3afde: 59 f4 brne .+22 ; 0x3aff6 3afe0: 88 81 ld r24, Y 3afe2: 8f 7d andi r24, 0xDF ; 223 3afe4: 88 35 cpi r24, 0x58 ; 88 3afe6: 09 f0 breq .+2 ; 0x3afea 3afe8: 7c c0 rjmp .+248 ; 0x3b0e2 3afea: 19 81 ldd r17, Y+1 ; 0x01 3afec: 22 96 adiw r28, 0x02 ; 2 3afee: 02 60 ori r16, 0x02 ; 2 3aff0: f0 e1 ldi r31, 0x10 ; 16 3aff2: ef 2e mov r14, r31 3aff4: f1 2c mov r15, r1 3aff6: 81 2c mov r8, r1 3aff8: 91 2c mov r9, r1 3affa: a1 2c mov r10, r1 3affc: 88 e0 ldi r24, 0x08 ; 8 3affe: b8 2e mov r11, r24 3b000: 92 c0 rjmp .+292 ; 0x3b126 3b002: 1b 32 cpi r17, 0x2B ; 43 3b004: 21 f4 brne .+8 ; 0x3b00e 3b006: e5 01 movw r28, r10 3b008: 22 96 adiw r28, 0x02 ; 2 3b00a: f5 01 movw r30, r10 3b00c: 11 81 ldd r17, Z+1 ; 0x01 3b00e: 00 e0 ldi r16, 0x00 ; 0 3b010: dc cf rjmp .-72 ; 0x3afca 3b012: ea e0 ldi r30, 0x0A ; 10 3b014: ee 16 cp r14, r30 3b016: f1 04 cpc r15, r1 3b018: 09 f4 brne .+2 ; 0x3b01c 3b01a: c7 c0 rjmp .+398 ; 0x3b1aa 3b01c: f0 e1 ldi r31, 0x10 ; 16 3b01e: ef 16 cp r14, r31 3b020: f1 04 cpc r15, r1 3b022: 09 f0 breq .+2 ; 0x3b026 3b024: 73 c0 rjmp .+230 ; 0x3b10c 3b026: e7 cf rjmp .-50 ; 0x3aff6 3b028: 78 e0 ldi r23, 0x08 ; 8 3b02a: e7 2e mov r14, r23 3b02c: f1 2c mov r15, r1 3b02e: 81 2c mov r8, r1 3b030: 91 2c mov r9, r1 3b032: a1 2c mov r10, r1 3b034: 60 e1 ldi r22, 0x10 ; 16 3b036: b6 2e mov r11, r22 3b038: 76 c0 rjmp .+236 ; 0x3b126 3b03a: 21 e0 ldi r18, 0x01 ; 1 3b03c: ad c0 rjmp .+346 ; 0x3b198 3b03e: 30 2f mov r19, r16 3b040: 31 70 andi r19, 0x01 ; 1 3b042: c1 14 cp r12, r1 3b044: d1 04 cpc r13, r1 3b046: 31 f0 breq .+12 ; 0x3b054 3b048: 22 23 and r18, r18 3b04a: 71 f1 breq .+92 ; 0x3b0a8 3b04c: 21 97 sbiw r28, 0x01 ; 1 3b04e: f6 01 movw r30, r12 3b050: d1 83 std Z+1, r29 ; 0x01 3b052: c0 83 st Z, r28 3b054: 27 ff sbrs r18, 7 3b056: 2e c0 rjmp .+92 ; 0x3b0b4 3b058: 60 e0 ldi r22, 0x00 ; 0 3b05a: 70 e0 ldi r23, 0x00 ; 0 3b05c: 80 e0 ldi r24, 0x00 ; 0 3b05e: 90 e8 ldi r25, 0x80 ; 128 3b060: 31 11 cpse r19, r1 3b062: 04 c0 rjmp .+8 ; 0x3b06c 3b064: 6f ef ldi r22, 0xFF ; 255 3b066: 7f ef ldi r23, 0xFF ; 255 3b068: 8f ef ldi r24, 0xFF ; 255 3b06a: 9f e7 ldi r25, 0x7F ; 127 3b06c: 22 e2 ldi r18, 0x22 ; 34 3b06e: 30 e0 ldi r19, 0x00 ; 0 3b070: 30 93 15 18 sts 0x1815, r19 ; 0x801815 3b074: 20 93 14 18 sts 0x1814, r18 ; 0x801814 3b078: 46 2f mov r20, r22 3b07a: 37 2f mov r19, r23 3b07c: 28 2f mov r18, r24 3b07e: 64 2f mov r22, r20 3b080: 73 2f mov r23, r19 3b082: 82 2f mov r24, r18 3b084: df 91 pop r29 3b086: cf 91 pop r28 3b088: 1f 91 pop r17 3b08a: 0f 91 pop r16 3b08c: ff 90 pop r15 3b08e: ef 90 pop r14 3b090: df 90 pop r13 3b092: cf 90 pop r12 3b094: bf 90 pop r11 3b096: af 90 pop r10 3b098: 9f 90 pop r9 3b09a: 8f 90 pop r8 3b09c: 7f 90 pop r7 3b09e: 6f 90 pop r6 3b0a0: 5f 90 pop r5 3b0a2: 4f 90 pop r4 3b0a4: 3f 90 pop r3 3b0a6: 08 95 ret 3b0a8: 01 ff sbrs r16, 1 3b0aa: 04 c0 rjmp .+8 ; 0x3b0b4 3b0ac: 22 97 sbiw r28, 0x02 ; 2 3b0ae: f6 01 movw r30, r12 3b0b0: d1 83 std Z+1, r29 ; 0x01 3b0b2: c0 83 st Z, r28 3b0b4: 33 23 and r19, r19 3b0b6: 41 f0 breq .+16 ; 0x3b0c8 3b0b8: 90 95 com r25 3b0ba: 80 95 com r24 3b0bc: 70 95 com r23 3b0be: 61 95 neg r22 3b0c0: 7f 4f sbci r23, 0xFF ; 255 3b0c2: 8f 4f sbci r24, 0xFF ; 255 3b0c4: 9f 4f sbci r25, 0xFF ; 255 3b0c6: d8 cf rjmp .-80 ; 0x3b078 3b0c8: 97 ff sbrs r25, 7 3b0ca: d6 cf rjmp .-84 ; 0x3b078 3b0cc: 82 e2 ldi r24, 0x22 ; 34 3b0ce: 90 e0 ldi r25, 0x00 ; 0 3b0d0: 90 93 15 18 sts 0x1815, r25 ; 0x801815 3b0d4: 80 93 14 18 sts 0x1814, r24 ; 0x801814 3b0d8: 6f ef ldi r22, 0xFF ; 255 3b0da: 7f ef ldi r23, 0xFF ; 255 3b0dc: 8f ef ldi r24, 0xFF ; 255 3b0de: 9f e7 ldi r25, 0x7F ; 127 3b0e0: cb cf rjmp .-106 ; 0x3b078 3b0e2: 10 e3 ldi r17, 0x30 ; 48 3b0e4: e1 14 cp r14, r1 3b0e6: f1 04 cpc r15, r1 3b0e8: 09 f4 brne .+2 ; 0x3b0ec 3b0ea: 9e cf rjmp .-196 ; 0x3b028 3b0ec: 28 e0 ldi r18, 0x08 ; 8 3b0ee: e2 16 cp r14, r18 3b0f0: f1 04 cpc r15, r1 3b0f2: 09 f4 brne .+2 ; 0x3b0f6 3b0f4: 9c cf rjmp .-200 ; 0x3b02e 3b0f6: 0c f0 brlt .+2 ; 0x3b0fa 3b0f8: 8c cf rjmp .-232 ; 0x3b012 3b0fa: 81 2c mov r8, r1 3b0fc: 91 2c mov r9, r1 3b0fe: a1 2c mov r10, r1 3b100: e0 e4 ldi r30, 0x40 ; 64 3b102: be 2e mov r11, r30 3b104: 82 e0 ldi r24, 0x02 ; 2 3b106: e8 16 cp r14, r24 3b108: f1 04 cpc r15, r1 3b10a: 69 f0 breq .+26 ; 0x3b126 3b10c: 60 e0 ldi r22, 0x00 ; 0 3b10e: 70 e0 ldi r23, 0x00 ; 0 3b110: 80 e0 ldi r24, 0x00 ; 0 3b112: 90 e8 ldi r25, 0x80 ; 128 3b114: 97 01 movw r18, r14 3b116: 0f 2c mov r0, r15 3b118: 00 0c add r0, r0 3b11a: 44 0b sbc r20, r20 3b11c: 55 0b sbc r21, r21 3b11e: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 3b122: 49 01 movw r8, r18 3b124: 5a 01 movw r10, r20 3b126: 20 e0 ldi r18, 0x00 ; 0 3b128: 60 e0 ldi r22, 0x00 ; 0 3b12a: 70 e0 ldi r23, 0x00 ; 0 3b12c: cb 01 movw r24, r22 3b12e: 27 01 movw r4, r14 3b130: 0f 2c mov r0, r15 3b132: 00 0c add r0, r0 3b134: 66 08 sbc r6, r6 3b136: 77 08 sbc r7, r7 3b138: fe 01 movw r30, r28 3b13a: 50 ed ldi r21, 0xD0 ; 208 3b13c: 35 2e mov r3, r21 3b13e: 31 0e add r3, r17 3b140: 39 e0 ldi r19, 0x09 ; 9 3b142: 33 15 cp r19, r3 3b144: 70 f4 brcc .+28 ; 0x3b162 3b146: 3f eb ldi r19, 0xBF ; 191 3b148: 31 0f add r19, r17 3b14a: 49 ec ldi r20, 0xC9 ; 201 3b14c: 34 2e mov r3, r20 3b14e: 3a 31 cpi r19, 0x1A ; 26 3b150: 38 f0 brcs .+14 ; 0x3b160 3b152: 3f e9 ldi r19, 0x9F ; 159 3b154: 31 0f add r19, r17 3b156: 3a 31 cpi r19, 0x1A ; 26 3b158: 08 f0 brcs .+2 ; 0x3b15c 3b15a: 71 cf rjmp .-286 ; 0x3b03e 3b15c: 39 ea ldi r19, 0xA9 ; 169 3b15e: 33 2e mov r3, r19 3b160: 31 0e add r3, r17 3b162: 3e 14 cp r3, r14 3b164: 1f 04 cpc r1, r15 3b166: 0c f0 brlt .+2 ; 0x3b16a 3b168: 6a cf rjmp .-300 ; 0x3b03e 3b16a: 27 fd sbrc r18, 7 3b16c: 15 c0 rjmp .+42 ; 0x3b198 3b16e: 86 16 cp r8, r22 3b170: 97 06 cpc r9, r23 3b172: a8 06 cpc r10, r24 3b174: b9 06 cpc r11, r25 3b176: 78 f0 brcs .+30 ; 0x3b196 3b178: a3 01 movw r20, r6 3b17a: 92 01 movw r18, r4 3b17c: 0f 94 86 dc call 0x3b90c ; 0x3b90c <__mulsi3> 3b180: 63 0d add r22, r3 3b182: 71 1d adc r23, r1 3b184: 81 1d adc r24, r1 3b186: 91 1d adc r25, r1 3b188: 61 30 cpi r22, 0x01 ; 1 3b18a: 71 05 cpc r23, r1 3b18c: 81 05 cpc r24, r1 3b18e: 20 e8 ldi r18, 0x80 ; 128 3b190: 92 07 cpc r25, r18 3b192: 08 f4 brcc .+2 ; 0x3b196 3b194: 52 cf rjmp .-348 ; 0x3b03a 3b196: 2f ef ldi r18, 0xFF ; 255 3b198: 21 96 adiw r28, 0x01 ; 1 3b19a: 10 81 ld r17, Z 3b19c: cd cf rjmp .-102 ; 0x3b138 3b19e: 10 33 cpi r17, 0x30 ; 48 3b1a0: 09 f4 brne .+2 ; 0x3b1a4 3b1a2: 1e cf rjmp .-452 ; 0x3afe0 3b1a4: 2a e0 ldi r18, 0x0A ; 10 3b1a6: e2 2e mov r14, r18 3b1a8: f1 2c mov r15, r1 3b1aa: 9c ec ldi r25, 0xCC ; 204 3b1ac: 89 2e mov r8, r25 3b1ae: 98 2c mov r9, r8 3b1b0: a8 2c mov r10, r8 3b1b2: 9c e0 ldi r25, 0x0C ; 12 3b1b4: b9 2e mov r11, r25 3b1b6: b7 cf rjmp .-146 ; 0x3b126 0003b1b8 <__ftoa_engine>: 3b1b8: 28 30 cpi r18, 0x08 ; 8 3b1ba: 08 f0 brcs .+2 ; 0x3b1be <__ftoa_engine+0x6> 3b1bc: 27 e0 ldi r18, 0x07 ; 7 3b1be: 33 27 eor r19, r19 3b1c0: da 01 movw r26, r20 3b1c2: 99 0f add r25, r25 3b1c4: 31 1d adc r19, r1 3b1c6: 87 fd sbrc r24, 7 3b1c8: 91 60 ori r25, 0x01 ; 1 3b1ca: 00 96 adiw r24, 0x00 ; 0 3b1cc: 61 05 cpc r22, r1 3b1ce: 71 05 cpc r23, r1 3b1d0: 39 f4 brne .+14 ; 0x3b1e0 <__ftoa_engine+0x28> 3b1d2: 32 60 ori r19, 0x02 ; 2 3b1d4: 2e 5f subi r18, 0xFE ; 254 3b1d6: 3d 93 st X+, r19 3b1d8: 30 e3 ldi r19, 0x30 ; 48 3b1da: 2a 95 dec r18 3b1dc: e1 f7 brne .-8 ; 0x3b1d6 <__ftoa_engine+0x1e> 3b1de: 08 95 ret 3b1e0: 9f 3f cpi r25, 0xFF ; 255 3b1e2: 30 f0 brcs .+12 ; 0x3b1f0 <__ftoa_engine+0x38> 3b1e4: 80 38 cpi r24, 0x80 ; 128 3b1e6: 71 05 cpc r23, r1 3b1e8: 61 05 cpc r22, r1 3b1ea: 09 f0 breq .+2 ; 0x3b1ee <__ftoa_engine+0x36> 3b1ec: 3c 5f subi r19, 0xFC ; 252 3b1ee: 3c 5f subi r19, 0xFC ; 252 3b1f0: 3d 93 st X+, r19 3b1f2: 91 30 cpi r25, 0x01 ; 1 3b1f4: 08 f0 brcs .+2 ; 0x3b1f8 <__ftoa_engine+0x40> 3b1f6: 80 68 ori r24, 0x80 ; 128 3b1f8: 91 1d adc r25, r1 3b1fa: df 93 push r29 3b1fc: cf 93 push r28 3b1fe: 1f 93 push r17 3b200: 0f 93 push r16 3b202: ff 92 push r15 3b204: ef 92 push r14 3b206: 19 2f mov r17, r25 3b208: 98 7f andi r25, 0xF8 ; 248 3b20a: 96 95 lsr r25 3b20c: e9 2f mov r30, r25 3b20e: 96 95 lsr r25 3b210: 96 95 lsr r25 3b212: e9 0f add r30, r25 3b214: ff 27 eor r31, r31 3b216: e2 55 subi r30, 0x52 ; 82 3b218: f9 48 sbci r31, 0x89 ; 137 3b21a: 99 27 eor r25, r25 3b21c: 33 27 eor r19, r19 3b21e: ee 24 eor r14, r14 3b220: ff 24 eor r15, r15 3b222: a7 01 movw r20, r14 3b224: e7 01 movw r28, r14 3b226: 05 90 lpm r0, Z+ 3b228: 08 94 sec 3b22a: 07 94 ror r0 3b22c: 28 f4 brcc .+10 ; 0x3b238 <__ftoa_engine+0x80> 3b22e: 36 0f add r19, r22 3b230: e7 1e adc r14, r23 3b232: f8 1e adc r15, r24 3b234: 49 1f adc r20, r25 3b236: 51 1d adc r21, r1 3b238: 66 0f add r22, r22 3b23a: 77 1f adc r23, r23 3b23c: 88 1f adc r24, r24 3b23e: 99 1f adc r25, r25 3b240: 06 94 lsr r0 3b242: a1 f7 brne .-24 ; 0x3b22c <__ftoa_engine+0x74> 3b244: 05 90 lpm r0, Z+ 3b246: 07 94 ror r0 3b248: 28 f4 brcc .+10 ; 0x3b254 <__ftoa_engine+0x9c> 3b24a: e7 0e add r14, r23 3b24c: f8 1e adc r15, r24 3b24e: 49 1f adc r20, r25 3b250: 56 1f adc r21, r22 3b252: c1 1d adc r28, r1 3b254: 77 0f add r23, r23 3b256: 88 1f adc r24, r24 3b258: 99 1f adc r25, r25 3b25a: 66 1f adc r22, r22 3b25c: 06 94 lsr r0 3b25e: a1 f7 brne .-24 ; 0x3b248 <__ftoa_engine+0x90> 3b260: 05 90 lpm r0, Z+ 3b262: 07 94 ror r0 3b264: 28 f4 brcc .+10 ; 0x3b270 <__ftoa_engine+0xb8> 3b266: f8 0e add r15, r24 3b268: 49 1f adc r20, r25 3b26a: 56 1f adc r21, r22 3b26c: c7 1f adc r28, r23 3b26e: d1 1d adc r29, r1 3b270: 88 0f add r24, r24 3b272: 99 1f adc r25, r25 3b274: 66 1f adc r22, r22 3b276: 77 1f adc r23, r23 3b278: 06 94 lsr r0 3b27a: a1 f7 brne .-24 ; 0x3b264 <__ftoa_engine+0xac> 3b27c: 05 90 lpm r0, Z+ 3b27e: 07 94 ror r0 3b280: 20 f4 brcc .+8 ; 0x3b28a <__ftoa_engine+0xd2> 3b282: 49 0f add r20, r25 3b284: 56 1f adc r21, r22 3b286: c7 1f adc r28, r23 3b288: d8 1f adc r29, r24 3b28a: 99 0f add r25, r25 3b28c: 66 1f adc r22, r22 3b28e: 77 1f adc r23, r23 3b290: 88 1f adc r24, r24 3b292: 06 94 lsr r0 3b294: a9 f7 brne .-22 ; 0x3b280 <__ftoa_engine+0xc8> 3b296: 84 91 lpm r24, Z 3b298: 10 95 com r17 3b29a: 17 70 andi r17, 0x07 ; 7 3b29c: 41 f0 breq .+16 ; 0x3b2ae <__ftoa_engine+0xf6> 3b29e: d6 95 lsr r29 3b2a0: c7 95 ror r28 3b2a2: 57 95 ror r21 3b2a4: 47 95 ror r20 3b2a6: f7 94 ror r15 3b2a8: e7 94 ror r14 3b2aa: 1a 95 dec r17 3b2ac: c1 f7 brne .-16 ; 0x3b29e <__ftoa_engine+0xe6> 3b2ae: e4 e5 ldi r30, 0x54 ; 84 3b2b0: f6 e7 ldi r31, 0x76 ; 118 3b2b2: 68 94 set 3b2b4: 15 90 lpm r1, Z+ 3b2b6: 15 91 lpm r17, Z+ 3b2b8: 35 91 lpm r19, Z+ 3b2ba: 65 91 lpm r22, Z+ 3b2bc: 95 91 lpm r25, Z+ 3b2be: 05 90 lpm r0, Z+ 3b2c0: 7f e2 ldi r23, 0x2F ; 47 3b2c2: 73 95 inc r23 3b2c4: e1 18 sub r14, r1 3b2c6: f1 0a sbc r15, r17 3b2c8: 43 0b sbc r20, r19 3b2ca: 56 0b sbc r21, r22 3b2cc: c9 0b sbc r28, r25 3b2ce: d0 09 sbc r29, r0 3b2d0: c0 f7 brcc .-16 ; 0x3b2c2 <__ftoa_engine+0x10a> 3b2d2: e1 0c add r14, r1 3b2d4: f1 1e adc r15, r17 3b2d6: 43 1f adc r20, r19 3b2d8: 56 1f adc r21, r22 3b2da: c9 1f adc r28, r25 3b2dc: d0 1d adc r29, r0 3b2de: 7e f4 brtc .+30 ; 0x3b2fe <__ftoa_engine+0x146> 3b2e0: 70 33 cpi r23, 0x30 ; 48 3b2e2: 11 f4 brne .+4 ; 0x3b2e8 <__ftoa_engine+0x130> 3b2e4: 8a 95 dec r24 3b2e6: e6 cf rjmp .-52 ; 0x3b2b4 <__ftoa_engine+0xfc> 3b2e8: e8 94 clt 3b2ea: 01 50 subi r16, 0x01 ; 1 3b2ec: 30 f0 brcs .+12 ; 0x3b2fa <__ftoa_engine+0x142> 3b2ee: 08 0f add r16, r24 3b2f0: 0a f4 brpl .+2 ; 0x3b2f4 <__ftoa_engine+0x13c> 3b2f2: 00 27 eor r16, r16 3b2f4: 02 17 cp r16, r18 3b2f6: 08 f4 brcc .+2 ; 0x3b2fa <__ftoa_engine+0x142> 3b2f8: 20 2f mov r18, r16 3b2fa: 23 95 inc r18 3b2fc: 02 2f mov r16, r18 3b2fe: 7a 33 cpi r23, 0x3A ; 58 3b300: 28 f0 brcs .+10 ; 0x3b30c <__ftoa_engine+0x154> 3b302: 79 e3 ldi r23, 0x39 ; 57 3b304: 7d 93 st X+, r23 3b306: 2a 95 dec r18 3b308: e9 f7 brne .-6 ; 0x3b304 <__ftoa_engine+0x14c> 3b30a: 10 c0 rjmp .+32 ; 0x3b32c <__ftoa_engine+0x174> 3b30c: 7d 93 st X+, r23 3b30e: 2a 95 dec r18 3b310: 89 f6 brne .-94 ; 0x3b2b4 <__ftoa_engine+0xfc> 3b312: 06 94 lsr r0 3b314: 97 95 ror r25 3b316: 67 95 ror r22 3b318: 37 95 ror r19 3b31a: 17 95 ror r17 3b31c: 17 94 ror r1 3b31e: e1 18 sub r14, r1 3b320: f1 0a sbc r15, r17 3b322: 43 0b sbc r20, r19 3b324: 56 0b sbc r21, r22 3b326: c9 0b sbc r28, r25 3b328: d0 09 sbc r29, r0 3b32a: 98 f0 brcs .+38 ; 0x3b352 <__ftoa_engine+0x19a> 3b32c: 23 95 inc r18 3b32e: 7e 91 ld r23, -X 3b330: 73 95 inc r23 3b332: 7a 33 cpi r23, 0x3A ; 58 3b334: 08 f0 brcs .+2 ; 0x3b338 <__ftoa_engine+0x180> 3b336: 70 e3 ldi r23, 0x30 ; 48 3b338: 7c 93 st X, r23 3b33a: 20 13 cpse r18, r16 3b33c: b8 f7 brcc .-18 ; 0x3b32c <__ftoa_engine+0x174> 3b33e: 7e 91 ld r23, -X 3b340: 70 61 ori r23, 0x10 ; 16 3b342: 7d 93 st X+, r23 3b344: 30 f0 brcs .+12 ; 0x3b352 <__ftoa_engine+0x19a> 3b346: 83 95 inc r24 3b348: 71 e3 ldi r23, 0x31 ; 49 3b34a: 7d 93 st X+, r23 3b34c: 70 e3 ldi r23, 0x30 ; 48 3b34e: 2a 95 dec r18 3b350: e1 f7 brne .-8 ; 0x3b34a <__ftoa_engine+0x192> 3b352: 11 24 eor r1, r1 3b354: ef 90 pop r14 3b356: ff 90 pop r15 3b358: 0f 91 pop r16 3b35a: 1f 91 pop r17 3b35c: cf 91 pop r28 3b35e: df 91 pop r29 3b360: 99 27 eor r25, r25 3b362: 87 fd sbrc r24, 7 3b364: 90 95 com r25 3b366: 08 95 ret 0003b368 : 3b368: 91 11 cpse r25, r1 3b36a: 0d 94 10 dc jmp 0x3b820 ; 0x3b820 <__ctype_isfalse> 3b36e: 80 32 cpi r24, 0x20 ; 32 3b370: 19 f0 breq .+6 ; 0x3b378 3b372: 89 50 subi r24, 0x09 ; 9 3b374: 85 50 subi r24, 0x05 ; 5 3b376: c8 f7 brcc .-14 ; 0x3b36a 3b378: 08 95 ret 0003b37a : 3b37a: fb 01 movw r30, r22 3b37c: dc 01 movw r26, r24 3b37e: 02 c0 rjmp .+4 ; 0x3b384 3b380: 05 90 lpm r0, Z+ 3b382: 0d 92 st X+, r0 3b384: 41 50 subi r20, 0x01 ; 1 3b386: 50 40 sbci r21, 0x00 ; 0 3b388: d8 f7 brcc .-10 ; 0x3b380 3b38a: 08 95 ret 0003b38c : 3b38c: fb 01 movw r30, r22 3b38e: dc 01 movw r26, r24 3b390: 0d 90 ld r0, X+ 3b392: 00 20 and r0, r0 3b394: e9 f7 brne .-6 ; 0x3b390 3b396: 11 97 sbiw r26, 0x01 ; 1 3b398: 05 90 lpm r0, Z+ 3b39a: 0d 92 st X+, r0 3b39c: 00 20 and r0, r0 3b39e: e1 f7 brne .-8 ; 0x3b398 3b3a0: 08 95 ret 0003b3a2 : 3b3a2: fb 01 movw r30, r22 3b3a4: dc 01 movw r26, r24 3b3a6: 8d 91 ld r24, X+ 3b3a8: 05 90 lpm r0, Z+ 3b3aa: 80 19 sub r24, r0 3b3ac: 01 10 cpse r0, r1 3b3ae: d9 f3 breq .-10 ; 0x3b3a6 3b3b0: 99 0b sbc r25, r25 3b3b2: 08 95 ret 0003b3b4 : 3b3b4: fb 01 movw r30, r22 3b3b6: dc 01 movw r26, r24 3b3b8: 05 90 lpm r0, Z+ 3b3ba: 0d 92 st X+, r0 3b3bc: 00 20 and r0, r0 3b3be: e1 f7 brne .-8 ; 0x3b3b8 3b3c0: 08 95 ret 0003b3c2 <__strlen_P>: 3b3c2: fc 01 movw r30, r24 3b3c4: 05 90 lpm r0, Z+ 3b3c6: 00 20 and r0, r0 3b3c8: e9 f7 brne .-6 ; 0x3b3c4 <__strlen_P+0x2> 3b3ca: 80 95 com r24 3b3cc: 90 95 com r25 3b3ce: 8e 0f add r24, r30 3b3d0: 9f 1f adc r25, r31 3b3d2: 08 95 ret 0003b3d4 : 3b3d4: fb 01 movw r30, r22 3b3d6: dc 01 movw r26, r24 3b3d8: 41 50 subi r20, 0x01 ; 1 3b3da: 50 40 sbci r21, 0x00 ; 0 3b3dc: 88 f0 brcs .+34 ; 0x3b400 3b3de: 8d 91 ld r24, X+ 3b3e0: 81 34 cpi r24, 0x41 ; 65 3b3e2: 1c f0 brlt .+6 ; 0x3b3ea 3b3e4: 8b 35 cpi r24, 0x5B ; 91 3b3e6: 0c f4 brge .+2 ; 0x3b3ea 3b3e8: 80 5e subi r24, 0xE0 ; 224 3b3ea: 65 91 lpm r22, Z+ 3b3ec: 61 34 cpi r22, 0x41 ; 65 3b3ee: 1c f0 brlt .+6 ; 0x3b3f6 3b3f0: 6b 35 cpi r22, 0x5B ; 91 3b3f2: 0c f4 brge .+2 ; 0x3b3f6 3b3f4: 60 5e subi r22, 0xE0 ; 224 3b3f6: 86 1b sub r24, r22 3b3f8: 61 11 cpse r22, r1 3b3fa: 71 f3 breq .-36 ; 0x3b3d8 3b3fc: 99 0b sbc r25, r25 3b3fe: 08 95 ret 3b400: 88 1b sub r24, r24 3b402: fc cf rjmp .-8 ; 0x3b3fc 0003b404 : 3b404: fb 01 movw r30, r22 3b406: dc 01 movw r26, r24 3b408: 41 50 subi r20, 0x01 ; 1 3b40a: 50 40 sbci r21, 0x00 ; 0 3b40c: 30 f0 brcs .+12 ; 0x3b41a 3b40e: 8d 91 ld r24, X+ 3b410: 05 90 lpm r0, Z+ 3b412: 80 19 sub r24, r0 3b414: 19 f4 brne .+6 ; 0x3b41c 3b416: 00 20 and r0, r0 3b418: b9 f7 brne .-18 ; 0x3b408 3b41a: 88 1b sub r24, r24 3b41c: 99 0b sbc r25, r25 3b41e: 08 95 ret 0003b420 : 3b420: fb 01 movw r30, r22 3b422: dc 01 movw r26, r24 3b424: 41 50 subi r20, 0x01 ; 1 3b426: 50 40 sbci r21, 0x00 ; 0 3b428: 48 f0 brcs .+18 ; 0x3b43c 3b42a: 05 90 lpm r0, Z+ 3b42c: 0d 92 st X+, r0 3b42e: 00 20 and r0, r0 3b430: c9 f7 brne .-14 ; 0x3b424 3b432: 01 c0 rjmp .+2 ; 0x3b436 3b434: 1d 92 st X+, r1 3b436: 41 50 subi r20, 0x01 ; 1 3b438: 50 40 sbci r21, 0x00 ; 0 3b43a: e0 f7 brcc .-8 ; 0x3b434 3b43c: 08 95 ret 0003b43e : 3b43e: fc 01 movw r30, r24 3b440: 05 90 lpm r0, Z+ 3b442: 61 50 subi r22, 0x01 ; 1 3b444: 70 40 sbci r23, 0x00 ; 0 3b446: 01 10 cpse r0, r1 3b448: d8 f7 brcc .-10 ; 0x3b440 3b44a: 80 95 com r24 3b44c: 90 95 com r25 3b44e: 8e 0f add r24, r30 3b450: 9f 1f adc r25, r31 3b452: 08 95 ret 0003b454 : 3b454: fb 01 movw r30, r22 3b456: 55 91 lpm r21, Z+ 3b458: 55 23 and r21, r21 3b45a: a9 f0 breq .+42 ; 0x3b486 3b45c: bf 01 movw r22, r30 3b45e: dc 01 movw r26, r24 3b460: 4d 91 ld r20, X+ 3b462: 45 17 cp r20, r21 3b464: 41 11 cpse r20, r1 3b466: e1 f7 brne .-8 ; 0x3b460 3b468: 59 f4 brne .+22 ; 0x3b480 3b46a: cd 01 movw r24, r26 3b46c: 05 90 lpm r0, Z+ 3b46e: 00 20 and r0, r0 3b470: 49 f0 breq .+18 ; 0x3b484 3b472: 4d 91 ld r20, X+ 3b474: 40 15 cp r20, r0 3b476: 41 11 cpse r20, r1 3b478: c9 f3 breq .-14 ; 0x3b46c 3b47a: fb 01 movw r30, r22 3b47c: 41 11 cpse r20, r1 3b47e: ef cf rjmp .-34 ; 0x3b45e 3b480: 81 e0 ldi r24, 0x01 ; 1 3b482: 90 e0 ldi r25, 0x00 ; 0 3b484: 01 97 sbiw r24, 0x01 ; 1 3b486: 08 95 ret 0003b488 : 3b488: fc 01 movw r30, r24 3b48a: 61 50 subi r22, 0x01 ; 1 3b48c: 70 40 sbci r23, 0x00 ; 0 3b48e: 01 90 ld r0, Z+ 3b490: 01 10 cpse r0, r1 3b492: d8 f7 brcc .-10 ; 0x3b48a 3b494: 80 95 com r24 3b496: 90 95 com r25 3b498: 8e 0f add r24, r30 3b49a: 9f 1f adc r25, r31 3b49c: 08 95 ret 0003b49e : 3b49e: cf 93 push r28 3b4a0: df 93 push r29 3b4a2: ec 01 movw r28, r24 3b4a4: 2b 81 ldd r18, Y+3 ; 0x03 3b4a6: 20 ff sbrs r18, 0 3b4a8: 1a c0 rjmp .+52 ; 0x3b4de 3b4aa: 26 ff sbrs r18, 6 3b4ac: 0c c0 rjmp .+24 ; 0x3b4c6 3b4ae: 2f 7b andi r18, 0xBF ; 191 3b4b0: 2b 83 std Y+3, r18 ; 0x03 3b4b2: 8e 81 ldd r24, Y+6 ; 0x06 3b4b4: 9f 81 ldd r25, Y+7 ; 0x07 3b4b6: 01 96 adiw r24, 0x01 ; 1 3b4b8: 9f 83 std Y+7, r25 ; 0x07 3b4ba: 8e 83 std Y+6, r24 ; 0x06 3b4bc: 8a 81 ldd r24, Y+2 ; 0x02 3b4be: 90 e0 ldi r25, 0x00 ; 0 3b4c0: df 91 pop r29 3b4c2: cf 91 pop r28 3b4c4: 08 95 ret 3b4c6: 22 ff sbrs r18, 2 3b4c8: 18 c0 rjmp .+48 ; 0x3b4fa 3b4ca: e8 81 ld r30, Y 3b4cc: f9 81 ldd r31, Y+1 ; 0x01 3b4ce: 80 81 ld r24, Z 3b4d0: 08 2e mov r0, r24 3b4d2: 00 0c add r0, r0 3b4d4: 99 0b sbc r25, r25 3b4d6: 00 97 sbiw r24, 0x00 ; 0 3b4d8: 29 f4 brne .+10 ; 0x3b4e4 3b4da: 20 62 ori r18, 0x20 ; 32 3b4dc: 2b 83 std Y+3, r18 ; 0x03 3b4de: 8f ef ldi r24, 0xFF ; 255 3b4e0: 9f ef ldi r25, 0xFF ; 255 3b4e2: ee cf rjmp .-36 ; 0x3b4c0 3b4e4: 31 96 adiw r30, 0x01 ; 1 3b4e6: f9 83 std Y+1, r31 ; 0x01 3b4e8: e8 83 st Y, r30 3b4ea: 2e 81 ldd r18, Y+6 ; 0x06 3b4ec: 3f 81 ldd r19, Y+7 ; 0x07 3b4ee: 2f 5f subi r18, 0xFF ; 255 3b4f0: 3f 4f sbci r19, 0xFF ; 255 3b4f2: 3f 83 std Y+7, r19 ; 0x07 3b4f4: 2e 83 std Y+6, r18 ; 0x06 3b4f6: 99 27 eor r25, r25 3b4f8: e3 cf rjmp .-58 ; 0x3b4c0 3b4fa: ea 85 ldd r30, Y+10 ; 0x0a 3b4fc: fb 85 ldd r31, Y+11 ; 0x0b 3b4fe: 19 95 eicall 3b500: 97 ff sbrs r25, 7 3b502: f3 cf rjmp .-26 ; 0x3b4ea 3b504: 2b 81 ldd r18, Y+3 ; 0x03 3b506: 01 96 adiw r24, 0x01 ; 1 3b508: 21 f0 breq .+8 ; 0x3b512 3b50a: 80 e2 ldi r24, 0x20 ; 32 3b50c: 82 2b or r24, r18 3b50e: 8b 83 std Y+3, r24 ; 0x03 3b510: e6 cf rjmp .-52 ; 0x3b4de 3b512: 80 e1 ldi r24, 0x10 ; 16 3b514: fb cf rjmp .-10 ; 0x3b50c 0003b516 : 3b516: 0f 93 push r16 3b518: 1f 93 push r17 3b51a: cf 93 push r28 3b51c: df 93 push r29 3b51e: 18 2f mov r17, r24 3b520: 09 2f mov r16, r25 3b522: eb 01 movw r28, r22 3b524: 8b 81 ldd r24, Y+3 ; 0x03 3b526: 81 fd sbrc r24, 1 3b528: 09 c0 rjmp .+18 ; 0x3b53c 3b52a: 1f ef ldi r17, 0xFF ; 255 3b52c: 0f ef ldi r16, 0xFF ; 255 3b52e: 81 2f mov r24, r17 3b530: 90 2f mov r25, r16 3b532: df 91 pop r29 3b534: cf 91 pop r28 3b536: 1f 91 pop r17 3b538: 0f 91 pop r16 3b53a: 08 95 ret 3b53c: 82 ff sbrs r24, 2 3b53e: 14 c0 rjmp .+40 ; 0x3b568 3b540: 2e 81 ldd r18, Y+6 ; 0x06 3b542: 3f 81 ldd r19, Y+7 ; 0x07 3b544: 8c 81 ldd r24, Y+4 ; 0x04 3b546: 9d 81 ldd r25, Y+5 ; 0x05 3b548: 28 17 cp r18, r24 3b54a: 39 07 cpc r19, r25 3b54c: 3c f4 brge .+14 ; 0x3b55c 3b54e: e8 81 ld r30, Y 3b550: f9 81 ldd r31, Y+1 ; 0x01 3b552: cf 01 movw r24, r30 3b554: 01 96 adiw r24, 0x01 ; 1 3b556: 99 83 std Y+1, r25 ; 0x01 3b558: 88 83 st Y, r24 3b55a: 10 83 st Z, r17 3b55c: 8e 81 ldd r24, Y+6 ; 0x06 3b55e: 9f 81 ldd r25, Y+7 ; 0x07 3b560: 01 96 adiw r24, 0x01 ; 1 3b562: 9f 83 std Y+7, r25 ; 0x07 3b564: 8e 83 std Y+6, r24 ; 0x06 3b566: e3 cf rjmp .-58 ; 0x3b52e 3b568: e8 85 ldd r30, Y+8 ; 0x08 3b56a: f9 85 ldd r31, Y+9 ; 0x09 3b56c: 81 2f mov r24, r17 3b56e: 19 95 eicall 3b570: 89 2b or r24, r25 3b572: a1 f3 breq .-24 ; 0x3b55c 3b574: da cf rjmp .-76 ; 0x3b52a 0003b576 : 3b576: ef 92 push r14 3b578: ff 92 push r15 3b57a: 0f 93 push r16 3b57c: 1f 93 push r17 3b57e: cf 93 push r28 3b580: df 93 push r29 3b582: 8c 01 movw r16, r24 3b584: 7b 01 movw r14, r22 3b586: db 01 movw r26, r22 3b588: 13 96 adiw r26, 0x03 ; 3 3b58a: 8c 91 ld r24, X 3b58c: d0 e0 ldi r29, 0x00 ; 0 3b58e: c0 e0 ldi r28, 0x00 ; 0 3b590: 81 fd sbrc r24, 1 3b592: 0f c0 rjmp .+30 ; 0x3b5b2 3b594: cf ef ldi r28, 0xFF ; 255 3b596: df ef ldi r29, 0xFF ; 255 3b598: 10 c0 rjmp .+32 ; 0x3b5ba 3b59a: d7 01 movw r26, r14 3b59c: 18 96 adiw r26, 0x08 ; 8 3b59e: ed 91 ld r30, X+ 3b5a0: fc 91 ld r31, X 3b5a2: b7 01 movw r22, r14 3b5a4: 19 95 eicall 3b5a6: 89 2b or r24, r25 3b5a8: 11 f0 breq .+4 ; 0x3b5ae 3b5aa: cf ef ldi r28, 0xFF ; 255 3b5ac: df ef ldi r29, 0xFF ; 255 3b5ae: 0f 5f subi r16, 0xFF ; 255 3b5b0: 1f 4f sbci r17, 0xFF ; 255 3b5b2: f8 01 movw r30, r16 3b5b4: 84 91 lpm r24, Z 3b5b6: 81 11 cpse r24, r1 3b5b8: f0 cf rjmp .-32 ; 0x3b59a 3b5ba: ce 01 movw r24, r28 3b5bc: df 91 pop r29 3b5be: cf 91 pop r28 3b5c0: 1f 91 pop r17 3b5c2: 0f 91 pop r16 3b5c4: ff 90 pop r15 3b5c6: ef 90 pop r14 3b5c8: 08 95 ret 0003b5ca : 3b5ca: 0f 93 push r16 3b5cc: 1f 93 push r17 3b5ce: cf 93 push r28 3b5d0: df 93 push r29 3b5d2: cd b7 in r28, 0x3d ; 61 3b5d4: de b7 in r29, 0x3e ; 62 3b5d6: ae 01 movw r20, r28 3b5d8: 48 5f subi r20, 0xF8 ; 248 3b5da: 5f 4f sbci r21, 0xFF ; 255 3b5dc: da 01 movw r26, r20 3b5de: 6d 91 ld r22, X+ 3b5e0: 7d 91 ld r23, X+ 3b5e2: ad 01 movw r20, r26 3b5e4: 0a e1 ldi r16, 0x1A ; 26 3b5e6: 18 e1 ldi r17, 0x18 ; 24 3b5e8: f8 01 movw r30, r16 3b5ea: 82 81 ldd r24, Z+2 ; 0x02 3b5ec: 93 81 ldd r25, Z+3 ; 0x03 3b5ee: dc 01 movw r26, r24 3b5f0: 13 96 adiw r26, 0x03 ; 3 3b5f2: 2c 91 ld r18, X 3b5f4: 13 97 sbiw r26, 0x03 ; 3 3b5f6: 28 60 ori r18, 0x08 ; 8 3b5f8: 13 96 adiw r26, 0x03 ; 3 3b5fa: 2c 93 st X, r18 3b5fc: 0e 94 f0 56 call 0xade0 ; 0xade0 3b600: d8 01 movw r26, r16 3b602: 12 96 adiw r26, 0x02 ; 2 3b604: ed 91 ld r30, X+ 3b606: fc 91 ld r31, X 3b608: 23 81 ldd r18, Z+3 ; 0x03 3b60a: 27 7f andi r18, 0xF7 ; 247 3b60c: 23 83 std Z+3, r18 ; 0x03 3b60e: df 91 pop r29 3b610: cf 91 pop r28 3b612: 1f 91 pop r17 3b614: 0f 91 pop r16 3b616: 08 95 ret 0003b618 : 3b618: 0f 93 push r16 3b61a: 1f 93 push r17 3b61c: cf 93 push r28 3b61e: df 93 push r29 3b620: 8c 01 movw r16, r24 3b622: e0 91 1c 18 lds r30, 0x181C ; 0x80181c <__iob+0x2> 3b626: f0 91 1d 18 lds r31, 0x181D ; 0x80181d <__iob+0x3> 3b62a: 83 81 ldd r24, Z+3 ; 0x03 3b62c: d0 e0 ldi r29, 0x00 ; 0 3b62e: c0 e0 ldi r28, 0x00 ; 0 3b630: 81 fd sbrc r24, 1 3b632: 0a c0 rjmp .+20 ; 0x3b648 3b634: cf ef ldi r28, 0xFF ; 255 3b636: df ef ldi r29, 0xFF ; 255 3b638: 17 c0 rjmp .+46 ; 0x3b668 3b63a: 19 95 eicall 3b63c: 89 2b or r24, r25 3b63e: 11 f0 breq .+4 ; 0x3b644 3b640: cf ef ldi r28, 0xFF ; 255 3b642: df ef ldi r29, 0xFF ; 255 3b644: 0f 5f subi r16, 0xFF ; 255 3b646: 1f 4f sbci r17, 0xFF ; 255 3b648: f8 01 movw r30, r16 3b64a: 84 91 lpm r24, Z 3b64c: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 3b650: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 3b654: db 01 movw r26, r22 3b656: 18 96 adiw r26, 0x08 ; 8 3b658: ed 91 ld r30, X+ 3b65a: fc 91 ld r31, X 3b65c: 81 11 cpse r24, r1 3b65e: ed cf rjmp .-38 ; 0x3b63a 3b660: 8a e0 ldi r24, 0x0A ; 10 3b662: 19 95 eicall 3b664: 89 2b or r24, r25 3b666: 31 f7 brne .-52 ; 0x3b634 3b668: ce 01 movw r24, r28 3b66a: df 91 pop r29 3b66c: cf 91 pop r28 3b66e: 1f 91 pop r17 3b670: 0f 91 pop r16 3b672: 08 95 ret 0003b674 : 3b674: 0f 93 push r16 3b676: 1f 93 push r17 3b678: cf 93 push r28 3b67a: df 93 push r29 3b67c: cd b7 in r28, 0x3d ; 61 3b67e: de b7 in r29, 0x3e ; 62 3b680: 2e 97 sbiw r28, 0x0e ; 14 3b682: 0f b6 in r0, 0x3f ; 63 3b684: f8 94 cli 3b686: de bf out 0x3e, r29 ; 62 3b688: 0f be out 0x3f, r0 ; 63 3b68a: cd bf out 0x3d, r28 ; 61 3b68c: 0e 89 ldd r16, Y+22 ; 0x16 3b68e: 1f 89 ldd r17, Y+23 ; 0x17 3b690: 8e e0 ldi r24, 0x0E ; 14 3b692: 8c 83 std Y+4, r24 ; 0x04 3b694: 1a 83 std Y+2, r17 ; 0x02 3b696: 09 83 std Y+1, r16 ; 0x01 3b698: 8f ef ldi r24, 0xFF ; 255 3b69a: 9f e7 ldi r25, 0x7F ; 127 3b69c: 9e 83 std Y+6, r25 ; 0x06 3b69e: 8d 83 std Y+5, r24 ; 0x05 3b6a0: ae 01 movw r20, r28 3b6a2: 46 5e subi r20, 0xE6 ; 230 3b6a4: 5f 4f sbci r21, 0xFF ; 255 3b6a6: 68 8d ldd r22, Y+24 ; 0x18 3b6a8: 79 8d ldd r23, Y+25 ; 0x19 3b6aa: ce 01 movw r24, r28 3b6ac: 01 96 adiw r24, 0x01 ; 1 3b6ae: 0e 94 f0 56 call 0xade0 ; 0xade0 3b6b2: 2f 81 ldd r18, Y+7 ; 0x07 3b6b4: 38 85 ldd r19, Y+8 ; 0x08 3b6b6: 02 0f add r16, r18 3b6b8: 13 1f adc r17, r19 3b6ba: f8 01 movw r30, r16 3b6bc: 10 82 st Z, r1 3b6be: 2e 96 adiw r28, 0x0e ; 14 3b6c0: 0f b6 in r0, 0x3f ; 63 3b6c2: f8 94 cli 3b6c4: de bf out 0x3e, r29 ; 62 3b6c6: 0f be out 0x3f, r0 ; 63 3b6c8: cd bf out 0x3d, r28 ; 61 3b6ca: df 91 pop r29 3b6cc: cf 91 pop r28 3b6ce: 1f 91 pop r17 3b6d0: 0f 91 pop r16 3b6d2: 08 95 ret 0003b6d4 : 3b6d4: cf 93 push r28 3b6d6: df 93 push r29 3b6d8: ec 01 movw r28, r24 3b6da: 8b 81 ldd r24, Y+3 ; 0x03 3b6dc: 88 60 ori r24, 0x08 ; 8 3b6de: 8b 83 std Y+3, r24 ; 0x03 3b6e0: ce 01 movw r24, r28 3b6e2: 0e 94 f0 56 call 0xade0 ; 0xade0 3b6e6: 2b 81 ldd r18, Y+3 ; 0x03 3b6e8: 27 7f andi r18, 0xF7 ; 247 3b6ea: 2b 83 std Y+3, r18 ; 0x03 3b6ec: df 91 pop r29 3b6ee: cf 91 pop r28 3b6f0: 08 95 ret 0003b6f2 : 3b6f2: 0f 93 push r16 3b6f4: 1f 93 push r17 3b6f6: cf 93 push r28 3b6f8: df 93 push r29 3b6fa: cd b7 in r28, 0x3d ; 61 3b6fc: de b7 in r29, 0x3e ; 62 3b6fe: 2e 97 sbiw r28, 0x0e ; 14 3b700: 0f b6 in r0, 0x3f ; 63 3b702: f8 94 cli 3b704: de bf out 0x3e, r29 ; 62 3b706: 0f be out 0x3f, r0 ; 63 3b708: cd bf out 0x3d, r28 ; 61 3b70a: 8c 01 movw r16, r24 3b70c: fa 01 movw r30, r20 3b70e: 8e e0 ldi r24, 0x0E ; 14 3b710: 8c 83 std Y+4, r24 ; 0x04 3b712: 1a 83 std Y+2, r17 ; 0x02 3b714: 09 83 std Y+1, r16 ; 0x01 3b716: 77 ff sbrs r23, 7 3b718: 02 c0 rjmp .+4 ; 0x3b71e 3b71a: 60 e0 ldi r22, 0x00 ; 0 3b71c: 70 e8 ldi r23, 0x80 ; 128 3b71e: 61 50 subi r22, 0x01 ; 1 3b720: 71 09 sbc r23, r1 3b722: 7e 83 std Y+6, r23 ; 0x06 3b724: 6d 83 std Y+5, r22 ; 0x05 3b726: a9 01 movw r20, r18 3b728: bf 01 movw r22, r30 3b72a: ce 01 movw r24, r28 3b72c: 01 96 adiw r24, 0x01 ; 1 3b72e: 0e 94 f0 56 call 0xade0 ; 0xade0 3b732: 4d 81 ldd r20, Y+5 ; 0x05 3b734: 5e 81 ldd r21, Y+6 ; 0x06 3b736: 57 fd sbrc r21, 7 3b738: 0a c0 rjmp .+20 ; 0x3b74e 3b73a: 2f 81 ldd r18, Y+7 ; 0x07 3b73c: 38 85 ldd r19, Y+8 ; 0x08 3b73e: 42 17 cp r20, r18 3b740: 53 07 cpc r21, r19 3b742: 0c f4 brge .+2 ; 0x3b746 3b744: 9a 01 movw r18, r20 3b746: 02 0f add r16, r18 3b748: 13 1f adc r17, r19 3b74a: f8 01 movw r30, r16 3b74c: 10 82 st Z, r1 3b74e: 2e 96 adiw r28, 0x0e ; 14 3b750: 0f b6 in r0, 0x3f ; 63 3b752: f8 94 cli 3b754: de bf out 0x3e, r29 ; 62 3b756: 0f be out 0x3f, r0 ; 63 3b758: cd bf out 0x3d, r28 ; 61 3b75a: df 91 pop r29 3b75c: cf 91 pop r28 3b75e: 1f 91 pop r17 3b760: 0f 91 pop r16 3b762: 08 95 ret 0003b764 <__ultoa_invert>: 3b764: fa 01 movw r30, r20 3b766: aa 27 eor r26, r26 3b768: 28 30 cpi r18, 0x08 ; 8 3b76a: 51 f1 breq .+84 ; 0x3b7c0 <__ultoa_invert+0x5c> 3b76c: 20 31 cpi r18, 0x10 ; 16 3b76e: 81 f1 breq .+96 ; 0x3b7d0 <__ultoa_invert+0x6c> 3b770: e8 94 clt 3b772: 6f 93 push r22 3b774: 6e 7f andi r22, 0xFE ; 254 3b776: 6e 5f subi r22, 0xFE ; 254 3b778: 7f 4f sbci r23, 0xFF ; 255 3b77a: 8f 4f sbci r24, 0xFF ; 255 3b77c: 9f 4f sbci r25, 0xFF ; 255 3b77e: af 4f sbci r26, 0xFF ; 255 3b780: b1 e0 ldi r27, 0x01 ; 1 3b782: 3e d0 rcall .+124 ; 0x3b800 <__ultoa_invert+0x9c> 3b784: b4 e0 ldi r27, 0x04 ; 4 3b786: 3c d0 rcall .+120 ; 0x3b800 <__ultoa_invert+0x9c> 3b788: 67 0f add r22, r23 3b78a: 78 1f adc r23, r24 3b78c: 89 1f adc r24, r25 3b78e: 9a 1f adc r25, r26 3b790: a1 1d adc r26, r1 3b792: 68 0f add r22, r24 3b794: 79 1f adc r23, r25 3b796: 8a 1f adc r24, r26 3b798: 91 1d adc r25, r1 3b79a: a1 1d adc r26, r1 3b79c: 6a 0f add r22, r26 3b79e: 71 1d adc r23, r1 3b7a0: 81 1d adc r24, r1 3b7a2: 91 1d adc r25, r1 3b7a4: a1 1d adc r26, r1 3b7a6: 20 d0 rcall .+64 ; 0x3b7e8 <__ultoa_invert+0x84> 3b7a8: 09 f4 brne .+2 ; 0x3b7ac <__ultoa_invert+0x48> 3b7aa: 68 94 set 3b7ac: 3f 91 pop r19 3b7ae: 2a e0 ldi r18, 0x0A ; 10 3b7b0: 26 9f mul r18, r22 3b7b2: 11 24 eor r1, r1 3b7b4: 30 19 sub r19, r0 3b7b6: 30 5d subi r19, 0xD0 ; 208 3b7b8: 31 93 st Z+, r19 3b7ba: de f6 brtc .-74 ; 0x3b772 <__ultoa_invert+0xe> 3b7bc: cf 01 movw r24, r30 3b7be: 08 95 ret 3b7c0: 46 2f mov r20, r22 3b7c2: 47 70 andi r20, 0x07 ; 7 3b7c4: 40 5d subi r20, 0xD0 ; 208 3b7c6: 41 93 st Z+, r20 3b7c8: b3 e0 ldi r27, 0x03 ; 3 3b7ca: 0f d0 rcall .+30 ; 0x3b7ea <__ultoa_invert+0x86> 3b7cc: c9 f7 brne .-14 ; 0x3b7c0 <__ultoa_invert+0x5c> 3b7ce: f6 cf rjmp .-20 ; 0x3b7bc <__ultoa_invert+0x58> 3b7d0: 46 2f mov r20, r22 3b7d2: 4f 70 andi r20, 0x0F ; 15 3b7d4: 40 5d subi r20, 0xD0 ; 208 3b7d6: 4a 33 cpi r20, 0x3A ; 58 3b7d8: 18 f0 brcs .+6 ; 0x3b7e0 <__ultoa_invert+0x7c> 3b7da: 49 5d subi r20, 0xD9 ; 217 3b7dc: 31 fd sbrc r19, 1 3b7de: 40 52 subi r20, 0x20 ; 32 3b7e0: 41 93 st Z+, r20 3b7e2: 02 d0 rcall .+4 ; 0x3b7e8 <__ultoa_invert+0x84> 3b7e4: a9 f7 brne .-22 ; 0x3b7d0 <__ultoa_invert+0x6c> 3b7e6: ea cf rjmp .-44 ; 0x3b7bc <__ultoa_invert+0x58> 3b7e8: b4 e0 ldi r27, 0x04 ; 4 3b7ea: a6 95 lsr r26 3b7ec: 97 95 ror r25 3b7ee: 87 95 ror r24 3b7f0: 77 95 ror r23 3b7f2: 67 95 ror r22 3b7f4: ba 95 dec r27 3b7f6: c9 f7 brne .-14 ; 0x3b7ea <__ultoa_invert+0x86> 3b7f8: 00 97 sbiw r24, 0x00 ; 0 3b7fa: 61 05 cpc r22, r1 3b7fc: 71 05 cpc r23, r1 3b7fe: 08 95 ret 3b800: 9b 01 movw r18, r22 3b802: ac 01 movw r20, r24 3b804: 0a 2e mov r0, r26 3b806: 06 94 lsr r0 3b808: 57 95 ror r21 3b80a: 47 95 ror r20 3b80c: 37 95 ror r19 3b80e: 27 95 ror r18 3b810: ba 95 dec r27 3b812: c9 f7 brne .-14 ; 0x3b806 <__ultoa_invert+0xa2> 3b814: 62 0f add r22, r18 3b816: 73 1f adc r23, r19 3b818: 84 1f adc r24, r20 3b81a: 95 1f adc r25, r21 3b81c: a0 1d adc r26, r0 3b81e: 08 95 ret 0003b820 <__ctype_isfalse>: 3b820: 99 27 eor r25, r25 3b822: 88 27 eor r24, r24 0003b824 <__ctype_istrue>: 3b824: 08 95 ret 0003b826 : 3b826: dc 01 movw r26, r24 3b828: cb 01 movw r24, r22 0003b82a : 3b82a: fc 01 movw r30, r24 3b82c: f9 99 sbic 0x1f, 1 ; 31 3b82e: fe cf rjmp .-4 ; 0x3b82c 3b830: 06 c0 rjmp .+12 ; 0x3b83e 3b832: f2 bd out 0x22, r31 ; 34 3b834: e1 bd out 0x21, r30 ; 33 3b836: f8 9a sbi 0x1f, 0 ; 31 3b838: 31 96 adiw r30, 0x01 ; 1 3b83a: 00 b4 in r0, 0x20 ; 32 3b83c: 0d 92 st X+, r0 3b83e: 41 50 subi r20, 0x01 ; 1 3b840: 50 40 sbci r21, 0x00 ; 0 3b842: b8 f7 brcc .-18 ; 0x3b832 3b844: 08 95 ret 0003b846 : 3b846: f9 99 sbic 0x1f, 1 ; 31 3b848: fe cf rjmp .-4 ; 0x3b846 3b84a: 92 bd out 0x22, r25 ; 34 3b84c: 81 bd out 0x21, r24 ; 33 3b84e: f8 9a sbi 0x1f, 0 ; 31 3b850: 99 27 eor r25, r25 3b852: 80 b5 in r24, 0x20 ; 32 3b854: 08 95 ret 0003b856 : 3b856: a6 e1 ldi r26, 0x16 ; 22 3b858: b0 e0 ldi r27, 0x00 ; 0 3b85a: 44 e0 ldi r20, 0x04 ; 4 3b85c: 50 e0 ldi r21, 0x00 ; 0 3b85e: 0d 94 15 dc jmp 0x3b82a ; 0x3b82a 0003b862 : 3b862: a8 e1 ldi r26, 0x18 ; 24 3b864: b0 e0 ldi r27, 0x00 ; 0 3b866: 42 e0 ldi r20, 0x02 ; 2 3b868: 50 e0 ldi r21, 0x00 ; 0 3b86a: 0d 94 15 dc jmp 0x3b82a ; 0x3b82a 0003b86e : 3b86e: dc 01 movw r26, r24 3b870: a4 0f add r26, r20 3b872: b5 1f adc r27, r21 3b874: 41 50 subi r20, 0x01 ; 1 3b876: 50 40 sbci r21, 0x00 ; 0 3b878: 48 f0 brcs .+18 ; 0x3b88c 3b87a: cb 01 movw r24, r22 3b87c: 84 0f add r24, r20 3b87e: 95 1f adc r25, r21 3b880: 2e 91 ld r18, -X 3b882: 0f 94 48 dc call 0x3b890 ; 0x3b890 3b886: 41 50 subi r20, 0x01 ; 1 3b888: 50 40 sbci r21, 0x00 ; 0 3b88a: d0 f7 brcc .-12 ; 0x3b880 3b88c: 08 95 ret 0003b88e : 3b88e: 26 2f mov r18, r22 0003b890 : 3b890: f9 99 sbic 0x1f, 1 ; 31 3b892: fe cf rjmp .-4 ; 0x3b890 3b894: 92 bd out 0x22, r25 ; 34 3b896: 81 bd out 0x21, r24 ; 33 3b898: f8 9a sbi 0x1f, 0 ; 31 3b89a: 01 97 sbiw r24, 0x01 ; 1 3b89c: 00 b4 in r0, 0x20 ; 32 3b89e: 02 16 cp r0, r18 3b8a0: 39 f0 breq .+14 ; 0x3b8b0 3b8a2: 1f ba out 0x1f, r1 ; 31 3b8a4: 20 bd out 0x20, r18 ; 32 3b8a6: 0f b6 in r0, 0x3f ; 63 3b8a8: f8 94 cli 3b8aa: fa 9a sbi 0x1f, 2 ; 31 3b8ac: f9 9a sbi 0x1f, 1 ; 31 3b8ae: 0f be out 0x3f, r0 ; 63 3b8b0: 08 95 ret 0003b8b2 : 3b8b2: 03 96 adiw r24, 0x03 ; 3 3b8b4: 27 2f mov r18, r23 3b8b6: 0f 94 48 dc call 0x3b890 ; 0x3b890 3b8ba: 0f 94 47 dc call 0x3b88e ; 0x3b88e 3b8be: 25 2f mov r18, r21 3b8c0: 0f 94 48 dc call 0x3b890 ; 0x3b890 3b8c4: 24 2f mov r18, r20 3b8c6: 0d 94 48 dc jmp 0x3b890 ; 0x3b890 0003b8ca : 3b8ca: 01 96 adiw r24, 0x01 ; 1 3b8cc: 27 2f mov r18, r23 3b8ce: 0f 94 48 dc call 0x3b890 ; 0x3b890 3b8d2: 0d 94 47 dc jmp 0x3b88e ; 0x3b88e 0003b8d6 : 3b8d6: 26 2f mov r18, r22 0003b8d8 : 3b8d8: f9 99 sbic 0x1f, 1 ; 31 3b8da: fe cf rjmp .-4 ; 0x3b8d8 3b8dc: 1f ba out 0x1f, r1 ; 31 3b8de: 92 bd out 0x22, r25 ; 34 3b8e0: 81 bd out 0x21, r24 ; 33 3b8e2: 20 bd out 0x20, r18 ; 32 3b8e4: 0f b6 in r0, 0x3f ; 63 3b8e6: f8 94 cli 3b8e8: fa 9a sbi 0x1f, 2 ; 31 3b8ea: f9 9a sbi 0x1f, 1 ; 31 3b8ec: 0f be out 0x3f, r0 ; 63 3b8ee: 01 96 adiw r24, 0x01 ; 1 3b8f0: 08 95 ret 0003b8f2 : 3b8f2: 24 2f mov r18, r20 3b8f4: 0f 94 6c dc call 0x3b8d8 ; 0x3b8d8 3b8f8: 25 2f mov r18, r21 3b8fa: 0f 94 6c dc call 0x3b8d8 ; 0x3b8d8 3b8fe: 0d 94 81 dc jmp 0x3b902 ; 0x3b902 0003b902 : 3b902: 0f 94 6b dc call 0x3b8d6 ; 0x3b8d6 3b906: 27 2f mov r18, r23 3b908: 0d 94 6c dc jmp 0x3b8d8 ; 0x3b8d8 0003b90c <__mulsi3>: 3b90c: db 01 movw r26, r22 3b90e: 8f 93 push r24 3b910: 9f 93 push r25 3b912: 0f 94 b8 dc call 0x3b970 ; 0x3b970 <__muluhisi3> 3b916: bf 91 pop r27 3b918: af 91 pop r26 3b91a: a2 9f mul r26, r18 3b91c: 80 0d add r24, r0 3b91e: 91 1d adc r25, r1 3b920: a3 9f mul r26, r19 3b922: 90 0d add r25, r0 3b924: b2 9f mul r27, r18 3b926: 90 0d add r25, r0 3b928: 11 24 eor r1, r1 3b92a: 08 95 ret 0003b92c <__udivmodsi4>: 3b92c: a1 e2 ldi r26, 0x21 ; 33 3b92e: 1a 2e mov r1, r26 3b930: aa 1b sub r26, r26 3b932: bb 1b sub r27, r27 3b934: fd 01 movw r30, r26 3b936: 0d c0 rjmp .+26 ; 0x3b952 <__udivmodsi4_ep> 0003b938 <__udivmodsi4_loop>: 3b938: aa 1f adc r26, r26 3b93a: bb 1f adc r27, r27 3b93c: ee 1f adc r30, r30 3b93e: ff 1f adc r31, r31 3b940: a2 17 cp r26, r18 3b942: b3 07 cpc r27, r19 3b944: e4 07 cpc r30, r20 3b946: f5 07 cpc r31, r21 3b948: 20 f0 brcs .+8 ; 0x3b952 <__udivmodsi4_ep> 3b94a: a2 1b sub r26, r18 3b94c: b3 0b sbc r27, r19 3b94e: e4 0b sbc r30, r20 3b950: f5 0b sbc r31, r21 0003b952 <__udivmodsi4_ep>: 3b952: 66 1f adc r22, r22 3b954: 77 1f adc r23, r23 3b956: 88 1f adc r24, r24 3b958: 99 1f adc r25, r25 3b95a: 1a 94 dec r1 3b95c: 69 f7 brne .-38 ; 0x3b938 <__udivmodsi4_loop> 3b95e: 60 95 com r22 3b960: 70 95 com r23 3b962: 80 95 com r24 3b964: 90 95 com r25 3b966: 9b 01 movw r18, r22 3b968: ac 01 movw r20, r24 3b96a: bd 01 movw r22, r26 3b96c: cf 01 movw r24, r30 3b96e: 08 95 ret 0003b970 <__muluhisi3>: 3b970: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 3b974: a5 9f mul r26, r21 3b976: 90 0d add r25, r0 3b978: b4 9f mul r27, r20 3b97a: 90 0d add r25, r0 3b97c: a4 9f mul r26, r20 3b97e: 80 0d add r24, r0 3b980: 91 1d adc r25, r1 3b982: 11 24 eor r1, r1 3b984: 08 95 ret 0003b986 <__umulhisi3>: 3b986: a2 9f mul r26, r18 3b988: b0 01 movw r22, r0 3b98a: b3 9f mul r27, r19 3b98c: c0 01 movw r24, r0 3b98e: a3 9f mul r26, r19 3b990: 70 0d add r23, r0 3b992: 81 1d adc r24, r1 3b994: 11 24 eor r1, r1 3b996: 91 1d adc r25, r1 3b998: b2 9f mul r27, r18 3b99a: 70 0d add r23, r0 3b99c: 81 1d adc r24, r1 3b99e: 11 24 eor r1, r1 3b9a0: 91 1d adc r25, r1 3b9a2: 08 95 ret 0003b9a4 <__udivmodqi4>: 3b9a4: 99 1b sub r25, r25 3b9a6: 79 e0 ldi r23, 0x09 ; 9 3b9a8: 04 c0 rjmp .+8 ; 0x3b9b2 <__udivmodqi4_ep> 0003b9aa <__udivmodqi4_loop>: 3b9aa: 99 1f adc r25, r25 3b9ac: 96 17 cp r25, r22 3b9ae: 08 f0 brcs .+2 ; 0x3b9b2 <__udivmodqi4_ep> 3b9b0: 96 1b sub r25, r22 0003b9b2 <__udivmodqi4_ep>: 3b9b2: 88 1f adc r24, r24 3b9b4: 7a 95 dec r23 3b9b6: c9 f7 brne .-14 ; 0x3b9aa <__udivmodqi4_loop> 3b9b8: 80 95 com r24 3b9ba: 08 95 ret 0003b9bc <__divmodqi4>: 3b9bc: 87 fb bst r24, 7 3b9be: 08 2e mov r0, r24 3b9c0: 06 26 eor r0, r22 3b9c2: 87 fd sbrc r24, 7 3b9c4: 81 95 neg r24 3b9c6: 67 fd sbrc r22, 7 3b9c8: 61 95 neg r22 3b9ca: 0f 94 d2 dc call 0x3b9a4 ; 0x3b9a4 <__udivmodqi4> 3b9ce: 0e f4 brtc .+2 ; 0x3b9d2 <__divmodqi4_1> 3b9d0: 91 95 neg r25 0003b9d2 <__divmodqi4_1>: 3b9d2: 07 fc sbrc r0, 7 3b9d4: 81 95 neg r24 0003b9d6 <__divmodqi4_exit>: 3b9d6: 08 95 ret 0003b9d8 <__udivmodhi4>: 3b9d8: aa 1b sub r26, r26 3b9da: bb 1b sub r27, r27 3b9dc: 51 e1 ldi r21, 0x11 ; 17 3b9de: 07 c0 rjmp .+14 ; 0x3b9ee <__udivmodhi4_ep> 0003b9e0 <__udivmodhi4_loop>: 3b9e0: aa 1f adc r26, r26 3b9e2: bb 1f adc r27, r27 3b9e4: a6 17 cp r26, r22 3b9e6: b7 07 cpc r27, r23 3b9e8: 10 f0 brcs .+4 ; 0x3b9ee <__udivmodhi4_ep> 3b9ea: a6 1b sub r26, r22 3b9ec: b7 0b sbc r27, r23 0003b9ee <__udivmodhi4_ep>: 3b9ee: 88 1f adc r24, r24 3b9f0: 99 1f adc r25, r25 3b9f2: 5a 95 dec r21 3b9f4: a9 f7 brne .-22 ; 0x3b9e0 <__udivmodhi4_loop> 3b9f6: 80 95 com r24 3b9f8: 90 95 com r25 3b9fa: bc 01 movw r22, r24 3b9fc: cd 01 movw r24, r26 3b9fe: 08 95 ret 0003ba00 <__divmodhi4>: 3ba00: 97 fb bst r25, 7 3ba02: 07 2e mov r0, r23 3ba04: 16 f4 brtc .+4 ; 0x3ba0a <__divmodhi4+0xa> 3ba06: 00 94 com r0 3ba08: 07 d0 rcall .+14 ; 0x3ba18 <__divmodhi4_neg1> 3ba0a: 77 fd sbrc r23, 7 3ba0c: 09 d0 rcall .+18 ; 0x3ba20 <__divmodhi4_neg2> 3ba0e: 0f 94 ec dc call 0x3b9d8 ; 0x3b9d8 <__udivmodhi4> 3ba12: 07 fc sbrc r0, 7 3ba14: 05 d0 rcall .+10 ; 0x3ba20 <__divmodhi4_neg2> 3ba16: 3e f4 brtc .+14 ; 0x3ba26 <__divmodhi4_exit> 0003ba18 <__divmodhi4_neg1>: 3ba18: 90 95 com r25 3ba1a: 81 95 neg r24 3ba1c: 9f 4f sbci r25, 0xFF ; 255 3ba1e: 08 95 ret 0003ba20 <__divmodhi4_neg2>: 3ba20: 70 95 com r23 3ba22: 61 95 neg r22 3ba24: 7f 4f sbci r23, 0xFF ; 255 0003ba26 <__divmodhi4_exit>: 3ba26: 08 95 ret 0003ba28 <__divmodsi4>: 3ba28: 05 2e mov r0, r21 3ba2a: 97 fb bst r25, 7 3ba2c: 1e f4 brtc .+6 ; 0x3ba34 <__divmodsi4+0xc> 3ba2e: 00 94 com r0 3ba30: 0f 94 2b dd call 0x3ba56 ; 0x3ba56 <__negsi2> 3ba34: 57 fd sbrc r21, 7 3ba36: 07 d0 rcall .+14 ; 0x3ba46 <__divmodsi4_neg2> 3ba38: 0f 94 96 dc call 0x3b92c ; 0x3b92c <__udivmodsi4> 3ba3c: 07 fc sbrc r0, 7 3ba3e: 03 d0 rcall .+6 ; 0x3ba46 <__divmodsi4_neg2> 3ba40: 4e f4 brtc .+18 ; 0x3ba54 <__divmodsi4_exit> 3ba42: 0d 94 2b dd jmp 0x3ba56 ; 0x3ba56 <__negsi2> 0003ba46 <__divmodsi4_neg2>: 3ba46: 50 95 com r21 3ba48: 40 95 com r20 3ba4a: 30 95 com r19 3ba4c: 21 95 neg r18 3ba4e: 3f 4f sbci r19, 0xFF ; 255 3ba50: 4f 4f sbci r20, 0xFF ; 255 3ba52: 5f 4f sbci r21, 0xFF ; 255 0003ba54 <__divmodsi4_exit>: 3ba54: 08 95 ret 0003ba56 <__negsi2>: 3ba56: 90 95 com r25 3ba58: 80 95 com r24 3ba5a: 70 95 com r23 3ba5c: 61 95 neg r22 3ba5e: 7f 4f sbci r23, 0xFF ; 255 3ba60: 8f 4f sbci r24, 0xFF ; 255 3ba62: 9f 4f sbci r25, 0xFF ; 255 3ba64: 08 95 ret 0003ba66 <__tablejump2__>: 3ba66: ee 0f add r30, r30 3ba68: ff 1f adc r31, r31 3ba6a: 88 1f adc r24, r24 3ba6c: 8b bf out 0x3b, r24 ; 59 3ba6e: 07 90 elpm r0, Z+ 3ba70: f6 91 elpm r31, Z 3ba72: e0 2d mov r30, r0 3ba74: 19 94 eijmp 0003ba76 <__mulhisi3>: 3ba76: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 3ba7a: 33 23 and r19, r19 3ba7c: 12 f4 brpl .+4 ; 0x3ba82 <__mulhisi3+0xc> 3ba7e: 8a 1b sub r24, r26 3ba80: 9b 0b sbc r25, r27 3ba82: 0d 94 45 dd jmp 0x3ba8a ; 0x3ba8a <__usmulhisi3_tail> 0003ba86 <__usmulhisi3>: 3ba86: 0f 94 c3 dc call 0x3b986 ; 0x3b986 <__umulhisi3> 0003ba8a <__usmulhisi3_tail>: 3ba8a: b7 ff sbrs r27, 7 3ba8c: 08 95 ret 3ba8e: 82 1b sub r24, r18 3ba90: 93 0b sbc r25, r19 3ba92: 08 95 ret 0003ba94 <__subsf3>: 3ba94: 50 58 subi r21, 0x80 ; 128 0003ba96 <__addsf3>: 3ba96: bb 27 eor r27, r27 3ba98: aa 27 eor r26, r26 3ba9a: 0f 94 62 dd call 0x3bac4 ; 0x3bac4 <__addsf3x> 3ba9e: 0d 94 74 d7 jmp 0x3aee8 ; 0x3aee8 <__fp_round> 3baa2: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscA> 3baa6: 38 f0 brcs .+14 ; 0x3bab6 <__addsf3+0x20> 3baa8: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_pscB> 3baac: 20 f0 brcs .+8 ; 0x3bab6 <__addsf3+0x20> 3baae: 39 f4 brne .+14 ; 0x3babe <__addsf3+0x28> 3bab0: 9f 3f cpi r25, 0xFF ; 255 3bab2: 19 f4 brne .+6 ; 0x3baba <__addsf3+0x24> 3bab4: 26 f4 brtc .+8 ; 0x3babe <__addsf3+0x28> 3bab6: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3baba: 0e f4 brtc .+2 ; 0x3babe <__addsf3+0x28> 3babc: e0 95 com r30 3babe: e7 fb bst r30, 7 3bac0: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 0003bac4 <__addsf3x>: 3bac4: e9 2f mov r30, r25 3bac6: 0f 94 85 d7 call 0x3af0a ; 0x3af0a <__fp_split3> 3baca: 58 f3 brcs .-42 ; 0x3baa2 <__addsf3+0xc> 3bacc: ba 17 cp r27, r26 3bace: 62 07 cpc r22, r18 3bad0: 73 07 cpc r23, r19 3bad2: 84 07 cpc r24, r20 3bad4: 95 07 cpc r25, r21 3bad6: 20 f0 brcs .+8 ; 0x3bae0 <__addsf3x+0x1c> 3bad8: 79 f4 brne .+30 ; 0x3baf8 <__addsf3x+0x34> 3bada: a6 f5 brtc .+104 ; 0x3bb44 <__addsf3x+0x80> 3badc: 0d 94 a7 d7 jmp 0x3af4e ; 0x3af4e <__fp_zero> 3bae0: 0e f4 brtc .+2 ; 0x3bae4 <__addsf3x+0x20> 3bae2: e0 95 com r30 3bae4: 0b 2e mov r0, r27 3bae6: ba 2f mov r27, r26 3bae8: a0 2d mov r26, r0 3baea: 0b 01 movw r0, r22 3baec: b9 01 movw r22, r18 3baee: 90 01 movw r18, r0 3baf0: 0c 01 movw r0, r24 3baf2: ca 01 movw r24, r20 3baf4: a0 01 movw r20, r0 3baf6: 11 24 eor r1, r1 3baf8: ff 27 eor r31, r31 3bafa: 59 1b sub r21, r25 3bafc: 99 f0 breq .+38 ; 0x3bb24 <__addsf3x+0x60> 3bafe: 59 3f cpi r21, 0xF9 ; 249 3bb00: 50 f4 brcc .+20 ; 0x3bb16 <__addsf3x+0x52> 3bb02: 50 3e cpi r21, 0xE0 ; 224 3bb04: 68 f1 brcs .+90 ; 0x3bb60 <__addsf3x+0x9c> 3bb06: 1a 16 cp r1, r26 3bb08: f0 40 sbci r31, 0x00 ; 0 3bb0a: a2 2f mov r26, r18 3bb0c: 23 2f mov r18, r19 3bb0e: 34 2f mov r19, r20 3bb10: 44 27 eor r20, r20 3bb12: 58 5f subi r21, 0xF8 ; 248 3bb14: f3 cf rjmp .-26 ; 0x3bafc <__addsf3x+0x38> 3bb16: 46 95 lsr r20 3bb18: 37 95 ror r19 3bb1a: 27 95 ror r18 3bb1c: a7 95 ror r26 3bb1e: f0 40 sbci r31, 0x00 ; 0 3bb20: 53 95 inc r21 3bb22: c9 f7 brne .-14 ; 0x3bb16 <__addsf3x+0x52> 3bb24: 7e f4 brtc .+30 ; 0x3bb44 <__addsf3x+0x80> 3bb26: 1f 16 cp r1, r31 3bb28: ba 0b sbc r27, r26 3bb2a: 62 0b sbc r22, r18 3bb2c: 73 0b sbc r23, r19 3bb2e: 84 0b sbc r24, r20 3bb30: ba f0 brmi .+46 ; 0x3bb60 <__addsf3x+0x9c> 3bb32: 91 50 subi r25, 0x01 ; 1 3bb34: a1 f0 breq .+40 ; 0x3bb5e <__addsf3x+0x9a> 3bb36: ff 0f add r31, r31 3bb38: bb 1f adc r27, r27 3bb3a: 66 1f adc r22, r22 3bb3c: 77 1f adc r23, r23 3bb3e: 88 1f adc r24, r24 3bb40: c2 f7 brpl .-16 ; 0x3bb32 <__addsf3x+0x6e> 3bb42: 0e c0 rjmp .+28 ; 0x3bb60 <__addsf3x+0x9c> 3bb44: ba 0f add r27, r26 3bb46: 62 1f adc r22, r18 3bb48: 73 1f adc r23, r19 3bb4a: 84 1f adc r24, r20 3bb4c: 48 f4 brcc .+18 ; 0x3bb60 <__addsf3x+0x9c> 3bb4e: 87 95 ror r24 3bb50: 77 95 ror r23 3bb52: 67 95 ror r22 3bb54: b7 95 ror r27 3bb56: f7 95 ror r31 3bb58: 9e 3f cpi r25, 0xFE ; 254 3bb5a: 08 f0 brcs .+2 ; 0x3bb5e <__addsf3x+0x9a> 3bb5c: b0 cf rjmp .-160 ; 0x3babe <__addsf3+0x28> 3bb5e: 93 95 inc r25 3bb60: 88 0f add r24, r24 3bb62: 08 f0 brcs .+2 ; 0x3bb66 <__addsf3x+0xa2> 3bb64: 99 27 eor r25, r25 3bb66: ee 0f add r30, r30 3bb68: 97 95 ror r25 3bb6a: 87 95 ror r24 3bb6c: 08 95 ret 3bb6e: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscA> 3bb72: 60 f0 brcs .+24 ; 0x3bb8c <__addsf3x+0xc8> 3bb74: 80 e8 ldi r24, 0x80 ; 128 3bb76: 91 e0 ldi r25, 0x01 ; 1 3bb78: 09 f4 brne .+2 ; 0x3bb7c <__addsf3x+0xb8> 3bb7a: 9e ef ldi r25, 0xFE ; 254 3bb7c: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_pscB> 3bb80: 28 f0 brcs .+10 ; 0x3bb8c <__addsf3x+0xc8> 3bb82: 40 e8 ldi r20, 0x80 ; 128 3bb84: 51 e0 ldi r21, 0x01 ; 1 3bb86: 71 f4 brne .+28 ; 0x3bba4 3bb88: 5e ef ldi r21, 0xFE ; 254 3bb8a: 0c c0 rjmp .+24 ; 0x3bba4 3bb8c: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3bb90: 0d 94 a7 d7 jmp 0x3af4e ; 0x3af4e <__fp_zero> 0003bb94 : 3bb94: e9 2f mov r30, r25 3bb96: e0 78 andi r30, 0x80 ; 128 3bb98: 0f 94 85 d7 call 0x3af0a ; 0x3af0a <__fp_split3> 3bb9c: 40 f3 brcs .-48 ; 0x3bb6e <__addsf3x+0xaa> 3bb9e: 09 2e mov r0, r25 3bba0: 05 2a or r0, r21 3bba2: b1 f3 breq .-20 ; 0x3bb90 <__addsf3x+0xcc> 3bba4: 26 17 cp r18, r22 3bba6: 37 07 cpc r19, r23 3bba8: 48 07 cpc r20, r24 3bbaa: 59 07 cpc r21, r25 3bbac: 38 f0 brcs .+14 ; 0x3bbbc 3bbae: 0e 2e mov r0, r30 3bbb0: 07 f8 bld r0, 7 3bbb2: e0 25 eor r30, r0 3bbb4: 69 f0 breq .+26 ; 0x3bbd0 3bbb6: e0 25 eor r30, r0 3bbb8: e0 64 ori r30, 0x40 ; 64 3bbba: 0a c0 rjmp .+20 ; 0x3bbd0 3bbbc: ef 63 ori r30, 0x3F ; 63 3bbbe: 07 f8 bld r0, 7 3bbc0: 00 94 com r0 3bbc2: 07 fa bst r0, 7 3bbc4: db 01 movw r26, r22 3bbc6: b9 01 movw r22, r18 3bbc8: 9d 01 movw r18, r26 3bbca: dc 01 movw r26, r24 3bbcc: ca 01 movw r24, r20 3bbce: ad 01 movw r20, r26 3bbd0: ef 93 push r30 3bbd2: 0f 94 61 de call 0x3bcc2 ; 0x3bcc2 <__divsf3_pse> 3bbd6: 0f 94 74 d7 call 0x3aee8 ; 0x3aee8 <__fp_round> 3bbda: 0f 94 fa dd call 0x3bbf4 ; 0x3bbf4 3bbde: 5f 91 pop r21 3bbe0: 55 23 and r21, r21 3bbe2: 39 f0 breq .+14 ; 0x3bbf2 3bbe4: 2b ed ldi r18, 0xDB ; 219 3bbe6: 3f e0 ldi r19, 0x0F ; 15 3bbe8: 49 e4 ldi r20, 0x49 ; 73 3bbea: 50 fd sbrc r21, 0 3bbec: 49 ec ldi r20, 0xC9 ; 201 3bbee: 0d 94 4b dd jmp 0x3ba96 ; 0x3ba96 <__addsf3> 3bbf2: 08 95 ret 0003bbf4 : 3bbf4: df 93 push r29 3bbf6: dd 27 eor r29, r29 3bbf8: b9 2f mov r27, r25 3bbfa: bf 77 andi r27, 0x7F ; 127 3bbfc: 40 e8 ldi r20, 0x80 ; 128 3bbfe: 5f e3 ldi r21, 0x3F ; 63 3bc00: 16 16 cp r1, r22 3bc02: 17 06 cpc r1, r23 3bc04: 48 07 cpc r20, r24 3bc06: 5b 07 cpc r21, r27 3bc08: 18 f4 brcc .+6 ; 0x3bc10 3bc0a: d9 2f mov r29, r25 3bc0c: 0f 94 46 e0 call 0x3c08c ; 0x3c08c 3bc10: 9f 93 push r25 3bc12: 8f 93 push r24 3bc14: 7f 93 push r23 3bc16: 6f 93 push r22 3bc18: 0f 94 ec d6 call 0x3add8 ; 0x3add8 3bc1c: e7 e4 ldi r30, 0x47 ; 71 3bc1e: f1 e7 ldi r31, 0x71 ; 113 3bc20: 0f 94 56 df call 0x3beac ; 0x3beac <__fp_powser> 3bc24: 0f 94 74 d7 call 0x3aee8 ; 0x3aee8 <__fp_round> 3bc28: 2f 91 pop r18 3bc2a: 3f 91 pop r19 3bc2c: 4f 91 pop r20 3bc2e: 5f 91 pop r21 3bc30: 0f 94 03 d7 call 0x3ae06 ; 0x3ae06 <__mulsf3x> 3bc34: dd 23 and r29, r29 3bc36: 51 f0 breq .+20 ; 0x3bc4c 3bc38: 90 58 subi r25, 0x80 ; 128 3bc3a: a2 ea ldi r26, 0xA2 ; 162 3bc3c: 2a ed ldi r18, 0xDA ; 218 3bc3e: 3f e0 ldi r19, 0x0F ; 15 3bc40: 49 ec ldi r20, 0xC9 ; 201 3bc42: 5f e3 ldi r21, 0x3F ; 63 3bc44: d0 78 andi r29, 0x80 ; 128 3bc46: 5d 27 eor r21, r29 3bc48: 0f 94 62 dd call 0x3bac4 ; 0x3bac4 <__addsf3x> 3bc4c: df 91 pop r29 3bc4e: 0d 94 74 d7 jmp 0x3aee8 ; 0x3aee8 <__fp_round> 0003bc52 : 3bc52: 0f 94 bc df call 0x3bf78 ; 0x3bf78 <__fp_trunc> 3bc56: 90 f0 brcs .+36 ; 0x3bc7c 3bc58: 9f 37 cpi r25, 0x7F ; 127 3bc5a: 48 f4 brcc .+18 ; 0x3bc6e 3bc5c: 91 11 cpse r25, r1 3bc5e: 16 f4 brtc .+4 ; 0x3bc64 3bc60: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3bc64: 60 e0 ldi r22, 0x00 ; 0 3bc66: 70 e0 ldi r23, 0x00 ; 0 3bc68: 80 e8 ldi r24, 0x80 ; 128 3bc6a: 9f e3 ldi r25, 0x3F ; 63 3bc6c: 08 95 ret 3bc6e: 26 f0 brts .+8 ; 0x3bc78 3bc70: 1b 16 cp r1, r27 3bc72: 61 1d adc r22, r1 3bc74: 71 1d adc r23, r1 3bc76: 81 1d adc r24, r1 3bc78: 0d 94 2d df jmp 0x3be5a ; 0x3be5a <__fp_mintl> 3bc7c: 0d 94 48 df jmp 0x3be90 ; 0x3be90 <__fp_mpack> 0003bc80 <__cmpsf2>: 3bc80: 0f 94 09 df call 0x3be12 ; 0x3be12 <__fp_cmp> 3bc84: 08 f4 brcc .+2 ; 0x3bc88 <__cmpsf2+0x8> 3bc86: 81 e0 ldi r24, 0x01 ; 1 3bc88: 08 95 ret 0003bc8a : 3bc8a: 0f 94 7f df call 0x3befe ; 0x3befe <__fp_rempio2> 3bc8e: e3 95 inc r30 3bc90: 0d 94 a8 df jmp 0x3bf50 ; 0x3bf50 <__fp_sinus> 0003bc94 <__divsf3>: 3bc94: 0f 94 5e de call 0x3bcbc ; 0x3bcbc <__divsf3x> 3bc98: 0d 94 74 d7 jmp 0x3aee8 ; 0x3aee8 <__fp_round> 3bc9c: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_pscB> 3bca0: 58 f0 brcs .+22 ; 0x3bcb8 <__divsf3+0x24> 3bca2: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscA> 3bca6: 40 f0 brcs .+16 ; 0x3bcb8 <__divsf3+0x24> 3bca8: 29 f4 brne .+10 ; 0x3bcb4 <__divsf3+0x20> 3bcaa: 5f 3f cpi r21, 0xFF ; 255 3bcac: 29 f0 breq .+10 ; 0x3bcb8 <__divsf3+0x24> 3bcae: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3bcb2: 51 11 cpse r21, r1 3bcb4: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3bcb8: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 0003bcbc <__divsf3x>: 3bcbc: 0f 94 85 d7 call 0x3af0a ; 0x3af0a <__fp_split3> 3bcc0: 68 f3 brcs .-38 ; 0x3bc9c <__divsf3+0x8> 0003bcc2 <__divsf3_pse>: 3bcc2: 99 23 and r25, r25 3bcc4: b1 f3 breq .-20 ; 0x3bcb2 <__divsf3+0x1e> 3bcc6: 55 23 and r21, r21 3bcc8: 91 f3 breq .-28 ; 0x3bcae <__divsf3+0x1a> 3bcca: 95 1b sub r25, r21 3bccc: 55 0b sbc r21, r21 3bcce: bb 27 eor r27, r27 3bcd0: aa 27 eor r26, r26 3bcd2: 62 17 cp r22, r18 3bcd4: 73 07 cpc r23, r19 3bcd6: 84 07 cpc r24, r20 3bcd8: 38 f0 brcs .+14 ; 0x3bce8 <__divsf3_pse+0x26> 3bcda: 9f 5f subi r25, 0xFF ; 255 3bcdc: 5f 4f sbci r21, 0xFF ; 255 3bcde: 22 0f add r18, r18 3bce0: 33 1f adc r19, r19 3bce2: 44 1f adc r20, r20 3bce4: aa 1f adc r26, r26 3bce6: a9 f3 breq .-22 ; 0x3bcd2 <__divsf3_pse+0x10> 3bce8: 35 d0 rcall .+106 ; 0x3bd54 <__divsf3_pse+0x92> 3bcea: 0e 2e mov r0, r30 3bcec: 3a f0 brmi .+14 ; 0x3bcfc <__divsf3_pse+0x3a> 3bcee: e0 e8 ldi r30, 0x80 ; 128 3bcf0: 32 d0 rcall .+100 ; 0x3bd56 <__divsf3_pse+0x94> 3bcf2: 91 50 subi r25, 0x01 ; 1 3bcf4: 50 40 sbci r21, 0x00 ; 0 3bcf6: e6 95 lsr r30 3bcf8: 00 1c adc r0, r0 3bcfa: ca f7 brpl .-14 ; 0x3bcee <__divsf3_pse+0x2c> 3bcfc: 2b d0 rcall .+86 ; 0x3bd54 <__divsf3_pse+0x92> 3bcfe: fe 2f mov r31, r30 3bd00: 29 d0 rcall .+82 ; 0x3bd54 <__divsf3_pse+0x92> 3bd02: 66 0f add r22, r22 3bd04: 77 1f adc r23, r23 3bd06: 88 1f adc r24, r24 3bd08: bb 1f adc r27, r27 3bd0a: 26 17 cp r18, r22 3bd0c: 37 07 cpc r19, r23 3bd0e: 48 07 cpc r20, r24 3bd10: ab 07 cpc r26, r27 3bd12: b0 e8 ldi r27, 0x80 ; 128 3bd14: 09 f0 breq .+2 ; 0x3bd18 <__divsf3_pse+0x56> 3bd16: bb 0b sbc r27, r27 3bd18: 80 2d mov r24, r0 3bd1a: bf 01 movw r22, r30 3bd1c: ff 27 eor r31, r31 3bd1e: 93 58 subi r25, 0x83 ; 131 3bd20: 5f 4f sbci r21, 0xFF ; 255 3bd22: 3a f0 brmi .+14 ; 0x3bd32 <__divsf3_pse+0x70> 3bd24: 9e 3f cpi r25, 0xFE ; 254 3bd26: 51 05 cpc r21, r1 3bd28: 78 f0 brcs .+30 ; 0x3bd48 <__divsf3_pse+0x86> 3bd2a: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3bd2e: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3bd32: 5f 3f cpi r21, 0xFF ; 255 3bd34: e4 f3 brlt .-8 ; 0x3bd2e <__divsf3_pse+0x6c> 3bd36: 98 3e cpi r25, 0xE8 ; 232 3bd38: d4 f3 brlt .-12 ; 0x3bd2e <__divsf3_pse+0x6c> 3bd3a: 86 95 lsr r24 3bd3c: 77 95 ror r23 3bd3e: 67 95 ror r22 3bd40: b7 95 ror r27 3bd42: f7 95 ror r31 3bd44: 9f 5f subi r25, 0xFF ; 255 3bd46: c9 f7 brne .-14 ; 0x3bd3a <__divsf3_pse+0x78> 3bd48: 88 0f add r24, r24 3bd4a: 91 1d adc r25, r1 3bd4c: 96 95 lsr r25 3bd4e: 87 95 ror r24 3bd50: 97 f9 bld r25, 7 3bd52: 08 95 ret 3bd54: e1 e0 ldi r30, 0x01 ; 1 3bd56: 66 0f add r22, r22 3bd58: 77 1f adc r23, r23 3bd5a: 88 1f adc r24, r24 3bd5c: bb 1f adc r27, r27 3bd5e: 62 17 cp r22, r18 3bd60: 73 07 cpc r23, r19 3bd62: 84 07 cpc r24, r20 3bd64: ba 07 cpc r27, r26 3bd66: 20 f0 brcs .+8 ; 0x3bd70 <__divsf3_pse+0xae> 3bd68: 62 1b sub r22, r18 3bd6a: 73 0b sbc r23, r19 3bd6c: 84 0b sbc r24, r20 3bd6e: ba 0b sbc r27, r26 3bd70: ee 1f adc r30, r30 3bd72: 88 f7 brcc .-30 ; 0x3bd56 <__divsf3_pse+0x94> 3bd74: e0 95 com r30 3bd76: 08 95 ret 0003bd78 <__fixsfsi>: 3bd78: 0f 94 c3 de call 0x3bd86 ; 0x3bd86 <__fixunssfsi> 3bd7c: 68 94 set 3bd7e: b1 11 cpse r27, r1 3bd80: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3bd84: 08 95 ret 0003bd86 <__fixunssfsi>: 3bd86: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3bd8a: 88 f0 brcs .+34 ; 0x3bdae <__fixunssfsi+0x28> 3bd8c: 9f 57 subi r25, 0x7F ; 127 3bd8e: 98 f0 brcs .+38 ; 0x3bdb6 <__fixunssfsi+0x30> 3bd90: b9 2f mov r27, r25 3bd92: 99 27 eor r25, r25 3bd94: b7 51 subi r27, 0x17 ; 23 3bd96: b0 f0 brcs .+44 ; 0x3bdc4 <__fixunssfsi+0x3e> 3bd98: e1 f0 breq .+56 ; 0x3bdd2 <__fixunssfsi+0x4c> 3bd9a: 66 0f add r22, r22 3bd9c: 77 1f adc r23, r23 3bd9e: 88 1f adc r24, r24 3bda0: 99 1f adc r25, r25 3bda2: 1a f0 brmi .+6 ; 0x3bdaa <__fixunssfsi+0x24> 3bda4: ba 95 dec r27 3bda6: c9 f7 brne .-14 ; 0x3bd9a <__fixunssfsi+0x14> 3bda8: 14 c0 rjmp .+40 ; 0x3bdd2 <__fixunssfsi+0x4c> 3bdaa: b1 30 cpi r27, 0x01 ; 1 3bdac: 91 f0 breq .+36 ; 0x3bdd2 <__fixunssfsi+0x4c> 3bdae: 0f 94 a7 d7 call 0x3af4e ; 0x3af4e <__fp_zero> 3bdb2: b1 e0 ldi r27, 0x01 ; 1 3bdb4: 08 95 ret 3bdb6: 0d 94 a7 d7 jmp 0x3af4e ; 0x3af4e <__fp_zero> 3bdba: 67 2f mov r22, r23 3bdbc: 78 2f mov r23, r24 3bdbe: 88 27 eor r24, r24 3bdc0: b8 5f subi r27, 0xF8 ; 248 3bdc2: 39 f0 breq .+14 ; 0x3bdd2 <__fixunssfsi+0x4c> 3bdc4: b9 3f cpi r27, 0xF9 ; 249 3bdc6: cc f3 brlt .-14 ; 0x3bdba <__fixunssfsi+0x34> 3bdc8: 86 95 lsr r24 3bdca: 77 95 ror r23 3bdcc: 67 95 ror r22 3bdce: b3 95 inc r27 3bdd0: d9 f7 brne .-10 ; 0x3bdc8 <__fixunssfsi+0x42> 3bdd2: 3e f4 brtc .+14 ; 0x3bde2 <__fixunssfsi+0x5c> 3bdd4: 90 95 com r25 3bdd6: 80 95 com r24 3bdd8: 70 95 com r23 3bdda: 61 95 neg r22 3bddc: 7f 4f sbci r23, 0xFF ; 255 3bdde: 8f 4f sbci r24, 0xFF ; 255 3bde0: 9f 4f sbci r25, 0xFF ; 255 3bde2: 08 95 ret 0003bde4 : 3bde4: 0f 94 bc df call 0x3bf78 ; 0x3bf78 <__fp_trunc> 3bde8: 90 f0 brcs .+36 ; 0x3be0e 3bdea: 9f 37 cpi r25, 0x7F ; 127 3bdec: 48 f4 brcc .+18 ; 0x3be00 3bdee: 91 11 cpse r25, r1 3bdf0: 16 f0 brts .+4 ; 0x3bdf6 3bdf2: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3bdf6: 60 e0 ldi r22, 0x00 ; 0 3bdf8: 70 e0 ldi r23, 0x00 ; 0 3bdfa: 80 e8 ldi r24, 0x80 ; 128 3bdfc: 9f eb ldi r25, 0xBF ; 191 3bdfe: 08 95 ret 3be00: 26 f4 brtc .+8 ; 0x3be0a 3be02: 1b 16 cp r1, r27 3be04: 61 1d adc r22, r1 3be06: 71 1d adc r23, r1 3be08: 81 1d adc r24, r1 3be0a: 0d 94 2d df jmp 0x3be5a ; 0x3be5a <__fp_mintl> 3be0e: 0d 94 48 df jmp 0x3be90 ; 0x3be90 <__fp_mpack> 0003be12 <__fp_cmp>: 3be12: 99 0f add r25, r25 3be14: 00 08 sbc r0, r0 3be16: 55 0f add r21, r21 3be18: aa 0b sbc r26, r26 3be1a: e0 e8 ldi r30, 0x80 ; 128 3be1c: fe ef ldi r31, 0xFE ; 254 3be1e: 16 16 cp r1, r22 3be20: 17 06 cpc r1, r23 3be22: e8 07 cpc r30, r24 3be24: f9 07 cpc r31, r25 3be26: c0 f0 brcs .+48 ; 0x3be58 <__fp_cmp+0x46> 3be28: 12 16 cp r1, r18 3be2a: 13 06 cpc r1, r19 3be2c: e4 07 cpc r30, r20 3be2e: f5 07 cpc r31, r21 3be30: 98 f0 brcs .+38 ; 0x3be58 <__fp_cmp+0x46> 3be32: 62 1b sub r22, r18 3be34: 73 0b sbc r23, r19 3be36: 84 0b sbc r24, r20 3be38: 95 0b sbc r25, r21 3be3a: 39 f4 brne .+14 ; 0x3be4a <__fp_cmp+0x38> 3be3c: 0a 26 eor r0, r26 3be3e: 61 f0 breq .+24 ; 0x3be58 <__fp_cmp+0x46> 3be40: 23 2b or r18, r19 3be42: 24 2b or r18, r20 3be44: 25 2b or r18, r21 3be46: 21 f4 brne .+8 ; 0x3be50 <__fp_cmp+0x3e> 3be48: 08 95 ret 3be4a: 0a 26 eor r0, r26 3be4c: 09 f4 brne .+2 ; 0x3be50 <__fp_cmp+0x3e> 3be4e: a1 40 sbci r26, 0x01 ; 1 3be50: a6 95 lsr r26 3be52: 8f ef ldi r24, 0xFF ; 255 3be54: 81 1d adc r24, r1 3be56: 81 1d adc r24, r1 3be58: 08 95 ret 0003be5a <__fp_mintl>: 3be5a: 88 23 and r24, r24 3be5c: 71 f4 brne .+28 ; 0x3be7a <__fp_mintl+0x20> 3be5e: 77 23 and r23, r23 3be60: 21 f0 breq .+8 ; 0x3be6a <__fp_mintl+0x10> 3be62: 98 50 subi r25, 0x08 ; 8 3be64: 87 2b or r24, r23 3be66: 76 2f mov r23, r22 3be68: 07 c0 rjmp .+14 ; 0x3be78 <__fp_mintl+0x1e> 3be6a: 66 23 and r22, r22 3be6c: 11 f4 brne .+4 ; 0x3be72 <__fp_mintl+0x18> 3be6e: 99 27 eor r25, r25 3be70: 0d c0 rjmp .+26 ; 0x3be8c <__fp_mintl+0x32> 3be72: 90 51 subi r25, 0x10 ; 16 3be74: 86 2b or r24, r22 3be76: 70 e0 ldi r23, 0x00 ; 0 3be78: 60 e0 ldi r22, 0x00 ; 0 3be7a: 2a f0 brmi .+10 ; 0x3be86 <__fp_mintl+0x2c> 3be7c: 9a 95 dec r25 3be7e: 66 0f add r22, r22 3be80: 77 1f adc r23, r23 3be82: 88 1f adc r24, r24 3be84: da f7 brpl .-10 ; 0x3be7c <__fp_mintl+0x22> 3be86: 88 0f add r24, r24 3be88: 96 95 lsr r25 3be8a: 87 95 ror r24 3be8c: 97 f9 bld r25, 7 3be8e: 08 95 ret 0003be90 <__fp_mpack>: 3be90: 9f 3f cpi r25, 0xFF ; 255 3be92: 31 f0 breq .+12 ; 0x3bea0 <__fp_mpack_finite+0xc> 0003be94 <__fp_mpack_finite>: 3be94: 91 50 subi r25, 0x01 ; 1 3be96: 20 f4 brcc .+8 ; 0x3bea0 <__fp_mpack_finite+0xc> 3be98: 87 95 ror r24 3be9a: 77 95 ror r23 3be9c: 67 95 ror r22 3be9e: b7 95 ror r27 3bea0: 88 0f add r24, r24 3bea2: 91 1d adc r25, r1 3bea4: 96 95 lsr r25 3bea6: 87 95 ror r24 3bea8: 97 f9 bld r25, 7 3beaa: 08 95 ret 0003beac <__fp_powser>: 3beac: df 93 push r29 3beae: cf 93 push r28 3beb0: 1f 93 push r17 3beb2: 0f 93 push r16 3beb4: ff 92 push r15 3beb6: ef 92 push r14 3beb8: df 92 push r13 3beba: 7b 01 movw r14, r22 3bebc: 8c 01 movw r16, r24 3bebe: 68 94 set 3bec0: 06 c0 rjmp .+12 ; 0x3bece <__fp_powser+0x22> 3bec2: da 2e mov r13, r26 3bec4: ef 01 movw r28, r30 3bec6: 0f 94 03 d7 call 0x3ae06 ; 0x3ae06 <__mulsf3x> 3beca: fe 01 movw r30, r28 3becc: e8 94 clt 3bece: a5 91 lpm r26, Z+ 3bed0: 25 91 lpm r18, Z+ 3bed2: 35 91 lpm r19, Z+ 3bed4: 45 91 lpm r20, Z+ 3bed6: 55 91 lpm r21, Z+ 3bed8: a6 f3 brts .-24 ; 0x3bec2 <__fp_powser+0x16> 3beda: ef 01 movw r28, r30 3bedc: 0f 94 62 dd call 0x3bac4 ; 0x3bac4 <__addsf3x> 3bee0: fe 01 movw r30, r28 3bee2: 97 01 movw r18, r14 3bee4: a8 01 movw r20, r16 3bee6: da 94 dec r13 3bee8: 69 f7 brne .-38 ; 0x3bec4 <__fp_powser+0x18> 3beea: df 90 pop r13 3beec: ef 90 pop r14 3beee: ff 90 pop r15 3bef0: 0f 91 pop r16 3bef2: 1f 91 pop r17 3bef4: cf 91 pop r28 3bef6: df 91 pop r29 3bef8: 08 95 ret 3befa: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 0003befe <__fp_rempio2>: 3befe: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3bf02: d8 f3 brcs .-10 ; 0x3befa <__fp_powser+0x4e> 3bf04: e8 94 clt 3bf06: e0 e0 ldi r30, 0x00 ; 0 3bf08: bb 27 eor r27, r27 3bf0a: 9f 57 subi r25, 0x7F ; 127 3bf0c: f0 f0 brcs .+60 ; 0x3bf4a <__fp_rempio2+0x4c> 3bf0e: 2a ed ldi r18, 0xDA ; 218 3bf10: 3f e0 ldi r19, 0x0F ; 15 3bf12: 49 ec ldi r20, 0xC9 ; 201 3bf14: 06 c0 rjmp .+12 ; 0x3bf22 <__fp_rempio2+0x24> 3bf16: ee 0f add r30, r30 3bf18: bb 0f add r27, r27 3bf1a: 66 1f adc r22, r22 3bf1c: 77 1f adc r23, r23 3bf1e: 88 1f adc r24, r24 3bf20: 28 f0 brcs .+10 ; 0x3bf2c <__fp_rempio2+0x2e> 3bf22: b2 3a cpi r27, 0xA2 ; 162 3bf24: 62 07 cpc r22, r18 3bf26: 73 07 cpc r23, r19 3bf28: 84 07 cpc r24, r20 3bf2a: 28 f0 brcs .+10 ; 0x3bf36 <__fp_rempio2+0x38> 3bf2c: b2 5a subi r27, 0xA2 ; 162 3bf2e: 62 0b sbc r22, r18 3bf30: 73 0b sbc r23, r19 3bf32: 84 0b sbc r24, r20 3bf34: e3 95 inc r30 3bf36: 9a 95 dec r25 3bf38: 72 f7 brpl .-36 ; 0x3bf16 <__fp_rempio2+0x18> 3bf3a: 80 38 cpi r24, 0x80 ; 128 3bf3c: 30 f4 brcc .+12 ; 0x3bf4a <__fp_rempio2+0x4c> 3bf3e: 9a 95 dec r25 3bf40: bb 0f add r27, r27 3bf42: 66 1f adc r22, r22 3bf44: 77 1f adc r23, r23 3bf46: 88 1f adc r24, r24 3bf48: d2 f7 brpl .-12 ; 0x3bf3e <__fp_rempio2+0x40> 3bf4a: 90 48 sbci r25, 0x80 ; 128 3bf4c: 0d 94 4a df jmp 0x3be94 ; 0x3be94 <__fp_mpack_finite> 0003bf50 <__fp_sinus>: 3bf50: ef 93 push r30 3bf52: e0 ff sbrs r30, 0 3bf54: 07 c0 rjmp .+14 ; 0x3bf64 <__fp_sinus+0x14> 3bf56: a2 ea ldi r26, 0xA2 ; 162 3bf58: 2a ed ldi r18, 0xDA ; 218 3bf5a: 3f e0 ldi r19, 0x0F ; 15 3bf5c: 49 ec ldi r20, 0xC9 ; 201 3bf5e: 5f eb ldi r21, 0xBF ; 191 3bf60: 0f 94 62 dd call 0x3bac4 ; 0x3bac4 <__addsf3x> 3bf64: 0f 94 74 d7 call 0x3aee8 ; 0x3aee8 <__fp_round> 3bf68: 0f 90 pop r0 3bf6a: 03 94 inc r0 3bf6c: 01 fc sbrc r0, 1 3bf6e: 90 58 subi r25, 0x80 ; 128 3bf70: e4 e7 ldi r30, 0x74 ; 116 3bf72: f1 e7 ldi r31, 0x71 ; 113 3bf74: 0d 94 9f e1 jmp 0x3c33e ; 0x3c33e <__fp_powsodd> 0003bf78 <__fp_trunc>: 3bf78: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3bf7c: a0 f0 brcs .+40 ; 0x3bfa6 <__fp_trunc+0x2e> 3bf7e: be e7 ldi r27, 0x7E ; 126 3bf80: b9 17 cp r27, r25 3bf82: 88 f4 brcc .+34 ; 0x3bfa6 <__fp_trunc+0x2e> 3bf84: bb 27 eor r27, r27 3bf86: 9f 38 cpi r25, 0x8F ; 143 3bf88: 60 f4 brcc .+24 ; 0x3bfa2 <__fp_trunc+0x2a> 3bf8a: 16 16 cp r1, r22 3bf8c: b1 1d adc r27, r1 3bf8e: 67 2f mov r22, r23 3bf90: 78 2f mov r23, r24 3bf92: 88 27 eor r24, r24 3bf94: 98 5f subi r25, 0xF8 ; 248 3bf96: f7 cf rjmp .-18 ; 0x3bf86 <__fp_trunc+0xe> 3bf98: 86 95 lsr r24 3bf9a: 77 95 ror r23 3bf9c: 67 95 ror r22 3bf9e: b1 1d adc r27, r1 3bfa0: 93 95 inc r25 3bfa2: 96 39 cpi r25, 0x96 ; 150 3bfa4: c8 f3 brcs .-14 ; 0x3bf98 <__fp_trunc+0x20> 3bfa6: 08 95 ret 0003bfa8 <__gesf2>: 3bfa8: 0f 94 09 df call 0x3be12 ; 0x3be12 <__fp_cmp> 3bfac: 08 f4 brcc .+2 ; 0x3bfb0 <__gesf2+0x8> 3bfae: 8f ef ldi r24, 0xFF ; 255 3bfb0: 08 95 ret 3bfb2: 0f 94 66 d7 call 0x3aecc ; 0x3aecc <__fp_pscA> 3bfb6: 29 f0 breq .+10 ; 0x3bfc2 <__gesf2+0x1a> 3bfb8: 0f 94 6d d7 call 0x3aeda ; 0x3aeda <__fp_pscB> 3bfbc: 11 f0 breq .+4 ; 0x3bfc2 <__gesf2+0x1a> 3bfbe: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3bfc2: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3bfc6: b9 01 movw r22, r18 3bfc8: ca 01 movw r24, r20 3bfca: 0d 94 48 df jmp 0x3be90 ; 0x3be90 <__fp_mpack> 0003bfce : 3bfce: 9f 77 andi r25, 0x7F ; 127 3bfd0: 5f 77 andi r21, 0x7F ; 127 3bfd2: 0f 94 85 d7 call 0x3af0a ; 0x3af0a <__fp_split3> 3bfd6: 68 f3 brcs .-38 ; 0x3bfb2 <__gesf2+0xa> 3bfd8: 99 23 and r25, r25 3bfda: a9 f3 breq .-22 ; 0x3bfc6 <__gesf2+0x1e> 3bfdc: 55 23 and r21, r21 3bfde: a9 f3 breq .-22 ; 0x3bfca <__gesf2+0x22> 3bfe0: ff 27 eor r31, r31 3bfe2: 95 17 cp r25, r21 3bfe4: 58 f4 brcc .+22 ; 0x3bffc 3bfe6: e5 2f mov r30, r21 3bfe8: e9 1b sub r30, r25 3bfea: ed 30 cpi r30, 0x0D ; 13 3bfec: 60 f7 brcc .-40 ; 0x3bfc6 <__gesf2+0x1e> 3bfee: 5e 3b cpi r21, 0xBE ; 190 3bff0: 10 f0 brcs .+4 ; 0x3bff6 3bff2: f1 e4 ldi r31, 0x41 ; 65 3bff4: 1c c0 rjmp .+56 ; 0x3c02e 3bff6: 90 34 cpi r25, 0x40 ; 64 3bff8: e0 f4 brcc .+56 ; 0x3c032 3bffa: 0a c0 rjmp .+20 ; 0x3c010 3bffc: e9 2f mov r30, r25 3bffe: e5 1b sub r30, r21 3c000: ed 30 cpi r30, 0x0D ; 13 3c002: 18 f7 brcc .-58 ; 0x3bfca <__gesf2+0x22> 3c004: 9e 3b cpi r25, 0xBE ; 190 3c006: 10 f0 brcs .+4 ; 0x3c00c 3c008: f1 e4 ldi r31, 0x41 ; 65 3c00a: 11 c0 rjmp .+34 ; 0x3c02e 3c00c: 50 34 cpi r21, 0x40 ; 64 3c00e: 88 f4 brcc .+34 ; 0x3c032 3c010: f9 ea ldi r31, 0xA9 ; 169 3c012: 88 23 and r24, r24 3c014: 2a f0 brmi .+10 ; 0x3c020 3c016: 9a 95 dec r25 3c018: 66 0f add r22, r22 3c01a: 77 1f adc r23, r23 3c01c: 88 1f adc r24, r24 3c01e: da f7 brpl .-10 ; 0x3c016 3c020: 44 23 and r20, r20 3c022: 2a f0 brmi .+10 ; 0x3c02e 3c024: 5a 95 dec r21 3c026: 22 0f add r18, r18 3c028: 33 1f adc r19, r19 3c02a: 44 1f adc r20, r20 3c02c: da f7 brpl .-10 ; 0x3c024 3c02e: 9f 1b sub r25, r31 3c030: 5f 1b sub r21, r31 3c032: ff 93 push r31 3c034: 1f 93 push r17 3c036: 0f 93 push r16 3c038: ff 92 push r15 3c03a: ef 92 push r14 3c03c: 79 01 movw r14, r18 3c03e: 8a 01 movw r16, r20 3c040: bb 27 eor r27, r27 3c042: ab 2f mov r26, r27 3c044: 9b 01 movw r18, r22 3c046: ac 01 movw r20, r24 3c048: 0f 94 06 d7 call 0x3ae0c ; 0x3ae0c <__mulsf3_pse> 3c04c: 97 01 movw r18, r14 3c04e: a8 01 movw r20, r16 3c050: bf 93 push r27 3c052: 7b 01 movw r14, r22 3c054: 8c 01 movw r16, r24 3c056: aa 27 eor r26, r26 3c058: ba 2f mov r27, r26 3c05a: b9 01 movw r22, r18 3c05c: ca 01 movw r24, r20 3c05e: 0f 94 06 d7 call 0x3ae0c ; 0x3ae0c <__mulsf3_pse> 3c062: af 91 pop r26 3c064: 97 01 movw r18, r14 3c066: a8 01 movw r20, r16 3c068: ef 90 pop r14 3c06a: ff 90 pop r15 3c06c: 0f 91 pop r16 3c06e: 1f 91 pop r17 3c070: 0f 94 62 dd call 0x3bac4 ; 0x3bac4 <__addsf3x> 3c074: 0f 94 74 d7 call 0x3aee8 ; 0x3aee8 <__fp_round> 3c078: 0f 94 19 e1 call 0x3c232 ; 0x3c232 3c07c: 4f 91 pop r20 3c07e: 40 ff sbrs r20, 0 3c080: 08 95 ret 3c082: 55 27 eor r21, r21 3c084: 47 fd sbrc r20, 7 3c086: 50 95 com r21 3c088: 0d 94 52 e0 jmp 0x3c0a4 ; 0x3c0a4 0003c08c : 3c08c: 9b 01 movw r18, r22 3c08e: ac 01 movw r20, r24 3c090: 60 e0 ldi r22, 0x00 ; 0 3c092: 70 e0 ldi r23, 0x00 ; 0 3c094: 80 e8 ldi r24, 0x80 ; 128 3c096: 9f e3 ldi r25, 0x3F ; 63 3c098: 0d 94 4a de jmp 0x3bc94 ; 0x3bc94 <__divsf3> 3c09c: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3c0a0: 0d 94 48 df jmp 0x3be90 ; 0x3be90 <__fp_mpack> 0003c0a4 : 3c0a4: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3c0a8: d8 f3 brcs .-10 ; 0x3c0a0 3c0aa: 99 23 and r25, r25 3c0ac: c9 f3 breq .-14 ; 0x3c0a0 3c0ae: 94 0f add r25, r20 3c0b0: 51 1d adc r21, r1 3c0b2: a3 f3 brvs .-24 ; 0x3c09c 3c0b4: 91 50 subi r25, 0x01 ; 1 3c0b6: 50 40 sbci r21, 0x00 ; 0 3c0b8: 94 f0 brlt .+36 ; 0x3c0de 3c0ba: 59 f0 breq .+22 ; 0x3c0d2 3c0bc: 88 23 and r24, r24 3c0be: 32 f0 brmi .+12 ; 0x3c0cc 3c0c0: 66 0f add r22, r22 3c0c2: 77 1f adc r23, r23 3c0c4: 88 1f adc r24, r24 3c0c6: 91 50 subi r25, 0x01 ; 1 3c0c8: 50 40 sbci r21, 0x00 ; 0 3c0ca: c1 f7 brne .-16 ; 0x3c0bc 3c0cc: 9e 3f cpi r25, 0xFE ; 254 3c0ce: 51 05 cpc r21, r1 3c0d0: 2c f7 brge .-54 ; 0x3c09c 3c0d2: 88 0f add r24, r24 3c0d4: 91 1d adc r25, r1 3c0d6: 96 95 lsr r25 3c0d8: 87 95 ror r24 3c0da: 97 f9 bld r25, 7 3c0dc: 08 95 ret 3c0de: 5f 3f cpi r21, 0xFF ; 255 3c0e0: ac f0 brlt .+42 ; 0x3c10c 3c0e2: 98 3e cpi r25, 0xE8 ; 232 3c0e4: 9c f0 brlt .+38 ; 0x3c10c 3c0e6: bb 27 eor r27, r27 3c0e8: 86 95 lsr r24 3c0ea: 77 95 ror r23 3c0ec: 67 95 ror r22 3c0ee: b7 95 ror r27 3c0f0: 08 f4 brcc .+2 ; 0x3c0f4 3c0f2: b1 60 ori r27, 0x01 ; 1 3c0f4: 93 95 inc r25 3c0f6: c1 f7 brne .-16 ; 0x3c0e8 3c0f8: bb 0f add r27, r27 3c0fa: 58 f7 brcc .-42 ; 0x3c0d2 3c0fc: 11 f4 brne .+4 ; 0x3c102 3c0fe: 60 ff sbrs r22, 0 3c100: e8 cf rjmp .-48 ; 0x3c0d2 3c102: 6f 5f subi r22, 0xFF ; 255 3c104: 7f 4f sbci r23, 0xFF ; 255 3c106: 8f 4f sbci r24, 0xFF ; 255 3c108: 9f 4f sbci r25, 0xFF ; 255 3c10a: e3 cf rjmp .-58 ; 0x3c0d2 3c10c: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 0003c110 : 3c110: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3c114: 58 f1 brcs .+86 ; 0x3c16c 3c116: 9e 57 subi r25, 0x7E ; 126 3c118: 60 f1 brcs .+88 ; 0x3c172 3c11a: 98 51 subi r25, 0x18 ; 24 3c11c: a0 f0 brcs .+40 ; 0x3c146 3c11e: e9 f0 breq .+58 ; 0x3c15a 3c120: 98 30 cpi r25, 0x08 ; 8 3c122: 20 f5 brcc .+72 ; 0x3c16c 3c124: 09 2e mov r0, r25 3c126: 99 27 eor r25, r25 3c128: 66 0f add r22, r22 3c12a: 77 1f adc r23, r23 3c12c: 88 1f adc r24, r24 3c12e: 99 1f adc r25, r25 3c130: 0a 94 dec r0 3c132: d1 f7 brne .-12 ; 0x3c128 3c134: 12 c0 rjmp .+36 ; 0x3c15a 3c136: 06 2e mov r0, r22 3c138: 67 2f mov r22, r23 3c13a: 78 2f mov r23, r24 3c13c: 88 27 eor r24, r24 3c13e: 98 5f subi r25, 0xF8 ; 248 3c140: 11 f4 brne .+4 ; 0x3c146 3c142: 00 0c add r0, r0 3c144: 07 c0 rjmp .+14 ; 0x3c154 3c146: 99 3f cpi r25, 0xF9 ; 249 3c148: b4 f3 brlt .-20 ; 0x3c136 3c14a: 86 95 lsr r24 3c14c: 77 95 ror r23 3c14e: 67 95 ror r22 3c150: 93 95 inc r25 3c152: d9 f7 brne .-10 ; 0x3c14a 3c154: 61 1d adc r22, r1 3c156: 71 1d adc r23, r1 3c158: 81 1d adc r24, r1 3c15a: 3e f4 brtc .+14 ; 0x3c16a 3c15c: 90 95 com r25 3c15e: 80 95 com r24 3c160: 70 95 com r23 3c162: 61 95 neg r22 3c164: 7f 4f sbci r23, 0xFF ; 255 3c166: 8f 4f sbci r24, 0xFF ; 255 3c168: 9f 4f sbci r25, 0xFF ; 255 3c16a: 08 95 ret 3c16c: 68 94 set 3c16e: 0d 94 a8 d7 jmp 0x3af50 ; 0x3af50 <__fp_szero> 3c172: 0d 94 a7 d7 jmp 0x3af4e ; 0x3af4e <__fp_zero> 0003c176 : 3c176: fa 01 movw r30, r20 3c178: ee 0f add r30, r30 3c17a: ff 1f adc r31, r31 3c17c: 30 96 adiw r30, 0x00 ; 0 3c17e: 21 05 cpc r18, r1 3c180: 31 05 cpc r19, r1 3c182: a1 f1 breq .+104 ; 0x3c1ec 3c184: 61 15 cp r22, r1 3c186: 71 05 cpc r23, r1 3c188: 61 f4 brne .+24 ; 0x3c1a2 3c18a: 80 38 cpi r24, 0x80 ; 128 3c18c: bf e3 ldi r27, 0x3F ; 63 3c18e: 9b 07 cpc r25, r27 3c190: 49 f1 breq .+82 ; 0x3c1e4 3c192: 68 94 set 3c194: 90 38 cpi r25, 0x80 ; 128 3c196: 81 05 cpc r24, r1 3c198: 61 f0 breq .+24 ; 0x3c1b2 3c19a: 80 38 cpi r24, 0x80 ; 128 3c19c: bf ef ldi r27, 0xFF ; 255 3c19e: 9b 07 cpc r25, r27 3c1a0: 41 f0 breq .+16 ; 0x3c1b2 3c1a2: 99 23 and r25, r25 3c1a4: 4a f5 brpl .+82 ; 0x3c1f8 3c1a6: ff 3f cpi r31, 0xFF ; 255 3c1a8: e1 05 cpc r30, r1 3c1aa: 31 05 cpc r19, r1 3c1ac: 21 05 cpc r18, r1 3c1ae: 19 f1 breq .+70 ; 0x3c1f6 3c1b0: e8 94 clt 3c1b2: 08 94 sec 3c1b4: e7 95 ror r30 3c1b6: d9 01 movw r26, r18 3c1b8: aa 23 and r26, r26 3c1ba: 29 f4 brne .+10 ; 0x3c1c6 3c1bc: ab 2f mov r26, r27 3c1be: be 2f mov r27, r30 3c1c0: f8 5f subi r31, 0xF8 ; 248 3c1c2: d0 f3 brcs .-12 ; 0x3c1b8 3c1c4: 10 c0 rjmp .+32 ; 0x3c1e6 3c1c6: ff 5f subi r31, 0xFF ; 255 3c1c8: 70 f4 brcc .+28 ; 0x3c1e6 3c1ca: a6 95 lsr r26 3c1cc: e0 f7 brcc .-8 ; 0x3c1c6 3c1ce: f7 39 cpi r31, 0x97 ; 151 3c1d0: 50 f0 brcs .+20 ; 0x3c1e6 3c1d2: 19 f0 breq .+6 ; 0x3c1da 3c1d4: ff 3a cpi r31, 0xAF ; 175 3c1d6: 38 f4 brcc .+14 ; 0x3c1e6 3c1d8: 9f 77 andi r25, 0x7F ; 127 3c1da: 9f 93 push r25 3c1dc: 0d d0 rcall .+26 ; 0x3c1f8 3c1de: 0f 90 pop r0 3c1e0: 07 fc sbrc r0, 7 3c1e2: 90 58 subi r25, 0x80 ; 128 3c1e4: 08 95 ret 3c1e6: 46 f0 brts .+16 ; 0x3c1f8 3c1e8: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3c1ec: 60 e0 ldi r22, 0x00 ; 0 3c1ee: 70 e0 ldi r23, 0x00 ; 0 3c1f0: 80 e8 ldi r24, 0x80 ; 128 3c1f2: 9f e3 ldi r25, 0x3F ; 63 3c1f4: 08 95 ret 3c1f6: 4f e7 ldi r20, 0x7F ; 127 3c1f8: 9f 77 andi r25, 0x7F ; 127 3c1fa: 5f 93 push r21 3c1fc: 4f 93 push r20 3c1fe: 3f 93 push r19 3c200: 2f 93 push r18 3c202: 0f 94 bb e1 call 0x3c376 ; 0x3c376 3c206: 2f 91 pop r18 3c208: 3f 91 pop r19 3c20a: 4f 91 pop r20 3c20c: 5f 91 pop r21 3c20e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3c212: 0d 94 66 e1 jmp 0x3c2cc ; 0x3c2cc 0003c216 : 3c216: 9f 93 push r25 3c218: 0f 94 7f df call 0x3befe ; 0x3befe <__fp_rempio2> 3c21c: 0f 90 pop r0 3c21e: 07 fc sbrc r0, 7 3c220: ee 5f subi r30, 0xFE ; 254 3c222: 0d 94 a8 df jmp 0x3bf50 ; 0x3bf50 <__fp_sinus> 3c226: 19 f4 brne .+6 ; 0x3c22e 3c228: 16 f4 brtc .+4 ; 0x3c22e 3c22a: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3c22e: 0d 94 48 df jmp 0x3be90 ; 0x3be90 <__fp_mpack> 0003c232 : 3c232: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3c236: b8 f3 brcs .-18 ; 0x3c226 3c238: 99 23 and r25, r25 3c23a: c9 f3 breq .-14 ; 0x3c22e 3c23c: b6 f3 brts .-20 ; 0x3c22a 3c23e: 9f 57 subi r25, 0x7F ; 127 3c240: 55 0b sbc r21, r21 3c242: 87 ff sbrs r24, 7 3c244: 0f 94 98 e1 call 0x3c330 ; 0x3c330 <__fp_norm2> 3c248: 00 24 eor r0, r0 3c24a: a0 e6 ldi r26, 0x60 ; 96 3c24c: 40 ea ldi r20, 0xA0 ; 160 3c24e: 90 01 movw r18, r0 3c250: 80 58 subi r24, 0x80 ; 128 3c252: 56 95 lsr r21 3c254: 97 95 ror r25 3c256: 28 f4 brcc .+10 ; 0x3c262 3c258: 80 5c subi r24, 0xC0 ; 192 3c25a: 66 0f add r22, r22 3c25c: 77 1f adc r23, r23 3c25e: 88 1f adc r24, r24 3c260: 20 f0 brcs .+8 ; 0x3c26a 3c262: 26 17 cp r18, r22 3c264: 37 07 cpc r19, r23 3c266: 48 07 cpc r20, r24 3c268: 30 f4 brcc .+12 ; 0x3c276 3c26a: 62 1b sub r22, r18 3c26c: 73 0b sbc r23, r19 3c26e: 84 0b sbc r24, r20 3c270: 20 29 or r18, r0 3c272: 31 29 or r19, r1 3c274: 4a 2b or r20, r26 3c276: a6 95 lsr r26 3c278: 17 94 ror r1 3c27a: 07 94 ror r0 3c27c: 20 25 eor r18, r0 3c27e: 31 25 eor r19, r1 3c280: 4a 27 eor r20, r26 3c282: 58 f7 brcc .-42 ; 0x3c25a 3c284: 66 0f add r22, r22 3c286: 77 1f adc r23, r23 3c288: 88 1f adc r24, r24 3c28a: 20 f0 brcs .+8 ; 0x3c294 3c28c: 26 17 cp r18, r22 3c28e: 37 07 cpc r19, r23 3c290: 48 07 cpc r20, r24 3c292: 30 f4 brcc .+12 ; 0x3c2a0 3c294: 62 0b sbc r22, r18 3c296: 73 0b sbc r23, r19 3c298: 84 0b sbc r24, r20 3c29a: 20 0d add r18, r0 3c29c: 31 1d adc r19, r1 3c29e: 41 1d adc r20, r1 3c2a0: a0 95 com r26 3c2a2: 81 f7 brne .-32 ; 0x3c284 3c2a4: b9 01 movw r22, r18 3c2a6: 84 2f mov r24, r20 3c2a8: 91 58 subi r25, 0x81 ; 129 3c2aa: 88 0f add r24, r24 3c2ac: 96 95 lsr r25 3c2ae: 87 95 ror r24 3c2b0: 08 95 ret 0003c2b2 <__unordsf2>: 3c2b2: 0f 94 09 df call 0x3be12 ; 0x3be12 <__fp_cmp> 3c2b6: 88 0b sbc r24, r24 3c2b8: 99 0b sbc r25, r25 3c2ba: 08 95 ret 3c2bc: 29 f4 brne .+10 ; 0x3c2c8 <__unordsf2+0x16> 3c2be: 16 f0 brts .+4 ; 0x3c2c4 <__unordsf2+0x12> 3c2c0: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 3c2c4: 0d 94 a7 d7 jmp 0x3af4e ; 0x3af4e <__fp_zero> 3c2c8: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 0003c2cc : 3c2cc: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3c2d0: a8 f3 brcs .-22 ; 0x3c2bc <__unordsf2+0xa> 3c2d2: 96 38 cpi r25, 0x86 ; 134 3c2d4: a0 f7 brcc .-24 ; 0x3c2be <__unordsf2+0xc> 3c2d6: 07 f8 bld r0, 7 3c2d8: 0f 92 push r0 3c2da: e8 94 clt 3c2dc: 2b e3 ldi r18, 0x3B ; 59 3c2de: 3a ea ldi r19, 0xAA ; 170 3c2e0: 48 eb ldi r20, 0xB8 ; 184 3c2e2: 5f e7 ldi r21, 0x7F ; 127 3c2e4: 0f 94 06 d7 call 0x3ae0c ; 0x3ae0c <__mulsf3_pse> 3c2e8: 0f 92 push r0 3c2ea: 0f 92 push r0 3c2ec: 0f 92 push r0 3c2ee: 4d b7 in r20, 0x3d ; 61 3c2f0: 5e b7 in r21, 0x3e ; 62 3c2f2: 0f 92 push r0 3c2f4: 0f 94 03 e2 call 0x3c406 ; 0x3c406 3c2f8: e2 e9 ldi r30, 0x92 ; 146 3c2fa: f1 e7 ldi r31, 0x71 ; 113 3c2fc: 0f 94 56 df call 0x3beac ; 0x3beac <__fp_powser> 3c300: 4f 91 pop r20 3c302: 5f 91 pop r21 3c304: ef 91 pop r30 3c306: ff 91 pop r31 3c308: e5 95 asr r30 3c30a: ee 1f adc r30, r30 3c30c: ff 1f adc r31, r31 3c30e: 49 f0 breq .+18 ; 0x3c322 3c310: fe 57 subi r31, 0x7E ; 126 3c312: e0 68 ori r30, 0x80 ; 128 3c314: 44 27 eor r20, r20 3c316: ee 0f add r30, r30 3c318: 44 1f adc r20, r20 3c31a: fa 95 dec r31 3c31c: e1 f7 brne .-8 ; 0x3c316 3c31e: 41 95 neg r20 3c320: 55 0b sbc r21, r21 3c322: 0f 94 52 e0 call 0x3c0a4 ; 0x3c0a4 3c326: 0f 90 pop r0 3c328: 07 fe sbrs r0, 7 3c32a: 0d 94 46 e0 jmp 0x3c08c ; 0x3c08c 3c32e: 08 95 ret 0003c330 <__fp_norm2>: 3c330: 91 50 subi r25, 0x01 ; 1 3c332: 50 40 sbci r21, 0x00 ; 0 3c334: 66 0f add r22, r22 3c336: 77 1f adc r23, r23 3c338: 88 1f adc r24, r24 3c33a: d2 f7 brpl .-12 ; 0x3c330 <__fp_norm2> 3c33c: 08 95 ret 0003c33e <__fp_powsodd>: 3c33e: 9f 93 push r25 3c340: 8f 93 push r24 3c342: 7f 93 push r23 3c344: 6f 93 push r22 3c346: ff 93 push r31 3c348: ef 93 push r30 3c34a: 9b 01 movw r18, r22 3c34c: ac 01 movw r20, r24 3c34e: 0f 94 f0 d6 call 0x3ade0 ; 0x3ade0 <__mulsf3> 3c352: ef 91 pop r30 3c354: ff 91 pop r31 3c356: 0f 94 56 df call 0x3beac ; 0x3beac <__fp_powser> 3c35a: 2f 91 pop r18 3c35c: 3f 91 pop r19 3c35e: 4f 91 pop r20 3c360: 5f 91 pop r21 3c362: 0d 94 f0 d6 jmp 0x3ade0 ; 0x3ade0 <__mulsf3> 3c366: 16 f0 brts .+4 ; 0x3c36c <__fp_powsodd+0x2e> 3c368: 0d 94 48 df jmp 0x3be90 ; 0x3be90 <__fp_mpack> 3c36c: 0d 94 63 d7 jmp 0x3aec6 ; 0x3aec6 <__fp_nan> 3c370: 68 94 set 3c372: 0d 94 5d d7 jmp 0x3aeba ; 0x3aeba <__fp_inf> 0003c376 : 3c376: 0f 94 8d d7 call 0x3af1a ; 0x3af1a <__fp_splitA> 3c37a: a8 f3 brcs .-22 ; 0x3c366 <__fp_powsodd+0x28> 3c37c: 99 23 and r25, r25 3c37e: c1 f3 breq .-16 ; 0x3c370 <__fp_powsodd+0x32> 3c380: ae f3 brts .-22 ; 0x3c36c <__fp_powsodd+0x2e> 3c382: df 93 push r29 3c384: cf 93 push r28 3c386: 1f 93 push r17 3c388: 0f 93 push r16 3c38a: ff 92 push r15 3c38c: c9 2f mov r28, r25 3c38e: dd 27 eor r29, r29 3c390: 88 23 and r24, r24 3c392: 2a f0 brmi .+10 ; 0x3c39e 3c394: 21 97 sbiw r28, 0x01 ; 1 3c396: 66 0f add r22, r22 3c398: 77 1f adc r23, r23 3c39a: 88 1f adc r24, r24 3c39c: da f7 brpl .-10 ; 0x3c394 3c39e: 20 e0 ldi r18, 0x00 ; 0 3c3a0: 30 e0 ldi r19, 0x00 ; 0 3c3a2: 40 e8 ldi r20, 0x80 ; 128 3c3a4: 5f eb ldi r21, 0xBF ; 191 3c3a6: 9f e3 ldi r25, 0x3F ; 63 3c3a8: 88 39 cpi r24, 0x98 ; 152 3c3aa: 20 f0 brcs .+8 ; 0x3c3b4 3c3ac: 80 3e cpi r24, 0xE0 ; 224 3c3ae: 38 f0 brcs .+14 ; 0x3c3be 3c3b0: 21 96 adiw r28, 0x01 ; 1 3c3b2: 8f 77 andi r24, 0x7F ; 127 3c3b4: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3c3b8: ea eb ldi r30, 0xBA ; 186 3c3ba: f1 e7 ldi r31, 0x71 ; 113 3c3bc: 04 c0 rjmp .+8 ; 0x3c3c6 3c3be: 0f 94 4b dd call 0x3ba96 ; 0x3ba96 <__addsf3> 3c3c2: e7 ee ldi r30, 0xE7 ; 231 3c3c4: f1 e7 ldi r31, 0x71 ; 113 3c3c6: 0f 94 56 df call 0x3beac ; 0x3beac <__fp_powser> 3c3ca: 8b 01 movw r16, r22 3c3cc: be 01 movw r22, r28 3c3ce: ec 01 movw r28, r24 3c3d0: fb 2e mov r15, r27 3c3d2: 6f 57 subi r22, 0x7F ; 127 3c3d4: 71 09 sbc r23, r1 3c3d6: 75 95 asr r23 3c3d8: 77 1f adc r23, r23 3c3da: 88 0b sbc r24, r24 3c3dc: 99 0b sbc r25, r25 3c3de: 0f 94 b1 d6 call 0x3ad62 ; 0x3ad62 <__floatsisf> 3c3e2: 28 e1 ldi r18, 0x18 ; 24 3c3e4: 32 e7 ldi r19, 0x72 ; 114 3c3e6: 41 e3 ldi r20, 0x31 ; 49 3c3e8: 5f e3 ldi r21, 0x3F ; 63 3c3ea: 0f 94 03 d7 call 0x3ae06 ; 0x3ae06 <__mulsf3x> 3c3ee: af 2d mov r26, r15 3c3f0: 98 01 movw r18, r16 3c3f2: ae 01 movw r20, r28 3c3f4: ff 90 pop r15 3c3f6: 0f 91 pop r16 3c3f8: 1f 91 pop r17 3c3fa: cf 91 pop r28 3c3fc: df 91 pop r29 3c3fe: 0f 94 62 dd call 0x3bac4 ; 0x3bac4 <__addsf3x> 3c402: 0d 94 74 d7 jmp 0x3aee8 ; 0x3aee8 <__fp_round> 0003c406 : 3c406: fa 01 movw r30, r20 3c408: dc 01 movw r26, r24 3c40a: aa 0f add r26, r26 3c40c: bb 1f adc r27, r27 3c40e: 9b 01 movw r18, r22 3c410: ac 01 movw r20, r24 3c412: bf 57 subi r27, 0x7F ; 127 3c414: 28 f4 brcc .+10 ; 0x3c420 3c416: 22 27 eor r18, r18 3c418: 33 27 eor r19, r19 3c41a: 44 27 eor r20, r20 3c41c: 50 78 andi r21, 0x80 ; 128 3c41e: 20 c0 rjmp .+64 ; 0x3c460 3c420: b7 51 subi r27, 0x17 ; 23 3c422: 90 f4 brcc .+36 ; 0x3c448 3c424: ab 2f mov r26, r27 3c426: 00 24 eor r0, r0 3c428: 46 95 lsr r20 3c42a: 37 95 ror r19 3c42c: 27 95 ror r18 3c42e: 01 1c adc r0, r1 3c430: a3 95 inc r26 3c432: d2 f3 brmi .-12 ; 0x3c428 3c434: 00 20 and r0, r0 3c436: 71 f0 breq .+28 ; 0x3c454 3c438: 22 0f add r18, r18 3c43a: 33 1f adc r19, r19 3c43c: 44 1f adc r20, r20 3c43e: b3 95 inc r27 3c440: da f3 brmi .-10 ; 0x3c438 3c442: 0e d0 rcall .+28 ; 0x3c460 3c444: 0d 94 4a dd jmp 0x3ba94 ; 0x3ba94 <__subsf3> 3c448: 61 30 cpi r22, 0x01 ; 1 3c44a: 71 05 cpc r23, r1 3c44c: a0 e8 ldi r26, 0x80 ; 128 3c44e: 8a 07 cpc r24, r26 3c450: b9 46 sbci r27, 0x69 ; 105 3c452: 30 f4 brcc .+12 ; 0x3c460 3c454: 9b 01 movw r18, r22 3c456: ac 01 movw r20, r24 3c458: 66 27 eor r22, r22 3c45a: 77 27 eor r23, r23 3c45c: 88 27 eor r24, r24 3c45e: 90 78 andi r25, 0x80 ; 128 3c460: 30 96 adiw r30, 0x00 ; 0 3c462: 21 f0 breq .+8 ; 0x3c46c 3c464: 20 83 st Z, r18 3c466: 31 83 std Z+1, r19 ; 0x01 3c468: 42 83 std Z+2, r20 ; 0x02 3c46a: 53 83 std Z+3, r21 ; 0x03 3c46c: 08 95 ret 0003c46e : 3c46e: 91 11 cpse r25, r1 3c470: 08 95 ret 3c472: 81 54 subi r24, 0x41 ; 65 3c474: 8a 51 subi r24, 0x1A ; 26 3c476: 08 f4 brcc .+2 ; 0x3c47a 3c478: 80 5e subi r24, 0xE0 ; 224 3c47a: 85 5a subi r24, 0xA5 ; 165 3c47c: 08 95 ret 0003c47e : 3c47e: fb 01 movw r30, r22 3c480: dc 01 movw r26, r24 3c482: 04 c0 rjmp .+8 ; 0x3c48c 3c484: 8d 91 ld r24, X+ 3c486: 01 90 ld r0, Z+ 3c488: 80 19 sub r24, r0 3c48a: 21 f4 brne .+8 ; 0x3c494 3c48c: 41 50 subi r20, 0x01 ; 1 3c48e: 50 40 sbci r21, 0x00 ; 0 3c490: c8 f7 brcc .-14 ; 0x3c484 3c492: 88 1b sub r24, r24 3c494: 99 0b sbc r25, r25 3c496: 08 95 ret 0003c498 : 3c498: fb 01 movw r30, r22 3c49a: dc 01 movw r26, r24 3c49c: 02 c0 rjmp .+4 ; 0x3c4a2 3c49e: 01 90 ld r0, Z+ 3c4a0: 0d 92 st X+, r0 3c4a2: 41 50 subi r20, 0x01 ; 1 3c4a4: 50 40 sbci r21, 0x00 ; 0 3c4a6: d8 f7 brcc .-10 ; 0x3c49e 3c4a8: 08 95 ret 0003c4aa : 3c4aa: dc 01 movw r26, r24 3c4ac: 01 c0 rjmp .+2 ; 0x3c4b0 3c4ae: 6d 93 st X+, r22 3c4b0: 41 50 subi r20, 0x01 ; 1 3c4b2: 50 40 sbci r21, 0x00 ; 0 3c4b4: e0 f7 brcc .-8 ; 0x3c4ae 3c4b6: 08 95 ret 0003c4b8 : 3c4b8: fb 01 movw r30, r22 3c4ba: dc 01 movw r26, r24 3c4bc: 8d 91 ld r24, X+ 3c4be: 81 34 cpi r24, 0x41 ; 65 3c4c0: 1c f0 brlt .+6 ; 0x3c4c8 3c4c2: 8b 35 cpi r24, 0x5B ; 91 3c4c4: 0c f4 brge .+2 ; 0x3c4c8 3c4c6: 80 5e subi r24, 0xE0 ; 224 3c4c8: 61 91 ld r22, Z+ 3c4ca: 61 34 cpi r22, 0x41 ; 65 3c4cc: 1c f0 brlt .+6 ; 0x3c4d4 3c4ce: 6b 35 cpi r22, 0x5B ; 91 3c4d0: 0c f4 brge .+2 ; 0x3c4d4 3c4d2: 60 5e subi r22, 0xE0 ; 224 3c4d4: 86 1b sub r24, r22 3c4d6: 61 11 cpse r22, r1 3c4d8: 89 f3 breq .-30 ; 0x3c4bc 3c4da: 99 0b sbc r25, r25 3c4dc: 08 95 ret 0003c4de : 3c4de: fb 01 movw r30, r22 3c4e0: dc 01 movw r26, r24 3c4e2: 0d 90 ld r0, X+ 3c4e4: 00 20 and r0, r0 3c4e6: e9 f7 brne .-6 ; 0x3c4e2 3c4e8: 11 97 sbiw r26, 0x01 ; 1 3c4ea: 01 90 ld r0, Z+ 3c4ec: 0d 92 st X+, r0 3c4ee: 00 20 and r0, r0 3c4f0: e1 f7 brne .-8 ; 0x3c4ea 3c4f2: 08 95 ret 0003c4f4 : 3c4f4: fc 01 movw r30, r24 3c4f6: 81 91 ld r24, Z+ 3c4f8: 86 17 cp r24, r22 3c4fa: 21 f0 breq .+8 ; 0x3c504 3c4fc: 88 23 and r24, r24 3c4fe: d9 f7 brne .-10 ; 0x3c4f6 3c500: 99 27 eor r25, r25 3c502: 08 95 ret 3c504: 31 97 sbiw r30, 0x01 ; 1 3c506: cf 01 movw r24, r30 3c508: 08 95 ret 0003c50a : 3c50a: fb 01 movw r30, r22 3c50c: dc 01 movw r26, r24 3c50e: 8d 91 ld r24, X+ 3c510: 01 90 ld r0, Z+ 3c512: 80 19 sub r24, r0 3c514: 01 10 cpse r0, r1 3c516: d9 f3 breq .-10 ; 0x3c50e 3c518: 99 0b sbc r25, r25 3c51a: 08 95 ret 0003c51c : 3c51c: fb 01 movw r30, r22 3c51e: dc 01 movw r26, r24 3c520: 01 90 ld r0, Z+ 3c522: 0d 92 st X+, r0 3c524: 00 20 and r0, r0 3c526: e1 f7 brne .-8 ; 0x3c520 3c528: 08 95 ret 0003c52a : 3c52a: fb 01 movw r30, r22 3c52c: dc 01 movw r26, r24 3c52e: 41 50 subi r20, 0x01 ; 1 3c530: 50 40 sbci r21, 0x00 ; 0 3c532: 30 f0 brcs .+12 ; 0x3c540 3c534: 8d 91 ld r24, X+ 3c536: 01 90 ld r0, Z+ 3c538: 80 19 sub r24, r0 3c53a: 19 f4 brne .+6 ; 0x3c542 3c53c: 00 20 and r0, r0 3c53e: b9 f7 brne .-18 ; 0x3c52e 3c540: 88 1b sub r24, r24 3c542: 99 0b sbc r25, r25 3c544: 08 95 ret 0003c546 : 3c546: fb 01 movw r30, r22 3c548: dc 01 movw r26, r24 3c54a: 41 50 subi r20, 0x01 ; 1 3c54c: 50 40 sbci r21, 0x00 ; 0 3c54e: 48 f0 brcs .+18 ; 0x3c562 3c550: 01 90 ld r0, Z+ 3c552: 0d 92 st X+, r0 3c554: 00 20 and r0, r0 3c556: c9 f7 brne .-14 ; 0x3c54a 3c558: 01 c0 rjmp .+2 ; 0x3c55c 3c55a: 1d 92 st X+, r1 3c55c: 41 50 subi r20, 0x01 ; 1 3c55e: 50 40 sbci r21, 0x00 ; 0 3c560: e0 f7 brcc .-8 ; 0x3c55a 3c562: 08 95 ret 0003c564 : 3c564: 0f 93 push r16 3c566: 1f 93 push r17 3c568: cf 93 push r28 3c56a: df 93 push r29 3c56c: e0 91 1c 18 lds r30, 0x181C ; 0x80181c <__iob+0x2> 3c570: f0 91 1d 18 lds r31, 0x181D ; 0x80181d <__iob+0x3> 3c574: 23 81 ldd r18, Z+3 ; 0x03 3c576: ec 01 movw r28, r24 3c578: 10 e0 ldi r17, 0x00 ; 0 3c57a: 00 e0 ldi r16, 0x00 ; 0 3c57c: 21 fd sbrc r18, 1 3c57e: 08 c0 rjmp .+16 ; 0x3c590 3c580: 0f ef ldi r16, 0xFF ; 255 3c582: 1f ef ldi r17, 0xFF ; 255 3c584: 14 c0 rjmp .+40 ; 0x3c5ae 3c586: 19 95 eicall 3c588: 89 2b or r24, r25 3c58a: 11 f0 breq .+4 ; 0x3c590 3c58c: 0f ef ldi r16, 0xFF ; 255 3c58e: 1f ef ldi r17, 0xFF ; 255 3c590: 89 91 ld r24, Y+ 3c592: 60 91 1c 18 lds r22, 0x181C ; 0x80181c <__iob+0x2> 3c596: 70 91 1d 18 lds r23, 0x181D ; 0x80181d <__iob+0x3> 3c59a: db 01 movw r26, r22 3c59c: 18 96 adiw r26, 0x08 ; 8 3c59e: ed 91 ld r30, X+ 3c5a0: fc 91 ld r31, X 3c5a2: 81 11 cpse r24, r1 3c5a4: f0 cf rjmp .-32 ; 0x3c586 3c5a6: 8a e0 ldi r24, 0x0A ; 10 3c5a8: 19 95 eicall 3c5aa: 89 2b or r24, r25 3c5ac: 49 f7 brne .-46 ; 0x3c580 3c5ae: c8 01 movw r24, r16 3c5b0: df 91 pop r29 3c5b2: cf 91 pop r28 3c5b4: 1f 91 pop r17 3c5b6: 0f 91 pop r16 3c5b8: 08 95 ret 0003c5ba <__do_global_dtors>: 3c5ba: 16 e5 ldi r17, 0x56 ; 86 3c5bc: cc eb ldi r28, 0xBC ; 188 3c5be: d6 e5 ldi r29, 0x56 ; 86 3c5c0: 00 e0 ldi r16, 0x00 ; 0 3c5c2: 06 c0 rjmp .+12 ; 0x3c5d0 <__do_global_dtors+0x16> 3c5c4: 80 2f mov r24, r16 3c5c6: fe 01 movw r30, r28 3c5c8: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 <__tablejump2__> 3c5cc: 21 96 adiw r28, 0x01 ; 1 3c5ce: 01 1d adc r16, r1 3c5d0: cd 3b cpi r28, 0xBD ; 189 3c5d2: d1 07 cpc r29, r17 3c5d4: 80 e0 ldi r24, 0x00 ; 0 3c5d6: 08 07 cpc r16, r24 3c5d8: a9 f7 brne .-22 ; 0x3c5c4 <__do_global_dtors+0xa> 3c5da: f8 94 cli 0003c5dc <__stop_program>: 3c5dc: ff cf rjmp .-2 ; 0x3c5dc <__stop_program>